From nobody Sun Feb 12 02:28:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PDry02Sxcz3nqTv; Sun, 12 Feb 2023 02:28: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 4PDry01vThz46MJ; Sun, 12 Feb 2023 02:28:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676168936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=thE1DPwYxhRmy+OeGVRQxp7t/NchYxhPYwl4LnOsztY=; b=ac7w9zKEpxglMTtV1/G8G3u2gIuU4b6+lIm/oyLxSNBwObUbmqkxTL2DGbHtveSuS35t9y eb4MlW68LALAoQpVgpkRfwTC/JLn5NJELbEp+8hERrurGeNSVKI3J0bL5RPXJvPmAWJCBf FeC4Tw4s5i8RscdUU3+A21UCamrlAr4yxDQtrcRqu5qL+QSlIEydd51AIzBeWg3ixojyqr v+VFlOvvrTYc8lWHHQvmhJuTeNZSUuu+Hrq1n2iXckJMNl3G5T7cvYg/7KMZAgmbsd/1Ua t8dLdSv93t3KhZSyIRKwntXXlQ7tDUTwk7p6JsifHNc1tE3aal2ooGnXjIm5Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676168936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=thE1DPwYxhRmy+OeGVRQxp7t/NchYxhPYwl4LnOsztY=; b=MqfY5o0NHhuF8jMNrHntMVkxsSacuq0K63+oJmctw1WgOOSuSos6nXqtMv35FfxPtHGMHo q4nVu0mPWg0pabK3bKXTyoKER+QJJdEbsmoBBERj8Gey94YgR3ru8IDkw59IZSBCRzouiK G71D7b9Vf2WmwMaxF2mPGaFx0szfvCcCwJcvciL2WLoLz5HMmUokufsW/jAcAHTUvcv2nY RotcbPv40riTU4zxzEnLtc4qzAhzKSFtixdpaYu8mb9TD6ZSYbMfa3a+RA+ZbqZRuxSMtS Nu1JQQymzJeQKOZOoMSSovIMd1lnNr3+OzLFsPJcMMpPPuxqzWC/r7JilzVbbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676168936; a=rsa-sha256; cv=none; b=cBfk9RVYRM7YYxcStFcMg/Teuw7ZQC4B3EhDeKLRoEX6BeGDl8i2A/XMXBxavLorOjewV3 VEbUU7HhsOmar239ZCAT623Z9m4f0+Lqwt/5BzdGpfTrpEExJa8gmsrF3l7IlXL+FYN9E+ wmcLuj+V2/CrhIh1vldbtWpfSfXYiPwlZn2ZqSHDvJuqvwjBDqPo3vPH+SU1SFFs7al4su rRMOOmvRs+f9YdP50IoZVIItlSUTQbOAfI23+RyW4V01d0ANIYFrRDni4q3I0fIGKi9OTJ inl6Mwt3MY/g72MbZHZ3euLc1bdg010O4WJ9EroZivzo5lCFUsVX0OvE1xNYkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PDry00y3NzMKc; Sun, 12 Feb 2023 02:28: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 31C2Sus6099977; Sun, 12 Feb 2023 02:28:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31C2SuxF099976; Sun, 12 Feb 2023 02:28:56 GMT (envelope-from git) Date: Sun, 12 Feb 2023 02:28:56 GMT Message-Id: <202302120228.31C2SuxF099976@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: 4d68605f31fb - main - nfsd: Delete nfsrv_prison_cleanup() until vneting enabled List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d68605f31fb536722529dc90f16cc47d964882e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4d68605f31fb536722529dc90f16cc47d964882e commit 4d68605f31fb536722529dc90f16cc47d964882e Author: Rick Macklem AuthorDate: 2023-02-12 02:27:59 +0000 Commit: Rick Macklem CommitDate: 2023-02-12 02:27:59 +0000 nfsd: Delete nfsrv_prison_cleanup() until vneting enabled Oops, although the vneting macros do not do anything yet, commit 7344856e3a6d enabled the prison cleanup function, that would get called and crash the system when a jail was terminated. This patch gets rid of nfsrv_prison_cleanup() for now. It can go in when the vnet macros are enabled as front ends to the vnet macros. MFC after: 3 months --- sys/fs/nfsserver/nfs_nfsdport.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index af5327bd5a2d..834a6b069899 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -94,7 +94,6 @@ static char nfsd_master_comm[MAXCOMLEN + 1]; static struct timeval nfsd_master_start; static uint32_t nfsv4_sysid = 0; static fhandle_t zerofh; -static int nfsrv_osd_jail_slot; NFSD_VNET_DEFINE(struct proc *, nfsd_master_proc) = NULL; NFSD_VNET_DEFINE(struct nfsrvhashhead *, nfsrvudphashtbl); @@ -3687,18 +3686,6 @@ out: return (error); } -/* Osd entry for nfsrv_cleanup. */ -static int -nfsrv_prison_cleanup(void *obj, void *data __unused) -{ - struct prison *pr = obj; - - if ((pr->pr_flags & PR_VNET) == 0) - return (0); - nfsrv_cleanup(pr); - return (0); -} - /* * Nfs server pseudo system call for the nfsd's */ @@ -7123,7 +7110,7 @@ nfsrv_vnetinit(const void *unused __unused) nfsd_mntinit(); } -VNET_SYSINIT(nfsrv_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, +SYSINIT(nfsrv_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, nfsrv_vnetinit, NULL); /* @@ -7193,9 +7180,6 @@ static int nfsd_modevent(module_t mod, int type, void *data) { int error = 0, i; - osd_method_t methods[PR_MAXMETHOD] = { - [PR_METHOD_REMOVE] = nfsrv_prison_cleanup, - }; static int loaded = 0; switch (type) { @@ -7212,8 +7196,6 @@ nfsd_modevent(module_t mod, int type, void *data) vn_deleg_ops.vndeleg_disable = nfsd_disabledelegation; #endif nfsd_call_nfsd = nfssvc_nfsd; - /* XXX-BZ OSD to VNET? */ - nfsrv_osd_jail_slot = osd_jail_register(NULL, methods); loaded = 1; break; @@ -7228,7 +7210,6 @@ nfsd_modevent(module_t mod, int type, void *data) vn_deleg_ops.vndeleg_disable = NULL; #endif nfsd_call_nfsd = NULL; - osd_jail_deregister(nfsrv_osd_jail_slot); nfsrv_cleanup(&prison0); mtx_destroy(&nfsrc_udpmtx); mtx_destroy(&nfs_v4root_mutex); From nobody Sun Feb 12 09:47:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PF2h30LvYz3qSwQ; Sun, 12 Feb 2023 09:47:31 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 4PF2h22DQ8z3kdf; Sun, 12 Feb 2023 09:47:30 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of antoine.brodin.freebsd@gmail.com designates 209.85.167.47 as permitted sender) smtp.mailfrom=antoine.brodin.freebsd@gmail.com; dmarc=none Received: by mail-lf1-f47.google.com with SMTP id v17so14956209lfd.7; Sun, 12 Feb 2023 01:47:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=a2bHPE+lk8nZCUO2/WEaQvW8lGV9sCErUkJCp1xX0cU=; b=PpaRpUkOHJx69red+0VYBCMp7ASznLj+ijHjtAJ0co4qrm+4xQn3nfoLDjFL2TAgk5 lO5SNilPE6picWDHeHPFrH650bhvjJVR1dvMU8Md3IoesHtA7jlZXGkqcfTH1x2/lQMt NY8DORFA4hfLHOzBf4V1vInPDnG6b9+JeitQ3Gr6uHklwgboHW4ckanaoA0U2B6dwn1S QgYD8pBMLI15Hw0W5gSshKxXnQpXJyG3W26V12Skl80CW4i99+UYP8CPjaFWX1kQkir9 GjiEbA41rELQPnvg/5HjQ0hn2S0lr9lAX06vEXvp2hLykj0m7uixAk5HpvvItoey890i xmRQ== X-Gm-Message-State: AO0yUKXBl6GZDycUdaJQw2Chb0Y8Jhis3KABQOvP6IU5qiI2/FZPfO+K 02hKz2Yl6AU9rBEr1yZZQE7lX79GwIdUmrOgDaENUxK6rzA= X-Google-Smtp-Source: AK7set+Ri60q2bpiKqo6jh0GDVvCk00DYw7Of+rxH2DG7120YknVD1dQF+gorbN+XRSBD5fw71Hm7C+tl4Oq+ey0HtU= X-Received: by 2002:ac2:431a:0:b0:4b5:5bf8:24fd with SMTP id l26-20020ac2431a000000b004b55bf824fdmr3444235lfh.187.1676195247496; Sun, 12 Feb 2023 01:47:27 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> In-Reply-To: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> From: Antoine Brodin Date: Sun, 12 Feb 2023 09:47:15 +0000 Message-ID: Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. To: Dmitry Chagin 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 [-2.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.996]; NEURAL_HAM_SHORT(-0.99)[-0.992]; FORGED_SENDER(0.30)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.47:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.47:from]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4PF2h22DQ8z3kdf X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin wrote: > > The branch main has been updated by dchagin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > Author: Dmitry Chagin > AuthorDate: 2023-01-29 13:17:33 +0000 > Commit: Dmitry Chagin > CommitDate: 2023-01-29 13:17:33 +0000 > > cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. > > Under Linux to sched_[g|s]etaffinity() functions the value returned from a call > to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 > will set the attribute for the calling thread, and passing the value returned > from a call to getpid(2) (process id) will set the attribute for the main thread > of the thread group. > > Native cpuset(2) family of system calls has "which" argument to determine how > the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass > a thread id and CPU_WHICH_PID - to pass a process id. > > For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" > CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this > adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. > > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D38209 > MFC after: 1 week > --- > lib/libc/gen/sched_getaffinity.c | 2 +- > lib/libc/gen/sched_setaffinity.c | 2 +- > lib/libc/sys/cpuset.2 | 4 +++- > sys/kern/kern_cpuset.c | 42 +++++++++++++++++++++++++++++++++++++++- > sys/sys/cpuset.h | 1 + > 5 files changed, 47 insertions(+), 4 deletions(-) Hello, This broke math/py-numpy on main and stable/13 https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p52768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-baseline/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log File "/wrkdirs/usr/ports/math/py-numpy/work-py39/numpy-1.23.5/numpy/distutils/misc_util.py", line 93, in get_num_build_jobs cpu_count = len(os.sched_getaffinity(0)) OverflowError: could not allocate a large enough CPU set Cheers, Antoine From nobody Sun Feb 12 10:40:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PF3sw6Dprz3qYyF; Sun, 12 Feb 2023 10:41:08 +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 4PF3sw1qBqz3qbf; Sun, 12 Feb 2023 10:41:08 +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 31CAexS4004575; Sun, 12 Feb 2023 13:40:59 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 31CAexA4004574; Sun, 12 Feb 2023 13:40:59 +0300 (MSK) (envelope-from dchagin) Date: Sun, 12 Feb 2023 13:40:59 +0300 From: Dmitry Chagin To: Antoine Brodin Cc: Dmitry Chagin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. Message-ID: References: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4PF3sw1qBqz3qbf 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 Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: > On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin wrote: > > > > The branch main has been updated by dchagin: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > Author: Dmitry Chagin > > AuthorDate: 2023-01-29 13:17:33 +0000 > > Commit: Dmitry Chagin > > CommitDate: 2023-01-29 13:17:33 +0000 > > > > cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. > > > > Under Linux to sched_[g|s]etaffinity() functions the value returned from a call > > to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 > > will set the attribute for the calling thread, and passing the value returned > > from a call to getpid(2) (process id) will set the attribute for the main thread > > of the thread group. > > > > Native cpuset(2) family of system calls has "which" argument to determine how > > the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass > > a thread id and CPU_WHICH_PID - to pass a process id. > > > > For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" > > CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this > > adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. > > > > Reviewed by: kib > > Differential Revision: https://reviews.freebsd.org/D38209 > > MFC after: 1 week > > --- > > lib/libc/gen/sched_getaffinity.c | 2 +- > > lib/libc/gen/sched_setaffinity.c | 2 +- > > lib/libc/sys/cpuset.2 | 4 +++- > > sys/kern/kern_cpuset.c | 42 +++++++++++++++++++++++++++++++++++++++- > > sys/sys/cpuset.h | 1 + > > 5 files changed, 47 insertions(+), 4 deletions(-) > > > Hello, > > This broke math/py-numpy on main and stable/13 > > https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p52768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log > https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-baseline/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log > > File "/wrkdirs/usr/ports/math/py-numpy/work-py39/numpy-1.23.5/numpy/distutils/misc_util.py", > line 93, in get_num_build_jobs > cpu_count = len(os.sched_getaffinity(0)) > OverflowError: could not allocate a large enough CPU set hi, Antoine, on stable/13 dchagin@heemeyer:~ % uname -a FreeBSD heemeyer.club 13.2-STABLE FreeBSD 13.2-STABLE #268 stable/13-n254471-51485f81b01a-dirty: Sat Feb 11 12:16:21 MSK 2023 dchagin@heemeyer.club:/usr/home/dchagin/tmp/obj/usr/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 dchagin@heemeyer:~ % python3.9 Python 3.9.16 (main, Dec 18 2022, 01:15:32) [Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a on freebsd13 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> len(os.sched_getaffinity(0)) 1 >>> os.sched_getaffinity(0) {0} >>> exit() dchagin@heemeyer:~ % on current: dchagin@mordor:~/freebsd % uname -a FreeBSD mordor.heemeyer.club 14.0-CURRENT FreeBSD 14.0-CURRENT #458 futex-n260850-52456667491d-dirty: Sat Feb 11 14:24:46 MSK 2023 dchagin@mordor.heemeyer.club:/home/dchagin/tmp/obj/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 dchagin@mordor:~/freebsd % python3.9 Python 3.9.16 (main, Dec 18 2022, 01:24:21) [Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc1238 on freebsd14 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> len(os.sched_getaffinity(0)) 16 >>> os.sched_getaffinity(0) {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} >>> exit() dchagin@mordor:~/freebsd % could you please show out of os.sched_getaffinity(0) ? From nobody Sun Feb 12 11:12:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PF4Zk3PX3z3p8P6; Sun, 12 Feb 2023 11:13:02 +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 4PF4Zj2Kyrz3tsm; Sun, 12 Feb 2023 11:13:01 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of dchagin@heemeyer.club has no SPF policy when checking 195.93.173.158) smtp.mailfrom=dchagin@heemeyer.club; dmarc=none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.1/8.16.1) with ESMTP id 31CBCxYA000914; Sun, 12 Feb 2023 14:12:59 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 31CBCxEe000913; Sun, 12 Feb 2023 14:12:59 +0300 (MSK) (envelope-from dchagin) Date: Sun, 12 Feb 2023 14:12:59 +0300 From: Dmitry Chagin To: Antoine Brodin Cc: Dmitry Chagin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. Message-ID: References: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [-2.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[dchagin]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[heemeyer.club]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4PF4Zj2Kyrz3tsm X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: > On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: > > On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin wrote: > > > > > > The branch main has been updated by dchagin: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > > > commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > Author: Dmitry Chagin > > > AuthorDate: 2023-01-29 13:17:33 +0000 > > > Commit: Dmitry Chagin > > > CommitDate: 2023-01-29 13:17:33 +0000 > > > > > > cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. > > > > > > Under Linux to sched_[g|s]etaffinity() functions the value returned from a call > > > to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 > > > will set the attribute for the calling thread, and passing the value returned > > > from a call to getpid(2) (process id) will set the attribute for the main thread > > > of the thread group. > > > > > > Native cpuset(2) family of system calls has "which" argument to determine how > > > the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass > > > a thread id and CPU_WHICH_PID - to pass a process id. > > > > > > For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" > > > CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this > > > adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. > > > > > > Reviewed by: kib > > > Differential Revision: https://reviews.freebsd.org/D38209 > > > MFC after: 1 week > > > --- > > > lib/libc/gen/sched_getaffinity.c | 2 +- > > > lib/libc/gen/sched_setaffinity.c | 2 +- > > > lib/libc/sys/cpuset.2 | 4 +++- > > > sys/kern/kern_cpuset.c | 42 +++++++++++++++++++++++++++++++++++++++- > > > sys/sys/cpuset.h | 1 + > > > 5 files changed, 47 insertions(+), 4 deletions(-) > > > > > > Hello, > > > > This broke math/py-numpy on main and stable/13 > > > > https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p52768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log > > https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-baseline/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log > > > > File "/wrkdirs/usr/ports/math/py-numpy/work-py39/numpy-1.23.5/numpy/distutils/misc_util.py", > > line 93, in get_num_build_jobs > > cpu_count = len(os.sched_getaffinity(0)) > > OverflowError: could not allocate a large enough CPU set > > hi, Antoine, > > on stable/13 > dchagin@heemeyer:~ % uname -a > FreeBSD heemeyer.club 13.2-STABLE FreeBSD 13.2-STABLE #268 stable/13-n254471-51485f81b01a-dirty: Sat Feb 11 12:16:21 MSK 2023 dchagin@heemeyer.club:/usr/home/dchagin/tmp/obj/usr/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > dchagin@heemeyer:~ % python3.9 > Python 3.9.16 (main, Dec 18 2022, 01:15:32) > [Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a on freebsd13 > Type "help", "copyright", "credits" or "license" for more information. > >>> import os > >>> len(os.sched_getaffinity(0)) > 1 > >>> os.sched_getaffinity(0) > {0} > >>> exit() > dchagin@heemeyer:~ % > > on current: > dchagin@mordor:~/freebsd % uname -a > FreeBSD mordor.heemeyer.club 14.0-CURRENT FreeBSD 14.0-CURRENT #458 futex-n260850-52456667491d-dirty: Sat Feb 11 14:24:46 MSK 2023 dchagin@mordor.heemeyer.club:/home/dchagin/tmp/obj/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > dchagin@mordor:~/freebsd % python3.9 > Python 3.9.16 (main, Dec 18 2022, 01:24:21) > [Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc1238 on freebsd14 > Type "help", "copyright", "credits" or "license" for more information. > >>> import os > >>> len(os.sched_getaffinity(0)) > 16 > >>> os.sched_getaffinity(0) > {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} > >>> exit() > dchagin@mordor:~/freebsd % > > > could you please show out of os.sched_getaffinity(0) ? and os.cpu_count() also sysctl kern.smp thanks From nobody Sun Feb 12 11:46:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PF5Kk28H0z3pDPk; Sun, 12 Feb 2023 11:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PF5Kk1Ss7z41KG; Sun, 12 Feb 2023 11:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676202410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YU45OO3K2R3h4jRMtQ1BPBZI+RdW5YMVq2kI6m4tAdQ=; b=ps/SAbWEMVujgdSdPrqO/8DkjfM9a49Fq2JUxhRZOmzu+5lu8hDLgrvmghdf4aNWCq3M4l hmylh7nL4jQf+E8UZyBN3xsckyb9RX+R8gWVYbxTqxEwL/c8R1kSoVB3muvvhtyx8L77LQ lVuhJKmflurnxW8Y+cCWYfKClkwrziwmBZaVMpzV1Fjo1nyIv3NsZU2wbl2if7la2vMHFi 95C0arBgwx2WEzHOldpbJAqLkXx1lxbXBtYqETVom/rk6JDYUbL32/6HwiNBJgJKhYjAkH gNtAm5ft/GxCVCELpjJeYGmCUbvaffTFimeGddhC6jXZrXk2SzEPwCHiGi89aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676202410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YU45OO3K2R3h4jRMtQ1BPBZI+RdW5YMVq2kI6m4tAdQ=; b=NtsJ9erGkzGzYhH71PO+RljFpoN16b6xDT6F3pBb7OQAIJa2fA/GRPi5XBErC64mO1lWHt WX21E9t9WEVl/RGk7Lg3BIFvDu3yCHU31IxRXvA9vj/dxvT4sqZRl2sCova18Rs9yBgxxr rdQDO4E27lgj+BjEBIDhwURwKnMEvu+GlADUVxrQuu1dUq4VQpPlTxcWS2Aj3cpabwTD/N hdvGVB1gWbve29wv3n7r12lKZNuAwDbE8PHXM6T9gAobNMaAQLrc9oy91g/PP24VyzB6wc 9iU7H5FHWpnMmpzULuDSryS9bzCwyk0HrzwoC8QPmVlc8Tl+DDM/Fbev1EiXvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676202410; a=rsa-sha256; cv=none; b=EWWBRXNap8UCWBcq5QDIz2QTtAo9hlAWP07JspS9JWBBIrvS/lssWgEmvZqkGJC73FBy4Z rXBrypEhtPTq+733aGGnF+mHimaxwyrXN0w0QfgoEVsCrfg6UIPxXQlDqGCvgL66ztEZRh XTVIRxV7p6wwqqJ9qFgGSJm2VQ2CH5WNyLcVET8qM9uXoN72IGkoVdfWzqt97H33PyIeHH 417h1Rb1x++HKH0W3oUuA9Zpqme5t+9lm7hhg/7dPjhWxaNwz5FJQoMiry9MwJ+rfdC8vZ bZbHPreXGq7QL82847FDMUSBycXzQd/qDeBB8sCSPJKNwrO4ri8fhGmPrtw++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 4PF5Kk0Qcfzd6V; Sun, 12 Feb 2023 11:46: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 31CBknlp096364; Sun, 12 Feb 2023 11:46:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CBknWF096363; Sun, 12 Feb 2023 11:46:49 GMT (envelope-from git) Date: Sun, 12 Feb 2023 11:46:49 GMT Message-Id: <202302121146.31CBknWF096363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 629d9219d931 - main - netlink: make netlink_snl(3) c++ friendly. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 629d9219d931e63dc49ef046332b2a360e42a5f6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=629d9219d931e63dc49ef046332b2a360e42a5f6 commit 629d9219d931e63dc49ef046332b2a360e42a5f6 Author: Alexander V. Chernikov AuthorDate: 2023-02-10 20:19:09 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-12 11:46:38 +0000 netlink: make netlink_snl(3) c++ friendly. --- sys/netlink/netlink_snl.h | 22 +++++++++++++--------- sys/netlink/netlink_snl_route.h | 6 +++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 6e2c4b89a7c4..586cab391046 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -44,6 +44,7 @@ #include #include +__BEGIN_DECLS #define _roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) @@ -83,7 +84,7 @@ lb_allocz(struct linear_buffer *lb, int len) return (NULL); void *data = (void *)(lb->base + lb->offset); lb->offset += len; - return (data); + return ((char *)data); } static inline void @@ -132,10 +133,10 @@ struct snl_hdr_parser { #define SNL_DECLARE_PARSER(_name, _t, _fp, _np) \ static const struct snl_hdr_parser _name = { \ .hdr_off = sizeof(_t), \ - .fp = &((_fp)[0]), \ - .np = &((_np)[0]), \ .fp_size = NL_ARRAY_LEN(_fp), \ .np_size = NL_ARRAY_LEN(_np), \ + .fp = &((_fp)[0]), \ + .np = &((_np)[0]), \ } #define SNL_DECLARE_ATTR_PARSER(_name, _np) \ @@ -175,14 +176,14 @@ snl_init(struct snl_state *ss, int netlink_family) } ss->bufsize = rcvbuf; - ss->buf = malloc(ss->bufsize); + ss->buf = (char *)malloc(ss->bufsize); if (ss->buf == NULL) { snl_free(ss); return (false); } ss->lb.size = SCRATCH_BUFFER_SIZE; - ss->lb.base = calloc(1, ss->lb.size); + ss->lb.base = (char *)calloc(1, ss->lb.size); if (ss->lb.base == NULL) { snl_free(ss); return (false); @@ -360,7 +361,7 @@ snl_attr_get_uint16(struct snl_state *ss __unused, struct nlattr *nla, const void *arg __unused, void *target) { if (NLA_DATA_LEN(nla) == sizeof(uint16_t)) { - *((uint16_t *)target) = *((const uint16_t *)NLA_DATA_CONST(nla)); + *((uint16_t *)target) = *((const uint16_t *)NL_RTA_DATA_CONST(nla)); return (true); } return (false); @@ -371,7 +372,7 @@ snl_attr_get_uint32(struct snl_state *ss __unused, struct nlattr *nla, const void *arg __unused, void *target) { if (NLA_DATA_LEN(nla) == sizeof(uint32_t)) { - *((uint32_t *)target) = *((const uint32_t *)NLA_DATA_CONST(nla)); + *((uint32_t *)target) = *((const uint32_t *)NL_RTA_DATA_CONST(nla)); return (true); } return (false); @@ -396,7 +397,7 @@ snl_attr_get_stringn(struct snl_state *ss, struct nlattr *nla, { int maxlen = NLA_DATA_LEN(nla); - char *buf = snl_allocz(ss, maxlen + 1); + char *buf = (char *)snl_allocz(ss, maxlen + 1); if (buf == NULL) return (false); buf[maxlen] = '\0'; @@ -416,7 +417,8 @@ snl_attr_get_nested(struct snl_state *ss, struct nlattr *nla, const void *arg, v } static inline bool -snl_attr_get_nla(struct snl_state *ss __unused, struct nlattr *nla, void *target) +snl_attr_get_nla(struct snl_state *ss __unused, struct nlattr *nla, + const void *arg __unused, void *target) { *((struct nlattr **)target) = nla; return (true); @@ -440,4 +442,6 @@ snl_field_get_uint32(struct snl_state *ss __unused, void *src, void *target) *((uint32_t *)target) = *((uint32_t *)src); } +__END_DECLS + #endif diff --git a/sys/netlink/netlink_snl_route.h b/sys/netlink/netlink_snl_route.h index 4adb3d697ecd..19841bdd2f50 100644 --- a/sys/netlink/netlink_snl_route.h +++ b/sys/netlink/netlink_snl_route.h @@ -31,6 +31,8 @@ #include #include +__BEGIN_DECLS + /* * Simple Netlink Library - NETLINK_ROUTE helpers */ @@ -100,7 +102,7 @@ snl_attr_get_ip(struct snl_state *ss, struct nlattr *nla, static inline struct sockaddr * parse_rta_via(struct snl_state *ss, struct rtattr *rta, int *perror) { - struct rtvia *via = NL_RTA_DATA(rta); + struct rtvia *via = (struct rtvia *)NL_RTA_DATA(rta); switch (via->rtvia_family) { case AF_INET: @@ -127,4 +129,6 @@ snl_attr_get_ipvia(struct snl_state *ss, struct nlattr *nla, return (false); } +__END_DECLS + #endif From nobody Sun Feb 12 11:46:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PF5Kl2nPVz3pDKJ; Sun, 12 Feb 2023 11:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PF5Kl219Qz41F9; Sun, 12 Feb 2023 11:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676202411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JJMrtXvY3x3/ydVMTe3VE4AveL8Xsc6yOeU/efYvCBM=; b=p1NDJjtllnS33yf8iOofRGl6Muj2bSXDhrGBg9zfXrProvpreMGvCeC5iHUYjXVNF5Iyop wj7+7ADiB4Rebz6wglioiV3Sie5rO1UDg7u6BB92zwa8h9sAnS0jvE5VrOZ77JFbZc8S96 sdJN2r9lmE+hwfU1RM8JAo1l6Av3LUAqS4qYj2WJRN1d9UsJR4toxLqgr3L+THvt+Qf/ZJ 4MzIdI5ZfXWuMeaRCyPEXngideQKjsNSHPhAMDZXyTo0Pws8El97GJ9qsJ8NVGinIMUB6n Q5doIuwJkCoRHaW/ZTJ/2kDg8Dmv/uBWeCDCkqe2RJXUDSWEkN1SjRHcRjLB/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676202411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JJMrtXvY3x3/ydVMTe3VE4AveL8Xsc6yOeU/efYvCBM=; b=eDb9uEIQTGi35XTbRK6kzWf/ygY4B3QBD1uF5iU7OdHXORJJowpaTQ3+BAv9aGZxnTg1M3 4bqwaZAT/A0o1/ZeyvAJX8jJCppzi+ttToSQUnHSLtRE1WRwoVn9LpGIK62cren1HjcADa 64Xhu/zC/xMeUcwBqn/djSVHevaXd8p3jTA47csuXgmp24PuN9bo8MjOj8a+9SKkAtingA CVSw4L8vyg9BFDvU7t2aHwEsX44xYAX9Y4D0wf7ASlRQAlTluUwuw4Q5xBZF2hWW/9LjbI lC2rfLGLPBY5fE63/xjkmoEIZU2yTk08p1SG1RY+g2SaWFT/avkCWPD0jTqmYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676202411; a=rsa-sha256; cv=none; b=lwCemwkYuoNLsycziCDnMBQ7ttpWNgtqBxUbd7nupS6DRo3aW1vEuSsldnu94uKnluZQhr lGHjBUuwe7D0gY4pbL/xPheSTxr2PG8GGZ1v0Ptj3Te2zsGB5Acoz9biVfYlw8ZauzQPuG F8aEuZMhZ84aTRUN2e0ZSNO9MxEYdSWPrsQNsCP84PhlLEJD3GlFlZTu/XrqLPqLFP9iDD aXULxBbYrMcDTg044dLGqYaYflcO2ngWElzwS8InURjMLe+mjOgq4H3rpVy1s+DY5UkAKT Li6G2mDV4Ik0zbCV9+6HaNNqZV+HLR+RFw6auaa3TaYukycLonbxfLNiytmpZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PF5Kl15dLzcmP; Sun, 12 Feb 2023 11:46: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 31CBkpnm096388; Sun, 12 Feb 2023 11:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CBkprW096387; Sun, 12 Feb 2023 11:46:51 GMT (envelope-from git) Date: Sun, 12 Feb 2023 11:46:51 GMT Message-Id: <202302121146.31CBkprW096387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 69e7d9b7e6b3 - main - fibs: restrict jail_attach(2) if process fibnum >= numfibs in the jail. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69e7d9b7e6b369b760e1f189af2e25587b56a102 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=69e7d9b7e6b369b760e1f189af2e25587b56a102 commit 69e7d9b7e6b369b760e1f189af2e25587b56a102 Author: Alexander V. Chernikov AuthorDate: 2023-02-11 15:43:23 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-12 11:46:38 +0000 fibs: restrict jail_attach(2) if process fibnum >= numfibs in the jail. Reported by: olivier Tested by: olivier Reviewed by: kp, glebius Differential Revision: https://reviews.freebsd.org/D38505 MFC after: 1 week --- sys/net/route/route_tables.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index 637a86573320..be67556915d0 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -162,6 +163,39 @@ sys_setfib(struct thread *td, struct setfib_args *uap) return (error); } +static int +rtables_check_proc_fib(void *obj, void *data) +{ + struct prison *pr = obj; + struct thread *td = data; + int error = 0; + + if (TD_TO_VNET(td) != pr->pr_vnet) { + /* number of fibs may be lower in a new vnet */ + CURVNET_SET(pr->pr_vnet); + if (td->td_proc->p_fibnum >= V_rt_numfibs) + error = EINVAL; + CURVNET_RESTORE(); + } + return (error); +} + +static void +rtables_prison_destructor(void *data) +{ +} + +static void +rtables_init(void) +{ + osd_method_t methods[PR_MAXMETHOD] = { + [PR_METHOD_ATTACH] = rtables_check_proc_fib, + }; + osd_jail_register(rtables_prison_destructor, methods); +} +SYSINIT(rtables_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, rtables_init, NULL); + + /* * If required, copy interface routes from existing tables to the * newly-created routing table. From nobody Sun Feb 12 12:17:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PF6175XnMz3pHL9; Sun, 12 Feb 2023 12:17: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 4PF617523Zz44Lp; Sun, 12 Feb 2023 12:17:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676204251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtP0TvAiVBelVr9Mdp4dqwLMPXonMiZE7weX5J6o6WE=; b=SLhLbgRwbYbddKL0szvGKrwjpvZ5OvYNM0yPiCELyZ7za3oIeIOkSBDHdrHqWJwNsJtPfP B+O2KJDJ+BVEoDZL0IYI0FA8KoVMfX1xA5DXNFwP6RCz3W51NQefzHbJOHsECZk/kbx62n 4q8eXyumbRytqnmGdqyY4vo/EMD/+FNnaCuXLISgOCKM1hcH6xg1cQioOwvzP+bAIQ/GCc RBY33xg0H3Hi0zl+UCZo6t4+4nufc/ZipGvI5+DXVfmu1Lp4fiRKM5cZVgVaRN3I7+howh HwFDUABYHpu1zevdBqZJwOdqeKmk4J19QsybY5OHcPZ/93WuXBSOLm0giHhXxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676204251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtP0TvAiVBelVr9Mdp4dqwLMPXonMiZE7weX5J6o6WE=; b=ao69rjId9mDfDrwb18/WJ8kFuOYegO6muZA0cAJMe5YKAkPjpq6TKbz4ba3eXcMPR2hf1U Pa7iIkYBR8q3mR/ckF+U67rwVbq7Sf3XtmKkS2LJH/xnsE3OwnjA/5EYp6JN1fhqFBop+t 8Kza8LTvfHmyWltLyt4laX0kE44uasA8gf/XDptsIOL+hTyuDu5coM+k+0AW9hxMY8YQXI TPKybHekCIGsaUIq7ZSZ5nFJzgj5IHBGsI0V+KUSkrdhTP6dDg++bR2YLkK8ZKgm+d+AX1 kj9uFJpDvsZEendVbToBspkTWsa7l9frZQMs9/fXCI+9UdIKNHzDVUv51Btg8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676204251; a=rsa-sha256; cv=none; b=Z31GFr8S/XAyWPnhpWajdBGUEVGIgbsYKE2L/80LelaZeZSfg1+ysWX7x4+Lq/vQGESoJD Z1y3kYHS+vD1xFbiNS11dLzgob+30CzWLoyLG4g/Y6rq01gHvDaw8FgwoHIROiIZLZdhHT QLakimMqtXueAOzLavbZQmHH5fZ7VY8V+XxIw0aZvMjyD0e1RoQi4G8RaMz33/UwbW71Z6 2+muLxDVTG/ZYkT3zwpULd4/5buSwXoZe8edPAWSsGQJixzyAfMz2skGneCSR5QoQntkB5 uFLx/QXvNGz7+uEvcKJbJSiGYmrB/OxNiNVJG/qow49NTi1J7krOnk4PC1uG6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PF617450jzdtf; Sun, 12 Feb 2023 12:17: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 31CCHVTD039900; Sun, 12 Feb 2023 12:17:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CCHVof039899; Sun, 12 Feb 2023 12:17:31 GMT (envelope-from git) Date: Sun, 12 Feb 2023 12:17:31 GMT Message-Id: <202302121217.31CCHVof039899@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 6d7da7c8490f - main - Revert "netlink: make netlink_snl(3) c++ friendly." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d7da7c8490f625642faad93b890354cc749f5ae Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6d7da7c8490f625642faad93b890354cc749f5ae commit 6d7da7c8490f625642faad93b890354cc749f5ae Author: Alexander V. Chernikov AuthorDate: 2023-02-12 12:16:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-12 12:17:05 +0000 Revert "netlink: make netlink_snl(3) c++ friendly." Was pushed accidentally. This reverts commit 629d9219d931e63dc49ef046332b2a360e42a5f6. --- sys/netlink/netlink_snl.h | 22 +++++++++------------- sys/netlink/netlink_snl_route.h | 6 +----- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 586cab391046..6e2c4b89a7c4 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -44,7 +44,6 @@ #include #include -__BEGIN_DECLS #define _roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) @@ -84,7 +83,7 @@ lb_allocz(struct linear_buffer *lb, int len) return (NULL); void *data = (void *)(lb->base + lb->offset); lb->offset += len; - return ((char *)data); + return (data); } static inline void @@ -133,10 +132,10 @@ struct snl_hdr_parser { #define SNL_DECLARE_PARSER(_name, _t, _fp, _np) \ static const struct snl_hdr_parser _name = { \ .hdr_off = sizeof(_t), \ - .fp_size = NL_ARRAY_LEN(_fp), \ - .np_size = NL_ARRAY_LEN(_np), \ .fp = &((_fp)[0]), \ .np = &((_np)[0]), \ + .fp_size = NL_ARRAY_LEN(_fp), \ + .np_size = NL_ARRAY_LEN(_np), \ } #define SNL_DECLARE_ATTR_PARSER(_name, _np) \ @@ -176,14 +175,14 @@ snl_init(struct snl_state *ss, int netlink_family) } ss->bufsize = rcvbuf; - ss->buf = (char *)malloc(ss->bufsize); + ss->buf = malloc(ss->bufsize); if (ss->buf == NULL) { snl_free(ss); return (false); } ss->lb.size = SCRATCH_BUFFER_SIZE; - ss->lb.base = (char *)calloc(1, ss->lb.size); + ss->lb.base = calloc(1, ss->lb.size); if (ss->lb.base == NULL) { snl_free(ss); return (false); @@ -361,7 +360,7 @@ snl_attr_get_uint16(struct snl_state *ss __unused, struct nlattr *nla, const void *arg __unused, void *target) { if (NLA_DATA_LEN(nla) == sizeof(uint16_t)) { - *((uint16_t *)target) = *((const uint16_t *)NL_RTA_DATA_CONST(nla)); + *((uint16_t *)target) = *((const uint16_t *)NLA_DATA_CONST(nla)); return (true); } return (false); @@ -372,7 +371,7 @@ snl_attr_get_uint32(struct snl_state *ss __unused, struct nlattr *nla, const void *arg __unused, void *target) { if (NLA_DATA_LEN(nla) == sizeof(uint32_t)) { - *((uint32_t *)target) = *((const uint32_t *)NL_RTA_DATA_CONST(nla)); + *((uint32_t *)target) = *((const uint32_t *)NLA_DATA_CONST(nla)); return (true); } return (false); @@ -397,7 +396,7 @@ snl_attr_get_stringn(struct snl_state *ss, struct nlattr *nla, { int maxlen = NLA_DATA_LEN(nla); - char *buf = (char *)snl_allocz(ss, maxlen + 1); + char *buf = snl_allocz(ss, maxlen + 1); if (buf == NULL) return (false); buf[maxlen] = '\0'; @@ -417,8 +416,7 @@ snl_attr_get_nested(struct snl_state *ss, struct nlattr *nla, const void *arg, v } static inline bool -snl_attr_get_nla(struct snl_state *ss __unused, struct nlattr *nla, - const void *arg __unused, void *target) +snl_attr_get_nla(struct snl_state *ss __unused, struct nlattr *nla, void *target) { *((struct nlattr **)target) = nla; return (true); @@ -442,6 +440,4 @@ snl_field_get_uint32(struct snl_state *ss __unused, void *src, void *target) *((uint32_t *)target) = *((uint32_t *)src); } -__END_DECLS - #endif diff --git a/sys/netlink/netlink_snl_route.h b/sys/netlink/netlink_snl_route.h index 19841bdd2f50..4adb3d697ecd 100644 --- a/sys/netlink/netlink_snl_route.h +++ b/sys/netlink/netlink_snl_route.h @@ -31,8 +31,6 @@ #include #include -__BEGIN_DECLS - /* * Simple Netlink Library - NETLINK_ROUTE helpers */ @@ -102,7 +100,7 @@ snl_attr_get_ip(struct snl_state *ss, struct nlattr *nla, static inline struct sockaddr * parse_rta_via(struct snl_state *ss, struct rtattr *rta, int *perror) { - struct rtvia *via = (struct rtvia *)NL_RTA_DATA(rta); + struct rtvia *via = NL_RTA_DATA(rta); switch (via->rtvia_family) { case AF_INET: @@ -129,6 +127,4 @@ snl_attr_get_ipvia(struct snl_state *ss, struct nlattr *nla, return (false); } -__END_DECLS - #endif From nobody Sun Feb 12 17:19:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFDjb6JC8z3qNWH; Sun, 12 Feb 2023 17:19: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 4PFDjb5gSQz3PsX; Sun, 12 Feb 2023 17:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676222371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IDSEQxzWiALEL4DSu+dcpVhnzsyz/+OI57WSYhJs8Vc=; b=hcstsU07gwXMGq8Gb3X568XGKAnXB8LpeW731L2h0tx9AIXPApinDjpd1B0vWuAEEoOUUC n7IMhVWuc06CfGNjDDL8P0VFiNo6Ap0puESQt/Ua6uNpfI6tIl6z/FKocv3iqSHCLSa8lJ coTwsAeLfcU2gpPe7AL3Ru9yKOR7N/mihxHg8f7iM2OsfZIoGUNWThLvhWYrwtcdmb+0/m pWyG0XDJxhbGa9kcB5UcSLfiJKjfUG66ZID3ZyM6uBpAaWdjIXQ5BLLRN7pKRrMKglCf7p 5ycsLCvu2Pwi3JbekFsyISzkNL0bIfP5dbO3piK5HRZnVfHfiFAQBggxRY0BgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676222371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IDSEQxzWiALEL4DSu+dcpVhnzsyz/+OI57WSYhJs8Vc=; b=wg8tZm63282Tr8GaixU+nJyqbg3efXHTBX2gsS9lsFGjEacBFs/iOddh/EOv+xkThfvoeO inBZh0rkEvJ9EZiAjtSVRpi0N39kKQcK4eSW9pGS94mApeKVdjc76Tbig8wedG9BKPbU/x f3t3NJwrqNE+Y86JaVhpmegGFfH/mhpfOHbd9UWHEXLkAIte6IxiruZprvTCNAHLlGoI+6 tNewh7WVm+fJF/nn3KfIT7vwQ8XI6Lb9CvnsVJzlGZ72aQ6TG9ojtDyYW9AffB6bk2AotN fKN2KrpaAgJMwAg6f7MNGkayf9NTK6ld7nb57QaJmlI+8wu6bauV/w+7itxoAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676222371; a=rsa-sha256; cv=none; b=veFcBbiT6dah31jWI8pZms2jlTJv//ghbGyFpBdebpmvJZY7CsoKlABS7upq6yy8rUxJGz jr0faRy8mcpQV88dvhFe+N70pYlg6oD2I8Dsm+kj9VKbzs9uQsUq2TrXGJwwvIBnkliAlc CFn9N7z3fl9YFsDCnsoOgjoQ6b4/sg3ATH6TrMHlwlpHD4oE163ze5S29y1buVPZV8jI1J dmTBR+MZq0m/vjBsM8eXzcmvLy3WmxdZ3jhfbMG2HErWjH1qWwUz4W4b6n6cFIEvn0Bz/M fOk7U+uJtFAWur3hJQHZQKh31FUzACFLNcpwdwtgGSgigOxI1Zt47VORE9tinw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFDjb4cSRzmV9; Sun, 12 Feb 2023 17:19: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 31CHJVdc069086; Sun, 12 Feb 2023 17:19:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CHJVeI069085; Sun, 12 Feb 2023 17:19:31 GMT (envelope-from git) Date: Sun, 12 Feb 2023 17:19:31 GMT Message-Id: <202302121719.31CHJVeI069085@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: fcfdb76e12fb - main - nfsd: Fix initialization broken by 7344856e3a6d List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fcfdb76e12fb3cdf584e6f06e56e7c48ec475cc6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=fcfdb76e12fb3cdf584e6f06e56e7c48ec475cc6 commit fcfdb76e12fb3cdf584e6f06e56e7c48ec475cc6 Author: Rick Macklem AuthorDate: 2023-02-12 17:16:56 +0000 Commit: Rick Macklem CommitDate: 2023-02-12 17:16:56 +0000 nfsd: Fix initialization broken by 7344856e3a6d Oops, although the vneting macros do not do anything yet, commit 7344856e3a6d did change where things are initialized and one of the initialization functions was not being called early enough. This patch moves nfsrvd_init(0) to the function called via (VNET_)SYSINIT() to fix this. Reported by: olivier MFC after: 3 months --- sys/fs/nfsserver/nfs_nfsdkrpc.c | 1 - sys/fs/nfsserver/nfs_nfsdport.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdkrpc.c b/sys/fs/nfsserver/nfs_nfsdkrpc.c index 696af8a0e409..45459d115346 100644 --- a/sys/fs/nfsserver/nfs_nfsdkrpc.c +++ b/sys/fs/nfsserver/nfs_nfsdkrpc.c @@ -531,7 +531,6 @@ nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args) */ NFSD_LOCK(); if (NFSD_VNET(nfsrv_numnfsd) == 0) { - nfsrvd_init(0); nfsdev_time = time_second; p = td->td_proc; PROC_LOCK(p); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 834a6b069899..bcc49f8bcac3 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3532,6 +3532,7 @@ nfsd_mntinit(void) return; } NFSD_VNET(nfsrv_mntinited) = true; + nfsrvd_init(0); NFSD_UNLOCK(); if (curthread->td_ucred->cr_prison == &prison0) From nobody Sun Feb 12 17:24:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFDqc2bWQz3qNmb; Sun, 12 Feb 2023 17:24: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 4PFDqb6QPXz3R6C; Sun, 12 Feb 2023 17:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676222683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fiy4VJ8hIaMpjOuK/STpErOvqIDYxubdE7w+XSmG1+k=; b=iOSWA1XXxt8F46/9xPmGGm18tUPMoGOMSE+N9z+nn+hxL1LyFupcB4UA10OdbmqFwe+rhJ fnyYbkD52SZh70/+kcC2QKf+2bNEwn6/yRBBZ2Diolr7sjvlhP9TcGaPPpr+uHwsanhDz2 /Kje+IYKk5gfVltFdPjh+WFIaD2R7rv6F8aH/xajbqaKNwTLidrnta/KkKzKGVE62s7v8b yxfZMFlM56DC9dgXlsWI3XKP4McxNqhmaU/SEtBnKiHxkaIszt1JcQxTs909kSVqKu8BPO tLYu5TaGGMgsonuQzhsr6A26/tuu9SnPB1WDoqfz5V1bdtWwNm2aZLPwQzDTMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676222683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fiy4VJ8hIaMpjOuK/STpErOvqIDYxubdE7w+XSmG1+k=; b=nldcLFpWC6nYPNZAnkh9b8OAm5+D3V2vrFdqf0MpfXCZiUmAxzCC+eEIZEEHDJ1IiEOlXI zHeaEcHAxusARNrkJ177xlD+XaD1g5xGLl/X9qHAqZFCgr+hl5sYXYiqqGK9omPax6tUVq TX2GjhjLkMne5kPwtCYzF+yYsVoJeJAH/N0XXnmp28LWLV2mu3xgr3c3MdhG6quVR31zSr h9i2SGyqzrplkNIev0XH64vTWcnGPjCEfBSVXCIkmrDKyeC0bplOMT9xLbl4M/X9YafviY AGE8jgAlg4VPszo1gVOBnFYh6vjjvefUedY38NqbM+t2LXZ6X/X3UdkM03/6jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676222683; a=rsa-sha256; cv=none; b=LmiX0o5ke9eM2xversIJlFaEgW1uGFaPvPh5+P4x4A8uZZ8bQRCgKhkuVQN8jo1ItUdG+p 0V0aNN3oqMydfVC1Tfn+Bzkef3/LwQVUaFPVQ4WqSwLXHZTjO6j9YYXn1FGreqhU7WOZgI Q4Xmr1sdW3Uj2YKFdzWKBJCKlGDoRt5XvQVvyQYGZneeRkTXYubpCKYgddktoz+WrDfAjn qlPmCnP9pErRkLv8IAthF674DNOCqhkh7mxBj3myZblZgXxkqOfMleLko51k0Zvk9OwfBX /UZcmxtCXqgKLiCTmP2ttr7aDOX01PtJfoe6MOamXtMCwKYIK+00KoCAcV88kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFDqb5WBRzmW3; Sun, 12 Feb 2023 17:24: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 31CHOhAo082380; Sun, 12 Feb 2023 17:24:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CHOhBR082379; Sun, 12 Feb 2023 17:24:43 GMT (envelope-from git) Date: Sun, 12 Feb 2023 17:24:43 GMT Message-Id: <202302121724.31CHOhBR082379@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: 10d16789a383 - main - linux(4): Get rid of the opt_compat.h include. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 10d16789a383a5b9e007dfd4c2e7844e044eaf7d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=10d16789a383a5b9e007dfd4c2e7844e044eaf7d commit 10d16789a383a5b9e007dfd4c2e7844e044eaf7d Author: Dmitry Chagin AuthorDate: 2023-02-12 17:24:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-12 17:24:32 +0000 linux(4): Get rid of the opt_compat.h include. Since e013e369 COMPAT_LINUX, COMPAT_LINUX32 build options are removed, so include of opt_compat.h is no more needed. MFC after: 2 weeks --- sys/amd64/linux32/linux32_machdep.c | 2 -- sys/amd64/linux32/linux32_sysvec.c | 2 -- sys/arm64/linux/linux_dummy_machdep.c | 2 -- sys/compat/linux/linux_elf.c | 2 -- sys/compat/linux/linux_event.c | 2 -- sys/compat/linux/linux_file.c | 2 -- sys/compat/linux/linux_fork.c | 2 -- sys/compat/linux/linux_futex.c | 2 -- sys/compat/linux/linux_getcwd.c | 2 -- sys/compat/linux/linux_ioctl.c | 2 -- sys/compat/linux/linux_ipc.c | 2 -- sys/compat/linux/linux_misc.c | 2 -- sys/compat/linux/linux_signal.c | 2 -- sys/compat/linux/linux_socket.c | 2 -- sys/compat/linux/linux_stats.c | 2 -- sys/compat/linux/linux_sysctl.c | 2 -- sys/compat/linux/linux_time.c | 2 -- sys/compat/linux/linux_timer.c | 2 -- sys/compat/linux/linux_uid16.c | 2 -- sys/compat/linux/linux_vdso.c | 2 -- sys/i386/linux/linux_copyout.c | 2 -- sys/modules/linux/Makefile | 1 - sys/modules/linux64/Makefile | 1 - sys/x86/linux/linux_dummy_x86.c | 2 -- 24 files changed, 46 deletions(-) diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 9746c4bd7cdf..5599cbff2525 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -33,8 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 6e40a6a82a39..88720ac7199b 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -32,8 +32,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_compat.h" - #include __FBSDID("$FreeBSD$"); diff --git a/sys/arm64/linux/linux_dummy_machdep.c b/sys/arm64/linux/linux_dummy_machdep.c index 22ad39a84eeb..40cab9baad10 100644 --- a/sys/arm64/linux/linux_dummy_machdep.c +++ b/sys/arm64/linux/linux_dummy_machdep.c @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index cde72e3ed99a..43df9508d470 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -40,8 +40,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 002987ed3c0e..fc27996580c2 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 3b712cf71e60..29a0afaeedda 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c index 7654e447f878..6918868b2c50 100644 --- a/sys/compat/linux/linux_fork.c +++ b/sys/compat/linux/linux_fork.c @@ -31,8 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index d16e047f831c..7d75889d2dce 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_getcwd.c b/sys/compat/linux/linux_getcwd.c index 4917641be5e5..304a72d06588 100644 --- a/sys/compat/linux/linux_getcwd.c +++ b/sys/compat/linux/linux_getcwd.c @@ -38,8 +38,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index deb84fd8dc93..a9d39ef18429 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -26,8 +26,6 @@ * SUCH DAMAGE. */ -#include "opt_compat.h" - #include __FBSDID("$FreeBSD$"); diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 134e353122c1..5f0c22b49e58 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_compat.h" - #ifdef COMPAT_LINUX32 #include #include diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index f9b720cfc0b8..98bbe4b4cbb9 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 09bcbcef4427..26da86eba9f7 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include -#include "opt_compat.h" - #ifdef COMPAT_LINUX32 #include #include diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 42dd7bcb3d36..4bf528943d4f 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -/* XXX we use functions that might not exist. */ -#include "opt_compat.h" #include "opt_inet6.h" #include diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index a1cc2bb7bf8b..1049cb54748b 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_sysctl.c b/sys/compat/linux/linux_sysctl.c index 36f76c088ca3..abf2c898902d 100644 --- a/sys/compat/linux/linux_sysctl.c +++ b/sys/compat/linux/linux_sysctl.c @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_time.c b/sys/compat/linux/linux_time.c index 32db84a570b9..c35d257cd78c 100644 --- a/sys/compat/linux/linux_time.c +++ b/sys/compat/linux/linux_time.c @@ -37,8 +37,6 @@ __FBSDID("$FreeBSD$"); __KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/05/14 03:40:54 christos Exp $"); #endif -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_timer.c b/sys/compat/linux/linux_timer.c index 3e844704f132..4b888eac7718 100644 --- a/sys/compat/linux/linux_timer.c +++ b/sys/compat/linux/linux_timer.c @@ -30,8 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c index 4dd4129cfa0b..149d75459bc8 100644 --- a/sys/compat/linux/linux_uid16.c +++ b/sys/compat/linux/linux_uid16.c @@ -29,8 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/compat/linux/linux_vdso.c b/sys/compat/linux/linux_vdso.c index f5fc7a20b1ef..b4093e64eb83 100644 --- a/sys/compat/linux/linux_vdso.c +++ b/sys/compat/linux/linux_vdso.c @@ -26,8 +26,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) #define __ELF_WORD_SIZE 32 #else diff --git a/sys/i386/linux/linux_copyout.c b/sys/i386/linux/linux_copyout.c index 5672787d5df7..3227d904a235 100644 --- a/sys/i386/linux/linux_copyout.c +++ b/sys/i386/linux/linux_copyout.c @@ -31,8 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index ffb19782c225..b3d662740df9 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -34,7 +34,6 @@ SRCS= linux${SFX}_dummy_machdep.c \ linux_timer.c \ linux_uid16.c \ linux_vdso.c \ - opt_compat.h \ opt_inet6.h \ opt_ktrace.h \ opt_posix.h \ diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index 7d9929f7e14b..7f264471bcd8 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -29,7 +29,6 @@ SRCS= linux_dummy_machdep.c \ linux_time.c \ linux_vdso.c \ linux_timer.c \ - opt_compat.h \ opt_ktrace.h \ opt_inet6.h \ opt_posix.h \ diff --git a/sys/x86/linux/linux_dummy_x86.c b/sys/x86/linux/linux_dummy_x86.c index c48443096180..54799c1f0df2 100644 --- a/sys/x86/linux/linux_dummy_x86.c +++ b/sys/x86/linux/linux_dummy_x86.c @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" - #include #include #include From nobody Sun Feb 12 19:58:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFJDr6DlRz3rBl1; Sun, 12 Feb 2023 19:58:20 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-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 4PFJDr4GH6z42R7; Sun, 12 Feb 2023 19:58:20 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lj1-f182.google.com with SMTP id z37so2350015ljq.8; Sun, 12 Feb 2023 11:58:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=eoNwjiSNe0S1uKLyMTxDZAQuU5rM5MsLgHFGQIMCxwg=; b=Rmds9JYeRBx5N8wUZfaGQoj23JdQzLYj4mRSxXDghwZULup1I+4ITG6aXXy4ana2XL a7YbFRhoJeprPJYkcqr4+QUWEujpUqlLglN4papdm+oq+I+RoC4EbDCPhGiLxkgnopt4 LsYozS3WKu3lWVL7n28nmHb8eKHnfDUK44a2Q+D9kS6O8Rdr9sHaTNvRf0OMgaQO20dK TakDrfLYtemWw8QkPvpGFay3Wp2F/ztEitHY6jZbM3MMfVJ71Ate5FGzr1fKTMMMoX28 Lt6v3BGdKmc1YiBBZ6P/paF7RxpeQezUvNVUcX2UIQehK+qkednimNyPzSVyeCxcSQFf WXHQ== X-Gm-Message-State: AO0yUKU6jOz/sSV8sH4X9xQGXbbaUjIc9qk9PspT0p3QVL1q/LdUi1aB bpgxeATgaVMhYo9JTlZjaQ6pV9lhxDC36n/1ToI= X-Google-Smtp-Source: AK7set/C/3cp/vVSEABW3mN+XsEKTWcNfWjUS9ArJnhfYW08PCTMUnxu86LZ3KUsLydKavfbVV9JUarJ8BS69qYCaco= X-Received: by 2002:a2e:b537:0:b0:28f:81a2:6eb with SMTP id z23-20020a2eb537000000b0028f81a206ebmr4160023ljm.118.1676231898022; Sun, 12 Feb 2023 11:58:18 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> In-Reply-To: From: Antoine Brodin Date: Sun, 12 Feb 2023 19:58:07 +0000 Message-ID: Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. To: Dmitry Chagin Cc: Dmitry Chagin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4PFJDr4GH6z42R7 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]; TAGGED_FROM(0.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin wrote: > > On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: > > On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: > > > On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin wrote: > > > > > > > > The branch main has been updated by dchagin: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > > > > > commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > Author: Dmitry Chagin > > > > AuthorDate: 2023-01-29 13:17:33 +0000 > > > > Commit: Dmitry Chagin > > > > CommitDate: 2023-01-29 13:17:33 +0000 > > > > > > > > cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. > > > > > > > > Under Linux to sched_[g|s]etaffinity() functions the value returned from a call > > > > to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 > > > > will set the attribute for the calling thread, and passing the value returned > > > > from a call to getpid(2) (process id) will set the attribute for the main thread > > > > of the thread group. > > > > > > > > Native cpuset(2) family of system calls has "which" argument to determine how > > > > the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass > > > > a thread id and CPU_WHICH_PID - to pass a process id. > > > > > > > > For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" > > > > CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this > > > > adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. > > > > > > > > Reviewed by: kib > > > > Differential Revision: https://reviews.freebsd.org/D38209 > > > > MFC after: 1 week > > > > --- > > > > lib/libc/gen/sched_getaffinity.c | 2 +- > > > > lib/libc/gen/sched_setaffinity.c | 2 +- > > > > lib/libc/sys/cpuset.2 | 4 +++- > > > > sys/kern/kern_cpuset.c | 42 +++++++++++++++++++++++++++++++++++++++- > > > > sys/sys/cpuset.h | 1 + > > > > 5 files changed, 47 insertions(+), 4 deletions(-) > > > > > > > > > Hello, > > > > > > This broke math/py-numpy on main and stable/13 > > > > > > https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p52768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log > > > https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-baseline/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log > > > > > > File "/wrkdirs/usr/ports/math/py-numpy/work-py39/numpy-1.23.5/numpy/distutils/misc_util.py", > > > line 93, in get_num_build_jobs > > > cpu_count = len(os.sched_getaffinity(0)) > > > OverflowError: could not allocate a large enough CPU set > > > > hi, Antoine, > > > > on stable/13 > > dchagin@heemeyer:~ % uname -a > > FreeBSD heemeyer.club 13.2-STABLE FreeBSD 13.2-STABLE #268 stable/13-n254471-51485f81b01a-dirty: Sat Feb 11 12:16:21 MSK 2023 dchagin@heemeyer.club:/usr/home/dchagin/tmp/obj/usr/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > > dchagin@heemeyer:~ % python3.9 > > Python 3.9.16 (main, Dec 18 2022, 01:15:32) > > [Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a on freebsd13 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> import os > > >>> len(os.sched_getaffinity(0)) > > 1 > > >>> os.sched_getaffinity(0) > > {0} > > >>> exit() > > dchagin@heemeyer:~ % > > > > on current: > > dchagin@mordor:~/freebsd % uname -a > > FreeBSD mordor.heemeyer.club 14.0-CURRENT FreeBSD 14.0-CURRENT #458 futex-n260850-52456667491d-dirty: Sat Feb 11 14:24:46 MSK 2023 dchagin@mordor.heemeyer.club:/home/dchagin/tmp/obj/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > > dchagin@mordor:~/freebsd % python3.9 > > Python 3.9.16 (main, Dec 18 2022, 01:24:21) > > [Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc1238 on freebsd14 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> import os > > >>> len(os.sched_getaffinity(0)) > > 16 > > >>> os.sched_getaffinity(0) > > {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} > > >>> exit() > > dchagin@mordor:~/freebsd % > > > > > > could you please show out of os.sched_getaffinity(0) ? > > and os.cpu_count() > also sysctl kern.smp Here is what I have in the head jail: >>> len(os.sched_getaffinity(0)) Traceback (most recent call last): File "", line 1, in OverflowError: could not allocate a large enough CPU set >>> os.sched_getaffinity(0) Traceback (most recent call last): File "", line 1, in OverflowError: could not allocate a large enough CPU set >>> os.cpu_count() 64 >>> root@mainamd64PR269425-default:~ # sysctl kern.smp kern.smp.forward_signal_enabled: 1 kern.smp.topology: 0 kern.smp.cores: 32 kern.smp.threads_per_core: 2 kern.smp.cpus: 64 kern.smp.disabled: 0 kern.smp.active: 1 kern.smp.maxcpus: 256 kern.smp.maxid: 63 Antoine From nobody Sun Feb 12 21:13:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFKv31tr5z3rLHb; Sun, 12 Feb 2023 21:13: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 4PFKv31FwMz4J7t; Sun, 12 Feb 2023 21:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676236383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NsYwT3HfqjUOQyiK60I8Jahsvj4a97xcA5xqJlMMgIs=; b=x4Jl1Ioc98ar8Ykp0tkYi7Zh5vtUjiblguFZtFW7PGdNMnQR2s11z1Ib3Y5j1lWsNsV8wW yKWs5a4E1Iaa/5gS6TARWth5Q7pkQ1xxs+VKCKv6as0cKf17kLZcttuYOhwBHjCsP34SOD 4kboC0m/2PqtVY3nuHsZB3RzySwCHEC47FPkVKePZfSD6YIP2fmlm2qomJb3R/aOZiE8la B7zzTYEoCTcIJgVn8Ee7SULvN+VgdOE0UZxZBefUx1tVrYl4UdwNFLAGnp2cUfIjHhSilX v40efr/dEPFfRUlewczyYgo28C2jC41Jp8iulrUdG533zkkKMjkYRxeDBOvizw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676236383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NsYwT3HfqjUOQyiK60I8Jahsvj4a97xcA5xqJlMMgIs=; b=brYchLE3A3pjBO9/ySQXTt4g0P1Y8IcYAwnzqJTrYzep2kAogVoRxb0uOKl7TaPPgYb1Nj /eUsWPSskxOH6vceO+PFB3yoKDMXeBXNT/Jtzp7TB4SchTNwVBi+hqkzsLvDfKsmEheouh 2CGExLhBHyNbSxwvgU/ocsCrZhU2HhfvLyRwPt0Sd74n260dFyxhuCQURO2PnGlSAkV3yp kfMBHyHiRJx8UpmKyjt+TKaEvyBRRqAUae4c4EwlfPwk4T1E+InaUC35w99y9RSXtthlgW +GwY7bETfM2B3J8jAGEDUmcDVjwY712O3vgxwFq0ErBgydxXjotqaWG4MH7g0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676236383; a=rsa-sha256; cv=none; b=TiG9v3fhf/E+zOLI7TtFbkuG9rP8RChUDyPfu4n8JvgDNQoKUHXCXyr9Zas4tKCaPhYDF+ umVbAODD8zE0xlmoRFDQT5Luci92oRaj/Szhbe5t5bV7PC9IxCnpoPJqZzgJxZkreiuEZz kzzpZZuZRQU9wecDjv8722oo/rOhCXeoxxnP5YV3DMRgN6Nj/SMBO3g43uMgKbelB7lBTQ nO/m5Plw8NNSoLoOg5Irb/38z+EFxpqvPonAa/8E2Z0wIygahGj7C7gqn7HSMpxFmGnUPR 2GyuK4my4S8qfu0VD07uN+hFEfLPNRC2O2/CBhd2NmMnoQ9fN8MN3LT4mm+mVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFKv275THztLL; Sun, 12 Feb 2023 21:13: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 31CLD2wi012259; Sun, 12 Feb 2023 21:13:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CLD2av012258; Sun, 12 Feb 2023 21:13:02 GMT (envelope-from git) Date: Sun, 12 Feb 2023 21:13:02 GMT Message-Id: <202302122113.31CLD2av012258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: eca005d8531f - main - zlib: silence K&R warns List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eca005d8531fd153f46f941f3101e73cdf181a0b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=eca005d8531fd153f46f941f3101e73cdf181a0b commit eca005d8531fd153f46f941f3101e73cdf181a0b Author: Mateusz Guzik AuthorDate: 2023-02-12 21:12:34 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-12 21:12:34 +0000 zlib: silence K&R warns Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/conf/files | 18 +++++++++++------- sys/modules/zlib/Makefile | 2 ++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 9171b434a7bf..53f90f7afc22 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard libkern/strvalid.c standard libkern/timingsafe_bcmp.c standard contrib/zlib/adler32.c optional crypto | geom_uzip | \ - mxge | ddb_ctf | gzio | zfs | zlib + mxge | ddb_ctf | gzio | zfs | zlib \ + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" contrib/zlib/compress.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-cast-qual" + compile-with "${NORMAL_C} -Wno-cast-qual -Wno-deprecated-non-prototype" contrib/zlib/crc32.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" contrib/zlib/deflate.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-cast-qual" + compile-with "${NORMAL_C} -Wno-cast-qual -Wno-deprecated-non-prototype" contrib/zlib/inffast.c optional crypto | geom_uzip | \ - mxge | ddb_ctf | gzio | zfs | zlib + mxge | ddb_ctf | gzio | zfs | zlib \ + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" contrib/zlib/inflate.c optional crypto | geom_uzip | \ - mxge | ddb_ctf | gzio | zfs | zlib + mxge | ddb_ctf | gzio | zfs | zlib \ + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" contrib/zlib/inftrees.c optional crypto | geom_uzip | \ - mxge | ddb_ctf | gzio | zfs | zlib + mxge | ddb_ctf | gzio | zfs | zlib \ + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" contrib/zlib/trees.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" contrib/zlib/uncompr.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-cast-qual" + compile-with "${NORMAL_C} -Wno-cast-qual -Wno-deprecated-non-prototype" contrib/zlib/zutil.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile index 6391255e512b..178d3a3f7ab7 100644 --- a/sys/modules/zlib/Makefile +++ b/sys/modules/zlib/Makefile @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=${NO_WSTRICT_PROTOTYPES} # crc32.c:586 CWARNFLAGS.trees.c+=${NO_WSTRICT_PROTOTYPES} # trees.c:232 CWARNFLAGS.zutil.c+=${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 +CWARNFLAGS+=-Wno-deprecated-non-prototype + .include From nobody Sun Feb 12 21:18:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFL1r5SgCz3rLqM for ; Sun, 12 Feb 2023 21:18:56 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 4PFL1r2kjBz4Jk5 for ; Sun, 12 Feb 2023 21:18:56 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f41.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so9978679wma.1 for ; Sun, 12 Feb 2023 13:18:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=cE6lz/4G7ZhN3pb+bPl4vz6LlnW12mxXiB+ltMignYE=; b=QFv+XIiEJDXFh9WJqasgkkKR/8FoLRS34eor1oJvlv9M3cTXceY6/nEHL6rcpWglD5 NVDw8vnVcRVd/wpBIwB+G84zMHpPEoXYRejbM+KN0EQ5yVs4gU77zf4c4lMFxaQk6bQR D9y3sKXENDNyL8PNK+bQqXP/t9ksR2cKpuN/kbpTU1RnruLpMHv1SwpT17QiebbmWK4I /etqceHUsTTwcvP7fe6UEY/cgRWWq/6yw0/51qMcqfUN+dxZySUf+eejxL9piKI2gwDg qfFmPXov5tA7YPjBYgQvaTcmHIvDzOiHSM1mNhvIYQEinXscHz5VDZJHE9y/pusAexYW 1+cQ== X-Gm-Message-State: AO0yUKVtgkab78uBkZhkjLANUBTiixw0OjHzKE/qvn+ABsqz8dXVdsCm +P/qQGUuQjZHFclKZFwAuIzMIA== X-Google-Smtp-Source: AK7set/hLDRjo3uWW3z69qDx4Es5ZAus9LfoVdVjqwnhG04XvlBPKtKGDscyDKJm2vImW+Jso9FtjA== X-Received: by 2002:a05:600c:490a:b0:3dc:433a:e952 with SMTP id f10-20020a05600c490a00b003dc433ae952mr17211145wmp.33.1676236734977; Sun, 12 Feb 2023 13:18:54 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id l19-20020a05600c2cd300b003dfefe115b9sm13199360wmc.0.2023.02.12.13.18.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2023 13:18:54 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns From: Jessica Clarke In-Reply-To: <202302122113.31CLD2av012258@gitrepo.freebsd.org> Date: Sun, 12 Feb 2023 21:18:53 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PFL1r2kjBz4Jk5 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 12 Feb 2023, at 21:13, Mateusz Guzik wrote: >=20 > The branch main has been updated by mjg: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e73c= df181a0b >=20 > commit eca005d8531fd153f46f941f3101e73cdf181a0b > Author: Mateusz Guzik > AuthorDate: 2023-02-12 21:12:34 +0000 > Commit: Mateusz Guzik > CommitDate: 2023-02-12 21:12:34 +0000 >=20 > zlib: silence K&R warns >=20 > Sponsored by: Rubicon Communications, LLC ("Netgate") > --- > sys/conf/files | 18 +++++++++++------- > sys/modules/zlib/Makefile | 2 ++ > 2 files changed, 13 insertions(+), 7 deletions(-) >=20 > diff --git a/sys/conf/files b/sys/conf/files > index 9171b434a7bf..53f90f7afc22 100644 > --- a/sys/conf/files > +++ b/sys/conf/files > @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard > libkern/strvalid.c standard > libkern/timingsafe_bcmp.c standard > contrib/zlib/adler32.c optional crypto | geom_uzip | \ > - mxge | ddb_ctf | gzio | zfs | zlib > + mxge | ddb_ctf | gzio | zfs | zlib \ > + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" This doesn=E2=80=99t exist pre-Clang 15. Jess > contrib/zlib/compress.c optional crypto | geom_uzip | \ > mxge | ddb_ctf | gzio | zfs | zlib \ > - compile-with "${NORMAL_C} -Wno-cast-qual" > + compile-with "${NORMAL_C} -Wno-cast-qual = -Wno-deprecated-non-prototype" > contrib/zlib/crc32.c optional crypto | geom_uzip | \ > mxge | ddb_ctf | gzio | zfs | zlib \ > compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > contrib/zlib/deflate.c optional crypto | geom_uzip | \ > mxge | ddb_ctf | gzio | zfs | zlib \ > - compile-with "${NORMAL_C} -Wno-cast-qual" > + compile-with "${NORMAL_C} -Wno-cast-qual = -Wno-deprecated-non-prototype" > contrib/zlib/inffast.c optional crypto | geom_uzip | \ > - mxge | ddb_ctf | gzio | zfs | zlib > + mxge | ddb_ctf | gzio | zfs | zlib \ > + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > contrib/zlib/inflate.c optional crypto | geom_uzip | \ > - mxge | ddb_ctf | gzio | zfs | zlib > + mxge | ddb_ctf | gzio | zfs | zlib \ > + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > contrib/zlib/inftrees.c optional crypto | geom_uzip | \ > - mxge | ddb_ctf | gzio | zfs | zlib > + mxge | ddb_ctf | gzio | zfs | zlib \ > + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > contrib/zlib/trees.c optional crypto | geom_uzip | \ > mxge | ddb_ctf | gzio | zfs | zlib \ > compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > contrib/zlib/uncompr.c optional crypto | geom_uzip | \ > mxge | ddb_ctf | gzio | zfs | zlib \ > - compile-with "${NORMAL_C} -Wno-cast-qual" > + compile-with "${NORMAL_C} -Wno-cast-qual = -Wno-deprecated-non-prototype" > contrib/zlib/zutil.c optional crypto | geom_uzip | \ > mxge | ddb_ctf | gzio | zfs | zlib \ > compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile > index 6391255e512b..178d3a3f7ab7 100644 > --- a/sys/modules/zlib/Makefile > +++ b/sys/modules/zlib/Makefile > @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTOTYPES} # = crc32.c:586 > CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:232 > CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 >=20 > +CWARNFLAGS+=3D-Wno-deprecated-non-prototype > + > .include From nobody Sun Feb 12 21:23:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFL7P6m7pz3p8DY; Sun, 12 Feb 2023 21:23:45 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (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 4PFL7P2jHVz4KXr; Sun, 12 Feb 2023 21:23:45 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x236.google.com with SMTP id bd6so8752100oib.6; Sun, 12 Feb 2023 13:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=u27xuN1lplR2O6jI4ehTKuoJzAn1tDMLU7wUDV8Mf0A=; b=DUoCnqbljfikMEhmaquSbvOZo7SmvTigPv05TpZwRumWbn3Gt1FphCxFOHgD/0v6El TQKwpGLrolm5tkyrdfnXaO+RNdGJdG7opdtsDwVyfNqNIJ0ldurscgMXkZzBDaRuY5LS 3UbSTfdk+BbVVqUzRF88D/VmgpMicIOeFelxyipAbFgFtJVHHlm453kvCCgQAGvIhZfo wcS2ZEfdM2KFGZMNJDqMq3S1k/lq9ZMzcP8ttnyYzEGNjclIrxSyINUHHwhnfy0kqWKx AygkGaAb+9nd45O0h9URYMlVivM3Pv/lqC0CWIrqfXqqzo3oG7o8OmpHWjrTs7ncA0Ip 4N/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u27xuN1lplR2O6jI4ehTKuoJzAn1tDMLU7wUDV8Mf0A=; b=3i15F+Be5CAkPqHTrHwZMKkCw6zca/u/PL1aGySrh/e4rmtu/mY7L2hC2o3/6pgPFU e6Meh5knGaoKTaq3U7sUIzZbN+8mgUOekNPfnbV5CeFuTcDBbDwRgOsrHlqFUEoD5Zq7 PnjUWZ3LKt3Ty4OyFC7wrKJfHZhjTOm+XF1vpSfhakdFLL/NXMO8L4t+KeKAH4YOJT8k Yv/s9iNOp4LWFh4OHa3XaL3dPq08UXbQl+7FDFH+MDh3Wg0sUwYDHqto7EDowga6BsJZ wDHU/79FdliSa9pI3EgI/pU/gVWzs+09cbA2yBLEfrS1R0dlQ7kF0xeoc2j2EX8eOQl+ DI4Q== X-Gm-Message-State: AO0yUKXtmEPAHE7/nflZVj6LPwHZBIWrDofBtrRmg419vSCneH1dFz2C XZ2ZLxvqRsvh+41HtoTwrKgF87ZTYOshIsPp/dWVO4of X-Google-Smtp-Source: AK7set9rxI3idqD/ckrtvRN9vo5Lh/+G/BdNreg6p4dSV3dLZKh5io2TayIHRMViXarBczshdGclpsh4Jctq77tBSNU= X-Received: by 2002:aca:91a:0:b0:37d:6ebd:605 with SMTP id 26-20020aca091a000000b0037d6ebd0605mr586999oij.159.1676237023676; Sun, 12 Feb 2023 13:23:43 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:6c92:0:b0:4b3:d953:974c with HTTP; Sun, 12 Feb 2023 13:23:43 -0800 (PST) In-Reply-To: <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> From: Mateusz Guzik Date: Sun, 12 Feb 2023 22:23:43 +0100 Message-ID: Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PFL7P2jHVz4KXr X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 2/12/23, Jessica Clarke wrote: > On 12 Feb 2023, at 21:13, Mateusz Guzik wrote: >> >> The branch main has been updated by mjg: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e7= 3cdf181a0b >> >> commit eca005d8531fd153f46f941f3101e73cdf181a0b >> Author: Mateusz Guzik >> AuthorDate: 2023-02-12 21:12:34 +0000 >> Commit: Mateusz Guzik >> CommitDate: 2023-02-12 21:12:34 +0000 >> >> zlib: silence K&R warns >> >> Sponsored by: Rubicon Communications, LLC ("Netgate") >> --- >> sys/conf/files | 18 +++++++++++------- >> sys/modules/zlib/Makefile | 2 ++ >> 2 files changed, 13 insertions(+), 7 deletions(-) >> >> diff --git a/sys/conf/files b/sys/conf/files >> index 9171b434a7bf..53f90f7afc22 100644 >> --- a/sys/conf/files >> +++ b/sys/conf/files >> @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard >> libkern/strvalid.c standard >> libkern/timingsafe_bcmp.c standard >> contrib/zlib/adler32.c optional crypto | geom_uzip | \ >> - mxge | ddb_ctf | gzio | zfs | zlib >> + mxge | ddb_ctf | gzio | zfs | zlib \ >> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > > This doesn=E2=80=99t exist pre-Clang 15. > this is main-only and it already has llvm15. the build requirement is top of the branch, so I don't see a problem. if you ran into trouble cross-compiling, you should probably update that env instead of expecting working around the warn in the tree for older compilers > Jess > >> contrib/zlib/compress.c optional crypto | geom_uzip | \ >> mxge | ddb_ctf | gzio | zfs | zlib \ >> - compile-with "${NORMAL_C} -Wno-cast-qual" >> + compile-with "${NORMAL_C} -Wno-cast-qual -Wno-deprecated-non-prototype= " >> contrib/zlib/crc32.c optional crypto | geom_uzip | \ >> mxge | ddb_ctf | gzio | zfs | zlib \ >> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >> contrib/zlib/deflate.c optional crypto | geom_uzip | \ >> mxge | ddb_ctf | gzio | zfs | zlib \ >> - compile-with "${NORMAL_C} -Wno-cast-qual" >> + compile-with "${NORMAL_C} -Wno-cast-qual -Wno-deprecated-non-prototype= " >> contrib/zlib/inffast.c optional crypto | geom_uzip | \ >> - mxge | ddb_ctf | gzio | zfs | zlib >> + mxge | ddb_ctf | gzio | zfs | zlib \ >> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> contrib/zlib/inflate.c optional crypto | geom_uzip | \ >> - mxge | ddb_ctf | gzio | zfs | zlib >> + mxge | ddb_ctf | gzio | zfs | zlib \ >> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> contrib/zlib/inftrees.c optional crypto | geom_uzip | \ >> - mxge | ddb_ctf | gzio | zfs | zlib >> + mxge | ddb_ctf | gzio | zfs | zlib \ >> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> contrib/zlib/trees.c optional crypto | geom_uzip | \ >> mxge | ddb_ctf | gzio | zfs | zlib \ >> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >> contrib/zlib/uncompr.c optional crypto | geom_uzip | \ >> mxge | ddb_ctf | gzio | zfs | zlib \ >> - compile-with "${NORMAL_C} -Wno-cast-qual" >> + compile-with "${NORMAL_C} -Wno-cast-qual -Wno-deprecated-non-prototype= " >> contrib/zlib/zutil.c optional crypto | geom_uzip | \ >> mxge | ddb_ctf | gzio | zfs | zlib \ >> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >> diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile >> index 6391255e512b..178d3a3f7ab7 100644 >> --- a/sys/modules/zlib/Makefile >> +++ b/sys/modules/zlib/Makefile >> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTOTYPES} # >> crc32.c:586 >> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:232 >> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 >> >> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype >> + >> .include > > --=20 Mateusz Guzik From nobody Sun Feb 12 21:33:05 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFLL93KFRz3p97G; Sun, 12 Feb 2023 21:33: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 4PFLL92XRlz4LRM; Sun, 12 Feb 2023 21:33:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676237585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M8cn0es/woDLIAcmAyt0v+txsxNoCZcLv4TF6xqIE6s=; b=AnOl+UBBeT3VZ4ePzy/46F+mFxm5pl4qDy3bnfVkmTZFaFbWze69VFAKAaa6UT4bmHEs9l B0Uv18CiUYUl51J9akXUKe030lUBQWuplkZkTY2c/zXYK5qBa1XHssl/oSeySo3T1mygCn gH1iiNG2+TkOrf4k56adnLPC+likUdMLP5hyJ/8DwrtWx97AIwQ1sKmuq0lJf6aWu5nwmt ukaJquS5cDHuG5KwWZcUxIgZqXIBoCf2VOjQzb8AROzUHK4Bu6ehpTWdQLnIasLu40U/sj C1yJb7sZNq8lMaj5v2UEj7lEDWNCluyxF0buoQZ+hXVbLyfSKUXLjLcMlj/mZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676237585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M8cn0es/woDLIAcmAyt0v+txsxNoCZcLv4TF6xqIE6s=; b=cYcUHNREdpDQ8HgP96sCJ81hPVmgWcodE+gone8yqZZfFj5WP8JsNHCpMYIzT3M0UA0Wq3 rspNARpOfd1TAdlLS58hV4Bka4ZOSNgEJ+8fnKISR73p8l7nuTcSieNBjJ7SWci1fh9Gky MMKC+UzYyc2FLQjk+gj0LhlOGnXOzYzpl1DPx7GCHsvT9G+myRv+fh0WA//4Vy+LPT4ooV j8rT0OIg0yoC2Q/gKWi/okivXRlH27wjdBx2l+K4pFWRbQM3UbcLG170aIp18qI+QORUDH KfUnDmplbU+pOzV9PocqdslQiEa14QXOojNIizhDJo240n7NjZitbQdkzdC1rQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676237585; a=rsa-sha256; cv=none; b=XdxZSCQTPUpb5dsSqKxBCiOuhKV9nuNlWH2/NjhOKRfbIY4zJVRzqTgFgOhep9gaIiF9Eu Ck8dkOjBwmieXoofXj+mPKOt4VZpem8f/5ozV9hLKAVfDQV/YnEmTloLjqx2jyGuXXpJII yVPHo0WgUb2UKVyHNo0Q9kgLEF6UA9jSBaSSJteia/PXDvn/15MUQ/kueVdlCoRnRKz/y8 XR0sRhmoe3ltvUj/S107MNNx1JLYtpXkr+DX2irYPDiKtm92tXwYVrIF+g9dCI0rGsa9O2 IphdJmbDyZQxoSBH9OdlhBUCUAEFvDalgJeEVGhrdq7litYmj3hJb7UBEezG2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFLL91bgwztgy; Sun, 12 Feb 2023 21:33: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 31CLX5N3040661; Sun, 12 Feb 2023 21:33:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CLX5Xb040660; Sun, 12 Feb 2023 21:33:05 GMT (envelope-from git) Date: Sun, 12 Feb 2023 21:33:05 GMT Message-Id: <202302122133.31CLX5Xb040660@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joerg Wunsch Subject: git: 57228a493335 - main - ARM release build: enable IPv6 SLAAC by default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: joerg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57228a49333505aebbc992f3799819667630f255 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by joerg: URL: https://cgit.FreeBSD.org/src/commit/?id=57228a49333505aebbc992f3799819667630f255 commit 57228a49333505aebbc992f3799819667630f255 Author: Joerg Wunsch AuthorDate: 2023-02-12 21:26:52 +0000 Commit: Joerg Wunsch CommitDate: 2023-02-12 21:32:16 +0000 ARM release build: enable IPv6 SLAAC by default When building ARM release images, enable IPv6 SLAAC by default in addition to IPv4 DHCP. Unlike amd64 (and other desktop/server) releases, ARM releases on SoC setups are usually deployed by just using the installation image, so there is no interactive network configuration. Not having IPv6 included by default is kind of an anachronism these days, given that FreeBSD with the KAME project once pioneered IPv6 technology. MFC after: 2 weeks --- release/tools/arm.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 99bfde33c801..9fa76db8b2af 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -219,7 +219,7 @@ arm_install_base() { local hostname hostname="$(echo ${KERNEL} | tr '[:upper:]' '[:lower:]')" echo "hostname=\"${hostname}\"" > ${CHROOTDIR}/${DESTDIR}/etc/rc.conf - echo 'ifconfig_DEFAULT="DHCP"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + echo 'ifconfig_DEFAULT="DHCP inet6 accept_rtadv"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'sshd_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'sendmail_enable="NONE"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'sendmail_submit_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf From nobody Sun Feb 12 21:36:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFLQd5Bm6z3p9jH for ; Sun, 12 Feb 2023 21:36:57 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-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 4PFLQd3MHMz4MCn for ; Sun, 12 Feb 2023 21:36:57 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f50.google.com with SMTP id j29-20020a05600c1c1d00b003dc52fed235so7688003wms.1 for ; Sun, 12 Feb 2023 13:36:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=QF7UTPvJHqYex33t8gxQgJeJ03WCMvVBcA0da33ApHQ=; b=dfq0EFdlyUwACokEYEEyH3WVbI3v0s/OnIvpkz5BqsPWxT4FxYyRfY10E0X7w6uY+m OjeUv7WV8vJB2Ovd9lqHOWD95+FREPypnvLbFDPO6IAxvbEX68PI1vVp7tJZC+MoRw6P lKCp8bxTKevKTYBFb8MC0fSJqCIDyfRC29jN89LIAxOoDekrlZiq9dPtSq3eFMA/bc67 2KK51b9z8kl0+xjReJfdLostq8qVUeN0ePSNjiKeFI34gRoblXq/FSp3AtthrCZLwRsS ldGHS7RVB495yS4Q/OxeXQfGhb7WQS7bGxin9FbVH98AkHvSHBoF/wtKU0J4UdS0zo1s c5nA== X-Gm-Message-State: AO0yUKVQLZ6hWZBGI78yrWgUNa9vy6s3YsX3zH37vTlQofa+y32YOgHD DB0iNtKscpRbCmer99tbx6fsNQ== X-Google-Smtp-Source: AK7set/V5RaHHgX/FIu23vTxb3R2NAnT6PRB7qBn7eAJjOn8OKSV1R+Byo8GJb/Ab7x9K4Ng1E38eA== X-Received: by 2002:a05:600c:a687:b0:3db:bc5:b2ae with SMTP id ip7-20020a05600ca68700b003db0bc5b2aemr17054493wmb.41.1676237815839; Sun, 12 Feb 2023 13:36:55 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id h8-20020a05600c314800b003e11ad0750csm11147859wmo.47.2023.02.12.13.36.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2023 13:36:55 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns From: Jessica Clarke In-Reply-To: Date: Sun, 12 Feb 2023 21:36:54 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PFLQd3MHMz4MCn 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 12 Feb 2023, at 21:23, Mateusz Guzik wrote: >=20 > On 2/12/23, Jessica Clarke wrote: >> On 12 Feb 2023, at 21:13, Mateusz Guzik wrote: >>>=20 >>> The branch main has been updated by mjg: >>>=20 >>> URL: >>> = https://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e73c= df181a0b >>>=20 >>> commit eca005d8531fd153f46f941f3101e73cdf181a0b >>> Author: Mateusz Guzik >>> AuthorDate: 2023-02-12 21:12:34 +0000 >>> Commit: Mateusz Guzik >>> CommitDate: 2023-02-12 21:12:34 +0000 >>>=20 >>> zlib: silence K&R warns >>>=20 >>> Sponsored by: Rubicon Communications, LLC ("Netgate") >>> --- >>> sys/conf/files | 18 +++++++++++------- >>> sys/modules/zlib/Makefile | 2 ++ >>> 2 files changed, 13 insertions(+), 7 deletions(-) >>>=20 >>> diff --git a/sys/conf/files b/sys/conf/files >>> index 9171b434a7bf..53f90f7afc22 100644 >>> --- a/sys/conf/files >>> +++ b/sys/conf/files >>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard >>> libkern/strvalid.c standard >>> libkern/timingsafe_bcmp.c standard >>> contrib/zlib/adler32.c optional crypto | geom_uzip | \ >>> - mxge | ddb_ctf | gzio | zfs | zlib >>> + mxge | ddb_ctf | gzio | zfs | zlib \ >>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >>=20 >> This doesn=E2=80=99t exist pre-Clang 15. >>=20 >=20 > this is main-only and it already has llvm15. the build requirement is > top of the branch, so I don't see a problem. >=20 > if you ran into trouble cross-compiling, you should probably update > that env instead of expecting working around the warn in the tree for > older compilers That is not our policy. Please fix this. Jess >> Jess >>=20 >>> contrib/zlib/compress.c optional crypto | geom_uzip | \ >>> mxge | ddb_ctf | gzio | zfs | zlib \ >>> - compile-with "${NORMAL_C} -Wno-cast-qual" >>> + compile-with "${NORMAL_C} -Wno-cast-qual = -Wno-deprecated-non-prototype" >>> contrib/zlib/crc32.c optional crypto | geom_uzip | \ >>> mxge | ddb_ctf | gzio | zfs | zlib \ >>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >>> contrib/zlib/deflate.c optional crypto | geom_uzip | \ >>> mxge | ddb_ctf | gzio | zfs | zlib \ >>> - compile-with "${NORMAL_C} -Wno-cast-qual" >>> + compile-with "${NORMAL_C} -Wno-cast-qual = -Wno-deprecated-non-prototype" >>> contrib/zlib/inffast.c optional crypto | geom_uzip | \ >>> - mxge | ddb_ctf | gzio | zfs | zlib >>> + mxge | ddb_ctf | gzio | zfs | zlib \ >>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >>> contrib/zlib/inflate.c optional crypto | geom_uzip | \ >>> - mxge | ddb_ctf | gzio | zfs | zlib >>> + mxge | ddb_ctf | gzio | zfs | zlib \ >>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >>> contrib/zlib/inftrees.c optional crypto | geom_uzip | \ >>> - mxge | ddb_ctf | gzio | zfs | zlib >>> + mxge | ddb_ctf | gzio | zfs | zlib \ >>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >>> contrib/zlib/trees.c optional crypto | geom_uzip | \ >>> mxge | ddb_ctf | gzio | zfs | zlib \ >>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >>> contrib/zlib/uncompr.c optional crypto | geom_uzip | \ >>> mxge | ddb_ctf | gzio | zfs | zlib \ >>> - compile-with "${NORMAL_C} -Wno-cast-qual" >>> + compile-with "${NORMAL_C} -Wno-cast-qual = -Wno-deprecated-non-prototype" >>> contrib/zlib/zutil.c optional crypto | geom_uzip | \ >>> mxge | ddb_ctf | gzio | zfs | zlib \ >>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >>> diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile >>> index 6391255e512b..178d3a3f7ab7 100644 >>> --- a/sys/modules/zlib/Makefile >>> +++ b/sys/modules/zlib/Makefile >>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTOTYPES} # >>> crc32.c:586 >>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:232 >>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 >>>=20 >>> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype >>> + >>> .include >>=20 >>=20 >=20 >=20 > --=20 > Mateusz Guzik From nobody Sun Feb 12 21:38:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFLS81Wx8z3p9lX; Sun, 12 Feb 2023 21:38: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 4PFLS80zYQz4MLV; Sun, 12 Feb 2023 21:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676237896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D6POHTpktpJBdwSi+EzAMq1P9hASuEWTs3FD/OwGh54=; b=pVuOisuCqCho+vJRlaL6LrjT/TIikNJnqtj+I/ZIwPzQb8FeqLelWuHGetP2G4Kq2PBHH5 w+Q8w9MFB/WkKvGvWoSjr84AYCySyqvChMV29Mmdd9fPq0lNpvcekM6tiixD9wNxNgMqDI NfFmug9FGvLUVVWVFxMYIfyQvS5ncRDuqb4U2McfEXe9YW+CKyB2T/nj6nA5R1Gy2vpyJ/ iVqMiwLkVp9XsM7GgLA1daUVOCuY+vzACM3d9d/BVmEnUGaxHLYk7au0p/3SvHcx/I0ljy K/9uiPP2PAWK2sQwM5ZTXMQJSFriv4CK/5rloO2dOlHcwWKXm3Sx3mQJYrvZXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676237896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D6POHTpktpJBdwSi+EzAMq1P9hASuEWTs3FD/OwGh54=; b=kiuUzbJHUBTOLwaOoeGviBC/Dh71isurVSRuLIyuPRMOlWZx6VpkvKsAujBIJBuOxyn4/r ISfn46hhkxcsLLEHIWjmCz+btKoTcTFDaheqAGjFtrZZNMkKpVO7nqMs8y5fXLltHqDbeO wNWhwdPoK9wtsWb7vBhYmQ8mF4E3gGTwlTtaRVB3MXu2nmvWQMhsfROhh/rdq8j2EtklH5 w+oIxhRbQiyQO2ClN9S2tfnHwggdIrM4WRxYZVh/V+ahLutDSZRL49hQrJw1KINyVCQdMZ 7sqlah1XrlEPGs9pO0O5q5gOC64YZIphP5T7fjqfd/ysTsO3LkuxEV6Iv+HM8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676237896; a=rsa-sha256; cv=none; b=lIVz0d1WKGqpkznuCCjQ/YOA5q3iDfEtRJWqJJ+QkO4vglnsCjwi//FC5q5GEBjISc0PzL gPDKLU17+TtNr2HGqZWBJ58bTz/NKNrjb+pHXrw4RwYwKheSGZRwzMPM5F6+OVyj2l0K8B fH1EOsa7w4qcz+VafTNcKAP6eJgTC4J3yx+1MDD+2p3N9yvw9rN5/NxQM6a79SdYQhfPwx ZJU4NWwqBT+5ml9mtXa0XcqKrq5y9g6eYfgA238J5NmLe39o01uguUnBApc7HM6PzFsnGp yI5Xz+ufponTLg/k1e93DwAVnzn5R09eeLfdGjb3q1DQ4XnAr1BnVSqDo6wCQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFLS76q0pzth0; Sun, 12 Feb 2023 21:38: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 31CLcFat041558; Sun, 12 Feb 2023 21:38:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CLcF5J041557; Sun, 12 Feb 2023 21:38:15 GMT (envelope-from git) Date: Sun, 12 Feb 2023 21:38:15 GMT Message-Id: <202302122138.31CLcF5J041557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 16d10ee0235a - main - lge: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16d10ee0235abb217773aa46b927c8c1513f3261 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=16d10ee0235abb217773aa46b927c8c1513f3261 commit 16d10ee0235abb217773aa46b927c8c1513f3261 Author: Mateusz Guzik AuthorDate: 2023-02-12 21:37:24 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-12 21:38:11 +0000 lge: ansify Reported by: clang 15 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/lge/if_lge.c | 123 ++++++++++++++++----------------------------------- 1 file changed, 37 insertions(+), 86 deletions(-) diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index e977e4e6897c..bbca5dfb77c2 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -211,10 +211,7 @@ MODULE_DEPEND(lge, miibus, 1, 1, 1); * Read a word of data stored in the EEPROM at address 'addr.' */ static void -lge_eeprom_getword(sc, addr, dest) - struct lge_softc *sc; - int addr; - u_int16_t *dest; +lge_eeprom_getword(struct lge_softc *sc, int addr, u_int16_t *dest) { int i; u_int32_t val; @@ -245,12 +242,7 @@ lge_eeprom_getword(sc, addr, dest) * Read a sequence of words from the EEPROM. */ static void -lge_read_eeprom(sc, dest, off, cnt, swap) - struct lge_softc *sc; - caddr_t dest; - int off; - int cnt; - int swap; +lge_read_eeprom(struct lge_softc *sc, caddr_t dest, int off, int cnt, int swap) { int i; u_int16_t word = 0, *ptr; @@ -268,9 +260,7 @@ lge_read_eeprom(sc, dest, off, cnt, swap) } static int -lge_miibus_readreg(dev, phy, reg) - device_t dev; - int phy, reg; +lge_miibus_readreg(device_t dev, int phy, int reg) { struct lge_softc *sc; int i; @@ -300,9 +290,7 @@ lge_miibus_readreg(dev, phy, reg) } static int -lge_miibus_writereg(dev, phy, reg, data) - device_t dev; - int phy, reg, data; +lge_miibus_writereg(device_t dev, int phy, int reg, int data) { struct lge_softc *sc; int i; @@ -325,8 +313,7 @@ lge_miibus_writereg(dev, phy, reg, data) } static void -lge_miibus_statchg(dev) - device_t dev; +lge_miibus_statchg(device_t dev) { struct lge_softc *sc; struct mii_data *mii; @@ -379,8 +366,7 @@ lge_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int count) } static void -lge_setmulti(sc) - struct lge_softc *sc; +lge_setmulti(struct lge_softc *sc) { if_t ifp; uint32_t hashes[2] = { 0, 0 }; @@ -411,8 +397,7 @@ lge_setmulti(sc) } static void -lge_reset(sc) - struct lge_softc *sc; +lge_reset(struct lge_softc *sc) { int i; @@ -429,7 +414,7 @@ lge_reset(sc) /* Wait a little while for the chip to get its brains in order. */ DELAY(1000); - return; + return; } /* @@ -437,8 +422,7 @@ lge_reset(sc) * IDs against our list and return a device name if we find a match. */ static int -lge_probe(dev) - device_t dev; +lge_probe(device_t dev) { const struct lge_type *t; @@ -461,8 +445,7 @@ lge_probe(dev) * setup and ethernet/BPF attach. */ static int -lge_attach(dev) - device_t dev; +lge_attach(device_t dev) { u_char eaddr[ETHER_ADDR_LEN]; struct lge_softc *sc; @@ -471,7 +454,7 @@ lge_attach(dev) sc = device_get_softc(dev); sc->lge_dev = dev; - + mtx_init(&sc->lge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->lge_stat_callout, &sc->lge_mtx, 0); @@ -592,8 +575,7 @@ fail: } static int -lge_detach(dev) - device_t dev; +lge_detach(device_t dev) { struct lge_softc *sc; if_t ifp; @@ -627,8 +609,7 @@ lge_detach(dev) * Initialize the transmit descriptors. */ static int -lge_list_tx_init(sc) - struct lge_softc *sc; +lge_list_tx_init(struct lge_softc *sc) { struct lge_list_data *ld; struct lge_ring_data *cd; @@ -653,8 +634,7 @@ lge_list_tx_init(sc) * points back to the first. */ static int -lge_list_rx_init(sc) - struct lge_softc *sc; +lge_list_rx_init(struct lge_softc *sc) { struct lge_list_data *ld; struct lge_ring_data *cd; @@ -684,10 +664,7 @@ lge_list_rx_init(sc) * Initialize an RX descriptor and attach an MBUF cluster. */ static int -lge_newbuf(sc, c, m) - struct lge_softc *sc; - struct lge_rx_desc *c; - struct mbuf *m; +lge_newbuf(struct lge_softc *sc, struct lge_rx_desc *c, struct mbuf *m) { struct mbuf *m_new = NULL; char *buf = NULL; @@ -752,8 +729,7 @@ lge_newbuf(sc, c, m) } static int -lge_alloc_jumbo_mem(sc) - struct lge_softc *sc; +lge_alloc_jumbo_mem(struct lge_softc *sc) { caddr_t ptr; int i; @@ -795,8 +771,7 @@ lge_alloc_jumbo_mem(sc) } static void -lge_free_jumbo_mem(sc) - struct lge_softc *sc; +lge_free_jumbo_mem(struct lge_softc *sc) { struct lge_jpool_entry *entry; @@ -825,13 +800,12 @@ lge_free_jumbo_mem(sc) * Allocate a jumbo buffer. */ static void * -lge_jalloc(sc) - struct lge_softc *sc; +lge_jalloc(struct lge_softc *sc) { struct lge_jpool_entry *entry; - + entry = SLIST_FIRST(&sc->lge_jfree_listhead); - + if (entry == NULL) { #ifdef LGE_VERBOSE device_printf(sc->lge_dev, "no free jumbo buffers\n"); @@ -880,9 +854,7 @@ lge_jfree(struct mbuf *m) * the higher level protocols. */ static void -lge_rxeof(sc, cnt) - struct lge_softc *sc; - int cnt; +lge_rxeof(struct lge_softc *sc, int cnt) { struct mbuf *m; if_t ifp; @@ -964,8 +936,7 @@ lge_rxeof(sc, cnt) } static void -lge_rxeoc(sc) - struct lge_softc *sc; +lge_rxeoc(struct lge_softc *sc) { if_t ifp; @@ -981,8 +952,7 @@ lge_rxeoc(sc) */ static void -lge_txeof(sc) - struct lge_softc *sc; +lge_txeof(struct lge_softc *sc) { struct lge_tx_desc *cur_tx = NULL; if_t ifp; @@ -1024,8 +994,7 @@ lge_txeof(sc) } static void -lge_tick(xsc) - void *xsc; +lge_tick(void *xsc) { struct lge_softc *sc; struct mii_data *mii; @@ -1063,8 +1032,7 @@ lge_tick(xsc) } static void -lge_intr(arg) - void *arg; +lge_intr(void *arg) { struct lge_softc *sc; if_t ifp; @@ -1123,10 +1091,7 @@ lge_intr(arg) * pointers to the fragment pointers. */ static int -lge_encap(sc, m_head, txidx) - struct lge_softc *sc; - struct mbuf *m_head; - u_int32_t *txidx; +lge_encap(struct lge_softc *sc, struct mbuf *m_head, u_int32_t *txidx) { struct lge_frag *f = NULL; struct lge_tx_desc *cur_tx; @@ -1174,8 +1139,7 @@ lge_encap(sc, m_head, txidx) */ static void -lge_start(ifp) - if_t ifp; +lge_start(if_t ifp) { struct lge_softc *sc; @@ -1186,8 +1150,7 @@ lge_start(ifp) } static void -lge_start_locked(ifp) - if_t ifp; +lge_start_locked(if_t ifp) { struct lge_softc *sc; struct mbuf *m_head = NULL; @@ -1235,8 +1198,7 @@ lge_start_locked(ifp) } static void -lge_init(xsc) - void *xsc; +lge_init(void *xsc) { struct lge_softc *sc = xsc; @@ -1246,8 +1208,7 @@ lge_init(xsc) } static void -lge_init_locked(sc) - struct lge_softc *sc; +lge_init_locked(struct lge_softc *sc) { if_t ifp = sc->lge_ifp; @@ -1375,8 +1336,7 @@ lge_init_locked(sc) * Set media options. */ static int -lge_ifmedia_upd(ifp) - if_t ifp; +lge_ifmedia_upd(if_t ifp) { struct lge_softc *sc; @@ -1389,8 +1349,7 @@ lge_ifmedia_upd(ifp) } static void -lge_ifmedia_upd_locked(ifp) - if_t ifp; +lge_ifmedia_upd_locked(if_t ifp) { struct lge_softc *sc; struct mii_data *mii; @@ -1410,9 +1369,7 @@ lge_ifmedia_upd_locked(ifp) * Report current media status. */ static void -lge_ifmedia_sts(ifp, ifmr) - if_t ifp; - struct ifmediareq *ifmr; +lge_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) { struct lge_softc *sc; struct mii_data *mii; @@ -1430,10 +1387,7 @@ lge_ifmedia_sts(ifp, ifmr) } static int -lge_ioctl(ifp, command, data) - if_t ifp; - u_long command; - caddr_t data; +lge_ioctl(if_t ifp, u_long command, caddr_t data) { struct lge_softc *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *) data; @@ -1496,8 +1450,7 @@ lge_ioctl(ifp, command, data) } static void -lge_watchdog(sc) - struct lge_softc *sc; +lge_watchdog(struct lge_softc *sc) { if_t ifp; @@ -1521,8 +1474,7 @@ lge_watchdog(sc) * RX and TX lists. */ static void -lge_stop(sc) - struct lge_softc *sc; +lge_stop(struct lge_softc *sc) { int i; if_t ifp; @@ -1572,8 +1524,7 @@ lge_stop(sc) * get confused by errant DMAs when rebooting. */ static int -lge_shutdown(dev) - device_t dev; +lge_shutdown(device_t dev) { struct lge_softc *sc; From nobody Sun Feb 12 21:40:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFLVl0238z3p9m7; Sun, 12 Feb 2023 21:40:31 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) (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 4PFLVk5Pfrz4N1m; Sun, 12 Feb 2023 21:40:30 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-15fe106c7c7so13234210fac.8; Sun, 12 Feb 2023 13:40:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=X488yGmqrqiuGWqcUfeQePb8kTIxriUGToQkUCeJoLE=; b=VKPbntdFu1xYz9H1GzmD3dRdtS3p7OsPhB+lbH+/Ab2sC3Aaa+O2GkdTNLphT/4ylX v7dhOVdP49G/+ks2GM9X5fW2viSJ5cvJdpI91RlYN8sisaiNUutax+QJmdsgRUBSQIpO P3zoXeoUI+2HYR09caXeegS/yn9GNAv6XRf8q+z9Zrb183CcCBdPS5VINL9Bje4L+0S+ Gy38mAM7hNoTarYIEJnoSSJ5lisXzgI94FGxWLb4xuGSAA8U7mzLEgUDl22vWyE4OZ/+ G/j6ohXYKL8Tv1imEs+mUa1winiMinXYYsTWmB/XofQM6/BEmdiL3+a1EXBcoan+4iLD DDOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X488yGmqrqiuGWqcUfeQePb8kTIxriUGToQkUCeJoLE=; b=hFMOaVJT2r55lNWPwW0fcYR/AX4Z1mBJTXsHy/uUeBvFooLfLL0qgSKCqsCy5Cfu6R KU9JBU3OVM9rb4CWb9qj+qFv9yFVzS0YmKmd+JCj8MCMcSkGK3bgYIFSMbb3zzp+jjQX DUEGkPfx04WpmaK6FHuPmva1VOe0X+2vDp4jYwa6KnVLen6rMpk+7a/1HgydT/LpVCUx 5Y06Z+nQGw9AV2WlmUAAiRR8/dH1rNdG0Wt75dx5PqU7M6j9u1YQFJvyzCl11Fjfwlk3 e3s3Wu9aSx3UzQVsDoZekbJTuN6zMzwGPpwdn9xC6e+usKCkQ99gag3TSvhpsEUUOsBZ xi+g== X-Gm-Message-State: AO0yUKXPR4pyj02iGzDDU2AWCAPhT8M4UCAkRZVjFr84wHWoP+WpVbQz TkVPGuGQ2lf8WWWpfqfyk9zlYyAhfhuBr1FkvpW+5OBL X-Google-Smtp-Source: AK7set+DgcdzUt5dWoCRarhiRp+RVuE2AjPIiUbWW2s+hcWjWeqeHkeEVtrLDhREldAgTyP3eD1VZHug11FeRf3sGJc= X-Received: by 2002:a05:6870:1250:b0:16d:c7db:f60f with SMTP id 16-20020a056870125000b0016dc7dbf60fmr906411oao.159.1676238029407; Sun, 12 Feb 2023 13:40:29 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:6c92:0:b0:4b3:d953:974c with HTTP; Sun, 12 Feb 2023 13:40:28 -0800 (PST) In-Reply-To: <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> From: Mateusz Guzik Date: Sun, 12 Feb 2023 22:40:28 +0100 Message-ID: Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PFLVk5Pfrz4N1m X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 2/12/23, Jessica Clarke wrote: > On 12 Feb 2023, at 21:23, Mateusz Guzik wrote: >> >> On 2/12/23, Jessica Clarke wrote: >>> On 12 Feb 2023, at 21:13, Mateusz Guzik wrote: >>>> >>>> The branch main has been updated by mjg: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101= e73cdf181a0b >>>> >>>> commit eca005d8531fd153f46f941f3101e73cdf181a0b >>>> Author: Mateusz Guzik >>>> AuthorDate: 2023-02-12 21:12:34 +0000 >>>> Commit: Mateusz Guzik >>>> CommitDate: 2023-02-12 21:12:34 +0000 >>>> >>>> zlib: silence K&R warns >>>> >>>> Sponsored by: Rubicon Communications, LLC ("Netgate") >>>> --- >>>> sys/conf/files | 18 +++++++++++------- >>>> sys/modules/zlib/Makefile | 2 ++ >>>> 2 files changed, 13 insertions(+), 7 deletions(-) >>>> >>>> diff --git a/sys/conf/files b/sys/conf/files >>>> index 9171b434a7bf..53f90f7afc22 100644 >>>> --- a/sys/conf/files >>>> +++ b/sys/conf/files >>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard >>>> libkern/strvalid.c standard >>>> libkern/timingsafe_bcmp.c standard >>>> contrib/zlib/adler32.c optional crypto | geom_uzip | \ >>>> - mxge | ddb_ctf | gzio | zfs | zlib >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >>> >>> This doesn=E2=80=99t exist pre-Clang 15. >>> >> >> this is main-only and it already has llvm15. the build requirement is >> top of the branch, so I don't see a problem. >> >> if you ran into trouble cross-compiling, you should probably update >> that env instead of expecting working around the warn in the tree for >> older compilers > > That is not our policy. Please fix this. > Are you sure about that? I distinctly recall the supported path to get top of the latest stable branch first, from there you should be able to build the toolchain and the kernel. afaics the above change did not affect it If you insist, I can look for the exact paragraph in the docs. > Jess > >>> Jess >>> >>>> contrib/zlib/compress.c optional crypto | geom_uzip | \ >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" >>>> + compile-with "${NORMAL_C} -Wno-cast-qual >>>> -Wno-deprecated-non-prototype" >>>> contrib/zlib/crc32.c optional crypto | geom_uzip | \ >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >>>> contrib/zlib/deflate.c optional crypto | geom_uzip | \ >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" >>>> + compile-with "${NORMAL_C} -Wno-cast-qual >>>> -Wno-deprecated-non-prototype" >>>> contrib/zlib/inffast.c optional crypto | geom_uzip | \ >>>> - mxge | ddb_ctf | gzio | zfs | zlib >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >>>> contrib/zlib/inflate.c optional crypto | geom_uzip | \ >>>> - mxge | ddb_ctf | gzio | zfs | zlib >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >>>> contrib/zlib/inftrees.c optional crypto | geom_uzip | \ >>>> - mxge | ddb_ctf | gzio | zfs | zlib >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >>>> contrib/zlib/trees.c optional crypto | geom_uzip | \ >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >>>> contrib/zlib/uncompr.c optional crypto | geom_uzip | \ >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" >>>> + compile-with "${NORMAL_C} -Wno-cast-qual >>>> -Wno-deprecated-non-prototype" >>>> contrib/zlib/zutil.c optional crypto | geom_uzip | \ >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >>>> diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile >>>> index 6391255e512b..178d3a3f7ab7 100644 >>>> --- a/sys/modules/zlib/Makefile >>>> +++ b/sys/modules/zlib/Makefile >>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTOTYPES} # >>>> crc32.c:586 >>>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:232 >>>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 >>>> >>>> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype >>>> + >>>> .include >>> >>> >> >> >> -- >> Mateusz Guzik > > --=20 Mateusz Guzik From nobody Sun Feb 12 21:47:52 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFLgT3Gr2z3pBwV for ; Sun, 12 Feb 2023 21:48:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 4PFLgT1P1Gz4PVY for ; Sun, 12 Feb 2023 21:48:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52d.google.com with SMTP id c1so6789280edt.4 for ; Sun, 12 Feb 2023 13:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=b6EMt36rQx3PkAReBAI9tmz5BdnxulUmzgFrG9vUxf4=; b=JRizj2vkmB+bndcurHmU33RfUvhQv/HW2va9M3synaYcfIGHv8qP0I6e5hU22yviTE Bd6OqZkqleSzm8n7HwwzZBZ0amjwk/Kxxa7ryprA2VFW9Q1HLj29dKhiCZEelcq1WfYK And1JgpTznxLlPu3WemIbelY2cZ4rbNE9GtY8VOWZXUpc960CcuVYVFcABccBytd8fpK XCAWvVGMkTLojVkaz3DkZ9TYSb8dVfS8YBhkoAlxpoY8H/kh4GpR+RDlB44fz4fKBOae AvKkgoflyATH/AYtg8qXxAI3/qBPXvqB8hIzYcE3LSxsfiBRKxV+FKtfWZeQnjXfunOt nl1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=b6EMt36rQx3PkAReBAI9tmz5BdnxulUmzgFrG9vUxf4=; b=PSnAbY53r8dQZoopzzOf35P4tg4KRk3MO623AKSUhqpLB/HFaVf9Hdelowitb1rkVF ql1y7dxpqagQK8o7JC3NtaNBkvngxZ2gz/CH3l7C4pc7CERGUB+CQO1iuY7xbxC/onLL JLp9X3hpwhJaP8vjPSHFm2bjiySOlBmXbFX4OPpqDFggpuMXJodsaHvZaMzXGUdutJo5 4+hDKz6QkgScRByCOmIJiy38O1YFyS+apuAK0aQRBR6YUEufjLgeZjRsCGBYLUSAxh49 oedCSEGAGtO9K3dvek64hRSJyS1s/xaWcf6Zn8qMExWrdcYGLMj8G7p2+axC1rnHHyTJ KUng== X-Gm-Message-State: AO0yUKXMZxQlPwBHBeupydEx6sGfvvzY+1FYMMfX97hG9Ur676lhNaL0 9YwNvDv8ex/1aY6/TM25Qr/CW77vY01YnzKbMPnkgQ== X-Google-Smtp-Source: AK7set+3PM2va1UnBiqJ339om+FhrPkfIC358s55j7RwIJUoNTprMtMrPfRqh9QqyJ94FT/dsuQ2Mz9Xlf0mHk1ECCQ= X-Received: by 2002:a50:d51d:0:b0:4ac:b74b:a6a3 with SMTP id u29-20020a50d51d000000b004acb74ba6a3mr2022120edi.0.1676238483915; Sun, 12 Feb 2023 13:48:03 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 12 Feb 2023 14:47:52 -0700 Message-ID: Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns To: Mateusz Guzik Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000649e8305f487af00" X-Rspamd-Queue-Id: 4PFLgT1P1Gz4PVY 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 --000000000000649e8305f487af00 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Feb 12, 2023 at 2:40 PM Mateusz Guzik wrote: > On 2/12/23, Jessica Clarke wrote: > > On 12 Feb 2023, at 21:23, Mateusz Guzik wrote: > >> > >> On 2/12/23, Jessica Clarke wrote: > >>> On 12 Feb 2023, at 21:13, Mateusz Guzik wrote: > >>>> > >>>> The branch main has been updated by mjg: > >>>> > >>>> URL: > >>>> > https://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e73= cdf181a0b > >>>> > >>>> commit eca005d8531fd153f46f941f3101e73cdf181a0b > >>>> Author: Mateusz Guzik > >>>> AuthorDate: 2023-02-12 21:12:34 +0000 > >>>> Commit: Mateusz Guzik > >>>> CommitDate: 2023-02-12 21:12:34 +0000 > >>>> > >>>> zlib: silence K&R warns > >>>> > >>>> Sponsored by: Rubicon Communications, LLC ("Netgate") > >>>> --- > >>>> sys/conf/files | 18 +++++++++++------- > >>>> sys/modules/zlib/Makefile | 2 ++ > >>>> 2 files changed, 13 insertions(+), 7 deletions(-) > >>>> > >>>> diff --git a/sys/conf/files b/sys/conf/files > >>>> index 9171b434a7bf..53f90f7afc22 100644 > >>>> --- a/sys/conf/files > >>>> +++ b/sys/conf/files > >>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard > >>>> libkern/strvalid.c standard > >>>> libkern/timingsafe_bcmp.c standard > >>>> contrib/zlib/adler32.c optional crypto | geom_uzip | \ > >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >>> > >>> This doesn=E2=80=99t exist pre-Clang 15. > >>> > >> > >> this is main-only and it already has llvm15. the build requirement is > >> top of the branch, so I don't see a problem. > >> > >> if you ran into trouble cross-compiling, you should probably update > >> that env instead of expecting working around the warn in the tree for > >> older compilers > > > > That is not our policy. Please fix this. > > > > Are you sure about that? I distinctly recall the supported path to get > top of the latest stable branch first, from there you should be able > to build the toolchain and the kernel. > > afaics the above change did not affect it > > If you insist, I can look for the exact paragraph in the docs. > The fix is trivial. https://reviews.freebsd.org/D38550 Please focus your efforts on commenting on the above and testing it out. Warner > > Jess > > > >>> Jess > >>> > >>>> contrib/zlib/compress.c optional crypto | geom_uzip | \ > >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" > >>>> + compile-with "${NORMAL_C} -Wno-cast-qual > >>>> -Wno-deprecated-non-prototype" > >>>> contrib/zlib/crc32.c optional crypto | geom_uzip | \ > >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > >>>> contrib/zlib/deflate.c optional crypto | geom_uzip | \ > >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" > >>>> + compile-with "${NORMAL_C} -Wno-cast-qual > >>>> -Wno-deprecated-non-prototype" > >>>> contrib/zlib/inffast.c optional crypto | geom_uzip | \ > >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >>>> contrib/zlib/inflate.c optional crypto | geom_uzip | \ > >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >>>> contrib/zlib/inftrees.c optional crypto | geom_uzip | \ > >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >>>> contrib/zlib/trees.c optional crypto | geom_uzip | \ > >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > >>>> contrib/zlib/uncompr.c optional crypto | geom_uzip | \ > >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" > >>>> + compile-with "${NORMAL_C} -Wno-cast-qual > >>>> -Wno-deprecated-non-prototype" > >>>> contrib/zlib/zutil.c optional crypto | geom_uzip | \ > >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > >>>> diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile > >>>> index 6391255e512b..178d3a3f7ab7 100644 > >>>> --- a/sys/modules/zlib/Makefile > >>>> +++ b/sys/modules/zlib/Makefile > >>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTOTYPES} # > >>>> crc32.c:586 > >>>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:232 > >>>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 > >>>> > >>>> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype > >>>> + > >>>> .include > >>> > >>> > >> > >> > >> -- > >> Mateusz Guzik > > > > > > > -- > Mateusz Guzik > --000000000000649e8305f487af00 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Feb 12, 2023 at 2:40 PM Mateu= sz Guzik <mjguzik@gmail.com>= wrote:
On 2/12/= 23, Jessica Clarke <jrtc27@freebsd.org> wrote:
> On 12 Feb 2023, at 21:23, Mateusz Guzik <mjguzik@gmail.com> wrote:
>>
>> On 2/12/23, Jessica Clarke <jrtc27@freebsd.org> wrote:
>>> On 12 Feb 2023, at 21:13, Mateusz Guzik <mjg@FreeBSD.org>= ; wrote:
>>>>
>>>> The branch main has been updated by mjg:
>>>>
>>>> URL:
>>>> h= ttps://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e73cdf= 181a0b
>>>>
>>>> commit eca005d8531fd153f46f941f3101e73cdf181a0b
>>>> Author:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik <mjg@FreeBSD.o= rg>
>>>> AuthorDate: 2023-02-12 21:12:34 +0000
>>>> Commit:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik <mjg@FreeBSD.o= rg>
>>>> CommitDate: 2023-02-12 21:12:34 +0000
>>>>
>>>>=C2=A0 =C2=A0zlib: silence K&R warns
>>>>
>>>>=C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Rubicon Communicatio= ns, LLC ("Netgate")
>>>> ---
>>>> sys/conf/files=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | = 18 +++++++++++-------
>>>> sys/modules/zlib/Makefile |=C2=A0 2 ++
>>>> 2 files changed, 13 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/sys/conf/files b/sys/conf/files
>>>> index 9171b434a7bf..53f90f7afc22 100644
>>>> --- a/sys/conf/files
>>>> +++ b/sys/conf/files
>>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 standard
>>>> libkern/strvalid.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0standa= rd
>>>> libkern/timingsafe_bcmp.c=C2=A0 standard
>>>> contrib/zlib/adler32.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0optional crypto | geom_uzip | \
>>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib
>>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-deprecated-non= -prototype"
>>>
>>> This doesn=E2=80=99t exist pre-Clang 15.
>>>
>>
>> this is main-only and it already has llvm15. the build requirement= is
>> top of the branch, so I don't see a problem.
>>
>> if you ran into trouble cross-compiling, you should probably updat= e
>> that env instead of expecting working around the warn in the tree = for
>> older compilers
>
> That is not our policy. Please fix this.
>

Are you sure about that? I distinctly recall the supported path to get
top of the latest stable branch first, from there you should be able
to build the toolchain and the kernel.

afaics the above change did not affect it

If you insist, I can look for the exact paragraph in the docs.

The fix is trivial.


Please focus your efforts on commenting o= n the above and testing it out.

Warner
= =C2=A0
> Jess
>
>>> Jess
>>>
>>>> contrib/zlib/compress.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 optional crypto | geom_uzip | \
>>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>> -=C2=A0 compile-with "${NORMAL_C} -Wno-cast-qual"= ;
>>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-cast-qual
>>>> -Wno-deprecated-non-prototype"
>>>> contrib/zlib/crc32.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>>=C2=A0 =C2=A0 compile-with "${NORMAL_C} ${NO_WSTRICT_P= ROTOTYPES}"
>>>> contrib/zlib/deflate.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0optional crypto | geom_uzip | \
>>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>> -=C2=A0 compile-with "${NORMAL_C} -Wno-cast-qual"= ;
>>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-cast-qual
>>>> -Wno-deprecated-non-prototype"
>>>> contrib/zlib/inffast.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0optional crypto | geom_uzip | \
>>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib
>>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-deprecated-non= -prototype"
>>>> contrib/zlib/inflate.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0optional crypto | geom_uzip | \
>>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib
>>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-deprecated-non= -prototype"
>>>> contrib/zlib/inftrees.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 optional crypto | geom_uzip | \
>>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib
>>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-deprecated-non= -prototype"
>>>> contrib/zlib/trees.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>>=C2=A0 =C2=A0 compile-with "${NORMAL_C} ${NO_WSTRICT_P= ROTOTYPES}"
>>>> contrib/zlib/uncompr.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0optional crypto | geom_uzip | \
>>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>> -=C2=A0 compile-with "${NORMAL_C} -Wno-cast-qual"= ;
>>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-cast-qual
>>>> -Wno-deprecated-non-prototype"
>>>> contrib/zlib/zutil.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>>>>=C2=A0 =C2=A0 compile-with "${NORMAL_C} ${NO_WSTRICT_P= ROTOTYPES}"
>>>> diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/= Makefile
>>>> index 6391255e512b..178d3a3f7ab7 100644
>>>> --- a/sys/modules/zlib/Makefile
>>>> +++ b/sys/modules/zlib/Makefile
>>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTO= TYPES} #
>>>> crc32.c:586
>>>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:2= 32
>>>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:2= 7,32
>>>>
>>>> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype
>>>> +
>>>> .include <bsd.kmod.mk>
>>>
>>>
>>
>>
>> --
>> Mateusz Guzik <mjguzik gmail.com>
>
>


--
Mateusz Guzik <mjguzik gmail.com>
--000000000000649e8305f487af00-- From nobody Sun Feb 12 21:53:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFLnC5fQxz3pC9K; Sun, 12 Feb 2023 21:53: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 4PFLnC4lnbz4RHy; Sun, 12 Feb 2023 21:53:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676238783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XmbiYB/2cJt87roCsGffSlNHKWs3yUyhPDEW0l9WUyI=; b=cqIQA5xlREwzeWsGUcDiIDYdxX+fsvvJ8njJgOOFQWV6XK67FIQizUFjnCLelkIjPDBkal PQ0N2sV957JLJVMS6t9AU+UddYtKyBWMQS8+9ijw3UsZNLYxQjpeIwRKA8I6NG6oo9S64u xM8Alit/ZRHdDbDMQAj5HK4I4dUe4P8EsaoydeYQ3TY/AJLCO5uKGNQ8kX2JL8Cvwu8KV2 xdLQEekHNLayNUK0I5WNk7oBRnAQOcnobXjQWZBwRCIPMtRkMRj4KKEN9NXiZIsKYl0eaI vA7G6btXCMBsYqFT4x7+/OARmhh6Q/VjOK9LsX7A7XSrDBcZ+uKfCCWO+OliUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676238783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XmbiYB/2cJt87roCsGffSlNHKWs3yUyhPDEW0l9WUyI=; b=ogf07zNtyRPTHrKAUBcg1TAtpiSV4UQGtr2+vIwNBvTX/81AkONaPhHYRQktsKnjuREDhZ Xaupj5AvS9x4BJ3KX7VGtmgicgtZJqwq/HpMaJbx0rmpTPOumJnuKU2zGzn3NjqIA2Oltq rVW9eIyWF9vz9cJAPkma+hQwTPXkFbXNI3s7wtuE/SBwLfjSibAOHXvbmMJWANJnjs3lmw UMfSY3y20GXreOYRiWXrhmGpuT1EkwlX14z0+x/k4utnziAz+fc0c8Yjvi2NIpv45++Ccl K4e42Ew9lc+vSoKTEbKbaMIRQnbVpvgHD4YU1e+0BaN2MWAiWJvv/GdpBdls2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676238783; a=rsa-sha256; cv=none; b=W1yIXVQukB8zf2T+kvJtEhMtFXl6oEjBNTxQVo1p5NkOvohUOxMTmVWVjQABisMwEN2xOl QmaqmK8/Iq2uCexgXO4HAbZnDD2HJq4jjbzWlof9LS0uvOLodMFNl321pCrdXieJ4k9rds Az5UiXaFMHPTaj+wNgXKRkqr6GuA0PPGH/uDOIP6ktDkU7btH55tJQfoGMNxBACF6A5Uwd lTW2q+7JstR5lLrVtfMMVF4hkzv347voAl3Hqz0lJWidn9xi1x03SaaD8gBig5T9HxfdX+ DOaom7IJCg50Tu598FbekP+sA3L98ne/fISMTru2AQqzvhNP+Qu+T2jJrHa87A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFLnC3pZLztjc; Sun, 12 Feb 2023 21:53: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 31CLr3xn069223; Sun, 12 Feb 2023 21:53:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CLr3Na069222; Sun, 12 Feb 2023 21:53:03 GMT (envelope-from git) Date: Sun, 12 Feb 2023 21:53:03 GMT Message-Id: <202302122153.31CLr3Na069222@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: ab0440af75ba - main - nfsd: Continue adding macros so nfsd can run in a vnet prison List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab0440af75ba0c2dbf263c5441ccbe4058515fff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ab0440af75ba0c2dbf263c5441ccbe4058515fff commit ab0440af75ba0c2dbf263c5441ccbe4058515fff Author: Rick Macklem AuthorDate: 2023-02-12 21:52:13 +0000 Commit: Rick Macklem CommitDate: 2023-02-12 21:52:13 +0000 nfsd: Continue adding macros so nfsd can run in a vnet prison Commit 7344856e3a6d added a lot of macros that will front end vnet macros so that nfsd(8) can run in vnet prison. This patch adds some more of them. MFC after: 3 months --- sys/fs/nfs/nfsdport.h | 2 +- sys/fs/nfs/nfsrvstate.h | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfs/nfsdport.h b/sys/fs/nfs/nfsdport.h index 6d468219adf3..26bd57d5736d 100644 --- a/sys/fs/nfs/nfsdport.h +++ b/sys/fs/nfs/nfsdport.h @@ -92,7 +92,7 @@ struct nfsexstuff { bcmp(&(f1)->fh_fid, &(f2)->fh_fid, sizeof(struct fid)) == 0) #define NFSLOCKHASH(f) \ - (&nfslockhash[nfsrv_hashfh(f) % nfsrv_lockhashsize]) + (&NFSD_VNET(nfslockhash)[nfsrv_hashfh(f) % nfsrv_lockhashsize]) #define NFSFPVNODE(f) ((f)->f_vnode) #define NFSFPCRED(f) ((f)->f_cred) diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h index 4c171e8b3f50..4dc9729a952f 100644 --- a/sys/fs/nfs/nfsrvstate.h +++ b/sys/fs/nfs/nfsrvstate.h @@ -58,18 +58,18 @@ LIST_HEAD(nfsdontlisthead, nfsdontlist); TAILQ_HEAD(nfsuserhashhead, nfsusrgrp); #define NFSCLIENTHASH(id) \ - (&nfsclienthash[(id).lval[1] % nfsrv_clienthashsize]) + (&NFSD_VNET(nfsclienthash)[(id).lval[1] % nfsrv_clienthashsize]) #define NFSSTATEHASH(clp, id) \ (&((clp)->lc_stateid[(id).other[2] % nfsrv_statehashsize])) #define NFSUSERHASH(id) \ - (&nfsuserhash[(id) % nfsrv_lughashsize]) + (&NFSD_VNET(nfsuserhash)[(id) % nfsrv_lughashsize]) #define NFSUSERNAMEHASH(p, l) \ - (&nfsusernamehash[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \ + (&NFSD_VNET(nfsusernamehash)[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \ % nfsrv_lughashsize]) #define NFSGROUPHASH(id) \ - (&nfsgrouphash[(id) % nfsrv_lughashsize]) + (&NFSD_VNET(nfsgrouphash)[(id) % nfsrv_lughashsize]) #define NFSGROUPNAMEHASH(p, l) \ - (&nfsgroupnamehash[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \ + (&NFSD_VNET(nfsgroupnamehash)[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \ % nfsrv_lughashsize]) struct nfssessionhash { @@ -77,7 +77,8 @@ struct nfssessionhash { struct nfssessionhashhead list; }; #define NFSSESSIONHASH(f) \ - (&nfssessionhash[nfsrv_hashsessionid(f) % nfsrv_sessionhashsize]) + (&NFSD_VNET(nfssessionhash)[nfsrv_hashsessionid(f) % \ + nfsrv_sessionhashsize]) struct nfslayouthash { struct mtx mtx; From nobody Sun Feb 12 21:54:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFLpv1D0Yz3pC9l; Sun, 12 Feb 2023 21:54:31 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) (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 4PFLpt65pfz4RSK; Sun, 12 Feb 2023 21:54:30 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x230.google.com with SMTP id 20so8792246oix.5; Sun, 12 Feb 2023 13:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dmIidRDacOtXrVLvmMexxYqGKHD6kP2LLh8ZQriXb5o=; b=eNThqQHo8XweQD+8DvoTCre5l8laUAX2pqRK/lrNzRFsR/aYAeTFs/U5dkWiBoAyDX oJtBSbzlHnDSXY8UO2dwh8EoIeVkqTat1IFCSE7V3mZkVOPg29NOLFSMJsUc1p8oQWDz YLSLGojy4d+xWFtmURzO4Yq2MRj0wQLV/7CQG54WAxXlvkFqMxOg94icdZCK+cBjb0+f 7OHGfZcRmxkBsNzHuf/uXdrq5icRmYTSXIuUtNv6+1ILmF1YkFt8T7slb8kt+9M/F9Op SbfQRf/lFIJmLpe2krmzabikOp8eoGALGOXrPMql2U4MouBlZT7wrFoePOmDMNu/KFca oZ2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dmIidRDacOtXrVLvmMexxYqGKHD6kP2LLh8ZQriXb5o=; b=K8NVuYH11iGfpeA4fY5JahPuolFGO+2ovr55j15ScnvbgxifSGBEB6Znp5N1wkEpNZ 9QtFjwDiQhX6AjHePpl+jAKwkHPEuD3LZeO48kvWkOSuM6pno/bjO7G7tfAAq6pbI9qr g5g85DDhEbMmv3Jr1/6oPesZkyub/9S2n0jBYYn9rmYfTnP+NwemsM3yGtLLmrIuHFIY SmcYIwKkwmulBgGZ126W3JDtajRYitlciWu4Sy+rYBlxe6rWiE2jkSshOoEhCvtUzCUH Ik/Pf5zZVuoiGcFlFxtfLdUoLV5vwN6Yv94fG5nj5a5oVVNYTVf04wYeKCpwXOf+gLLQ Bf8Q== X-Gm-Message-State: AO0yUKXzCBiKYv2eRlpe4PJbkKnryLuDX4lQ9160Ors5NgDFbu+N0DM5 vgT1ekTys+mkoIZGQRyLFwumE+U6KThfyvaeiuuVcXo6 X-Google-Smtp-Source: AK7set/KuYOrbbAbqMlfJHe0rD9PMU9z/WTbM/sFuehz8s4dxABdPp5aqbz9NUQSFFQaVLHtLcTToL0338SDlSIuggA= X-Received: by 2002:aca:3c05:0:b0:378:348b:9346 with SMTP id j5-20020aca3c05000000b00378348b9346mr1085754oia.81.1676238869477; Sun, 12 Feb 2023 13:54:29 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:6c92:0:b0:4b3:d953:974c with HTTP; Sun, 12 Feb 2023 13:54:28 -0800 (PST) In-Reply-To: References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> From: Mateusz Guzik Date: Sun, 12 Feb 2023 22:54:28 +0100 Message-ID: Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns To: Warner Losh Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PFLpt65pfz4RSK X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 2/12/23, Warner Losh wrote: > On Sun, Feb 12, 2023 at 2:40 PM Mateusz Guzik wrote: > >> On 2/12/23, Jessica Clarke wrote: >> > On 12 Feb 2023, at 21:23, Mateusz Guzik wrote: >> >> >> >> On 2/12/23, Jessica Clarke wrote: >> >>> On 12 Feb 2023, at 21:13, Mateusz Guzik wrote: >> >>>> >> >>>> The branch main has been updated by mjg: >> >>>> >> >>>> URL: >> >>>> >> https://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e7= 3cdf181a0b >> >>>> >> >>>> commit eca005d8531fd153f46f941f3101e73cdf181a0b >> >>>> Author: Mateusz Guzik >> >>>> AuthorDate: 2023-02-12 21:12:34 +0000 >> >>>> Commit: Mateusz Guzik >> >>>> CommitDate: 2023-02-12 21:12:34 +0000 >> >>>> >> >>>> zlib: silence K&R warns >> >>>> >> >>>> Sponsored by: Rubicon Communications, LLC ("Netgate") >> >>>> --- >> >>>> sys/conf/files | 18 +++++++++++------- >> >>>> sys/modules/zlib/Makefile | 2 ++ >> >>>> 2 files changed, 13 insertions(+), 7 deletions(-) >> >>>> >> >>>> diff --git a/sys/conf/files b/sys/conf/files >> >>>> index 9171b434a7bf..53f90f7afc22 100644 >> >>>> --- a/sys/conf/files >> >>>> +++ b/sys/conf/files >> >>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard >> >>>> libkern/strvalid.c standard >> >>>> libkern/timingsafe_bcmp.c standard >> >>>> contrib/zlib/adler32.c optional crypto | geom_uzip | \ >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> >>> >> >>> This doesn=E2=80=99t exist pre-Clang 15. >> >>> >> >> >> >> this is main-only and it already has llvm15. the build requirement is >> >> top of the branch, so I don't see a problem. >> >> >> >> if you ran into trouble cross-compiling, you should probably update >> >> that env instead of expecting working around the warn in the tree for >> >> older compilers >> > >> > That is not our policy. Please fix this. >> > >> >> Are you sure about that? I distinctly recall the supported path to get >> top of the latest stable branch first, from there you should be able >> to build the toolchain and the kernel. >> >> afaics the above change did not affect it >> >> If you insist, I can look for the exact paragraph in the docs. >> > > The fix is trivial. > > https://reviews.freebsd.org/D38550 > > Please focus your efforts on commenting on the above and testing it out. > there is no warn with it but where is it stated that a compiler older than the newest in the tree is supported for kernel builds? > > >> > Jess >> > >> >>> Jess >> >>> >> >>>> contrib/zlib/compress.c optional crypto | geom_uzip | \ >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual >> >>>> -Wno-deprecated-non-prototype" >> >>>> contrib/zlib/crc32.c optional crypto | geom_uzip | \ >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >> >>>> contrib/zlib/deflate.c optional crypto | geom_uzip | \ >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual >> >>>> -Wno-deprecated-non-prototype" >> >>>> contrib/zlib/inffast.c optional crypto | geom_uzip | \ >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> >>>> contrib/zlib/inflate.c optional crypto | geom_uzip | \ >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> >>>> contrib/zlib/inftrees.c optional crypto | geom_uzip | \ >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> >>>> contrib/zlib/trees.c optional crypto | geom_uzip | \ >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >> >>>> contrib/zlib/uncompr.c optional crypto | geom_uzip | \ >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual >> >>>> -Wno-deprecated-non-prototype" >> >>>> contrib/zlib/zutil.c optional crypto | geom_uzip | \ >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >> >>>> diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile >> >>>> index 6391255e512b..178d3a3f7ab7 100644 >> >>>> --- a/sys/modules/zlib/Makefile >> >>>> +++ b/sys/modules/zlib/Makefile >> >>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTOTYPES} # >> >>>> crc32.c:586 >> >>>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:232 >> >>>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 >> >>>> >> >>>> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype >> >>>> + >> >>>> .include >> >>> >> >>> >> >> >> >> >> >> -- >> >> Mateusz Guzik >> > >> > >> >> >> -- >> Mateusz Guzik >> > --=20 Mateusz Guzik From nobody Sun Feb 12 22:02:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFM0Z30ySz3pDhm; Sun, 12 Feb 2023 22:02:54 +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 4PFM0Y6Wygz4Srr; Sun, 12 Feb 2023 22:02:53 +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 31CM2nKj002276; Mon, 13 Feb 2023 01:02:49 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 31CM2nrK002275; Mon, 13 Feb 2023 01:02:49 +0300 (MSK) (envelope-from dchagin) Date: Mon, 13 Feb 2023 01:02:49 +0300 From: Dmitry Chagin To: Antoine Brodin Cc: Dmitry Chagin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. Message-ID: References: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4PFM0Y6Wygz4Srr 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 Sun, Feb 12, 2023 at 07:58:07PM +0000, Antoine Brodin wrote: > On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin wrote: > > > > On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: > > > On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: > > > > On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin wrote: > > > > > > > > > > The branch main has been updated by dchagin: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > > > > > > > commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > > Author: Dmitry Chagin > > > > > AuthorDate: 2023-01-29 13:17:33 +0000 > > > > > Commit: Dmitry Chagin > > > > > CommitDate: 2023-01-29 13:17:33 +0000 > > > > > > > > > > cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. > > > > > > > > > > Under Linux to sched_[g|s]etaffinity() functions the value returned from a call > > > > > to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 > > > > > will set the attribute for the calling thread, and passing the value returned > > > > > from a call to getpid(2) (process id) will set the attribute for the main thread > > > > > of the thread group. > > > > > > > > > > Native cpuset(2) family of system calls has "which" argument to determine how > > > > > the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass > > > > > a thread id and CPU_WHICH_PID - to pass a process id. > > > > > > > > > > For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" > > > > > CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this > > > > > adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. > > > > > > > > > > Reviewed by: kib > > > > > Differential Revision: https://reviews.freebsd.org/D38209 > > > > > MFC after: 1 week > > > > > --- > > > > > lib/libc/gen/sched_getaffinity.c | 2 +- > > > > > lib/libc/gen/sched_setaffinity.c | 2 +- > > > > > lib/libc/sys/cpuset.2 | 4 +++- > > > > > sys/kern/kern_cpuset.c | 42 +++++++++++++++++++++++++++++++++++++++- > > > > > sys/sys/cpuset.h | 1 + > > > > > 5 files changed, 47 insertions(+), 4 deletions(-) > > > > > > > > > > > > Hello, > > > > > > > > This broke math/py-numpy on main and stable/13 > > > > > > > > https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p52768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log > > > > https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-baseline/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log > > > > > > > > File "/wrkdirs/usr/ports/math/py-numpy/work-py39/numpy-1.23.5/numpy/distutils/misc_util.py", > > > > line 93, in get_num_build_jobs > > > > cpu_count = len(os.sched_getaffinity(0)) > > > > OverflowError: could not allocate a large enough CPU set > > > > > > hi, Antoine, > > > > > > on stable/13 > > > dchagin@heemeyer:~ % uname -a > > > FreeBSD heemeyer.club 13.2-STABLE FreeBSD 13.2-STABLE #268 stable/13-n254471-51485f81b01a-dirty: Sat Feb 11 12:16:21 MSK 2023 dchagin@heemeyer.club:/usr/home/dchagin/tmp/obj/usr/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > > > dchagin@heemeyer:~ % python3.9 > > > Python 3.9.16 (main, Dec 18 2022, 01:15:32) > > > [Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a on freebsd13 > > > Type "help", "copyright", "credits" or "license" for more information. > > > >>> import os > > > >>> len(os.sched_getaffinity(0)) > > > 1 > > > >>> os.sched_getaffinity(0) > > > {0} > > > >>> exit() > > > dchagin@heemeyer:~ % > > > > > > on current: > > > dchagin@mordor:~/freebsd % uname -a > > > FreeBSD mordor.heemeyer.club 14.0-CURRENT FreeBSD 14.0-CURRENT #458 futex-n260850-52456667491d-dirty: Sat Feb 11 14:24:46 MSK 2023 dchagin@mordor.heemeyer.club:/home/dchagin/tmp/obj/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > > > dchagin@mordor:~/freebsd % python3.9 > > > Python 3.9.16 (main, Dec 18 2022, 01:24:21) > > > [Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc1238 on freebsd14 > > > Type "help", "copyright", "credits" or "license" for more information. > > > >>> import os > > > >>> len(os.sched_getaffinity(0)) > > > 16 > > > >>> os.sched_getaffinity(0) > > > {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} > > > >>> exit() > > > dchagin@mordor:~/freebsd % > > > > > > > > > could you please show out of os.sched_getaffinity(0) ? > > > > and os.cpu_count() > > also sysctl kern.smp > > Here is what I have in the head jail: > > >>> len(os.sched_getaffinity(0)) > Traceback (most recent call last): > File "", line 1, in > OverflowError: could not allocate a large enough CPU set > >>> os.sched_getaffinity(0) > Traceback (most recent call last): > File "", line 1, in > OverflowError: could not allocate a large enough CPU set > >>> os.cpu_count() > 64 > >>> > root@mainamd64PR269425-default:~ # sysctl kern.smp > kern.smp.forward_signal_enabled: 1 > kern.smp.topology: 0 > kern.smp.cores: 32 > kern.smp.threads_per_core: 2 > kern.smp.cpus: 64 > kern.smp.disabled: 0 > kern.smp.active: 1 > kern.smp.maxcpus: 256 > kern.smp.maxid: 63 thanks, I've implemented python os_sched_getaffinity_impl and could not get a similar result. Is it posiible that you run old wolrd (pre 3e11d3f6)? From nobody Sun Feb 12 22:06:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFM4t0v5yz3pF48 for ; Sun, 12 Feb 2023 22:06:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 4PFM4s5Fp8z4Tpv for ; Sun, 12 Feb 2023 22:06:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x536.google.com with SMTP id s11so2873968edd.10 for ; Sun, 12 Feb 2023 14:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WkOdkICzmaQsG0IpwEpJ3rhCMYGWCSIGjZCpqjKDS4k=; b=RRPYrFGPCxBjgLCvyynBiUvcu++QBp4MMYm3d3dhAVowPU3ph/BUGDkmYQIJHz+zdc K2mD/5qpf67Mt1npyGrljcZY4bCRQ1j5nlLS7OqWRPcTgY8lVVyBGwUNZhIs6XZ9eoBB Wh3Q7auz60nXlX5uI+cbPrCyoR+gha+uOe/t1F3SgYeFsLeKbDaqani19uvOCsQx/Atg xXPsv+pgjkptz8aX/c/UPwbe3I0UVx/dLM4Js3Q312dMkD1Rh/lRlCvj/GyDq4eajzLP PeYiONnEb2ifwF2FSFzM3Bf5ZWT17W8lLIYtgRz6wU38wDIiIlNJzVs7+tNRhHORuiIE r+Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WkOdkICzmaQsG0IpwEpJ3rhCMYGWCSIGjZCpqjKDS4k=; b=nlWGEiqZtcxSiZi+LBP2dgdRCZXGlhHW61m6lyM9qEYIJpoVWkgqawhXxdEGvI5a/I C8NozowTmAO/qm0oiwP5fo6NGCc5La2ajW46vAp4m79y2KVMna00CcdAXHUp30eAHNii Nm0X7bHn8cOofApRKOt6y5/6rzGMqriDtLx19DNhqakmWLDBNpfAmYsyPw8I9eiEGjCr KcY7Ev+Gp2VT54to7A7cPypMIYdYfYQxE1WBeAOelp+LdYTVe/1qAORk+RrJ4ky805V5 +fe7fvHTCTRIM1bCAGwlC8wEt7mzvNzn8T5USDyVgEeBjn4i8Q5LrGYEE9VnPqWZrPGk Prjg== X-Gm-Message-State: AO0yUKXtRc1BhWN/wK05UUYIkljj1RHYd2rJr1Q/ePnSRrSWMQr6RQxE RXZ5QkBd7wsx+PzmBZzGOqyoNz38rk6juQ7Ou30lig== X-Google-Smtp-Source: AK7set8GV7GbKyUbE+AlcnLTvnb3xBBUXggF1eZUkj0TOEkxOY65WYlg4UBYY2hDRnqeYHPf49Km6Wuag536baEqMlQ= X-Received: by 2002:a50:cdca:0:b0:4aa:a255:291f with SMTP id h10-20020a50cdca000000b004aaa255291fmr5137346edj.0.1676239595711; Sun, 12 Feb 2023 14:06:35 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 12 Feb 2023 15:06:24 -0700 Message-ID: Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns To: Mateusz Guzik Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000a947c605f487f118" X-Rspamd-Queue-Id: 4PFM4s5Fp8z4Tpv 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 --000000000000a947c605f487f118 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Feb 12, 2023 at 2:54 PM Mateusz Guzik wrote: > On 2/12/23, Warner Losh wrote: > > On Sun, Feb 12, 2023 at 2:40 PM Mateusz Guzik wrote= : > > > >> On 2/12/23, Jessica Clarke wrote: > >> > On 12 Feb 2023, at 21:23, Mateusz Guzik wrote: > >> >> > >> >> On 2/12/23, Jessica Clarke wrote: > >> >>> On 12 Feb 2023, at 21:13, Mateusz Guzik wrote: > >> >>>> > >> >>>> The branch main has been updated by mjg: > >> >>>> > >> >>>> URL: > >> >>>> > >> > https://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e73= cdf181a0b > >> >>>> > >> >>>> commit eca005d8531fd153f46f941f3101e73cdf181a0b > >> >>>> Author: Mateusz Guzik > >> >>>> AuthorDate: 2023-02-12 21:12:34 +0000 > >> >>>> Commit: Mateusz Guzik > >> >>>> CommitDate: 2023-02-12 21:12:34 +0000 > >> >>>> > >> >>>> zlib: silence K&R warns > >> >>>> > >> >>>> Sponsored by: Rubicon Communications, LLC ("Netgate") > >> >>>> --- > >> >>>> sys/conf/files | 18 +++++++++++------- > >> >>>> sys/modules/zlib/Makefile | 2 ++ > >> >>>> 2 files changed, 13 insertions(+), 7 deletions(-) > >> >>>> > >> >>>> diff --git a/sys/conf/files b/sys/conf/files > >> >>>> index 9171b434a7bf..53f90f7afc22 100644 > >> >>>> --- a/sys/conf/files > >> >>>> +++ b/sys/conf/files > >> >>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard > >> >>>> libkern/strvalid.c standard > >> >>>> libkern/timingsafe_bcmp.c standard > >> >>>> contrib/zlib/adler32.c optional crypto | geom_uzip | = \ > >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >> >>> > >> >>> This doesn=E2=80=99t exist pre-Clang 15. > >> >>> > >> >> > >> >> this is main-only and it already has llvm15. the build requirement = is > >> >> top of the branch, so I don't see a problem. > >> >> > >> >> if you ran into trouble cross-compiling, you should probably update > >> >> that env instead of expecting working around the warn in the tree f= or > >> >> older compilers > >> > > >> > That is not our policy. Please fix this. > >> > > >> > >> Are you sure about that? I distinctly recall the supported path to get > >> top of the latest stable branch first, from there you should be able > >> to build the toolchain and the kernel. > >> > >> afaics the above change did not affect it > >> > >> If you insist, I can look for the exact paragraph in the docs. > >> > > > > The fix is trivial. > > > > https://reviews.freebsd.org/D38550 > > > > Please focus your efforts on commenting on the above and testing it out= . > > > > there is no warn with it > > but where is it stated that a compiler older than the newest in the > tree is supported for kernel builds? > As a project we've always benefitted from flexibility when it's trivial to be flexible. Warner > > > > > >> > Jess > >> > > >> >>> Jess > >> >>> > >> >>>> contrib/zlib/compress.c optional crypto | geom_uzip | = \ > >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" > >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual > >> >>>> -Wno-deprecated-non-prototype" > >> >>>> contrib/zlib/crc32.c optional crypto | geom_uzip | = \ > >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > >> >>>> contrib/zlib/deflate.c optional crypto | geom_uzip | = \ > >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" > >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual > >> >>>> -Wno-deprecated-non-prototype" > >> >>>> contrib/zlib/inffast.c optional crypto | geom_uzip | = \ > >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >> >>>> contrib/zlib/inflate.c optional crypto | geom_uzip | = \ > >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >> >>>> contrib/zlib/inftrees.c optional crypto | geom_uzip | = \ > >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >> >>>> contrib/zlib/trees.c optional crypto | geom_uzip | = \ > >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > >> >>>> contrib/zlib/uncompr.c optional crypto | geom_uzip | = \ > >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" > >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual > >> >>>> -Wno-deprecated-non-prototype" > >> >>>> contrib/zlib/zutil.c optional crypto | geom_uzip | = \ > >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > >> >>>> diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefil= e > >> >>>> index 6391255e512b..178d3a3f7ab7 100644 > >> >>>> --- a/sys/modules/zlib/Makefile > >> >>>> +++ b/sys/modules/zlib/Makefile > >> >>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTOTYPES} = # > >> >>>> crc32.c:586 > >> >>>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:232 > >> >>>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 > >> >>>> > >> >>>> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype > >> >>>> + > >> >>>> .include > >> >>> > >> >>> > >> >> > >> >> > >> >> -- > >> >> Mateusz Guzik > >> > > >> > > >> > >> > >> -- > >> Mateusz Guzik > >> > > > > > -- > Mateusz Guzik > --000000000000a947c605f487f118 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Feb 12, 2023 at 2:54 PM Mateu= sz Guzik <mjguzik@gmail.com>= wrote:
On 2/12/= 23, Warner Losh <imp= @bsdimp.com> wrote:
> On Sun, Feb 12, 2023 at 2:40 PM Mateusz Guzik <mjguzik@gmail.com> wrote:
>
>> On 2/12/23, Jessica Clarke <jrtc27@freebsd.org> wrote:
>> > On 12 Feb 2023, at 21:23, Mateusz Guzik <mjguzik@gmail.com> wrote:
>> >>
>> >> On 2/12/23, Jessica Clarke <jrtc27@freebsd.org> wrote:
>> >>> On 12 Feb 2023, at 21:13, Mateusz Guzik <mjg@FreeB= SD.org> wrote:
>> >>>>
>> >>>> The branch main has been updated by mjg:
>> >>>>
>> >>>> URL:
>> >>>>
>> https://c= git.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e73cdf181a0b
>> >>>>
>> >>>> commit eca005d8531fd153f46f941f3101e73cdf181a0b >> >>>> Author:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik <mjg@= FreeBSD.org>
>> >>>> AuthorDate: 2023-02-12 21:12:34 +0000
>> >>>> Commit:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik <mjg@= FreeBSD.org>
>> >>>> CommitDate: 2023-02-12 21:12:34 +0000
>> >>>>
>> >>>>=C2=A0 =C2=A0zlib: silence K&R warns
>> >>>>
>> >>>>=C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Rubicon Com= munications, LLC ("Netgate")
>> >>>> ---
>> >>>> sys/conf/files=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | 18 +++++++++++-------
>> >>>> sys/modules/zlib/Makefile |=C2=A0 2 ++
>> >>>> 2 files changed, 13 insertions(+), 7 deletions(-)=
>> >>>>
>> >>>> diff --git a/sys/conf/files b/sys/conf/files
>> >>>> index 9171b434a7bf..53f90f7afc22 100644
>> >>>> --- a/sys/conf/files
>> >>>> +++ b/sys/conf/files
>> >>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 standard
>> >>>> libkern/strvalid.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0standard
>> >>>> libkern/timingsafe_bcmp.c=C2=A0 standard
>> >>>> contrib/zlib/adler32.c=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>> >>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib
>> >>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>> >>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-depre= cated-non-prototype"
>> >>>
>> >>> This doesn=E2=80=99t exist pre-Clang 15.
>> >>>
>> >>
>> >> this is main-only and it already has llvm15. the build re= quirement is
>> >> top of the branch, so I don't see a problem.
>> >>
>> >> if you ran into trouble cross-compiling, you should proba= bly update
>> >> that env instead of expecting working around the warn in = the tree for
>> >> older compilers
>> >
>> > That is not our policy. Please fix this.
>> >
>>
>> Are you sure about that? I distinctly recall the supported path to= get
>> top of the latest stable branch first, from there you should be ab= le
>> to build the toolchain and the kernel.
>>
>> afaics the above change did not affect it
>>
>> If you insist, I can look for the exact paragraph in the docs.
>>
>
> The fix is trivial.
>
>
https://reviews.freebsd.org/D38550
>
> Please focus your efforts on commenting on the above and testing it ou= t.
>

there is no warn with it

but where is it stated that a compiler older than the newest in the
tree is supported for kernel builds?

As= a project we've always benefitted from flexibility when it's trivi= al to
be flexible.

Warner
<= div>=C2=A0
>
>
>> > Jess
>> >
>> >>> Jess
>> >>>
>> >>>> contrib/zlib/compress.c=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 optional crypto | geom_uzip | \
>> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \=
>> >>>> -=C2=A0 compile-with "${NORMAL_C} -Wno-cast-= qual"
>> >>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-cast-= qual
>> >>>> -Wno-deprecated-non-prototype"
>> >>>> contrib/zlib/crc32.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \=
>> >>>>=C2=A0 =C2=A0 compile-with "${NORMAL_C} ${NO_= WSTRICT_PROTOTYPES}"
>> >>>> contrib/zlib/deflate.c=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \=
>> >>>> -=C2=A0 compile-with "${NORMAL_C} -Wno-cast-= qual"
>> >>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-cast-= qual
>> >>>> -Wno-deprecated-non-prototype"
>> >>>> contrib/zlib/inffast.c=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>> >>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib
>> >>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>> >>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-depre= cated-non-prototype"
>> >>>> contrib/zlib/inflate.c=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>> >>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib
>> >>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>> >>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-depre= cated-non-prototype"
>> >>>> contrib/zlib/inftrees.c=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 optional crypto | geom_uzip | \
>> >>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib
>> >>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \
>> >>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-depre= cated-non-prototype"
>> >>>> contrib/zlib/trees.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \=
>> >>>>=C2=A0 =C2=A0 compile-with "${NORMAL_C} ${NO_= WSTRICT_PROTOTYPES}"
>> >>>> contrib/zlib/uncompr.c=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \=
>> >>>> -=C2=A0 compile-with "${NORMAL_C} -Wno-cast-= qual"
>> >>>> +=C2=A0 compile-with "${NORMAL_C} -Wno-cast-= qual
>> >>>> -Wno-deprecated-non-prototype"
>> >>>> contrib/zlib/zutil.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip | \
>> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs | zlib \=
>> >>>>=C2=A0 =C2=A0 compile-with "${NORMAL_C} ${NO_= WSTRICT_PROTOTYPES}"
>> >>>> diff --git a/sys/modules/zlib/Makefile b/sys/modu= les/zlib/Makefile
>> >>>> index 6391255e512b..178d3a3f7ab7 100644
>> >>>> --- a/sys/modules/zlib/Makefile
>> >>>> +++ b/sys/modules/zlib/Makefile
>> >>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTR= ICT_PROTOTYPES} #
>> >>>> crc32.c:586
>> >>>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # = trees.c:232
>> >>>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # = zutil.c:27,32
>> >>>>
>> >>>> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype
>> >>>> +
>> >>>> .include <bsd.kmod.mk>
>> >>>
>> >>>
>> >>
>> >>
>> >> --
>> >> Mateusz Guzik <mjguzik gmail.com>
>> >
>> >
>>
>>
>> --
>> Mateusz Guzik <mjguzik gmail.com>
>>
>


--
Mateusz Guzik <mjguzik gmail.com>
--000000000000a947c605f487f118-- From nobody Sun Feb 12 22:12:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFMCP4TGrz3pFSm; Sun, 12 Feb 2023 22:12:17 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (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 4PFMCP2rqTz4VhJ; Sun, 12 Feb 2023 22:12:17 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ot1-x32e.google.com with SMTP id d21-20020a056830005500b0068bd2e0b25bso3224031otp.1; Sun, 12 Feb 2023 14:12:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/GH/5WzUWO8XPUxbxsQ6cJcIV9TTJ+UbbluYXPhONOQ=; b=Lnfm+/cIKaxXXciNIA79YZxG2On2oFanmmY2BdcQ6CFezfXFw3AMG61G0VbbuUlloi yWlfASOxmjuYk93quhy1RA4TQYT886fdZ8PRYqAYMPF42FdHbYAmpHeTct30vji0R4Vq jh6iFiZK5NzHscYfgCNFLhMA1V0b4k9mUrlnuHfmAIxoLYLtqjYwP47WnPgxMc6wQuT3 G4ern9NIRIaf3EW90Lq66bHCKQwKfh63hMWRZ5OyoewyOaLA7dIB3CElMVdAhM2uhUdY hEFDURPFLYV6/vQovCi/vZgjl9avJEzHIirM5nBN4sFzTuCUJMM1On0i3Nr6O2RelOQF 7jiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/GH/5WzUWO8XPUxbxsQ6cJcIV9TTJ+UbbluYXPhONOQ=; b=OqWonfkzaOFW457iIEl+dlZOqpzxZgzNVvjvtN6t5ovN1m2lXCEMkwCAebuJHS9aoJ gH/VLaa3SI3xkV/RnhejzOd0tBHsdXviC38P6U8/3iE6Jfpd8Lv3ZLhTfezVvVCHhsc4 sl09QGmvNqcj6u2bYw0vkI8HSsuY98zu4U+SHY0jIheqfa6VTWLk1h+zJHWR1aJ3j8jW 7a/XyR0e2YHC2cQ6JPDsGsii/UG3aOEYOV0f93VsIsMHZ+6T75TZ/SMQXrAmSxH2ZsB7 YbwM8ML7vP/rH8p+tNWIOyk94HKiq+uhk2SCbCy4Pm+4+AboF425PRklUiUTukF0Ea8N xqhA== X-Gm-Message-State: AO0yUKU/kIuXSQVVhNZN9RklIwpkyUhCV0V5P1dxQaXNrUMJIxv5vwDF 1BiG9RGFXknaLGYcOb8Py0VEMAzay2bnEv8PIR3JGS3N X-Google-Smtp-Source: AK7set+OnFs25hqv9QpAheyFLYIqtKyTvb25ioD6XJA8IozjVoULCvzRddjBPFmihQoe6A2jDvsA7fYkuDj0YgCNnqw= X-Received: by 2002:a05:6830:1db5:b0:66e:f6cb:cb4e with SMTP id z21-20020a0568301db500b0066ef6cbcb4emr2162950oti.105.1676239936440; Sun, 12 Feb 2023 14:12:16 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:6c92:0:b0:4b3:d953:974c with HTTP; Sun, 12 Feb 2023 14:12:15 -0800 (PST) In-Reply-To: References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> From: Mateusz Guzik Date: Sun, 12 Feb 2023 23:12:15 +0100 Message-ID: Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns To: Warner Losh Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PFMCP2rqTz4VhJ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 2/12/23, Warner Losh wrote: > On Sun, Feb 12, 2023 at 2:54 PM Mateusz Guzik wrote: > >> On 2/12/23, Warner Losh wrote: >> > On Sun, Feb 12, 2023 at 2:40 PM Mateusz Guzik >> > wrote: >> > >> >> On 2/12/23, Jessica Clarke wrote: >> >> > On 12 Feb 2023, at 21:23, Mateusz Guzik wrote: >> >> >> >> >> >> On 2/12/23, Jessica Clarke wrote: >> >> >>> On 12 Feb 2023, at 21:13, Mateusz Guzik wrote: >> >> >>>> >> >> >>>> The branch main has been updated by mjg: >> >> >>>> >> >> >>>> URL: >> >> >>>> >> >> >> https://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e7= 3cdf181a0b >> >> >>>> >> >> >>>> commit eca005d8531fd153f46f941f3101e73cdf181a0b >> >> >>>> Author: Mateusz Guzik >> >> >>>> AuthorDate: 2023-02-12 21:12:34 +0000 >> >> >>>> Commit: Mateusz Guzik >> >> >>>> CommitDate: 2023-02-12 21:12:34 +0000 >> >> >>>> >> >> >>>> zlib: silence K&R warns >> >> >>>> >> >> >>>> Sponsored by: Rubicon Communications, LLC ("Netgate") >> >> >>>> --- >> >> >>>> sys/conf/files | 18 +++++++++++------- >> >> >>>> sys/modules/zlib/Makefile | 2 ++ >> >> >>>> 2 files changed, 13 insertions(+), 7 deletions(-) >> >> >>>> >> >> >>>> diff --git a/sys/conf/files b/sys/conf/files >> >> >>>> index 9171b434a7bf..53f90f7afc22 100644 >> >> >>>> --- a/sys/conf/files >> >> >>>> +++ b/sys/conf/files >> >> >>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard >> >> >>>> libkern/strvalid.c standard >> >> >>>> libkern/timingsafe_bcmp.c standard >> >> >>>> contrib/zlib/adler32.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib >> >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> >> >>> >> >> >>> This doesn=E2=80=99t exist pre-Clang 15. >> >> >>> >> >> >> >> >> >> this is main-only and it already has llvm15. the build requirement >> >> >> is >> >> >> top of the branch, so I don't see a problem. >> >> >> >> >> >> if you ran into trouble cross-compiling, you should probably updat= e >> >> >> that env instead of expecting working around the warn in the tree >> >> >> for >> >> >> older compilers >> >> > >> >> > That is not our policy. Please fix this. >> >> > >> >> >> >> Are you sure about that? I distinctly recall the supported path to ge= t >> >> top of the latest stable branch first, from there you should be able >> >> to build the toolchain and the kernel. >> >> >> >> afaics the above change did not affect it >> >> >> >> If you insist, I can look for the exact paragraph in the docs. >> >> >> > >> > The fix is trivial. >> > >> > https://reviews.freebsd.org/D38550 >> > >> > Please focus your efforts on commenting on the above and testing it >> > out. >> > >> >> there is no warn with it >> >> but where is it stated that a compiler older than the newest in the >> tree is supported for kernel builds? >> > > As a project we've always benefitted from flexibility when it's trivial t= o > be flexible. > Look, I just want the build to be warn-free again and I don't care how zlib is handled for that purpose. I do note though that if "compiler flexibility" if you will is to be expected, it should be stated somewhere. Again, I only recall the opposite -- top of main needed to build the kernel. > Warner > > >> > >> > >> >> > Jess >> >> > >> >> >>> Jess >> >> >>> >> >> >>>> contrib/zlib/compress.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" >> >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual >> >> >>>> -Wno-deprecated-non-prototype" >> >> >>>> contrib/zlib/crc32.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >> >> >>>> contrib/zlib/deflate.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" >> >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual >> >> >>>> -Wno-deprecated-non-prototype" >> >> >>>> contrib/zlib/inffast.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib >> >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> >> >>>> contrib/zlib/inflate.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib >> >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> >> >>>> contrib/zlib/inftrees.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib >> >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" >> >> >>>> contrib/zlib/trees.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >> >> >>>> contrib/zlib/uncompr.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" >> >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual >> >> >>>> -Wno-deprecated-non-prototype" >> >> >>>> contrib/zlib/zutil.c optional crypto | geom_uzip | >> >> >>>> \ >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ >> >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" >> >> >>>> diff --git a/sys/modules/zlib/Makefile >> >> >>>> b/sys/modules/zlib/Makefile >> >> >>>> index 6391255e512b..178d3a3f7ab7 100644 >> >> >>>> --- a/sys/modules/zlib/Makefile >> >> >>>> +++ b/sys/modules/zlib/Makefile >> >> >>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTOTYPES}= # >> >> >>>> crc32.c:586 >> >> >>>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:232 >> >> >>>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 >> >> >>>> >> >> >>>> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype >> >> >>>> + >> >> >>>> .include >> >> >>> >> >> >>> >> >> >> >> >> >> >> >> >> -- >> >> >> Mateusz Guzik >> >> > >> >> > >> >> >> >> >> >> -- >> >> Mateusz Guzik >> >> >> > >> >> >> -- >> Mateusz Guzik >> > --=20 Mateusz Guzik From nobody Sun Feb 12 22:18:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFMLK3v9xz3pFsr; Sun, 12 Feb 2023 22:18: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 4PFMLK2w2tz4W23; Sun, 12 Feb 2023 22:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676240297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=St7TaOb6N0U6OGqcEYPsaG9JhGCCTf+XDqybJ3088rQ=; b=hHDBhu/drIN8InMHMi54Wgo2r6pEnZk5oeUD3NCqzS4L6Nf7jO3j4K7JYbkSkmdvATbUhM KQVmwLqiSUILaxNW9rkcET0oIhQmx0+OdK8n8cUUWoO5DPR/wdDHsznfZw2rix6PS3MTKS 2FRDiiYJPQigjOL7qKrhxaDYMloLHy8bRm6D8qHdmGaVeOFn5Xvkerm3kSkJlbT4wbusb3 JPvTV3kqtCL6ngfwAVMZLMt9q5y82YIHSm8TnvMl3miK7TfZgu+GNC6a8yBrzJKHIV1UoX UBooBsc0SvfNbxvfFmFXO+WSRYALn7hJtpOUd+CfxRvwuyc7WGr8u2ZdUHXWYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676240297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=St7TaOb6N0U6OGqcEYPsaG9JhGCCTf+XDqybJ3088rQ=; b=VgRvuKYDb07qmltw2438GqwPNoVAjl/atR2OEYFAZAbH1xwPozS3TQJjBlbnSpUhFIMaeT bNRviVeGdKIE63tnkc2UNYi4NK14EVak+TvRG1E1U5LmOlPYdF3Rawdr5t0R9UUOD8/OAZ 01x2KkOZni3WpZgvtOQ6d/5fTo92F6D9gL3sxbJtUQcLN5QglOj1AUQfK9U96owXBrOmVC I2yZt9vAv71QNWmplCLl1sU60YEyvvjGNDScX2NBlYa5OM3+QqusRg/556j+RIvqfau/Ga TDHSOozH9dRfADNrfwkNbjoR1B6nvGWMK7OXjQ/e1QgEk3pjJ1lsZEJFlAbk+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676240297; a=rsa-sha256; cv=none; b=rZo1f8j8ywd8we2iPzSeyqhWR253de6lVD21dz2tZRGYjUG7QdoBRBo/96QvIuqyycZBfT I6575VfXZQUFTMZEeo7TCILlSMwRO5JkLEXdC83btm393GjPMdlQEOjWGksHJEUSOeNUzE xerpzEBN4LnBAA97ecwxL7Whf1St+fWtKQFgwN2G5GUL9o6cjEEnTPD/ivrs0bKJSfSC0a Ug5RP745n2lO3kmUvKoQg+GrPrmQqqURlNcW9St1t6OeJF06k7VWO9vU9lg9btb21z+C+N ed8MkyTos+g2XhNwP84fX8jsA7gB73ZHSLXW7TM7Gatx4berPkjl4XCj1Bfu0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFMLK1rS1zvW4; Sun, 12 Feb 2023 22:18: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 31CMIHvn098493; Sun, 12 Feb 2023 22:18:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CMIHfj098492; Sun, 12 Feb 2023 22:18:17 GMT (envelope-from git) Date: Sun, 12 Feb 2023 22:18:17 GMT Message-Id: <202302122218.31CMIHfj098492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ceri Davies Subject: git: 81b9905234e3 - main - man5/rc.conf.5: document utx_enable variable. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ceri X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81b9905234e34a778dd524385279c2a807d83308 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ceri (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=81b9905234e34a778dd524385279c2a807d83308 commit 81b9905234e34a778dd524385279c2a807d83308 Author: Ceri Davies AuthorDate: 2023-02-12 22:17:46 +0000 Commit: Ceri Davies CommitDate: 2023-02-12 22:17:46 +0000 man5/rc.conf.5: document utx_enable variable. --- share/man/man5/rc.conf.5 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index e67273cf0ea2..c979ffe6cae1 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2022 +.Dd February 12, 2023 .Dt RC.CONF 5 .Os .Sh NAME @@ -4495,6 +4495,13 @@ Bus address of the USB Bluetooth controller. Check the output of .Xr usbconfig 8 on your system to find this information. +.It Va utx_enable +.Pq Vt bool +Set to +.Dq Li YES +to enable user accounting through the +.Xr utx 8 +facility. .It Va netwait_enable .Pq Vt bool If set to @@ -4965,6 +4972,7 @@ these are the flags to pass to the .Xr sysrc 8 , .Xr unbound 8 , .Xr usbconfig 8 , +.Xr utx 8 , .Xr wlandebug 8 , .Xr yp 8 , .Xr ypbind 8 , From nobody Sun Feb 12 22:23:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFMSD6HwWz3pGY1; Sun, 12 Feb 2023 22:23:24 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 4PFMSD4V7qz4Xkp; Sun, 12 Feb 2023 22:23:24 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lj1-f180.google.com with SMTP id g14so12692449ljh.10; Sun, 12 Feb 2023 14:23:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=P6v5g17tVYFKGHUlYDOV4dlbvmR0BBv2WcfEEGnpY5M=; b=zpPQGvdpIdLOXarrzwunGiE+bdxiJjvB+WZ1/o+jnip2etv4Z8TD/icakIloRrdtHQ AURMMl5zsAxugcDyTa5FCNyHKb7waR/xtHJNND+NFW72vvWyi7DuVNEDWG6OQ8umlgR9 U+gYrmF2cxns+WpSyX65ty84f+W+Z5Irol4vInceNhZEd+PuJe0wH1tYNX3LYYgd4SH9 GxQ4SfegVVbWCelylNcAZmCNcseBzNvLVfwtVx2Ex/OUGnj4lYMNFNK1bsTmTa5jQeqd 6cZQtqePQEDSmBUT4SRr12+rh+ylYXmbySIduNw6tRCWSY7IhKfaL6xnSutpCDuRbP1H t5tw== X-Gm-Message-State: AO0yUKUtTUtjGBNJd60UeZ4v46/ZzyxGUBPKpT/BmmevfbcNwixETYxl 98Xc8d5r8PJolz9pQtuvy9dCv/IeAm0FmypaPOR9/veg X-Google-Smtp-Source: AK7set9slpyf1nwWQ65H9k636Z5rYZMigoG8iah8jWhruBDY8q/apXDXt/zuDKQy5unGSYyFX+4aWJkxNSNp57ez1vs= X-Received: by 2002:a2e:b537:0:b0:28f:81a2:6eb with SMTP id z23-20020a2eb537000000b0028f81a206ebmr4204626ljm.118.1676240602999; Sun, 12 Feb 2023 14:23:22 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> In-Reply-To: From: Antoine Brodin Date: Sun, 12 Feb 2023 22:23:12 +0000 Message-ID: Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. To: Dmitry Chagin Cc: Dmitry Chagin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4PFMSD4V7qz4Xkp X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.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 Sun, Feb 12, 2023 at 10:02 PM Dmitry Chagin wrote: > On Sun, Feb 12, 2023 at 07:58:07PM +0000, Antoine Brodin wrote: > > On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin wrote: > > > > > > On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: > > > > On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: > > > > > On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin wrote: > > > > > > > > > > > > The branch main has been updated by dchagin: > > > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > > > > > > > > > commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > > > Author: Dmitry Chagin > > > > > > AuthorDate: 2023-01-29 13:17:33 +0000 > > > > > > Commit: Dmitry Chagin > > > > > > CommitDate: 2023-01-29 13:17:33 +0000 > > > > > > > > > > > > cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. > > > > > > > > > > > > Under Linux to sched_[g|s]etaffinity() functions the value returned from a call > > > > > > to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 > > > > > > will set the attribute for the calling thread, and passing the value returned > > > > > > from a call to getpid(2) (process id) will set the attribute for the main thread > > > > > > of the thread group. > > > > > > > > > > > > Native cpuset(2) family of system calls has "which" argument to determine how > > > > > > the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass > > > > > > a thread id and CPU_WHICH_PID - to pass a process id. > > > > > > > > > > > > For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" > > > > > > CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this > > > > > > adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. > > > > > > > > > > > > Reviewed by: kib > > > > > > Differential Revision: https://reviews.freebsd.org/D38209 > > > > > > MFC after: 1 week > > > > > > --- > > > > > > lib/libc/gen/sched_getaffinity.c | 2 +- > > > > > > lib/libc/gen/sched_setaffinity.c | 2 +- > > > > > > lib/libc/sys/cpuset.2 | 4 +++- > > > > > > sys/kern/kern_cpuset.c | 42 +++++++++++++++++++++++++++++++++++++++- > > > > > > sys/sys/cpuset.h | 1 + > > > > > > 5 files changed, 47 insertions(+), 4 deletions(-) > > > > > > > > > > > > > > > Hello, > > > > > > > > > > This broke math/py-numpy on main and stable/13 > > > > > > > > > > https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p52768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log > > > > > https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-baseline/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log > > > > > > > > > > File "/wrkdirs/usr/ports/math/py-numpy/work-py39/numpy-1.23.5/numpy/distutils/misc_util.py", > > > > > line 93, in get_num_build_jobs > > > > > cpu_count = len(os.sched_getaffinity(0)) > > > > > OverflowError: could not allocate a large enough CPU set > > > > > > > > hi, Antoine, > > > > > > > > on stable/13 > > > > dchagin@heemeyer:~ % uname -a > > > > FreeBSD heemeyer.club 13.2-STABLE FreeBSD 13.2-STABLE #268 stable/13-n254471-51485f81b01a-dirty: Sat Feb 11 12:16:21 MSK 2023 dchagin@heemeyer.club:/usr/home/dchagin/tmp/obj/usr/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > > > > dchagin@heemeyer:~ % python3.9 > > > > Python 3.9.16 (main, Dec 18 2022, 01:15:32) > > > > [Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a on freebsd13 > > > > Type "help", "copyright", "credits" or "license" for more information. > > > > >>> import os > > > > >>> len(os.sched_getaffinity(0)) > > > > 1 > > > > >>> os.sched_getaffinity(0) > > > > {0} > > > > >>> exit() > > > > dchagin@heemeyer:~ % > > > > > > > > on current: > > > > dchagin@mordor:~/freebsd % uname -a > > > > FreeBSD mordor.heemeyer.club 14.0-CURRENT FreeBSD 14.0-CURRENT #458 futex-n260850-52456667491d-dirty: Sat Feb 11 14:24:46 MSK 2023 dchagin@mordor.heemeyer.club:/home/dchagin/tmp/obj/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > > > > dchagin@mordor:~/freebsd % python3.9 > > > > Python 3.9.16 (main, Dec 18 2022, 01:24:21) > > > > [Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc1238 on freebsd14 > > > > Type "help", "copyright", "credits" or "license" for more information. > > > > >>> import os > > > > >>> len(os.sched_getaffinity(0)) > > > > 16 > > > > >>> os.sched_getaffinity(0) > > > > {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} > > > > >>> exit() > > > > dchagin@mordor:~/freebsd % > > > > > > > > > > > > could you please show out of os.sched_getaffinity(0) ? > > > > > > and os.cpu_count() > > > also sysctl kern.smp > > > > Here is what I have in the head jail: > > > > >>> len(os.sched_getaffinity(0)) > > Traceback (most recent call last): > > File "", line 1, in > > OverflowError: could not allocate a large enough CPU set > > >>> os.sched_getaffinity(0) > > Traceback (most recent call last): > > File "", line 1, in > > OverflowError: could not allocate a large enough CPU set > > >>> os.cpu_count() > > 64 > > >>> > > root@mainamd64PR269425-default:~ # sysctl kern.smp > > kern.smp.forward_signal_enabled: 1 > > kern.smp.topology: 0 > > kern.smp.cores: 32 > > kern.smp.threads_per_core: 2 > > kern.smp.cpus: 64 > > kern.smp.disabled: 0 > > kern.smp.active: 1 > > kern.smp.maxcpus: 256 > > kern.smp.maxid: 63 > > > thanks, I've implemented python os_sched_getaffinity_impl and could not > get a similar result. Is it posiible that you run old wolrd > (pre 3e11d3f6)? This is with a new world, and a kernel that is a few weeks old. Antoine From nobody Sun Feb 12 22:43:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFMv30tbkz3pJkP; Sun, 12 Feb 2023 22:43:11 +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 4PFMv25wqlz4lGH; Sun, 12 Feb 2023 22:43:10 +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 31CMh936006698; Mon, 13 Feb 2023 01:43:09 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 31CMh8YW006697; Mon, 13 Feb 2023 01:43:08 +0300 (MSK) (envelope-from dchagin) Date: Mon, 13 Feb 2023 01:43:08 +0300 From: Dmitry Chagin To: Antoine Brodin Cc: Dmitry Chagin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. Message-ID: References: <202301291318.30TDIq4Q008231@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4PFMv25wqlz4lGH 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 Sun, Feb 12, 2023 at 10:23:12PM +0000, Antoine Brodin wrote: > On Sun, Feb 12, 2023 at 10:02 PM Dmitry Chagin wrote: > > On Sun, Feb 12, 2023 at 07:58:07PM +0000, Antoine Brodin wrote: > > > On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin wrote: > > > > > > > > On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: > > > > > On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: > > > > > > On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin wrote: > > > > > > > > > > > > > > The branch main has been updated by dchagin: > > > > > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > > > > > > > > > > > commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > > > > Author: Dmitry Chagin > > > > > > > AuthorDate: 2023-01-29 13:17:33 +0000 > > > > > > > Commit: Dmitry Chagin > > > > > > > CommitDate: 2023-01-29 13:17:33 +0000 > > > > > > > > > > > > > > cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. > > > > > > > > > > > > > > Under Linux to sched_[g|s]etaffinity() functions the value returned from a call > > > > > > > to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 > > > > > > > will set the attribute for the calling thread, and passing the value returned > > > > > > > from a call to getpid(2) (process id) will set the attribute for the main thread > > > > > > > of the thread group. > > > > > > > > > > > > > > Native cpuset(2) family of system calls has "which" argument to determine how > > > > > > > the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass > > > > > > > a thread id and CPU_WHICH_PID - to pass a process id. > > > > > > > > > > > > > > For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" > > > > > > > CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this > > > > > > > adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. > > > > > > > > > > > > > > Reviewed by: kib > > > > > > > Differential Revision: https://reviews.freebsd.org/D38209 > > > > > > > MFC after: 1 week > > > > > > > --- > > > > > > > lib/libc/gen/sched_getaffinity.c | 2 +- > > > > > > > lib/libc/gen/sched_setaffinity.c | 2 +- > > > > > > > lib/libc/sys/cpuset.2 | 4 +++- > > > > > > > sys/kern/kern_cpuset.c | 42 +++++++++++++++++++++++++++++++++++++++- > > > > > > > sys/sys/cpuset.h | 1 + > > > > > > > 5 files changed, 47 insertions(+), 4 deletions(-) > > > > > > > > > > > > > > > > > > Hello, > > > > > > > > > > > > This broke math/py-numpy on main and stable/13 > > > > > > > > > > > > https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p52768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log > > > > > > https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-baseline/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log > > > > > > > > > > > > File "/wrkdirs/usr/ports/math/py-numpy/work-py39/numpy-1.23.5/numpy/distutils/misc_util.py", > > > > > > line 93, in get_num_build_jobs > > > > > > cpu_count = len(os.sched_getaffinity(0)) > > > > > > OverflowError: could not allocate a large enough CPU set > > > > > > > > > > hi, Antoine, > > > > > > > > > > on stable/13 > > > > > dchagin@heemeyer:~ % uname -a > > > > > FreeBSD heemeyer.club 13.2-STABLE FreeBSD 13.2-STABLE #268 stable/13-n254471-51485f81b01a-dirty: Sat Feb 11 12:16:21 MSK 2023 dchagin@heemeyer.club:/usr/home/dchagin/tmp/obj/usr/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > > > > > dchagin@heemeyer:~ % python3.9 > > > > > Python 3.9.16 (main, Dec 18 2022, 01:15:32) > > > > > [Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a on freebsd13 > > > > > Type "help", "copyright", "credits" or "license" for more information. > > > > > >>> import os > > > > > >>> len(os.sched_getaffinity(0)) > > > > > 1 > > > > > >>> os.sched_getaffinity(0) > > > > > {0} > > > > > >>> exit() > > > > > dchagin@heemeyer:~ % > > > > > > > > > > on current: > > > > > dchagin@mordor:~/freebsd % uname -a > > > > > FreeBSD mordor.heemeyer.club 14.0-CURRENT FreeBSD 14.0-CURRENT #458 futex-n260850-52456667491d-dirty: Sat Feb 11 14:24:46 MSK 2023 dchagin@mordor.heemeyer.club:/home/dchagin/tmp/obj/home/dchagin/freebsd/amd64.amd64/sys/YOY amd64 > > > > > dchagin@mordor:~/freebsd % python3.9 > > > > > Python 3.9.16 (main, Dec 18 2022, 01:24:21) > > > > > [Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc1238 on freebsd14 > > > > > Type "help", "copyright", "credits" or "license" for more information. > > > > > >>> import os > > > > > >>> len(os.sched_getaffinity(0)) > > > > > 16 > > > > > >>> os.sched_getaffinity(0) > > > > > {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} > > > > > >>> exit() > > > > > dchagin@mordor:~/freebsd % > > > > > > > > > > > > > > > could you please show out of os.sched_getaffinity(0) ? > > > > > > > > and os.cpu_count() > > > > also sysctl kern.smp > > > > > > Here is what I have in the head jail: > > > > > > >>> len(os.sched_getaffinity(0)) > > > Traceback (most recent call last): > > > File "", line 1, in > > > OverflowError: could not allocate a large enough CPU set > > > >>> os.sched_getaffinity(0) > > > Traceback (most recent call last): > > > File "", line 1, in > > > OverflowError: could not allocate a large enough CPU set > > > >>> os.cpu_count() > > > 64 > > > >>> > > > root@mainamd64PR269425-default:~ # sysctl kern.smp > > > kern.smp.forward_signal_enabled: 1 > > > kern.smp.topology: 0 > > > kern.smp.cores: 32 > > > kern.smp.threads_per_core: 2 > > > kern.smp.cpus: 64 > > > kern.smp.disabled: 0 > > > kern.smp.active: 1 > > > kern.smp.maxcpus: 256 > > > kern.smp.maxid: 63 > > > > > > thanks, I've implemented python os_sched_getaffinity_impl and could not > > get a similar result. Is it posiible that you run old wolrd > > (pre 3e11d3f6)? > > This is with a new world, and a kernel that is a few weeks old. > > Antoine ok, so I need some help from you, I've put test program to https://people.freebsd.org/~dchagin/bsd_sched_getaffinity.tar please build and run like ktrace -di ./getaffinity, then kdump -HAR -m 64 > affinity.log and send log to me please. I can't reproduce problem in any my environment, I'll have hw with 88 cores only at the end of week. Thank you From nobody Mon Feb 13 01:52:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFS5x3CvFz3py3p for ; Mon, 13 Feb 2023 01:52:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (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 4PFS5x0wywz3l7c for ; Mon, 13 Feb 2023 01:52:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x633.google.com with SMTP id hx15so28319053ejc.11 for ; Sun, 12 Feb 2023 17:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FT5aMJrFrMFhpHcN9mGpTOScP5Gp3OclSmKb+zlJUGY=; b=bTBWG3TkwO8psREX7KDgT9mt+mrKxH83kV7kGVikjrDxY60gPn7p+E2QD7crMu+6d+ FYpF+jDqywq4S6ldmDjlikHnJ5vr8gqPajyDTK9P9/2SZg1GJoFhQT3JV8n7nQaA+bJ0 2j/VXryDjKyhiIDZq+N33NY62Jpxk0SDldJCmX9ObZPjYJTRontAVZ6yokeTyIbsxKRz oM6kuHCVDMr6slA0QoaPvFY8N0kUMbeC3KrbR2HTgMFjRqlUA3EjGldfMA3s8lxBVgpq +LJbeQX6o6Xd5aVQvNe6QD2adG+Fwna/tMP1dBxzAeyCyWxysquG/qUHbPFDe/C71uxw OcHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=FT5aMJrFrMFhpHcN9mGpTOScP5Gp3OclSmKb+zlJUGY=; b=Agy3kYm9YzLu9wYE+Hjos1LwZ8HX9iWWnJZG+wjR6aNJa0Xqt68/kB8VeinUQYm71W VSohoyBOYjQA9F1a99iX1gmJCSuyrt9DHXsBO9+lMF6wBW1ph0AyxN3c5n+jeOMTqWkR 1uXtYxCnx5r+cJOVaSPa5WF5IeuLz7mujhJb3bwWrFVnjHC2zZT1LY1wNrq0LhH7vujm 7XHwLPBbScGIEG6LwzQjDa4m2EBCqRS+gd7ayCEwWN3w25+rIwt006bdgBTXSnER1ID1 ambRlOOoHOLGB/sFAE69B1aSYIHT/de8Wy3kRVARE7EV7sTMfUHGlfspONhuhuAMoAs+ G9OA== X-Gm-Message-State: AO0yUKWKrE74JDEu9Ypl40et5V4or+iPB4qLr/7KeSyhMlYxVCwjRuuU uPeUNa2eTrm8ihauq9d9ueGQQPnuZWADTZrb7aUrHw== X-Google-Smtp-Source: AK7set8H2qKfrG4wFnRRBUIO7QJCxHit17sbKGcEDgOEpbi1TJrPs9trEAlk9PwK6txhuQudCVyb3P7CbbUqytl7xso= X-Received: by 2002:a17:906:8403:b0:8b0:7c88:e869 with SMTP id n3-20020a170906840300b008b07c88e869mr2150482ejx.2.1676253171093; Sun, 12 Feb 2023 17:52:51 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 12 Feb 2023 18:52:47 -0700 Message-ID: Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns To: Mateusz Guzik Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000d124d105f48b1a39" X-Rspamd-Queue-Id: 4PFS5x0wywz3l7c 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 --000000000000d124d105f48b1a39 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Feb 12, 2023 at 3:12 PM Mateusz Guzik wrote: > On 2/12/23, Warner Losh wrote: > > On Sun, Feb 12, 2023 at 2:54 PM Mateusz Guzik wrote= : > > > >> On 2/12/23, Warner Losh wrote: > >> > On Sun, Feb 12, 2023 at 2:40 PM Mateusz Guzik > >> > wrote: > >> > > >> >> On 2/12/23, Jessica Clarke wrote: > >> >> > On 12 Feb 2023, at 21:23, Mateusz Guzik wrote= : > >> >> >> > >> >> >> On 2/12/23, Jessica Clarke wrote: > >> >> >>> On 12 Feb 2023, at 21:13, Mateusz Guzik wrote= : > >> >> >>>> > >> >> >>>> The branch main has been updated by mjg: > >> >> >>>> > >> >> >>>> URL: > >> >> >>>> > >> >> > >> > https://cgit.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e73= cdf181a0b > >> >> >>>> > >> >> >>>> commit eca005d8531fd153f46f941f3101e73cdf181a0b > >> >> >>>> Author: Mateusz Guzik > >> >> >>>> AuthorDate: 2023-02-12 21:12:34 +0000 > >> >> >>>> Commit: Mateusz Guzik > >> >> >>>> CommitDate: 2023-02-12 21:12:34 +0000 > >> >> >>>> > >> >> >>>> zlib: silence K&R warns > >> >> >>>> > >> >> >>>> Sponsored by: Rubicon Communications, LLC ("Netgate") > >> >> >>>> --- > >> >> >>>> sys/conf/files | 18 +++++++++++------- > >> >> >>>> sys/modules/zlib/Makefile | 2 ++ > >> >> >>>> 2 files changed, 13 insertions(+), 7 deletions(-) > >> >> >>>> > >> >> >>>> diff --git a/sys/conf/files b/sys/conf/files > >> >> >>>> index 9171b434a7bf..53f90f7afc22 100644 > >> >> >>>> --- a/sys/conf/files > >> >> >>>> +++ b/sys/conf/files > >> >> >>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.c standard > >> >> >>>> libkern/strvalid.c standard > >> >> >>>> libkern/timingsafe_bcmp.c standard > >> >> >>>> contrib/zlib/adler32.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >> >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >> >> >>> > >> >> >>> This doesn=E2=80=99t exist pre-Clang 15. > >> >> >>> > >> >> >> > >> >> >> this is main-only and it already has llvm15. the build requireme= nt > >> >> >> is > >> >> >> top of the branch, so I don't see a problem. > >> >> >> > >> >> >> if you ran into trouble cross-compiling, you should probably > update > >> >> >> that env instead of expecting working around the warn in the tre= e > >> >> >> for > >> >> >> older compilers > >> >> > > >> >> > That is not our policy. Please fix this. > >> >> > > >> >> > >> >> Are you sure about that? I distinctly recall the supported path to > get > >> >> top of the latest stable branch first, from there you should be abl= e > >> >> to build the toolchain and the kernel. > >> >> > >> >> afaics the above change did not affect it > >> >> > >> >> If you insist, I can look for the exact paragraph in the docs. > >> >> > >> > > >> > The fix is trivial. > >> > > >> > https://reviews.freebsd.org/D38550 > >> > > >> > Please focus your efforts on commenting on the above and testing it > >> > out. > >> > > >> > >> there is no warn with it > >> > >> but where is it stated that a compiler older than the newest in the > >> tree is supported for kernel builds? > >> > > > > As a project we've always benefitted from flexibility when it's trivial > to > > be flexible. > > > > Look, I just want the build to be warn-free again and I don't care how > zlib is handled for that purpose. > > I do note though that if "compiler flexibility" if you will is to be > expected, it should be stated somewhere. Again, I only recall the > opposite -- top of main needed to build the kernel. > % cd src % find . -name Makefile\* -o -name \*.mk | xargs grep clang | wc 760 2843 57563 % find . -name Makefile\* -o -name \*.mk | xargs grep gcc | wc 337 1760 25053 % find . -name Makefile\* -o -name \*.mk | xargs grep COMPILER_VERSION | wc 79 478 6061 over 1000 clang or gcc specific bits speaks for itself. Warner > > Warner > > > > > >> > > >> > > >> >> > Jess > >> >> > > >> >> >>> Jess > >> >> >>> > >> >> >>>> contrib/zlib/compress.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" > >> >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual > >> >> >>>> -Wno-deprecated-non-prototype" > >> >> >>>> contrib/zlib/crc32.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > >> >> >>>> contrib/zlib/deflate.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" > >> >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual > >> >> >>>> -Wno-deprecated-non-prototype" > >> >> >>>> contrib/zlib/inffast.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >> >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >> >> >>>> contrib/zlib/inflate.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >> >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >> >> >>>> contrib/zlib/inftrees.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> - mxge | ddb_ctf | gzio | zfs | zlib > >> >> >>>> + mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> + compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" > >> >> >>>> contrib/zlib/trees.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > >> >> >>>> contrib/zlib/uncompr.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> - compile-with "${NORMAL_C} -Wno-cast-qual" > >> >> >>>> + compile-with "${NORMAL_C} -Wno-cast-qual > >> >> >>>> -Wno-deprecated-non-prototype" > >> >> >>>> contrib/zlib/zutil.c optional crypto | geom_uzip= | > >> >> >>>> \ > >> >> >>>> mxge | ddb_ctf | gzio | zfs | zlib \ > >> >> >>>> compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" > >> >> >>>> diff --git a/sys/modules/zlib/Makefile > >> >> >>>> b/sys/modules/zlib/Makefile > >> >> >>>> index 6391255e512b..178d3a3f7ab7 100644 > >> >> >>>> --- a/sys/modules/zlib/Makefile > >> >> >>>> +++ b/sys/modules/zlib/Makefile > >> >> >>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D${NO_WSTRICT_PROTOTYPE= S} # > >> >> >>>> crc32.c:586 > >> >> >>>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTOTYPES} # trees.c:232 > >> >> >>>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 > >> >> >>>> > >> >> >>>> +CWARNFLAGS+=3D-Wno-deprecated-non-prototype > >> >> >>>> + > >> >> >>>> .include > >> >> >>> > >> >> >>> > >> >> >> > >> >> >> > >> >> >> -- > >> >> >> Mateusz Guzik > >> >> > > >> >> > > >> >> > >> >> > >> >> -- > >> >> Mateusz Guzik > >> >> > >> > > >> > >> > >> -- > >> Mateusz Guzik > >> > > > > > -- > Mateusz Guzik > --000000000000d124d105f48b1a39 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Feb 12, 2023 at 3:12 PM Mateu= sz Guzik <mjguzik@gmail.com>= wrote:
On 2/12/= 23, Warner Losh <imp= @bsdimp.com> wrote:
> On Sun, Feb 12, 2023 at 2:54 PM Mateusz Guzik <mjguzik@gmail.com> wrote:
>
>> On 2/12/23, Warner Losh <imp@bsdimp.com> wrote:
>> > On Sun, Feb 12, 2023 at 2:40 PM Mateusz Guzik <mjguzik@gmail.com>
>> > wrote:
>> >
>> >> On 2/12/23, Jessica Clarke <jrtc27@freebsd.org> wrote:
>> >> > On 12 Feb 2023, at 21:23, Mateusz Guzik <mjguzik@gmail.com> w= rote:
>> >> >>
>> >> >> On 2/12/23, Jessica Clarke <jrtc27@freebsd.org> wrote: >> >> >>> On 12 Feb 2023, at 21:13, Mateusz Guzik <= mjg@FreeBSD.org> wrote:
>> >> >>>>
>> >> >>>> The branch main has been updated by mjg:=
>> >> >>>>
>> >> >>>> URL:
>> >> >>>>
>> >>
>> https://c= git.FreeBSD.org/src/commit/?id=3Deca005d8531fd153f46f941f3101e73cdf181a0b
>> >> >>>>
>> >> >>>> commit eca005d8531fd153f46f941f3101e73cd= f181a0b
>> >> >>>> Author:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik= <mjg@FreeBSD.org>
>> >> >>>> AuthorDate: 2023-02-12 21:12:34 +0000 >> >> >>>> Commit:=C2=A0 =C2=A0 =C2=A0Mateusz Guzik= <mjg@FreeBSD.org>
>> >> >>>> CommitDate: 2023-02-12 21:12:34 +0000 >> >> >>>>
>> >> >>>>=C2=A0 =C2=A0zlib: silence K&R warns<= br> >> >> >>>>
>> >> >>>>=C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Ru= bicon Communications, LLC ("Netgate")
>> >> >>>> ---
>> >> >>>> sys/conf/files=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 | 18 +++++++++++-------
>> >> >>>> sys/modules/zlib/Makefile |=C2=A0 2 ++ >> >> >>>> 2 files changed, 13 insertions(+), 7 del= etions(-)
>> >> >>>>
>> >> >>>> diff --git a/sys/conf/files b/sys/conf/f= iles
>> >> >>>> index 9171b434a7bf..53f90f7afc22 100644<= br> >> >> >>>> --- a/sys/conf/files
>> >> >>>> +++ b/sys/conf/files
>> >> >>>> @@ -4099,28 +4099,32 @@ libkern/strtouq.= c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 standard
>> >> >>>> libkern/strvalid.c=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0standard
>> >> >>>> libkern/timingsafe_bcmp.c=C2=A0 standard=
>> >> >>>> contrib/zlib/adler32.c=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zl= ib
>> >> >>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zl= ib \
>> >> >>>> +=C2=A0 compile-with "${NORMAL_C} -= Wno-deprecated-non-prototype"
>> >> >>>
>> >> >>> This doesn=E2=80=99t exist pre-Clang 15.
>> >> >>>
>> >> >>
>> >> >> this is main-only and it already has llvm15. the= build requirement
>> >> >> is
>> >> >> top of the branch, so I don't see a problem.=
>> >> >>
>> >> >> if you ran into trouble cross-compiling, you sho= uld probably update
>> >> >> that env instead of expecting working around the= warn in the tree
>> >> >> for
>> >> >> older compilers
>> >> >
>> >> > That is not our policy. Please fix this.
>> >> >
>> >>
>> >> Are you sure about that? I distinctly recall the supporte= d path to get
>> >> top of the latest stable branch first, from there you sho= uld be able
>> >> to build the toolchain and the kernel.
>> >>
>> >> afaics the above change did not affect it
>> >>
>> >> If you insist, I can look for the exact paragraph in the = docs.
>> >>
>> >
>> > The fix is trivial.
>> >
>> >
https://reviews.freebsd.org/D38550
>> >
>> > Please focus your efforts on commenting on the above and test= ing it
>> > out.
>> >
>>
>> there is no warn with it
>>
>> but where is it stated that a compiler older than the newest in th= e
>> tree is supported for kernel builds?
>>
>
> As a project we've always benefitted from flexibility when it'= s trivial to
> be flexible.
>

Look, I just want the build to be warn-free again and I don't care how<= br> zlib is handled for that purpose.

I do note though that if "compiler flexibility" if you will is to= be
expected, it should be stated somewhere. Again, I only recall the
opposite -- top of main needed to build the kernel.
% cd src
% find . -name Makefile\* -o -name \*.mk | = xargs grep clang | wc
=C2=A0 =C2=A0 =C2=A0760 =C2=A0 =C2=A02843 =C2=A0 5= 7563
% find . -name Makefile\* -o -name \*.mk | xargs grep gcc | wc
= =C2=A0 =C2=A0 =C2=A0337 =C2=A0 =C2=A01760 =C2=A0 25053
% find . -name Ma= kefile\* -o -name \*.mk | xargs grep COMPILER_VERSION | wc
=C2=A0 =C2=A0= =C2=A0 79 =C2=A0 =C2=A0 478 =C2=A0 =C2=A06061
=C2=A0
over 1000 clang or gcc specific bits speaks for itself.
<= br>
Warner
> Warner
>
>
>> >
>> >
>> >> > Jess
>> >> >
>> >> >>> Jess
>> >> >>>
>> >> >>>> contrib/zlib/compress.c=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs= | zlib \
>> >> >>>> -=C2=A0 compile-with "${NORMAL_C} -= Wno-cast-qual"
>> >> >>>> +=C2=A0 compile-with "${NORMAL_C} -= Wno-cast-qual
>> >> >>>> -Wno-deprecated-non-prototype"
>> >> >>>> contrib/zlib/crc32.c=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs= | zlib \
>> >> >>>>=C2=A0 =C2=A0 compile-with "${NORMAL= _C} ${NO_WSTRICT_PROTOTYPES}"
>> >> >>>> contrib/zlib/deflate.c=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs= | zlib \
>> >> >>>> -=C2=A0 compile-with "${NORMAL_C} -= Wno-cast-qual"
>> >> >>>> +=C2=A0 compile-with "${NORMAL_C} -= Wno-cast-qual
>> >> >>>> -Wno-deprecated-non-prototype"
>> >> >>>> contrib/zlib/inffast.c=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zl= ib
>> >> >>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zl= ib \
>> >> >>>> +=C2=A0 compile-with "${NORMAL_C} -= Wno-deprecated-non-prototype"
>> >> >>>> contrib/zlib/inflate.c=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zl= ib
>> >> >>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zl= ib \
>> >> >>>> +=C2=A0 compile-with "${NORMAL_C} -= Wno-deprecated-non-prototype"
>> >> >>>> contrib/zlib/inftrees.c=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>> -=C2=A0 mxge | ddb_ctf | gzio | zfs | zl= ib
>> >> >>>> +=C2=A0 mxge | ddb_ctf | gzio | zfs | zl= ib \
>> >> >>>> +=C2=A0 compile-with "${NORMAL_C} -= Wno-deprecated-non-prototype"
>> >> >>>> contrib/zlib/trees.c=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs= | zlib \
>> >> >>>>=C2=A0 =C2=A0 compile-with "${NORMAL= _C} ${NO_WSTRICT_PROTOTYPES}"
>> >> >>>> contrib/zlib/uncompr.c=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs= | zlib \
>> >> >>>> -=C2=A0 compile-with "${NORMAL_C} -= Wno-cast-qual"
>> >> >>>> +=C2=A0 compile-with "${NORMAL_C} -= Wno-cast-qual
>> >> >>>> -Wno-deprecated-non-prototype"
>> >> >>>> contrib/zlib/zutil.c=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0optional crypto | geom_uzip |
>> >> >>>> \
>> >> >>>>=C2=A0 =C2=A0 mxge | ddb_ctf | gzio | zfs= | zlib \
>> >> >>>>=C2=A0 =C2=A0 compile-with "${NORMAL= _C} ${NO_WSTRICT_PROTOTYPES}"
>> >> >>>> diff --git a/sys/modules/zlib/Makefile >> >> >>>> b/sys/modules/zlib/Makefile
>> >> >>>> index 6391255e512b..178d3a3f7ab7 100644<= br> >> >> >>>> --- a/sys/modules/zlib/Makefile
>> >> >>>> +++ b/sys/modules/zlib/Makefile
>> >> >>>> @@ -25,4 +25,6 @@ CWARNFLAGS.crc32.c+=3D= ${NO_WSTRICT_PROTOTYPES} #
>> >> >>>> crc32.c:586
>> >> >>>> CWARNFLAGS.trees.c+=3D${NO_WSTRICT_PROTO= TYPES} # trees.c:232
>> >> >>>> CWARNFLAGS.zutil.c+=3D${NO_WSTRICT_PROTO= TYPES} # zutil.c:27,32
>> >> >>>>
>> >> >>>> +CWARNFLAGS+=3D-Wno-deprecated-non-proto= type
>> >> >>>> +
>> >> >>>> .include <bsd.kmod.mk>
>> >> >>>
>> >> >>>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Mateusz Guzik <mjguzik gmail.com>
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Mateusz Guzik <mjguzik gmail.com>
>> >>
>> >
>>
>>
>> --
>> Mateusz Guzik <mjguzik gmail.com>
>>
>


--
Mateusz Guzik <mjguzik gmail.com>
--000000000000d124d105f48b1a39-- From nobody Mon Feb 13 04:57:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFXBY0PNlz3qY6j; Mon, 13 Feb 2023 04:57: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 4PFXBX6ls8z45j5; Mon, 13 Feb 2023 04:57:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676264229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2xjpDPC6fqHVl52q1mnaXuAG608gjfZ53vU3BaGJDwI=; b=yvnSB70dg1BYhBVSxP/j7aR6fqticZcHXyDvLzsG9CwtO3hT25hoVFzMk2/ikh23MhPjMd pm9xEV6IIJz33As6FBjwp2tAjEA4AxJMLHXHvMc7e4wzANR2aJPxWfRcyrvP4CTGy1uzvr OA6Bhh7a0H2CpF0g0FWbUXU4X+A/Rqt5SbaNSsIq6g9y28b0nWhlpx5859PEyc5KhQ3XTK +POU4012UiD4rpA7ptMHjgUlIkBeCgVIsqz5zl8Boc/AKjL9QdKq/8EMQJkQgweD0hi81T DW9zss9ab5SSro62/JrMgqZSyLW8aeT9m72lC2MXIyXvSz6UVAdGJC1BAgbvlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676264228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2xjpDPC6fqHVl52q1mnaXuAG608gjfZ53vU3BaGJDwI=; b=tyIm8t1+oHO8LPpn9uEyXr82QFOFGAQvi+CmPKP9JVK0VntXrDoxAJJFD2KTk9+7dGBoTm w6BV1aaeXZo+GCCf7blm84U+9p/vu7DpYenLqLMxSXXBaMgZIWwopyEE1xV+jSOqDiDmpY G0SUSoR8s2rTS3qsyH5CDdFO6FOpYOUhW5mlRwX8CPuCnLu7Wht2RSoOki26ie2Rzc2nQn riaBaF8nHg1XIGBkS/YtkFu9auPLyRsvXs8N1M6WhTjeO5yIHSq022uID3bfsjAXlDZDMg rIei4QtGM1L+J94/YaBjXZM/RUyF+b4nn9qyiwtWIZehlgajtKkPTnXvoNe/iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676264228; a=rsa-sha256; cv=none; b=ccAXN5dSlEjlfmlVSSDih0JWdCzUq3UUpPLHYKENut7pT9DUl5jKtyPow8czxKk0pdZTQi gmRa3dFvN8iudJ2wkARQ2p28pgNsNbgi0/a8QNoqsZb0AfoqKEKewOaTG9Ae6z7B3Xv05A 35R/C/DxdJEofqumY0eyjJdQhwOZ+/vqqLLdoyhj/1P3fcC3gd3K8fJ5yncEyZm/TQiGlx PzNUrFeB2BMeLN82mnLGJ1P0W93daj75FqMLTVUWd8p8KEBGjYRAnzQKwz8kqyIyrKHHwM bKQsDiyF9WMuKJ2cLxyXZ+4pEIE0PcchhTL2LJ2x4gS5b40aocTp+6Ky1yYXCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFXBX5pVMz1525; Mon, 13 Feb 2023 04:57: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 31D4v8Mr067793; Mon, 13 Feb 2023 04:57:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D4v8Hh067792; Mon, 13 Feb 2023 04:57:08 GMT (envelope-from git) Date: Mon, 13 Feb 2023 04:57:08 GMT Message-Id: <202302130457.31D4v8Hh067792@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: 39e8c2a29a86 - main - cleanvar: Be more careful when cleaning up /var. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=39e8c2a29a860bdb69ffcfbc06de4d4ad103b458 commit 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458 Author: Xin LI AuthorDate: 2023-02-13 04:56:17 +0000 Commit: Xin LI CommitDate: 2023-02-13 04:56:17 +0000 cleanvar: Be more careful when cleaning up /var. The cleanvar script uses find -delete to remove stale files under /var, which could lead to unwanted removal of files in some unusual scenarios. For example, when a mounted fdescfs(5) is present under /var/run/samba/fd, find(1) could descend into a directory that is out of /var/run and remove files that should not be removed. To mitigate this, modify the script to use find -x, which restricts the find scope to one file system only instead of descending into mounted file systems. PR: 269213 MFC after: 1 week --- libexec/rc/rc.d/cleanvar | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc.d/cleanvar b/libexec/rc/rc.d/cleanvar index fcfd365268c3..a682021ce5f6 100755 --- a/libexec/rc/rc.d/cleanvar +++ b/libexec/rc/rc.d/cleanvar @@ -31,15 +31,15 @@ cleanvar_start() { if [ -d /var/run -a ! -f /var/run/clean_var ]; then # Skip over logging sockets - find /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete + find -x /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then - find /var/spool/lock -type f -delete + find -x /var/spool/lock -type f -delete >/var/spool/lock/clean_var fi if [ -d /var/spool/uucp/.Temp ]; then - find /var/spool/uucp/.Temp -delete + find -x /var/spool/uucp/.Temp -delete fi } From nobody Mon Feb 13 05:39:33 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFY7T5GyDz3r7Sy; Mon, 13 Feb 2023 05:39: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 4PFY7T4rcsz49h8; Mon, 13 Feb 2023 05:39:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676266773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OVyRz/C3J8HqIwsENHBNLpVyn0dux5kW3AK/z2G3K8w=; b=s6GpSRqGBXvkc3dLQb6vZ3N02INLKODsvgcStZo0AnXRvnT7bw0O4rlgGz4JRRqBEE8n99 szrVcJ5JR8Lf+qp3x1sm1y/5U+LlYadLVXB7zHK1BfeCgYNWEUWy3g/7SIm4AQ3UhdC9YN IxJZTMkm+/fdvt/zHxnlc342ZD5hmYpYXjz0j7VwDM72i+PC4jksIy+UCsu7TCrtdPzvLP 1Z4+LwESIP1Yo8HC7uA2bdgZpokYoPyYccX7XR4S46iJ5Ad398QeaGPwwzEraSKo5L+Nbf ohLcwzvT9AzqNWKMueJhR0kQK5d4IPRuspHg/ncZJQ8Rn4gEkRE8rrR5bfkL/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676266773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OVyRz/C3J8HqIwsENHBNLpVyn0dux5kW3AK/z2G3K8w=; b=JpyGaCP0zZmEovox6JEXh9Gb5v5Hn0YirzQhTcloTd2Cdscl4Zp6nUyTNfBsRrFRNg+w3Y QCfq3cl8HXg3JdfDUXh9wgTAGASuLaD+Q4NQcfxs5af71toeNxoxE2pjepxM88DdUPvqqU 4hnIN7p/JLu3A/lMH/ZMEU9kg7z7ceWVGTwszFxxdSnUx9sqsoj+umfofRWLwfJzszqzKY OR3xaGPa1bMNXkzwvOhQFl9OF7FXVBTJ/AAfTSZDlRwS53UKfmu2sPHUFCYwwrVSVgbnoD eDxpfsJywybpzNxBzJVrAq70FdHoT/qkQuGUpc92BVh8nuHw3Ng/l6/hq2/wnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676266773; a=rsa-sha256; cv=none; b=eTkqNEhYX5jM2zxR/C2M3oFNQLNKmHz19XB2tNqBccsyISXo7XfqYuOQAPfbjRNkhandsD AlocSOvWz7pu6ROZ99/clUw2VmUEfhRCe/KanfYEOemtSViVqd1dk0i9CYpxweuXHjcABr GUVuM6kkIrmuI6AvJJM29p23igV/k2gEwTMyFead5yVeEdDYfO2oeg6D1j7UxePZzNX1/u 9jcgWhm20Pw6OpkGtVXxQ1vv7huju/OMVOUbAAtwmhIJFad1/YQlXevONYmDlA1ypu9PNe MzBzkZSDpZzeBdqXQQhQrWvLcEmIyLY/XvNNiQLXB0B6FFzOMjm9+kFUZqf3sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFY7T3wBqz1667; Mon, 13 Feb 2023 05:39: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 31D5dXoZ025195; Mon, 13 Feb 2023 05:39:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D5dXGn025194; Mon, 13 Feb 2023 05:39:33 GMT (envelope-from git) Date: Mon, 13 Feb 2023 05:39:33 GMT Message-Id: <202302130539.31D5dXGn025194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 71948c15ba9e - main - rpc: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71948c15ba9e6db536e7a26c65f2f22ee03f1630 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=71948c15ba9e6db536e7a26c65f2f22ee03f1630 commit 71948c15ba9e6db536e7a26c65f2f22ee03f1630 Author: Mateusz Guzik AuthorDate: 2023-02-13 05:39:10 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 05:39:10 +0000 rpc: ansify Reported by: clang 15 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/rpc/rpc_generic.c | 9 +++------ sys/rpc/svc_auth_unix.c | 6 ++---- sys/rpc/svc_dg.c | 5 +---- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/sys/rpc/rpc_generic.c b/sys/rpc/rpc_generic.c index 0e1797272a03..43caffea6dd2 100644 --- a/sys/rpc/rpc_generic.c +++ b/sys/rpc/rpc_generic.c @@ -146,8 +146,7 @@ __rpc_get_t_size(int af, int proto, int size) * Find the appropriate address buffer size */ u_int -__rpc_get_a_size(af) - int af; +__rpc_get_a_size(int af) { switch (af) { case AF_INET: @@ -567,8 +566,7 @@ __rpc_getconfip(const char *nettype) * unset, i.e. iterate over all visible entries in netconfig. */ void * -__rpc_setconf(nettype) - const char *nettype; +__rpc_setconf(const char *nettype) { struct handle *handle; @@ -688,8 +686,7 @@ __rpc_getconf(void *vhandle) } void -__rpc_endconf(vhandle) - void * vhandle; +__rpc_endconf(void *vhandle) { struct handle *handle; diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index de46bf438f0e..441f70e4a8af 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -135,10 +135,8 @@ done: * Looks up longhand in a cache. */ /*ARGSUSED*/ -enum auth_stat -_svcauth_short(rqst, msg) - struct svc_req *rqst; - struct rpc_msg *msg; +enum auth_stat +_svcauth_short(struct svc_req *rqst, struct rpc_msg *msg) { return (AUTH_REJECTEDCRED); } diff --git a/sys/rpc/svc_dg.c b/sys/rpc/svc_dg.c index bf3cbd2a6137..dcab970b63fa 100644 --- a/sys/rpc/svc_dg.c +++ b/sys/rpc/svc_dg.c @@ -292,10 +292,7 @@ svc_dg_destroy(SVCXPRT *xprt) static bool_t /*ARGSUSED*/ -svc_dg_control(xprt, rq, in) - SVCXPRT *xprt; - const u_int rq; - void *in; +svc_dg_control(SVCXPRT *xprt, const u_int rq, void *in) { return (FALSE); From nobody Mon Feb 13 05:55:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFYVY2plMz3r8v2 for ; Mon, 13 Feb 2023 05:56:05 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic308-8.consmr.mail.gq1.yahoo.com (sonic308-8.consmr.mail.gq1.yahoo.com [98.137.68.32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFYVX0rpMz4CY3 for ; Mon, 13 Feb 2023 05:56:03 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=tpUigHgn; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.68.32 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676267761; bh=sP2B1tRHgELH489610hed3WnqYRJrZYoOrXfFQvXb/4=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=tpUigHgnGkMOh8r6nlVtzDmvFJ+/4ts+Y/X+PFP/V22R6EeAevNZ5Yw0CfYWtXpFaPK7XG2q7GHD3LGR1jLddS9L2df8cMfotjztS8eRz/okR4rTJlr7+PYCaQIu6PHIML9ROPt8/2PRfG61bJYC1OQJZI8JWxMtiRLNd9OqPXgXMQl2Qyrzhf7bNp1QhJo5cjFcXAPj3Pa19n5hDJ32/GS8Uu96Mrj4uGvU8mdNF44cG9sazso4N1ToycKGgvoL7UchgogJy/LnCFakV1ZcjfZqep+zzYqESapuLaqB1ix3gHEdABUCUwwTBLJ2Ubjf4iO6FTtztCFW8UrOg8Hfyw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676267761; bh=5M8AVd16+yvpkTUvAkN6bk5AWM30/zwAJXkuudIUNkz=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=iCQcL7Ldd9Avpan4/4m9Iohv+7x2y/naU/eLC9+xkseFKS44N2940KU41KhTj3SVD0AZOx7LjWgIMeeGD7I5N4We5ann19xzPbvPJa2c2iQpIsMUJxfuFespJQ6sNrh3pB6ruYX1Ihjdg5UIccZijut8MjMl7c3leloLEQ10SFjRr01NEGA7c5CJZ4FEm/Vh5L2oM/xAEVkJgNRU8dsrH8k+r0mtrs2U/zAmmruHvvQ/+4WDLRkOtIepaIaiT/saIe+P0dEGyuDMRWGYwXwv1Tw1KqvB9fSKAYmBNzCkAAtgRCHZuqTxMf/s3hLXOISa8E1F1kOLyFQDUFeM+ZhBJg== X-YMail-OSG: TjlVPsIVM1mHyPUhDwGr2ElojBsdF9WCESPHyVqzyVOnD19jUzihOHT5GnDwoLL 3uOvR.K2Y6D5LGvScjW10NAU_kEnKb2KOkun1hwasYHVUPFm8z574ly7UeM27qaLzYcobqtcbTqt 6NpfyhUT7b6LLZEcTyJxYii1TxWod8Twis9HNRS64PpgpPTNaUT2quVw6.TK2XfjVG6y2tF5JUCc FHtcEFGQYaVpXS0qZB5NgTY2BuHveSt2BVtpObATW_Mt79u4TfIE1xuKrjjaUZnVFTMMbC1LyxFj uEaZMRWxmfy_YPrGhH1Ty039gX45.BLZhpQLYCRO_umcuZsxF9yrRCR9_IMLyh7AroQ5HEH5yXEn nhaZEJknbIAqmxloFm_hV9PdxBwQPbeMc65d9fEfOjlQvYL0I3O.xUPb82Xs7KFs47eENyniApN0 MUsfBD1hE6ie1mpvKrNXg6Gjdk8gxeY.pd0kL4CAHH0BrCsJHD6djrDgRI.3I7I8hL376Hsy8Sho gqxDct.5VLS2STes9NXS4bfjEnkNZ9UMi5pEJ4ytTS71AkhzJL1TUgplZ2PxWjcP6XeCowlkm9jQ gyI5zOz.YzPRYkNJUpjT40n68Hnttz1uJZ0d5MOniahb1Fy5iKb2VYlFkjZsLyABx88_AzGzwTFd 5uVnngriSqpTUPAchvYG5PmoWEvJm2coddTaXDHR4y5GEYBnKHUt6.0AJ7Ay90UmobZLd7PHxnMF 95UxcPOMftPrYKAhPLDiNMnJ._GixKG1QvWsDnuwjsgZu_tYMZ_q4x78gyM9xw6zKabvmogA8ym4 L2IBnafrBZPrQPE5f5eDpIQzZ6FxVO_tfQlsOygJCcMbiSfzUfhaI3vM5nqEO3XVAIeXXORvTwJ2 TXq57bCdqYKIr_OcnvwVgvzgciwUvUQwdZSmGlnQiBbgI4vLoUfVnnb6t4SGFFgwcl0lvRivVg74 aWYMWjqKI1o7JrUAwDKM7OoG8SqDN6d1NatGOzA7oNpv.zcWTi6l2RdLjksjWx6A3iksyaPGBdVX qTmtutQL4xkjqt_5WDc9FyfTdR_Ujp4NYil7.xTddbdHmHrquKAXMs30IHb5SLXfibfU9xrqCEPD x7dQu2w4Z1qdRTtJ0MNGLEN.4rUKhau4okosSrvsnaEj_FPRjfTpMJgQ5wpmPttH9FagPDASlhMt c3YhYdK5NAfDOBbJDTgBPvLMeklHOnmdgcT9jBIi5PKLqnM984ak8gwW86HGzLZRBfrd2z8mZ04k JiS1tFvgdLn_m.3ePtr7xnw41dAn.Je3cltMnDjise1_XdY_snArRf5GHaJ4qUYc1yjirmtpnbDZ SWmcOgLm51JkAdKTenfM0OqLU_jCMuGvHTc5RO3XZRW3kZCthplnxkA.fOT9ixWP3v_Eswg5.yKi fWzQOGpf_ALzhSWpNJENS0YCNc_t3ZXF8nD12l9QWFrP3gb72KpcRmgi40Oa4UVKRa3tvMqS4SRE x3RRrGx_53d2INAtQHOncWcoQ2VqGfW0GhcgGsherlaxyxgbmPyeXYH.zmApRLCb93yDhxK3wByX 2kblKLmVhSMPOmH7rxZBgwb8F5Ihlqmlxp659WPH_qwdbcQZpzTTeGGxSjCJPnQ8h6HXGKnakHJC DW99glTcZPUK6EQrvyfVBrqY1jfGnp29lfY77Ng_5xeEUa5uXv5a26E71SPL8bhUYoS3aPyDiQFb W0Pfgg2l3eLvhB1q1gVpUAgxPXQ7ivyvH4xxfd5.RIchXdDCumO4BR8wYkxAJ7VRId_kD2GlqdX3 U1yjLB3yM0vA8g40v_Hkgi1y5dg5RPrFlGKjNM6MoC6E.53RqKonAl9ruv10fX1Lf884jd_d.uAl d2DgB3ntrdoQAOa7nq2qRvaUdFFwm9aw4AUhj4nut87WxTqiQcvcOwvq6v7UjPgHpPOLEZFapVwf xFZWvs5sHstY4GYL6HyUKvwIWTzhJflRyePI4.L4ltAEXuO.mRYlIvhLNbXBmmZFRFVy78azEmFt UUOD_w62OR0giumrZzPR.hIlfRT31tqB5px3OTF2LW53UB_Kg.xuhivfLrtLsOM3h_sDyZs._.Pt lF.yfZcl2opr4F_Qda4VoyYsdJRFaSo2d.mmj2NTSfGi0N4NDZIgQ6ZCZAvexdPa_hKtC8goqbnU C28LSzD0ni.9vdh96A4OLjpI6Xb4noJBVycvD2B4BjPs8oZwL79JwU9J7.OTKqkXYSPlpn3dxzkR 1Anvc2s6.QA8h3EJBW59nxY2qNob.ZHij5j5o8fdaqG34T4rCem15Fo1b6ffX2I5aLdh_RMc8S8J AGgVPeeRc X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Mon, 13 Feb 2023 05:56:01 +0000 Received: by hermes--production-gq1-655ddccc9-dcm7h (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 873e5adfd12cc5602c72a1a5fb225592; Mon, 13 Feb 2023 05:55:57 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. Message-Id: Date: Sun, 12 Feb 2023 21:55:46 -0800 To: dchagin@heemeyer.club, antoine@reebsd.org, dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.300.101.1.3) References: X-Spamd-Result: default: False [-3.44 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.94)[-0.943]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.32:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.32:from] X-Rspamd-Queue-Id: 4PFYVX0rpMz4CY3 X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N > > On Sun, Feb 12, 2023 at 07:58:07PM +0000, Antoine Brodin wrote: > > > On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin = wrote: > > > > > > > > On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: > > > > > On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin = wrote: > > > > > > On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin = wrote: > > > > > > > > > > > > > > The branch main has been updated by dchagin: > > > > > > > > > > > > > > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc21b080f3dc2f5e91ada608d4385b7ed= 6538ba9b > > > > > > > > > > > > > > commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > > > > > > > Author: Dmitry Chagin > > > > > > > AuthorDate: 2023-01-29 13:17:33 +0000 > > > > > > > Commit: Dmitry Chagin > > > > > > > CommitDate: 2023-01-29 13:17:33 +0000 > > > > > > > > > > > > > > cpuset: Fix sched_[g|s]etaffinity() for better = compatibility with Linux. > > > > > > > > > > > > > > Under Linux to sched_[g|s]etaffinity() functions the value = returned from a call > > > > > > > to gettid(2) (thread id) can be passed in the argument = pid. Specifying pid as 0 > > > > > > > will set the attribute for the calling thread, and passing = the value returned > > > > > > > from a call to getpid(2) (process id) will set the = attribute for the main thread > > > > > > > of the thread group. > > > > > > > > > > > > > > Native cpuset(2) family of system calls has "which" = argument to determine how > > > > > > > the value of id argument is interpreted, i.e., = CPU_WHICH_TID is used to pass > > > > > > > a thread id and CPU_WHICH_PID - to pass a process id. > > > > > > > > > > > > > > For now native sched_[g|s]etaffinity() implementation is = wrong as uses "which" > > > > > > > CPU_WHICH_PID to pass both (process and thread id) to the = kernel. To fix this > > > > > > > adding a new "which" CPU_WHICH_TIDPID intended to handle = both id's. > > > > > > > > > > > > > > Reviewed by: kib > > > > > > > Differential Revision: https://reviews.freebsd.org/D38209 > > > > > > > MFC after: 1 week > > > > > > > --- > > > > > > > lib/libc/gen/sched_getaffinity.c | 2 +- > > > > > > > lib/libc/gen/sched_setaffinity.c | 2 +- > > > > > > > lib/libc/sys/cpuset.2 | 4 +++- > > > > > > > sys/kern/kern_cpuset.c | 42 = +++++++++++++++++++++++++++++++++++++++- > > > > > > > sys/sys/cpuset.h | 1 + > > > > > > > 5 files changed, 47 insertions(+), 4 deletions(-) > > > > > > > > > > > > > > > > > > Hello, > > > > > > > > > > > > This broke math/py-numpy on main and stable/13 > > > > > > > > > > > > = https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p5= 2768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log Well, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running a 1400079 [2023-02-08..2023-02-10] jail that is using new KBI material not in the older kernel (CPU_WHICH_TIDPID) have problems? : =3D>> Building math/py-numpy build started at Fri Feb 10 11:40:51 UTC 2023 port directory: /usr/ports/math/py-numpy package name: py39-numpy-1.24.1,1 building for: FreeBSD main-amd64-default-baseline-job-04 14.0-CURRENT = FreeBSD 14.0-CURRENT 1400079 amd64 maintained by: python@FreeBSD.org Makefile ident:=20 Poudriere version: 3.2.8-23-ga7f8d188 Host OSVERSION: 1400073 Jail OSVERSION: 1400079 Job Id: 04 !!! Jail is newer than host. (Jail: 1400079, Host: 1400073) !!! !!! This is not supported. !!! !!! Host kernel must be same or newer than jail. !!! !!! Expect build failures. !!! > > > > > > = https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-basel= ine/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log Similarly, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running a 13.2-PRERELEASE 1301511 [2023-01-10..2023-02-10] jail that is using new KBI material not in the older kernel (CPU_WHICH_TIDPID) have problems? : =3D>> Building math/py-numpy build started at Fri Feb 10 10:36:27 UTC 2023 port directory: /usr/ports/math/py-numpy package name: py39-numpy-1.23.5_1,1 building for: FreeBSD 13stable-amd64-quarterly-baseline-job-01 = 13.2-PRERELEASE FreeBSD 13.2-PRERELEASE 1301511 amd64 maintained by: python@FreeBSD.org Makefile ident:=20 Poudriere version: 3.2.8-23-ga7f8d188 Host OSVERSION: 1400073 Jail OSVERSION: 1301511 (Looks to me like CPU_WHICH_TIDPID use for 13.* has to require 13.2+ .) =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Mon Feb 13 06:05:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFYjD5MJBz3rB5F for ; Mon, 13 Feb 2023 06:05:20 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-23.consmr.mail.gq1.yahoo.com (sonic304-23.consmr.mail.gq1.yahoo.com [98.137.68.204]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFYjC6gGCz4DZC for ; Mon, 13 Feb 2023 06:05:19 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=Bf1ZTbP9; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.68.204 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676268318; bh=kP7Dih614f56vph7dp0tvpTirLNNfzwFEXMvQv/igZI=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=Bf1ZTbP9ezucrxjTt7ISNxdHwjt+vyoz1xZjSHDH9S8TFfGA021j8gaSH21FCPP9Fap3l2RQGv2WeU0UV9KO5ktZr+hyiKj1CGBfP9UAYW5alg7y8Arxd3ps132D4EMOsDOQK99NYIo8BZ0h2nETopHUJEsPkNbnzf5R0+09xo5LrHbKSuERwh1QYbsGxgNOZC2IbVqFkq2Zg5Ed3lAHluu+GpIH6EucxYrN+qCSY+FdhGXDsnNoJuTvg6NnsCnJIHCQXT7gzHD9pz6sPSCAFKLl02uwwWMzcb7KPEfTttCe8vSKgZ48RTrsHrn60lPaOJBN3mmxl9oCQ4ATySjVyg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676268318; bh=0YvYqOdP4x3/bMyhHAPQu54kd2DmQorOPSsS4FFAJUN=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=rG570kv9/9D3+sDqumz5VSSdt4oO1kK4jTwV/AgBgqIklFh/KADAumII+7eIpoGkr54+UpeJtfW7CulVTYvQF1kxk2RopFafIcbSOmD2f33YQRt9NN6kINQAjntqaov0hTaSUmBNVw5nqqEmTfYVEXc8S9k1q69U2Xjv7goRdVmfH8+tF7+Bsmat+JvbQ31G6/w20nAntPUs0b4FBz5dMYqhixYlGoY9Lw7tpC7Sd9SHHt12pm4TtX5JkrgU4ngDkCSb5CpFzZ0tAOwH+aTfysLNwfaexLd74vAYfYjXLyov5pDCZORLhHaDGSZkmOAjOL7ACQ78kXXkLXyJXiqJlw== X-YMail-OSG: UoNcNhoVM1le1.A4dCtpz6g8DEvBcjWTvPdXEEZEF9HB_ydoxyHZXbh_a_fZVIw mK01CnZVByEYKK_M9yRrZk6x4ogJ9.lY76szSx_ScWeWKKDAIc8Bm5pSrWsScafKjpKlcvcNmxuY hMmLPSOOzT_7qnnzQ.rqzfWMO4OdvqBsJYWPetwmhaGTg_2Zg3mD7mSG_Dr.B1MyU_90VA_i6z41 wx_trfI3Y5nIUW_fyd7WfjWjWGxnJYk.4o29sMpWqgvCT8fc14NJxn61NYY_3rIkna374Ah0qorj XXZpkOa9OBWosWTg3xb31cYtqAf53jZIM8DVVZ7aB5yniOdKzfrZL7.EYtlRY_MJ75eonxo4.1td ty.f19qoBC9FL8sJOGpwTW0Sm9K1vYdMd8kuxJ70_u5afSmi3uKCwkH2OYVW8174XoYkiGg5enqo zw.pmbhkNBRDqd_h0Tr.JaCqVkSz2UabzqhX63nzR.ayYKNRns.8RKmyfQilR5yJhNZ1Jfycc2yj PS5oiFHj8ld4JtGWOIVm.QUtNb4qx898YoXh79dQpYhWIIWwzuInaloQAqWfW4_hhmTDWayrlk4A GnVn.g.8DVdAXSeQpo08gV.5iBwK4a.KD1_pxFGXUdiyNuGJlOM4rKvGF9qEEimFpLbYurNUiMvk 2FnxilvmgfDU8BYLd6QOkAu.wmURwIou9g3O2.W.Ie36oxYhQ3eajI2By0BKpPX70mPx8Vl_DZyR GOpNTwzCINwZf8N4RW3gvNupPGRrtvMzo_5WDE4JAR_7zwhGgGFwM9bH6PqHWHc7ZqMzfSLMNC3l OXgFz_R0k8EUTl.nciJewl4qsIFkjNBcqsrlTszUUIZ5aREimYAaaYMFli8Plre6vdfPXQ1Z1J9k uHbPVuvZakQyvfGQ2E9yvznX7NqYFovj4Q41ff8RMUztIY.UcT._fBnJdBKASSnH2OVnSJ5eA.m5 mGE5ABC9yuvIYyuxkT_OI_XNU3YvvinJJpfYUWDhY1Ze7D2BfAu_sg4AwBXz6ghPe80MW45BqTki SPe8NFSDLzlDDK.PE6wprpWZf6I7kObjI2oVD0uSF_lGyWwBSuHuD2siMSSV5OC4t8RAsJ3LjErU mhRPN6ZT2U0eLV_lGOOYwwn0.GNz_RAIU7n37LgBub5YIA0T4.ZglA2TAuTKfzlKvJondnDc4tGK JttOJXd4oAP9uRZ6zXJnLv_ekddqsiFFYxm5fC9NisKN8r5wkNgYvd4RQ5uA12vrHdWPqF4K3TCZ aqGmU1Fdsfxu7yzZIuOOr1uj7fm4O4vXGyseqU02d8MUx4iJCT9ZHoivjZm7ingM.lpv7fNU4ZC0 h7uFkAtOsQ2wMPUysNT6S7c4pJqWA2v33KLokBNEvgT.9ogL4kXLCJNcWwFSiD1md4neMkTQHER6 SL9yRSmskc1QARBiArl09RPifUx0N3R6z1xC8FGV2sxfFjWQuHNDLUglNNnKp8JSZAUKvp60mgoV F.LSUfVWb0EB_CQLBr.I4R3Q1hhJFst_uG1ruX5pYZvQG8CCftsI_KT67UZu3jo3545cDBwY4jUL kvvLELC77Nma20ui1wHSdWrEzhENgooJElVc38Flpd0.CRyQt5n2h2kfRKbd0YqI2LpPgkIls1Gq 1VOajKCo3X4YqkSf2AgYEh2a9dPwPV2uVHTJXlQlTblTRPY0xtEuWHGLx2L6O.v7Hg8T0NCAlzna MP1WWh74hEna0iv8.TNWZUanyduitPFzi3oWiMQDjyoFfJYfY2U3fiWUYOBMMMH7CcrceEfTJBEm ceOMDI9wHhl9hmz_BKDDPgGPUrXYl8_VYVlCF580SrFlraq9HhfKEiW28VFDL66PPDCQWzUWvsaG Ad9bCA7jz6IzepBwSFIB01V5Nchxi.55bdR1b1vcwvCPv0TJwVotZ336gAeY8JHrJ5zBRG0wqdHd jdaov3GHf9F_F3pQgCcufTW5mpfuZPFhZk4xOLOgw2UlrtJGlD4zEDsu6iJuT9G_5lCSreC7yp8r gIBZdBTYOsPIF_4uNc.xRZxlywn8llzHqv9QE7aTjm93Yy5geEmSxACbM1t8AZPqJsAScd.l5zIi e52yJ6ez.DvAyV_t73O8qv.OPqtAHp.YcYh3BhcEcdd4Ra.UX6YWZ7B8f.DZwcYZOfx819WRkZA3 JGYY7ksgE_ijRqZVX0jhGAywVY.VCQ6SrogmwJPI5FBO2NN3afw.Zs85csdNVKauTUQM7WFQYOSf Y_r_Mc_nDDuMW3yNh0T51xizf_IXV.MKxrPM1IH7dj5JPfSybtbbhhduuO8x3VUuH88ipzfHnw2F W0jLC9A-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Mon, 13 Feb 2023 06:05:18 +0000 Received: by hermes--production-ne1-746bc6c6c4-9t6ft (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 84d7be43011ff0efb1448d9012cb8f96; Mon, 13 Feb 2023 06:05:14 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. (Just a fixed TO: address.) Date: Sun, 12 Feb 2023 22:05:02 -0800 References: To: dchagin@heemeyer.club, antoine@freebsd.org, dev-commits-src-main@freebsd.org In-Reply-To: Message-Id: <18263DB1-D79D-420A-9F24-EE8C8E071C15@yahoo.com> X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spamd-Result: default: False [-3.45 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.95)[-0.945]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.204:from]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org] X-Rspamd-Queue-Id: 4PFYjC6gGCz4DZC X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N [Just a fixed TO: address.] >> On Sun, Feb 12, 2023 at 07:58:07PM +0000, Antoine Brodin wrote: >>> On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin = wrote: >>>>=20 >>>> On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: >>>>> On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: >>>>>> On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin = wrote: >>>>>>>=20 >>>>>>> The branch main has been updated by dchagin: >>>>>>>=20 >>>>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc21b080f3dc2f5e91ada608d4385b7ed= 6538ba9b >>>>>>>=20 >>>>>>> commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b >>>>>>> Author: Dmitry Chagin >>>>>>> AuthorDate: 2023-01-29 13:17:33 +0000 >>>>>>> Commit: Dmitry Chagin >>>>>>> CommitDate: 2023-01-29 13:17:33 +0000 >>>>>>>=20 >>>>>>> cpuset: Fix sched_[g|s]etaffinity() for better compatibility = with Linux. >>>>>>>=20 >>>>>>> Under Linux to sched_[g|s]etaffinity() functions the value = returned from a call >>>>>>> to gettid(2) (thread id) can be passed in the argument pid. = Specifying pid as 0 >>>>>>> will set the attribute for the calling thread, and passing the = value returned >>>>>>> from a call to getpid(2) (process id) will set the attribute for = the main thread >>>>>>> of the thread group. >>>>>>>=20 >>>>>>> Native cpuset(2) family of system calls has "which" argument to = determine how >>>>>>> the value of id argument is interpreted, i.e., CPU_WHICH_TID is = used to pass >>>>>>> a thread id and CPU_WHICH_PID - to pass a process id. >>>>>>>=20 >>>>>>> For now native sched_[g|s]etaffinity() implementation is wrong = as uses "which" >>>>>>> CPU_WHICH_PID to pass both (process and thread id) to the = kernel. To fix this >>>>>>> adding a new "which" CPU_WHICH_TIDPID intended to handle both = id's. >>>>>>>=20 >>>>>>> Reviewed by: kib >>>>>>> Differential Revision: https://reviews.freebsd.org/D38209 >>>>>>> MFC after: 1 week >>>>>>> --- >>>>>>> lib/libc/gen/sched_getaffinity.c | 2 +- >>>>>>> lib/libc/gen/sched_setaffinity.c | 2 +- >>>>>>> lib/libc/sys/cpuset.2 | 4 +++- >>>>>>> sys/kern/kern_cpuset.c | 42 = +++++++++++++++++++++++++++++++++++++++- >>>>>>> sys/sys/cpuset.h | 1 + >>>>>>> 5 files changed, 47 insertions(+), 4 deletions(-) >>>>>>=20 >>>>>>=20 >>>>>> Hello, >>>>>>=20 >>>>>> This broke math/py-numpy on main and stable/13 >>>>>>=20 >>>>>> = https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p5= 2768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log Well, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running a 1400079 [2023-02-08..2023-02-10] jail that is using new KBI material not in the older kernel (CPU_WHICH_TIDPID) have problems? : =3D>> Building math/py-numpy build started at Fri Feb 10 11:40:51 UTC 2023 port directory: /usr/ports/math/py-numpy package name: py39-numpy-1.24.1,1 building for: FreeBSD main-amd64-default-baseline-job-04 14.0-CURRENT = FreeBSD 14.0-CURRENT 1400079 amd64 maintained by: python@FreeBSD.org Makefile ident:=20 Poudriere version: 3.2.8-23-ga7f8d188 Host OSVERSION: 1400073 Jail OSVERSION: 1400079 Job Id: 04 !!! Jail is newer than host. (Jail: 1400079, Host: 1400073) !!! !!! This is not supported. !!! !!! Host kernel must be same or newer than jail. !!! !!! Expect build failures. !!! >>>>>> = https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-basel= ine/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log Similarly, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running a 13.2-PRERELEASE 1301511 [2023-01-10..2023-02-10] jail that is using new KBI material not in the older kernel (CPU_WHICH_TIDPID) have problems? : =3D>> Building math/py-numpy build started at Fri Feb 10 10:36:27 UTC 2023 port directory: /usr/ports/math/py-numpy package name: py39-numpy-1.23.5_1,1 building for: FreeBSD 13stable-amd64-quarterly-baseline-job-01 = 13.2-PRERELEASE FreeBSD 13.2-PRERELEASE 1301511 amd64 maintained by: python@FreeBSD.org Makefile ident:=20 Poudriere version: 3.2.8-23-ga7f8d188 Host OSVERSION: 1400073 Jail OSVERSION: 1301511 (Looks to me like CPU_WHICH_TIDPID use for 13.* has to require 13.2+ .) =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Mon Feb 13 06:10:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFYqC1mrfz3rBNY; Mon, 13 Feb 2023 06:10: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 4PFYqC1DpTz4DlD; Mon, 13 Feb 2023 06:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676268631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7OS9i8x5OH1kOMAEWBot5fO7WRdxkUmpm3ekL/0VOnc=; b=UpAR827+d39J1Icp/6HNdgvR31CEe8jykmGox73N6Zj9YqPaPjpv+0MFX6feqgvBT8QyDR xvO3ONATOgy6GD6MTc+F+0AvPiDBEwJUpKKTFTCTQ3wAnYlWROOGUbvkpPEZRiHrWgs1i2 UsvYbFJCxSHg0nmwe2xp0IjPRzRejH6Ygj1LSqARnU2WWrAMt92n+cgN4FdnFf3FeTYXcu RK3sCHqmJECDsf2UY2bXahCL2quhh+ccz2r+U5/wo5LyZRu0ILyvrPPpA848mTFdcGzV/2 VF/9zfq+Kdij7Y8cgSh36fRzNPzW3Hz/SQY+K4+o3337BBVN7Aapv/r7m7iZkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676268631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7OS9i8x5OH1kOMAEWBot5fO7WRdxkUmpm3ekL/0VOnc=; b=yDT3JDfaGOor9KnNvwKuCPE/WYMzae9JIP5cYOE1WNKra3/RVidZ/lLQIHxBEMtB+EV1Tu EgLqyd11BhDeW47MJoZptB8SY3aEYVwI7xDm+8JOj2DEDkUH+7CMPevnfFCjmG4H/kc4n0 pn3K4gXGeNNlItC5wQFhagN05V9ILIiXRIvTDZPNsiWneAs+UWtFzGfW8sH/KGOa5mX/Gq f+2fttuetLr1x637+TruPypHAphOw6SRF3n806EfyKT4WfyDO8DsMivX9g5CtmEZSrT4Un +hN5jzdHGfc2kSazedm9uWN9cUkuHq9BtLgEDBIH+JM5lqSoOBh+avACfS4psg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676268631; a=rsa-sha256; cv=none; b=TP07ngM0YtU1ZWHmtr4bn6q05UWVxFXxkfF8kl3ajWAhKS8GUj73R1WWhL5mOdM3YmyINH x6OUOya3nvigXjvHq7doDLGFn0zvFQb6XxomtWhJkvb/h+ywghQfubmUyGJKNULqQpxah9 uqKZQPZ0xlyZkfwydN5gTkP2pWcyDgLJsSh1p/JCY+wBgStsfp2jaKE+gVKARgVFprndtJ p9a2D5g27oMEpq4bV3HG7QUmx0nO5/DkojYh8ih6ceKcp0iMIJrVDVP0DpwBgHXRJupFoG QgzmE6KDY9x58li4CzhnnZhMmcc8HKPtHGFE5dIONyp1mg42oYN0ZjXQQz4ulg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFYqC0HJhz16Pl; Mon, 13 Feb 2023 06:10: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 31D6AU2A076642; Mon, 13 Feb 2023 06:10:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D6AUHe076641; Mon, 13 Feb 2023 06:10:30 GMT (envelope-from git) Date: Mon, 13 Feb 2023 06:10:30 GMT Message-Id: <202302130610.31D6AUHe076641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 96f4ab26633a - main - wg: add a test for the home jail socket feature List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96f4ab26633a457c52fdb9c45f48dcb052b408a4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=96f4ab26633a457c52fdb9c45f48dcb052b408a4 commit 96f4ab26633a457c52fdb9c45f48dcb052b408a4 Author: Kyle Evans AuthorDate: 2023-02-13 05:59:20 +0000 Commit: Kyle Evans CommitDate: 2023-02-13 05:59:35 +0000 wg: add a test for the home jail socket feature This adds a test for a semantic that we added to mirror a feature of the Linux implementation w/ netns: if a wg interface is moved into a jail, we still create the socket in the context of the home vnet. With this added, one can actually create vnet jails that only have a wg tunnel to the outside world providing network connectivity without any epairs in the setup. Reviewed by: jhb, markj (both earlier version) Differential Revision: https://reviews.freebsd.org/D37755 --- tests/sys/net/if_wg.sh | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/tests/sys/net/if_wg.sh b/tests/sys/net/if_wg.sh index 1612e05ef168..80461127fde7 100644 --- a/tests/sys/net/if_wg.sh +++ b/tests/sys/net/if_wg.sh @@ -189,9 +189,81 @@ wg_key_peerdev_makeshared_cleanup() vnet_cleanup } +# The kernel is expected to create the wg socket in the jail context that the +# wg interface was created in, even if the interface is moved to a different +# vnet. +atf_test_case "wg_vnet_parent_routing" "cleanup" +wg_vnet_parent_routing_head() +{ + atf_set descr 'Create a wg(4) tunnel without epairs and pass traffic between jails' + atf_set require.user root +} + +wg_vnet_parent_routing_body() +{ + local pri1 pri2 pub1 pub2 wg1 wg2 + local tunnel1 tunnel2 + + kldload -n if_wg + + pri1=$(wg genkey) + pri2=$(wg genkey) + + tunnel1=169.254.0.1 + tunnel2=169.254.0.2 + + vnet_init + + wg1=$(ifconfig wg create) + wg2=$(ifconfig wg create) + + vnet_mkjail wgtest1 ${wg1} + vnet_mkjail wgtest2 ${wg2} + + echo "$pri1" | jexec wgtest1 wg set $wg1 listen-port 12345 \ + private-key /dev/stdin + pub1=$(jexec wgtest1 wg show $wg1 public-key) + echo "$pri2" | jexec wgtest2 wg set $wg2 listen-port 12346 \ + private-key /dev/stdin + pub2=$(jexec wgtest2 wg show $wg2 public-key) + + atf_check -s exit:0 -o ignore \ + jexec wgtest1 wg set $wg1 peer "$pub2" \ + endpoint 127.0.0.1:12346 allowed-ips ${tunnel2}/32 + atf_check -s exit:0 \ + jexec wgtest1 ifconfig $wg1 inet ${tunnel1}/24 up + + atf_check -s exit:0 -o ignore \ + jexec wgtest2 wg set $wg2 peer "$pub1" \ + endpoint 127.0.0.1:12345 allowed-ips ${tunnel1}/32 + atf_check -s exit:0 \ + jexec wgtest2 ifconfig $wg2 inet ${tunnel2}/24 up + + # Sanity check ICMP counters; should clearly be nothing on these new + # jails. We'll check them as we go to ensure that the ICMP packets + # generated really are being handled by the jails' vnets. + atf_check -o not-match:"histogram" jexec wgtest1 netstat -s -p icmp + atf_check -o not-match:"histogram" jexec wgtest2 netstat -s -p icmp + + # Generous timeout since the handshake takes some time. + atf_check -s exit:0 -o ignore jexec wgtest1 ping -c 1 -t 5 $tunnel2 + atf_check -o match:"echo reply: 1" jexec wgtest1 netstat -s -p icmp + atf_check -o match:"echo: 1" jexec wgtest2 netstat -s -p icmp + + atf_check -s exit:0 -o ignore jexec wgtest2 ping -c 1 $tunnel1 + atf_check -o match:"echo reply: 1" jexec wgtest2 netstat -s -p icmp + atf_check -o match:"echo: 1" jexec wgtest1 netstat -s -p icmp +} + +wg_vnet_parent_routing_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "wg_basic" atf_add_test_case "wg_key_peerdev_shared" atf_add_test_case "wg_key_peerdev_makeshared" + atf_add_test_case "wg_vnet_parent_routing" } From nobody Mon Feb 13 06:10:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFYqD261gz3rBQl; Mon, 13 Feb 2023 06:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFYqD1f3bz4Dns; Mon, 13 Feb 2023 06:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676268632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nKT3lE1kdhsGIB6AAB0HHLaPxivLszCHosQh39tx7UI=; b=KOGQ4a2UpZRlN4p97WuH9U2usPlkDlo2m5dgYUKqvJGJ2D9OtgZAa+rWALW6LioLeLtoPo m7ofOSSYj3VBj4J0axfVfwPKUVcjTnQK08ahg0+a4qk5FF1zkv9ihIopamCacwT9ZvoJTs brjO3E8eR4l/CC3YSbr4grFpBFPIiXmwaDEn+G+oeEqxUyix9YLdBO/lz1yEfGF5KEgkhA V0amZfxbktOl+pvePR8o6doxDDPBpKOgY/bTAKcknPp/g905z0Q4BOm0BDtFeZvPFo9/Rx wYkYp05Jv5cNaI8LDvpZmQGaRxNSxrzA62eh8pny2plWjvVRBhuJg2IPScT9yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676268632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nKT3lE1kdhsGIB6AAB0HHLaPxivLszCHosQh39tx7UI=; b=ffv8FGCOD/U8R4LRohcXGt+YVOhGm17XHifjNh7NH0aS4r0syZ0EjJEr0X+4VT5sU5jate V0iAOn6bRrf1dSGdj+NbAhWaodpY5yqRspK8lQSGcK6iyaXd/H2Zff+kZkwJIlSjvX0aH7 X/XRnRmVBW+OamYxouKSbN4BXoNofn1g7k6z/mLAwdiPTVTENwk2vQIyp6ECznU0kDagzW Bz7NQR3hr1vxxxVZ+u5gHPBdSs3s+CTJM+F9V3NOb/5+cmJ91AtEt8kmHHXcmJly1SPcNW 3gnA2XW3cLj8t/HzllLABn4h/8Byx/xfd4iPjoRc/+MKVzagd+4BTaZ26Z+4jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676268632; a=rsa-sha256; cv=none; b=LNOmaayHNwuVmF7veX6Cg9k61hx9ga95oJ6f+AhwXY2PMumloCZgVQEeYT4b5UZkVDGLNd oDYw/pLrtnR1xfUHSgactsfCfFQKNDkrqQBdu35oMswgw4t6G8oI6yncM16V0BDqzi8bOc D/Yd2lyZ+XrFQZ7NJL93QHwAvA72EteQcB3/e//u7B80DyVhTqNmcqBha1E0hGWqM3ONyz QRemcTvac0/GqaPOj5nWYQUS+j/VfPeoGF3Fs/9Z4xfbtZ5Bb6cndfLZtqQtUoz5fVGEPQ Yy9FduSo0PBAThw5Q8HnxzpjaGc3quHw/GPLo1j1un7CML8UQ2+9wKXE+ixvOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFYqD0lWrz17BQ; Mon, 13 Feb 2023 06:10: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 31D6AW0U077418; Mon, 13 Feb 2023 06:10:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D6AWxO077411; Mon, 13 Feb 2023 06:10:32 GMT (envelope-from git) Date: Mon, 13 Feb 2023 06:10:32 GMT Message-Id: <202302130610.31D6AWxO077411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: e63dcbe7a2cb - main - wg: tests: remove an obsolete workaround List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e63dcbe7a2cb8f6b6932cef48e70f3372f4df737 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e63dcbe7a2cb8f6b6932cef48e70f3372f4df737 commit e63dcbe7a2cb8f6b6932cef48e70f3372f4df737 Author: Kyle Evans AuthorDate: 2023-02-13 05:59:21 +0000 Commit: Kyle Evans CommitDate: 2023-02-13 05:59:46 +0000 wg: tests: remove an obsolete workaround PR 254212 was resolved to avoid issues with not having IPv6 addresses present in the jail, so we can safely drop this workaround now... Reviewed by: jhb, markj Differential Revision: https://reviews.freebsd.org/D37755 --- tests/sys/net/if_wg.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/sys/net/if_wg.sh b/tests/sys/net/if_wg.sh index 80461127fde7..446626b1d1d9 100644 --- a/tests/sys/net/if_wg.sh +++ b/tests/sys/net/if_wg.sh @@ -59,10 +59,6 @@ wg_basic_body() vnet_mkjail wgtest1 ${epair}a vnet_mkjail wgtest2 ${epair}b - # Workaround for PR 254212. - jexec wgtest1 ifconfig lo0 up - jexec wgtest2 ifconfig lo0 up - jexec wgtest1 ifconfig ${epair}a ${endpoint1}/24 up jexec wgtest2 ifconfig ${epair}b ${endpoint2}/24 up From nobody Mon Feb 13 06:15:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFYxF4RRrz3rBmm; Mon, 13 Feb 2023 06:15: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 4PFYxF3vmqz4FkM; Mon, 13 Feb 2023 06:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676268945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JWl/2Q5mj331yPe9grSN3jYaC2yLjpKlNLrCa+sZEHk=; b=rYNwbXCjtq4QteEin00OsGdN4DhNWX7GSH/sxHskzJHtps3i/UOldlsI46iExR1rKYW/VU VbxWewP4ino0YKb3LVnIo+TsSsq6VrmsebBxgaKEY5zsMojg5pkqjkBprF4tVJ7wVRLVuj fpvV+9ni6UqSDAhUiPj58QKsg33G5vdeaVim9f9pQgWPMmpFlS8UPZi7mlYfHBntwAjnw4 OVnyBq19C3vWQvcTFuvHDrwkoHkhdyl6Pd1clzdp8p8az0ktW2yqKmeXRC6u+jXbomG6nL urQtrr6SEjV40ynfZTfBrYSziI85j1SCagmgMQUGZJmGPZKDA1tEmbpaGoSiOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676268945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JWl/2Q5mj331yPe9grSN3jYaC2yLjpKlNLrCa+sZEHk=; b=QX8fx3tSpP8GKpymRheddruzuiiSFuNKd7EJVg/V+x0FMrkHFR+3vU6ju4dtkxbqhFpdyJ a2uy/x1sdbK9sovFIDqXYIlLOHjKACKm+rlwS/2mebdrgVcjluK/wd2UHMTjebOl2+DOcA jDe/wo0EFmejm0SoLfYlfOGagt6tUN2iP1V4IN4Bdlv4MQErvpmVWZLoEMGgY4kwABxILf tsL+gQznV/ORXcRPrV/LdMI6ZQm9jxkfA+nGtQxLAU7Uci7isHzvqoEFegSgni3pIwObnY qmAWYjhOrWESIOGJ4Scd5z9QosqasuM257nwyT8cMJQSgymlqtOomDDqUxq4nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676268945; a=rsa-sha256; cv=none; b=lHTtMk60m1tZkLuFPI5QeWhNcZpweKEy4h/a5LjspkwKvTlKcKEoy4C5CaoEQ0HO52hqoI Z3qkKThoxdr0WzjktXP4RNlP9XNV18ybBVhLLIvjsWlC6P8wbZCDSs/sjBFdHastBWnuem dokhdzKZ80aOQtgfnmQK80dWMIXkbiEPZ1dHxeBKW4gln6yJ/KNh3aUzdSh2JnFAXejbG3 Do4jduXvEPgpIajG5x0pqe4R+sxbGCZeSOem0UZJrIjpwXkVfFFjYDC/vSmELDtb8g/4kU CpmQojqkKHz1lOXceXJs1Yw45lKLVIk9jNyriGZB2dVihi3DFT61P1eOUW0LqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFYxF2zrGz16nw; Mon, 13 Feb 2023 06:15: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 31D6FjrP081744; Mon, 13 Feb 2023 06:15:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D6FjNG081743; Mon, 13 Feb 2023 06:15:45 GMT (envelope-from git) Date: Mon, 13 Feb 2023 06:15:45 GMT Message-Id: <202302130615.31D6FjNG081743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 7e688ed49348 - main - patch: omit filename if the prompt was ignored List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e688ed493482c5346d969e7667856d8ced8d87a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7e688ed493482c5346d969e7667856d8ced8d87a commit 7e688ed493482c5346d969e7667856d8ced8d87a Author: Kyle Evans AuthorDate: 2023-01-24 16:46:01 +0000 Commit: Kyle Evans CommitDate: 2023-02-13 06:15:08 +0000 patch: omit filename if the prompt was ignored When a file is missing, patch(1) will prompt for a filename to try and patch it. If we're doing a dry-run, we'll output that the patch to the source file was either ignored/failed. If you ignore the prompt in a dry-run (i.e. just hit enter), we'll output: X out of X hunks ignored while patching (null) Let's improve the aesthetics a bit and just omit the last part if the prompt was ignored: X out of X hunks ignored Unfortunately we can't really test this without expect(1) because both force and batch mode will use the first best guess, which is wiped out by the "File to patch:" prompt. We could record the initially derived bestguess there and use *that*, but given that this is only possible in an interactive session I think it's fine to just omit the filename rather than adding a fair amount of complexity (which could also break other scenarios I haven't considered yet).. Reviewed by: des Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38179 --- usr.bin/patch/patch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c index a23fc82d3d90..48d3bd37fe5b 100644 --- a/usr.bin/patch/patch.c +++ b/usr.bin/patch/patch.c @@ -463,9 +463,13 @@ main(int argc, char *argv[]) if (!check_only) say("%d out of %d hunks %s--saving rejects to %s\n", failed, hunk, skip_rest_of_patch ? "ignored" : "failed", rejname); - else + else if (filearg[0] != NULL) say("%d out of %d hunks %s while patching %s\n", failed, hunk, skip_rest_of_patch ? "ignored" : "failed", filearg[0]); + else + /* File prompt ignored, just note # hunks. */ + say("%d out of %d hunks %s\n", + failed, hunk, skip_rest_of_patch ? "ignored" : "failed"); if (!check_only && move_file(TMPREJNAME, rejname) < 0) trejkeep = true; } From nobody Mon Feb 13 06:32:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFZJy1WfYz3rDWt; Mon, 13 Feb 2023 06: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 4PFZJy134Pz4HQL; Mon, 13 Feb 2023 06: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=1676269970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMZOBanGkwXWkIbNzYtudLqqdK8LtbhILXxSHQlYXwQ=; b=s45Sy6HD27cLOrsl0X0xPybRKuZounRjgF9McQnJp1JnlyeytQyDBFrJFcM6R0OGezWMqO z1sWVOo0yqXZ3OUSZINTX2p4XTLQEP2NC12AjbMlWDsQWH/zXhB8aNlUwOLJdCN+g2h9/n J7FCMjvwQSyMsIsnmAgIgS0A7+bAQqyc2fXXa9fniot2Ju7+yNmV5Z6qi6qf1SQ72RXih4 +hY0+9Jo3CRH5bknVZmYoZDIxsfB0dvpZUMk9bugzNH/qiQ6KVA+nCqVT5OpZfVqBlSsyY 2KOx82wXrulug+GOsjveoFdgcVT9gZcaw5Sx2tpo0k2d9dxC8fxsxGdiHwweUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676269970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMZOBanGkwXWkIbNzYtudLqqdK8LtbhILXxSHQlYXwQ=; b=cho6SMBjp3HZ08X/fIfJ0v3fbL8SXiOW0wHHajylV53cMET75Mgk8bZGw/W5e0/f8B96+6 pNZPFQGWI36mtovkxkfWCVQIQbZgrGrNTvBvWQPMdtatT3oyPXW5c+UoxlXzRjmDMxj7K+ a5s1Rw12GxOYbDa275dOxVnLe8jxrO7iGo7yMa5zG969KRF3FKlzNXallMh+QitQwEcLy8 57xLCY9zd6XaHLF7m7+SYxhVw9Zw2R27216RWz7iIv7pSFg2rTaE1JAoMATGT56EZ7iNrQ kzzQeW1hZtptbYv8vSFVFUMdRJmaHIEFOHKIfgEBI1vQYvO5DOzAKxno+kwiiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676269970; a=rsa-sha256; cv=none; b=WyVoADPJTlro4jIUzdCsEyPsnWPc6ThSTYHcgOUNBvC0gLK6c6ZYTQMC9bixPRxWm9rqs6 40huNjrqI80pSQbh+G2+pngQ2JDb9QKp3u30CzYf1vfDkiE3cILvZSIwwRQamelNWT4M2g 6zHgpN3V8JhnIBVKiuK4P8DxY+l16fnDlz04/V3TGtsjMB6JK33kiexFAAKf9uNR0WU2nj zfEIvrcN/CDhX+1/zSh9N/gis+w9M6DV66ZGVIJ5lctQlO+TBfYBcFobbJZ4Tvp6bmKPGu ooxs+3mvPLSdt8+HHMX7VPuPJUcw1VK/bvD3/q5VnfKxVOazCSVPBuCHdH5nBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFZJy05bWz17rR; Mon, 13 Feb 2023 06: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 31D6WnPV009931; Mon, 13 Feb 2023 06:32:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D6WnZC009928; Mon, 13 Feb 2023 06:32:49 GMT (envelope-from git) Date: Mon, 13 Feb 2023 06:32:49 GMT Message-Id: <202302130632.31D6WnZC009928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8d78a0d331ec - main - md5: fix *sum -c with missing files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d78a0d331ec2c168efe6cb85bbc2da86e9a6124 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8d78a0d331ec2c168efe6cb85bbc2da86e9a6124 commit 8d78a0d331ec2c168efe6cb85bbc2da86e9a6124 Author: Kyle Evans AuthorDate: 2023-02-13 06:32:38 +0000 Commit: Kyle Evans CommitDate: 2023-02-13 06:32:38 +0000 md5: fix *sum -c with missing files If we fail to open one of the files in the file listing, we still need to advance `rec` along with `argv` so that the checksum we're checking against lines up with the file we're hashing. Tests added both for the -c flag, as well as the -b and -t modes of the *sum programs. PR: 267722 Reviewed by: emaste (earlier version) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D37374 --- sbin/md5/md5.c | 2 ++ sbin/md5/tests/Makefile | 4 ++- sbin/md5/tests/md5_test.sh | 82 ++++++++++++++++++++++++++++++++++++++++++ sbin/md5/tests/sum_a.in | 1 + sbin/md5/tests/sum_b.in | 1 + sbin/md5/tests/sum_c.in | 1 + sbin/md5/tests/sum_sums.digest | 3 ++ 7 files changed, 93 insertions(+), 1 deletion(-) diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c index db4cdd7da1ff..6bc1a780df86 100644 --- a/sbin/md5/md5.c +++ b/sbin/md5/md5.c @@ -368,6 +368,8 @@ main(int argc, char *argv[]) if ((fd = open(*argv, O_RDONLY)) < 0) { warn("%s", *argv); failed++; + if (cflag && gnu_emu) + rec = rec->next; continue; } /* diff --git a/sbin/md5/tests/Makefile b/sbin/md5/tests/Makefile index 93f3913c687d..7429233ebeaf 100644 --- a/sbin/md5/tests/Makefile +++ b/sbin/md5/tests/Makefile @@ -11,7 +11,7 @@ TEST_DIR= ${SRCTOP}/sbin/md5/tests FILESGROUPS+= FILESinputs FILESinputsPACKAGE= ${PACKAGE} FILESinputsDIR= ${TESTSDIR} -FILESinputs!= echo ${TEST_DIR}/*.inp +FILESinputs!= echo ${TEST_DIR}/*.inp ${TEST_DIR}/*.in FILESGROUPS+= FILESchkfiles FILESchkfilesPACKAGE= ${PACKAGE} @@ -28,6 +28,8 @@ FILESparamPACKAGE= ${PACKAGE} FILESparamDIR= ${TESTSDIR} FILESparam!= echo ${TEST_DIR}/*.txt +ATF_TESTS_SH+= md5_test + PLAIN_TESTS_SH+= self-test PLAIN_TESTS_SH+= bsd-c-test PLAIN_TESTS_SH+= bsd-p-test diff --git a/sbin/md5/tests/md5_test.sh b/sbin/md5/tests/md5_test.sh new file mode 100644 index 000000000000..1aeb91321c74 --- /dev/null +++ b/sbin/md5/tests/md5_test.sh @@ -0,0 +1,82 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2022 Kyle Evans +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +atf_test_case sum_bflag +sum_bflag_body() +{ + cp $(atf_get_srcdir)/sum_a.in a + cp $(atf_get_srcdir)/sum_a.in b + + (sha256 -q a | tr -d '\n'; echo " *a") > expected + (sha256 -q b | tr -d '\n'; echo " *b") >> expected + + atf_check -o file:expected sha256sum -b a b +} + +atf_test_case sum_cflag +sum_cflag_body() +{ + + # Verify that the *sum -c mode works even if some files are missing. + # PR 267722 identified that we would never advance past the first record + # to check against. As a result, things like checking the published + # checksums for the install media became a more manual process again if + # you didn't download all of the images. + for combo in "a b c" "b c" "a c" "a b" "a" "b" "c" ""; do + rm -f a b c + :> out + cnt=0 + for f in ${combo}; do + cp $(atf_get_srcdir)/sum_${f}.in ${f} + printf "${f}: OK\n" >> out + cnt=$((cnt + 1)) + done + + err=0 + [ "$cnt" -eq 3 ] || err=1 + atf_check -o file:out -e ignore -s exit:${err} \ + sha256sum -c $(atf_get_srcdir)/sum_sums.digest + done + +} + +atf_test_case sum_tflag +sum_tflag_body() +{ + cp $(atf_get_srcdir)/sum_a.in a + + # -t is a nop, not a time trial, when used with the *sum versions + (sha256 -q a | tr -d '\n'; echo " a") > expected + atf_check -o file:expected sha256sum -t a +} + +atf_init_test_cases() +{ + atf_add_test_case sum_bflag + atf_add_test_case sum_cflag + atf_add_test_case sum_tflag +} diff --git a/sbin/md5/tests/sum_a.in b/sbin/md5/tests/sum_a.in new file mode 100644 index 000000000000..257cc5642cb1 --- /dev/null +++ b/sbin/md5/tests/sum_a.in @@ -0,0 +1 @@ +foo diff --git a/sbin/md5/tests/sum_b.in b/sbin/md5/tests/sum_b.in new file mode 100644 index 000000000000..5716ca5987cb --- /dev/null +++ b/sbin/md5/tests/sum_b.in @@ -0,0 +1 @@ +bar diff --git a/sbin/md5/tests/sum_c.in b/sbin/md5/tests/sum_c.in new file mode 100644 index 000000000000..76018072e09c --- /dev/null +++ b/sbin/md5/tests/sum_c.in @@ -0,0 +1 @@ +baz diff --git a/sbin/md5/tests/sum_sums.digest b/sbin/md5/tests/sum_sums.digest new file mode 100644 index 000000000000..613c49dd031d --- /dev/null +++ b/sbin/md5/tests/sum_sums.digest @@ -0,0 +1,3 @@ +SHA256 (a) = b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c +SHA256 (b) = 7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730 +SHA256 (c) = bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c From nobody Mon Feb 13 06:34:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFZLM6TzRz3rDX2; Mon, 13 Feb 2023 06:34: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 4PFZLM5mbbz4HwD; Mon, 13 Feb 2023 06:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676270043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YqVBXBYsM7W0uGtvOeWWeR28A7hkzGhbbugulRnJ8qY=; b=vBWNZ/PV1pgzPRTx7eZV0Q5uj+aVr85T3SDkTJi8dQr31mJH4DLRw0BREV1JPbZT0764eH xUnU7GdgDxshSUQVTwmR7sV6+hJsSqG9CxffANEAxLFAclIPzJtgWrPsnrbrBJpt0/KXyv o2/3FYCsJ9dvuPM9mhGxDLMGh9PJii3geObRPNqLcrES4pqYSpjTlw2znjngaUkSthAMZo S2fSs0hGC8ObYGwIIzNfQpRtmYxpzIfgmaPkJnV0M3B9IlJtnvKt2OYF/BH8xS25SScFa9 Tz1or8UpN3GUewl4PwfHgjsxdDohRb4z/kVDma7K/LP6PXkr3fqKCwOdetGNCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676270043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YqVBXBYsM7W0uGtvOeWWeR28A7hkzGhbbugulRnJ8qY=; b=B8uc8LZCZgud0BLW4QzdnM2FTOOnyi20ftWe1VpZUl/rIWEBXKPML05KxDV7zmCQGSET3Q R7RMfzVTJQmCmj/9woAtVTOk2Uo9sGCAramurXFf9/Qkzm8/iEb3V5+bbXHlCt3Vt5HjP6 hZEr2X4esgJ2FGQejXIjAu/BAbCIJ9W8pyVFLx6J2RTqnbO63AGi9bSGcU7d3SAY/YqzzJ l7fCpLe7CAhdVnF7TOMY+1Y1qKTZZI9aDytcIZjCu46XbosofoZZt1Xcjw2UrBepmXRrXN rTZ4HLJIBRm9vZzXMQyyDg1f4t6jpW5jvQeqXzCWuz9H7F5X0oX186/SFDy17w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676270043; a=rsa-sha256; cv=none; b=wV/wnwImNit44tunhjY2jIv9qi1NoeW7eAfwqmwmj1nkooQ1IGngXwTuIMGTlOpIF8jixI M12/TBRWr8qFoK4GS1FMNatsrJ1dGUTzJvs3yVwZPD/5OxM7DLdmM69sM9WWngR7sve6EC UA+GmsPpmfoGd1AXGR67Z/mTdCSAKhHjpKdPggHKSCFr1fOahuadjj2H+fUL1uc32PBrH1 8xdXHo/dDLFo7n0O007ZzCrtJeCwBEXoiZ+ApKqiKqoOJk7EhZtFlpyQ4w9ALriOEX2bf9 0nVla+4Kg6FlKuXr7e1xkyp1T1alnRwsnL/kqpREI7E+hFYrAaIObHfoWaeg2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFZLM4mZnz17tZ; Mon, 13 Feb 2023 06:34: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 31D6Y3gg010341; Mon, 13 Feb 2023 06:34:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D6Y3YI010340; Mon, 13 Feb 2023 06:34:03 GMT (envelope-from git) Date: Mon, 13 Feb 2023 06:34:03 GMT Message-Id: <202302130634.31D6Y3YI010340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f123c6c425d4 - main - libc: popen: slightly simplify cloexec logic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f123c6c425d4161b06f237996662496abbd78b94 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f123c6c425d4161b06f237996662496abbd78b94 commit f123c6c425d4161b06f237996662496abbd78b94 Author: Kyle Evans AuthorDate: 2023-02-13 06:33:52 +0000 Commit: Kyle Evans CommitDate: 2023-02-13 06:33:57 +0000 libc: popen: slightly simplify cloexec logic No need to check the mode again here; we know that `iop` wraps the correct fd. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D37987 --- lib/libc/gen/popen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index 4f94405c2ff4..c5373077f3ae 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -181,7 +181,7 @@ popen(const char *command, const char *type) * the list which will cause an explicit close. */ if (!cloexec) - (void)_fcntl(*type == 'r' ? pdes[0] : pdes[1], F_SETFD, 0); + (void)_fcntl(fileno(iop), F_SETFD, 0); return (iop); } From nobody Mon Feb 13 06:44:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFZZX5P78z3rFCR; Mon, 13 Feb 2023 06:44: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 4PFZZX4Ntrz4JkW; Mon, 13 Feb 2023 06:44:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676270676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OYdVzfSlfcBsE1qi4FZjHPIEHWxeLVW7R248l7h7noE=; b=A/ymn079PMO9Qdar4OGj/dtVkS0CdYRDI8WbPuvttPYTFJypEW/bF6NdhZNqGEfmFGCqNV JrA9YEMHixDAbeokYGVKY/xJx6f9s3k4pFFlyOAAh+s0pX5riiT9OBaMomkTmo5GI1U6Yk u4Pg3sAFh5tuzXsoa3p3DMyDArtg0ss0MDGJ4HQyhIfsCnFain3PaVeXlDn+EzWuh0aNEP s5o2jcvX9vLskxNMgvFmUpmKR0eUa2XX7FXBcjg8K/Edqkcs1IrhXwhlCJgsu8ktbaWEuq ODzK0KwotfBeM4ZPlMAWg1sw1M2a5j9LH3pMUe2AX77Ul+/0tFyj5Gg4UfNiPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676270676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OYdVzfSlfcBsE1qi4FZjHPIEHWxeLVW7R248l7h7noE=; b=Y+aE0mt/yCjqypQu+tE3NxcAheiFP/gUoPSaP6zkhd45q+w4r5/OTkvVnM5AYzZwcPPbCF fG0VABU5xEPzfyYyOMcVzXzoAYwX6kwSQ2ytDLPcj/NduqiA6L9pDcMPF7RETsmfVmAmuo R7vbqKuz84xE+NCd69iftCaiYvwtOdt5o0R841AWnZoYYT/Z6AmU1XMRO15ieAyYwq7gs6 UcOEOhwLcTYjJB3WJqqH2MrifMWHXQ7CPw210ciQp+a1m1GyLQlRP2ts3CuQ0NNEszUIg6 7zy1GhyzekddJFQ2PI7pvfyUKknAccIKom5JinX9aLDJLoR5YfVMOCzfdr9WQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676270676; a=rsa-sha256; cv=none; b=QaTTPg3UAOsw0vt9xor30N/JVw5TL4h1PCqqIxih4ulY0DchZXt5dGsbiBi+UV9Jy2WmgZ Lnah8OFPhAhiqPaVQYWf9/6nRWu97L7ZQTCUhl851JJN/F38PaWA7wMeoyCohwTHfZp64q WQU5AxtHWdaLZcem11GmTp5ACoigcV8GHQ9as/lzaU/uLqJpbN4Cl2OEvvvutPZmPRn02v C6LZhW9lWyWXVqOjWMB22bwChnPgji5OJN1dnFtgM4XX9WG1AB3v9bxNR0SrH2uBVxTOv8 B0zlddvsd/oQNNniEUZUFRn9iCi7nwP4pCmeMbaQGb3KClMGtJyvASxSgnCLzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFZZX3R71z17Qt; Mon, 13 Feb 2023 06:44: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 31D6ia9w024610; Mon, 13 Feb 2023 06:44:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D6iaO5024609; Mon, 13 Feb 2023 06:44:36 GMT (envelope-from git) Date: Mon, 13 Feb 2023 06:44:36 GMT Message-Id: <202302130644.31D6iaO5024609@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: deb63adf945d - main - top: fix sorting by pid (-o pid) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: deb63adf945d446ed91a9d84124c71f15ae571d1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=deb63adf945d446ed91a9d84124c71f15ae571d1 commit deb63adf945d446ed91a9d84124c71f15ae571d1 Author: Kyle Evans AuthorDate: 2023-02-13 06:39:04 +0000 Commit: Kyle Evans CommitDate: 2023-02-13 06:43:32 +0000 top: fix sorting by pid (-o pid) The 'pid' order was added, but the equivalent comparator was not back in 8b800d3af2d8c ("Add the PID column to the list of sort keys."). `ordernames` indices need to match `compares` indices in order for this to work. A future commit will restructure all of this to make it less error prone going forward (see D37083). MFC after: 3 days Reviewed by: pstef (D37083) --- usr.bin/top/machine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 315c8be1a4c2..be667ec0e461 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1567,6 +1567,7 @@ int (*compares[])(const void *arg1, const void *arg2) = { compare_ivcsw, compare_jid, compare_swap, + compare_pid, NULL }; From nobody Mon Feb 13 14:27:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFmsM2M23z3r9XX; Mon, 13 Feb 2023 14:28:07 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-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 4PFmsL5LYFz4Fp5; Mon, 13 Feb 2023 14:28:06 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-f50.google.com with SMTP id h24so19143252lfv.6; Mon, 13 Feb 2023 06:28:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=zbiPdrqRKXoQ9w0qRFOBjvUUVHONLnuwt0weBcXrkmg=; b=GXafKcYqfy6dMgOBpen7bwCKOGDuxTQECV/gliEFs1T91TtbcKVAAj+CZXxPfTzIqs 4Sl14a+fsDnvaOl4QcRzVHmFMStTQL3IslQMIM6QXmaQw1i8W7iE13a58tvviCIwKPc6 GCDsfGM8xRF1tgvyGXzzunfJ0qLjj5orMPtzxdNsOcDw9CnsMiQ+c4w9z1zxyVHkvupf PsMvP4SxXmBy5nYyNHVBGWmh+XXuG1+/2N6nz93txeRcFt2Rye/09x/0VL2FErfswfAn fAQL7UjAYfEFPWPeNZ6742p3rvnWW3tAw3yTzSSnBoGlpT+iLY08azUVEmMOiFx1Az7p kcOQ== X-Gm-Message-State: AO0yUKU85Nyk9mRuCFiWf9fZGv+6z8ca9WeGLsSM4zmJGWjz478bH8MY H3vDW1Rb/ridi5AR+LxAZsGuoM/qLIvZvC+hmQw= X-Google-Smtp-Source: AK7set8mlZEs2g8lYVXn5uiOVPYg5f6GwTwbNLFxxmbXZHcwadUYa4K2DFOJJE+9VxyTlfoOd8CVkXdnRspU7eK3aTg= X-Received: by 2002:ac2:5dc9:0:b0:4d4:fcdb:6376 with SMTP id x9-20020ac25dc9000000b004d4fcdb6376mr5452006lfq.218.1676298484471; Mon, 13 Feb 2023 06:28:04 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> In-Reply-To: From: Ed Maste Date: Mon, 13 Feb 2023 09:27:57 -0500 Message-ID: Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns To: Mateusz Guzik Cc: Warner Losh , Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4PFmsL5LYFz4Fp5 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 Sun, 12 Feb 2023 at 17:12, Mateusz Guzik wrote: > > I do note though that if "compiler flexibility" if you will is to be > expected, it should be stated somewhere. Again, I only recall the > opposite -- top of main needed to build the kernel. We have always attempted to allow world and kernel to build with a slightly older compiler, in particular at least for the period immediately following a tool chain update. We'd like to avoid having downstream projects or others with slightly atypical build configurations avoid surprise breakage. For example, Cirrus-CI runs use a toolchain package to reduce the build time, and it is now failing: https://cirrus-ci.com/github/freebsd/freebsd-src/main. This is easily fixed by bumping the toolchain package version of course, but it is much better if we can avoid this altogether. From nobody Mon Feb 13 15:10:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFnpd1fdNz3rFsG; Mon, 13 Feb 2023 15:10: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 4PFnpd09wtz4LMP; Mon, 13 Feb 2023 15:10:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xZmYV14NkMr3I7msX/DE4bMCRHILGJMcGfecdFP8w6w=; b=I75h3MATneO1pVR5nhnyQzhV/3/ccrXN0+qY/cVxaCd3lOiUuDFwioeTv2qtvDCoFLIL10 AmgdIEHPhgphsdZ7y2z12la+t1RZgHkuN7t8SzVJC6eXd5LZBWv3bcSNSsY+8Fk2Ji1obX kB88fpcIr6tk5vu3KrcvMsaNMfK23hUKVa5asQYjA0E+JtIyHFN8cMC8dCjYyILEgr8z6Y 7/xCuB4WOp2mmrg5y8psNPA9WtemYe5wHBzStF30tixnEckXQkwIW70xwdoV0gKlinKFGV 04ZbZvlraAH312bzXMev0nl1DOHN78P9gxQvBnVLOoLd+hNmGBMAchpmUNW7kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xZmYV14NkMr3I7msX/DE4bMCRHILGJMcGfecdFP8w6w=; b=FE6gh+Sj7uGqCiK02toi/JU5f/NuUCmil9WpIi/U2MaFok0wBDjWeKsC1mM3WzGxzbt+jt NKfr/w+A244tjoJCJesL+6IZu1hIiRfR2LTrtUhzE4CCa9xS6NC28F/KJlL/b1P8FgdYRY +N6xUKpdLtreofEHUV42Ajz9pzE2RT1wMdHA6pYHtkwTFa+MkHYfX7SADA0iujPewyn/cv 2YoyUNcP0Aubu7e6z0aKJn9s3iz1DOnkpaHHuot9q2jrflIJ52HoUOuySY/kwyZC9uBt14 AS4n24FsVX9uxypZT2wClIIVllxGq7FAL7MkCPy20rESbOJvBdSMWiEKiEO/1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676301049; a=rsa-sha256; cv=none; b=f46NtvvcHjp5uNCYNpjRsHjKSbmg6kBsenhM2KPxlz4RpZuhhg+TZU2Cw+kFqyN69C2PPu ToCTt1kzKGoN+5wDRb1GAcwJdBIrmJC2oMFtKjsoXKlCgB5pJw/rp2aZE5POUciuEI8tvu G3j3DS0ymeGUacgbrcL6dmZUepMcRPKwjedBd9bhhP8ZjoDFjXpJrsLg/DspLK4lzsXctO L0CRSmtx/gwyaR/WVESvcGXoR8UlTKxUmuzV7b9wvpzU6+gTscS4MgOoLtvlFav1PX5gVm wrm2Neo1hKWNFrbGhZejqsANF3ZbibrPrxSgyqHdw18Qg3ksoBhEEKPWwpsAAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFnpc67BSzND9; Mon, 13 Feb 2023 15:10: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 31DFAmUf048394; Mon, 13 Feb 2023 15:10:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DFAmWO048393; Mon, 13 Feb 2023 15:10:48 GMT (envelope-from git) Date: Mon, 13 Feb 2023 15:10:48 GMT Message-Id: <202302131510.31DFAmWO048393@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: 67fca20eb2ce - main - Cirrus-CI: use llvm15 toolchain packages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67fca20eb2cea55fb2eaacc22807ee4741894796 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=67fca20eb2cea55fb2eaacc22807ee4741894796 commit 67fca20eb2cea55fb2eaacc22807ee4741894796 Author: Ed Maste AuthorDate: 2023-02-13 14:28:35 +0000 Commit: Ed Maste CommitDate: 2023-02-13 14:29:36 +0000 Cirrus-CI: use llvm15 toolchain packages As of commit 50d7464c3fe6 we use llvm15 as the system toolchain, and commit eca005d8531f added compiler options incompatible with earlier versions. Switch to llvm15 packages. Sponsored by: The FreeBSD Foundation --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 272032aa05fc..77510e1ea09e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -16,13 +16,13 @@ task: env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN_PKG: llvm14 + TOOLCHAIN_PKG: llvm15 - name: World and kernel arm64 build and boot smoke test trigger_type: manual env: TARGET: arm64 TARGET_ARCH: aarch64 - TOOLCHAIN_PKG: llvm14 + TOOLCHAIN_PKG: llvm15 - name: World and kernel gcc12 amd64 build and boot smoke test trigger_type: manual env: From nobody Mon Feb 13 15:19:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFp0H1jP6z3rGcP; Mon, 13 Feb 2023 15:19:11 +0000 (UTC) (envelope-from mat@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 4PFp0H0d5wz4PKn; Mon, 13 Feb 2023 15:19:11 +0000 (UTC) (envelope-from mat@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301551; 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=n6xtwscc+gjd+duULQW63pfTNgHx+fXDok1hbcaiUcw=; b=dxNnqLXtx0kGP3YCzG8WfC1J2/uTeSrYPO3XIBZLKjYrQr3ZwyH/o4Xrq2i4xemfp6sNfT lgS8I7ReDsatSZ6DGJsvmp0xe8bQsBRnpRvWZCwNPGECjY13Bse3ptf5/oFVnvhN/JKXeA NHTt/HJHZlGV5yC+j7RUkg5gdRpJKLtz3T36WytgUpvpoPurIWxRw2Shjw7UgQMyJqx0wj PA7aiTX51j2ZpsW9OT98oqt+R5n+MdAjB0wm9QTL1tjie7P1l8C/BAvAP47f3LG2qpfPl5 apJrru9ROllasGb+8qy56mcLOntI2+PQsawn9sLUpKjhlyzFjGNWaNe5GI0DKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301551; 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=n6xtwscc+gjd+duULQW63pfTNgHx+fXDok1hbcaiUcw=; b=M2BQciyqgu53shL6jnEzqJzEG3g7jmHPftXizW0Nqkjd9AVudE20d/IUu0h9c8e/WSm8sy 6xbeNyc4GIsrVUWlqE5qfJwH4zeGrmmd9uRsOiKGor1nrvnLJpgwL2U73xLaHJrvmlx85Q 3mJ6NCSr4dscI3HucxybdY/ate8VLhnYvN5fwFFHMO7CQaryxtjdsoh8r4SCNIpJCGvAoJ v93fPSrkhzs0HHI7uNz9bY+O+teXWrUI6n6gYuZCffk3D1qJWrnHgKBqSLi21cdJ8+1PvI Vt8rMcfXd50EpGc/xar8uB76UaXBxK94U9OmWxCRGnzwF1jIR9gXhvYMIqo3hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676301551; a=rsa-sha256; cv=none; b=tn/3xmCrHuPuRO98tfLP2V7B+VyZvGJOVKyWYhh9ywsCb+jUAroQtr5RQ9Twpp40VCauZv lleopY5NUlAAmOzH21gBqsRZStCUg9I4jiibR4S5+jKN5Mr0CjVOgFNDR0IvTgJnij2VQY EY6QWmkScn14EspijIBeajRfU2MgwmQeCTwVAqjKkmL7AMmEnslJtk65lMr44LRheTc2Qe KC/B30+OFqH/FgkTTOmvbN6hU4cZo/s/+kAjh1/M8gUtXO4fjxTOA2n/8LwzI8GwBrgjCQ g4o+ucO1uHs0jKqW+jKZrWgjrJ4d0egYkLwIuwRiOBPqVIKGALCzQpc2JYlOkg== Received: from mail.j.mat.cc (owncloud.cube.mat.cc [IPv6:2a01:678:4:1::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 (4096 bits) client-digest SHA256) (Client CN "mail.mat.cc", Issuer "R3" (verified OK)) (Authenticated sender: mat/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PFp0G60dHzFrx; Mon, 13 Feb 2023 15:19:10 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from aching.in.mat.cc (unknown [IPv6:2a01:678:ab:50:b21d:ca1a:88e2:2d18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mat@mat.cc) by mail.j.mat.cc (Postfix) with ESMTPSA id 5BC3C942D80; Mon, 13 Feb 2023 15:19:09 +0000 (UTC) Date: Mon, 13 Feb 2023 16:19:08 +0100 From: Mathieu Arnold To: Mateusz Guzik Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: eca005d8531f - main - zlib: silence K&R warns Message-ID: <20230213151908.plgthmmbjyvhmigg@aching.in.mat.cc> References: <202302122113.31CLD2av012258@gitrepo.freebsd.org> <72B4A01A-521D-4739-B1DD-6A19E98771EE@freebsd.org> <05AA573A-9692-40C3-8BF6-D52864BAB337@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yjj3t4dwktid3qbs" Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N --yjj3t4dwktid3qbs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 12, 2023 at 10:40:28PM +0100, Mateusz Guzik wrote: > > >=20 > Are you sure about that? I distinctly recall the supported path to get > top of the latest stable branch first, from there you should be able > to build the toolchain and the kernel. >=20 > afaics the above change did not affect it >=20 > If you insist, I can look for the exact paragraph in the docs. Technically, no, you have to be able to build the next release from the previous release. For example, when 13.0 was released on 2021-04-13, the latest release was 12.2, which was released on 2020-10-27, and you had to be able to build it with 12.2. Right now, the latest release is 13.1, so one should be able to build HEAD from 13.1. In the close future, when 14.0 gets cut in july this year (probably) the latest release would have been 13.2, so you will have to be able to build it from a 13.2. --=20 Mathieu Arnold --yjj3t4dwktid3qbs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQITBAABCgB9FiEE9XJBpJetWizkEBUef2IOCp6dQb4FAmPqVOtfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEY1 NzI0MUE0OTdBRDVBMkNFNDEwMTUxRTdGNjIwRTBBOUU5RDQxQkUACgkQf2IOCp6d Qb4Zzgv9EvBygCQzLKyE3i8D6peLiZ/eWym9DBsRBpIPSHxqL92DUV2eXimTmQP+ 6bFhZvH9styl/LWMylAMox6G+YjqR4hq+YwgmjTuGLwKAUEmw/qptzotMKyKPbTn mItRMrLz+1FVZawrLp8RVmV7qef4C6IFpsEU9rVx8Y2FsZhFrAN7cKnSAt5GFUzZ ySoJS8OutQa45paKwHNcrzO5MUhy6xYT5kzP07C3xHBuGOIn9p/zSLRg6yG8pljr N7tZsJ+rZOrQm7VNsYKm1qPz9IV2i4RSfG390kgH6aqohdRA7E+QGkM3V/fxdSwQ 8Gm2xxrMsbNQPUgKDwpX3vNNgxYUygJjymOTlE1zvfORCAPAZBL6spdVePKYhTt8 Ct5Y2HsRwz8lFymKhjYNF0BHbuVDrqw42eBnyWxA89MSbaSl14yBw9q7ubBxoBlZ k4e/6eWBFPGPoQnfc7F8ydAmYuAsgAEzGxuTOFSU3SAjrzNVVd5z5oqc3iuYcPr4 RRSBmBEJ =Rwiv -----END PGP SIGNATURE----- --yjj3t4dwktid3qbs-- From nobody Mon Feb 13 15:23:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFp4z5gM7z3rH8J; Mon, 13 Feb 2023 15:23: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 4PFp4z4yZrz4PfV; Mon, 13 Feb 2023 15:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OmKnEbIKr1jopjcl9hcAUfCJ94h3qpceJB68OpGlbaM=; b=hfjcPIgFT/GYMHzl09C4ALXx6muhaybBxo61Rgm6jh6LHDXAbzA0ut86ue3B/JvBX3JaEH lqTacIOmsXxanJTod10rzq7lfeY2eaZISPSPWIJLzLzqUBZ1ubb2WIhWXjtLh9nVwEgHHd Q++DzlbjomZjBAtsPrDP0iP/FRGNy9Kp1fjXaoylHubbZVeuNHT/5hIjIfvB3Z1opZM/Q5 eFX0coO80jx7UZEiEdm+4J4sP532QJXWajnsA+S3T0Sl5zr9lDmeOIKPMXVUDyREZRuKM7 bzM6JEZ8nLyU1OdV8CLxIwJd42WqVAY9V6S6QHukcZdC/A3uVLU7cvk+UX+GVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OmKnEbIKr1jopjcl9hcAUfCJ94h3qpceJB68OpGlbaM=; b=wGPj+PaZXQP8jwBNISIzaiMobi7u3qB4OucgfYr0K6oQLiLilzbNdeBi4nmqnF1MgETOYE gdjAiWHAueJJSbLYR2rUUu6lzZpQ4vGCjnqKYFVmHa4MDYQzlJ5n1/JNJG/0P8/BJjbH/S nQ/JNeggdZC/BWIOgZP5XE7S/8iTi9cceKyPzKMEcYZ4HtGxtIcp9oHLVA0+6AyTUsELxo 2MIxd/ezSYSrzEHs9mSTpBgcgi5HZ/ggT3ig65uuMsDQbT2mMW1uOtksvtF6GQZ9Q5g4zO Az76yZxrJ92/vMhEc0z3qRMr2hUbf22eqBymwqkytVanHTxX+letz6igixYdHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676301795; a=rsa-sha256; cv=none; b=sci8zgPhV3VM9dIzIKsBBlrieXptA0Wz6hAYBmfVA1CduRMq8y+KCAxjMXZmzTAz4I8xHZ S4nynr4Vo1+23GRYpZyM9yEHZuHrLAMKum4QZlAFseW88RnQb4S05gYF4QmMIWkDa33eGK qHedQjNkfsDDEJB9X/7IVYs/tvNRTHKudMGlxTeVay3UTLE5asUH8e4H97RDGeBdErab+C ydRnpRQhogi4cP3QXkQH7BmzIW3KyV/R1w6c07LY7G0rHhV06LUhs35dhtsL3EFyW4YW1n bfr6MtgtPY8b4uyIIGZ84jYq7s9TaJYQrjxLf0VvNFzfMC4achZNWvVccnXRGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFp4z3gYvzNfH; Mon, 13 Feb 2023 15:23: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 31DFNFwO068031; Mon, 13 Feb 2023 15:23:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DFNFs9068030; Mon, 13 Feb 2023 15:23:15 GMT (envelope-from git) Date: Mon, 13 Feb 2023 15:23:15 GMT Message-Id: <202302131523.31DFNFs9068030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 09c4c1e83665 - main - prof: Remove sysctl docs for sysctls that are now gone. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09c4c1e836659a30aa68790e9b7e7536d1194ef4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=09c4c1e836659a30aa68790e9b7e7536d1194ef4 commit 09c4c1e836659a30aa68790e9b7e7536d1194ef4 Author: Warner Losh AuthorDate: 2023-02-13 15:18:50 +0000 Commit: Warner Losh CommitDate: 2023-02-13 15:18:50 +0000 prof: Remove sysctl docs for sysctls that are now gone. GRPOF based kernel profiling was removed in aa3ea612be36. However, the docs for the sysctls were not. Remove them belatedly. Sponsored by: Netflix --- lib/libc/gen/sysctl.3 | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index 2d8da3974086..c4883e0aeb4d 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -349,7 +349,6 @@ information. .It Dv KERN_OSTYPE Ta string Ta no .It Dv KERN_POSIX1 Ta integer Ta no .It Dv KERN_PROC Ta node Ta not applicable -.It Dv KERN_PROF Ta node Ta not applicable .It Dv KERN_QUANTUM Ta integer Ta yes .It Dv KERN_SAVED_IDS Ta integer Ta no .It Dv KERN_SECURELVL Ta integer Ta raise only @@ -477,41 +476,6 @@ implies the current process. .It Dv KERN_PROC_ARGS Ta "A process ID" .It Dv KERN_PROC_PATHNAME Ta "A process ID" .El -.It Li KERN_PROF -Return profiling information about the kernel. -If the kernel is not compiled for profiling, -attempts to retrieve any of the KERN_PROF values will -fail with -.Er ENOENT . -The third level names for the string and integer profiling information -is detailed below. -The changeable column shows whether a process with appropriate -privilege may change the value. -.Bl -column "GPROFXGMONPARAMXXX" "struct gmonparamXXX" -offset indent -.It Sy Third Level Name Ta Sy Type Ta Sy Changeable -.It Dv GPROF_STATE Ta integer Ta yes -.It Dv GPROF_COUNT Ta u_short[\|] Ta yes -.It Dv GPROF_FROMS Ta u_short[\|] Ta yes -.It Dv GPROF_TOS Ta struct tostruct Ta yes -.It Dv GPROF_GMONPARAM Ta struct gmonparam Ta no -.El -.Pp -The variables are as follows: -.Bl -tag -width 6n -.It Li GPROF_STATE -Returns GMON_PROF_ON or GMON_PROF_OFF to show that profiling -is running or stopped. -.It Li GPROF_COUNT -Array of statistical program counter counts. -.It Li GPROF_FROMS -Array indexed by program counter of call-from points. -.It Li GPROF_TOS -Array of -.Va struct tostruct -describing destination of calls and their counts. -.It Li GPROF_GMONPARAM -Structure giving the sizes of the above arrays. -.El .It Li KERN_QUANTUM The maximum period of time, in microseconds, for which a process is allowed to run without being preempted if other processes are in the run queue. From nobody Mon Feb 13 15:23:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFp5061CHz3rGyd; Mon, 13 Feb 2023 15:23: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 4PFp505YM2z4PxW; Mon, 13 Feb 2023 15:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3qIUAdkdqOUTuzd+aYq78kTKZItTdrTpsDNLDtJAJ/c=; b=sPdXnKCW6d2yulmWtonAO6hghS1/avqtj46sMsysBT8N/+jRUTGTe3N1bj1Y9zfZ0rJd3G Fc39B9poRch2iZp+jWmM3z9vOW0QkoIhCOGtipBjxJITx2tOAEfqQ5LVRD/joJn9vGm+sh hIEAcdidHOHtJF0k82hpwxJJ3yoHZgVKHdefNlx5+YI8XCyiM8yUttK3MmmuxI2WOmb/m6 tZQg0uVnYjqXZdme0Q1EKkJyg2cZ+wiLCnACvZynVNWZdmPS4XToNA55Cgse9mvXQl3RKF FOOodMWFY2Vj2O6z3vlvEN5hp/4MQO+9gXSEyd12bqqmof7e62QynSbhb1DFkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3qIUAdkdqOUTuzd+aYq78kTKZItTdrTpsDNLDtJAJ/c=; b=AKiKE/P4Zj8Q/4JqssMQPQ4nezEG4OEEig5zWygjYEL9xqJPqS04M8GifV0usMoDA/68rA QLky7rvUSySfjvTLU2jYjJWw3/zYe7N3tpphdnEcMZVl0fjLDkfks3LVIKq2xzXXsm14J6 0jVMcLDfyGMvSl4sr9qa+Yb8RZCTtTRzfzv7NwAUrzoA1cQBLmMObKQAt6Viltto7IAJ2f QKr2AHtAl4d8+fAvKsbo2ZIGO7gNKFkOJcxRYNzCvthJ9vE+o1E0HmQv08jGaXk4jfpPqF IcSU1L2wtL6Pi1bxCLZQY5cU06XenXtjqFdleF6K5Q6bXRS5fcL4U4nTvkqaJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676301796; a=rsa-sha256; cv=none; b=fDn7e08MDZ9naeBqpQl2Q3NRQf8irpQkOAe027R/k5g1EVT8LSihDvSGDV3cDGYAIe0yvl r7TmVQE5Nt3BtDRG8CDgnUOSuzVCpR/tp9m83vmzmk0oADPOgksIFA4rY2RqjsaOBBcxnj j3LqRWlQpd5OJPmXKCgIwFonnDJmvv+BP34pKq7oeNEKPvRpM4XY1MTLgsygNhNZ0Ga5wJ 3tqHj7bYLrmv18abn5Mq0zjAo5JSyqHr1FYZ/1YC8+UnHGfNXCiGaOxMLDZwDUBqH+9jgO V10KORLa9XDYx/iyfAswn6Zv7Fpx3bTOcs+HFdZ9qnfMHp7KmL6Eq3fp2pJZ2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFp504XRrzNYm; Mon, 13 Feb 2023 15:23: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 31DFNGHG068062; Mon, 13 Feb 2023 15:23:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DFNGiW068061; Mon, 13 Feb 2023 15:23:16 GMT (envelope-from git) Date: Mon, 13 Feb 2023 15:23:16 GMT Message-Id: <202302131523.31DFNGiW068061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b9f235ba3178 - main - Properly conditionalize clang 15-only flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9f235ba3178e5315cc1c77c87febd033cf69b3e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b9f235ba3178e5315cc1c77c87febd033cf69b3e commit b9f235ba3178e5315cc1c77c87febd033cf69b3e Author: Warner Losh AuthorDate: 2023-02-13 15:19:00 +0000 Commit: Warner Losh CommitDate: 2023-02-13 15:19:00 +0000 Properly conditionalize clang 15-only flags Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38550 --- sys/conf/files | 20 ++++++++++---------- sys/conf/kern.pre.mk | 5 +++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 53f90f7afc22..952aab6f1b6e 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4100,34 +4100,34 @@ libkern/strvalid.c standard libkern/timingsafe_bcmp.c standard contrib/zlib/adler32.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" + compile-with "${ZLIB_C}" contrib/zlib/compress.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-cast-qual -Wno-deprecated-non-prototype" + compile-with "${ZLIB_C}" contrib/zlib/crc32.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" + compile-with "${ZLIB_C}" contrib/zlib/deflate.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-cast-qual -Wno-deprecated-non-prototype" + compile-with "${ZLIB_C}" contrib/zlib/inffast.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" + compile-with "${ZLIB_C}" contrib/zlib/inflate.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" + compile-with "${ZLIB_C}" contrib/zlib/inftrees.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-deprecated-non-prototype" + compile-with "${ZLIB_C}" contrib/zlib/trees.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" + compile-with "${ZLIB_C}" contrib/zlib/uncompr.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} -Wno-cast-qual -Wno-deprecated-non-prototype" + compile-with "${ZLIB_C}" contrib/zlib/zutil.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${NORMAL_C} ${NO_WSTRICT_PROTOTYPES}" + compile-with "${ZLIB_C}" dev/zlib/zlib_mod.c optional crypto | geom_uzip | \ mxge | ddb_ctf | gzio | zfs | zlib dev/zlib/zcalloc.c optional crypto | geom_uzip | \ diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 49437ac6c2da..1a94709eaded 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -278,6 +278,11 @@ DTRACE_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${DTRACE_CFLAGS} DTRACE_C= ${CC} -c ${DTRACE_CFLAGS} ${WERROR} ${.IMPSRC} DTRACE_S= ${CC} -c ${DTRACE_ASM_CFLAGS} ${WERROR} ${.IMPSRC} +# zlib code supports systems that are quite old, but will fix this issue once C2x gets radified. +# see https://github.com/madler/zlib/issues/633 for details +ZLIB_CFLAGS= -Wno-cast-qual ${NO_WDEPRECATED_NON_PROTOTYPE} -Wno-strict-prototypes +ZLIB_C= ${CC} -c ${CFLAGS} ${WERROR} ${ZLIB_CFLAGS} ${.IMPSRC} + # Special flags for managing the compat compiles for DTrace/FBT FBT_CFLAGS= -DBUILDING_DTRACE -nostdinc -I$S/cddl/dev/fbt/${MACHINE_CPUARCH} -I$S/cddl/dev/fbt ${CDDL_CFLAGS} -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" From nobody Mon Feb 13 15:23:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFp51716hz3rH4b; Mon, 13 Feb 2023 15:23: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 4PFp516XNkz4Q79; Mon, 13 Feb 2023 15:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qzdbaXNgzyury+l3o/h0za0B8SOf9EY9s3elQ9XHwp4=; b=smXFTUZvjCHReJzXGvi1QyZYMXndGrTBTJ96M4zspEBkYyDI648I6AvvGqzaVCYv3S5B1N gjArwarygiZ9etQuUkZt3AM3jwP/L86NbJUjJxy20IFT3DpjKD9vosEZ4audCs1bn4iJ5B /rX+/WNi/4r75mlCBCRB/iIchaKhantZbt+MjQ2dZIiJkXUlfHUGJ5qXYo6eHA1XxvO6G3 Egqv3S5H2zYSx7fgK/UEc8sve+Z0WF4tMSBYThVKD9oRnZ9hQzHc2c/2139OZzkGPdMhQA 0f+f+PAlHEWKoD2NabP4CW1Bh2lS6mqoskls5uqhMSY2N+Et1pwVRCQ45rBqMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676301797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qzdbaXNgzyury+l3o/h0za0B8SOf9EY9s3elQ9XHwp4=; b=ypmofS2J0SrNySD/N2/TxZrTvvViMJdUF1drsxqMRs4MBAZfhhYTgYwa1vMdRynEgUCHl5 PuNRjl86kG9E60v2CR9xTqUbX+4Xyw6qU4bLK8WJHdkMGWlaC+Cti5+ZQGvDfrPubjUlkQ /bQWZq9KbPS+XG82A7Sf66W44fDDlraQWV4OSCj3quSeZtat+Zr9Qb8Vgn2dQv4d320gZ7 rv3gTt2BHlj5ETXKTXySD+T6et8W7HyToTB3hF3i448IV/UvnoVnJEtGqUqiNUGH+h8S/l qda/O6JXdodbGrbm0GFuYP3hhHPpQzlMsMRZKrjjPMhT99iSCbpai15YCSpoMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676301797; a=rsa-sha256; cv=none; b=IVxL19oxN1vXo3RUaLndAb5m4vc1NuglXX9qQjHfcAQsGbxLkeITHMYKlfFR3TREmXi/GQ XZh5ijRJGd4oiS2LVYkxm+cXXxJzBw9MZLY65Ul6MLA7cLKRTv8B+SrEp0MVlSM1XGCxon 6mp/Dq7+yxFgchWj9pZVzur7SRhUXx+zorb0rWEVgRqLFuJvWE/tXpxrdXTSNGpLpUDIgT y2rq1J6417T9upYtNdA3GbCjEWK2lKXQrYYhxa2HRRa+vFfv2/F5q3PNjLElX+PIcbRQEC 9F4/BMQpGZx4ZZgciJk8Gwt63KQzLZ0achtsNQ4nl4cs57D1bFLRWQC76SmhLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFp515TrgzNYn; Mon, 13 Feb 2023 15:23: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 31DFNHo1068086; Mon, 13 Feb 2023 15:23:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DFNHn1068085; Mon, 13 Feb 2023 15:23:17 GMT (envelope-from git) Date: Mon, 13 Feb 2023 15:23:17 GMT Message-Id: <202302131523.31DFNHn1068085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9768746ba83e - main - bearssl: Suppress warnings from functions that have no args List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9768746ba83efa02837c5b9c66348db6e900208f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9768746ba83efa02837c5b9c66348db6e900208f commit 9768746ba83efa02837c5b9c66348db6e900208f Author: Warner Losh AuthorDate: 2023-02-13 15:19:40 +0000 Commit: Warner Losh CommitDate: 2023-02-13 15:19:40 +0000 bearssl: Suppress warnings from functions that have no args clag15 is much pickier than others, so suppress the warning until upstream can be updated. Sponsored by: Netflix --- lib/libbearssl/Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libbearssl/Makefile.inc b/lib/libbearssl/Makefile.inc index dd0e242c8ef0..2af4864d8441 100644 --- a/lib/libbearssl/Makefile.inc +++ b/lib/libbearssl/Makefile.inc @@ -4,4 +4,4 @@ BEARSSL?= ${SRCTOP}/contrib/bearssl BEARSSL_SRC= ${BEARSSL}/src CFLAGS+= -I${BEARSSL}/inc - +CFLAGS+= ${NO_WDEPRECATED_NON_PROTOTYPE} From nobody Mon Feb 13 16:06:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFq2Z6ryGz3rMBs; Mon, 13 Feb 2023 16:06: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 4PFq2Z617Tz3JTg; Mon, 13 Feb 2023 16:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676304374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cEZ5Jck38YH6SWP/Teml+AovQBhe+aL7v6XedqnxcUs=; b=W54RBHJursADxx5Ob5P4Veau1KOER9WENiT7FTb1JERz0jb3dQif1FQ6TEGL08dahHLdZ8 m3zrM402ppkA918thAQ8kajZ+xj7UL1YUarBD0wuPOGd7HU/ZkH+ltOnIzJkQN5u6yavhz JDVyP7cjol7VB1auMxrNTSwv4tz+S8pZquheXUAGQoXSEYJ3+1OZMRjBTTd0wFg9yUa4Ca WGSjyC/xrfuX/dmYmnlezj5qHJvIBJx+EH3V84sIzWXyE/OMR0q5ndtVeatLLezwxhHtGd NUPlHJItJ00dFPCJEv07RifNtOAFZg+LRgyz5ur7Ol8I6gSp0t/1Ftegs52Ndw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676304374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cEZ5Jck38YH6SWP/Teml+AovQBhe+aL7v6XedqnxcUs=; b=Ct2151wBqupsnni/ICZDZOwyQCRlOe9h7Kz+epVrBpVpGr7z359NBPslKelYCkGCna9oJe bAySWzLPVn/1zFptbYoSlcebiDgN2w+TPxUnJpaYVxhNJ4QGzNWXW8K+sA6T9x4LUXIqq4 EdZfrs2go1p367QHXQy254S6QI785Use1RuUqWZmpxi3Opi4eUHSvwH0a7vPU0oDmarP8n QKcLga9e2eGzDPy5jzTpIu8DUv/ex59KynuNPMmEavhbwr4lNivKpKk+gvXTE/Wzv2dFBw BefupD2hyAOxiyc3dEpDMbdAL1MMwpZJD7wYOuSBmYz4S96UJBKRWUHfuJcVKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676304374; a=rsa-sha256; cv=none; b=x6WgXWo9NTzgk4Ik3lFYuVbZ6CiQ+dKsaiul/RFhBL7GDaMVJqxMsrQDueeFWnkqy2CWh2 kROXbBC54QqLfxTss9NTlkRnF+q6oscV/iNtPHyzusoulhKd38I8XNuGpbIeCD+32j72Jp XptQKTvRXikldYUuYw8gMJk0dJ5HTv+c5w0ZV9L9G4Vba99fWQugNgz0E/ypxOK76XeS9R kLVllGTpgvM3cEucWkjHZvFl1aKMHp6rH1eYd6eBaaEf18jvx1cuSzFX6cen9fC5yzhz8M xqgZcXz7wa54qQkJtza3nFN7AQQcGlT9l4DrxFUJbvnTcpiJpVy5Q0ykqfUKpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFq2Z53tDzPlt; Mon, 13 Feb 2023 16:06: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 31DG6EwG025882; Mon, 13 Feb 2023 16:06:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DG6Ehu025881; Mon, 13 Feb 2023 16:06:14 GMT (envelope-from git) Date: Mon, 13 Feb 2023 16:06:14 GMT Message-Id: <202302131606.31DG6Ehu025881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 4bd4e4b45e8b - main - sesutil: don't malloc in a tight loop List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4bd4e4b45e8bfbe855406098f393bdf4eda7104d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4bd4e4b45e8bfbe855406098f393bdf4eda7104d commit 4bd4e4b45e8bfbe855406098f393bdf4eda7104d Author: Alan Somers AuthorDate: 2023-02-09 22:23:51 +0000 Commit: Alan Somers CommitDate: 2023-02-13 16:04:05 +0000 sesutil: don't malloc in a tight loop Reported by: mav MFC after: 1 week Sponsored by: Axcient Reviwed by: mav Differential Revision: https://reviews.freebsd.org/D38473 --- usr.sbin/sesutil/sesutil.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/usr.sbin/sesutil/sesutil.c b/usr.sbin/sesutil/sesutil.c index 989216690edf..22bd0127a484 100644 --- a/usr.sbin/sesutil/sesutil.c +++ b/usr.sbin/sesutil/sesutil.c @@ -417,6 +417,17 @@ objmap(int argc, char **argv __unused) usage(stderr, "map"); } + memset(&e_desc, 0, sizeof(e_desc)); + /* SES4r02 allows element descriptors of up to 65536 characters */ + e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); + if (e_desc.elm_desc_str == NULL) + xo_err(EXIT_FAILURE, "calloc()"); + + e_devname.elm_devnames = calloc(128, sizeof(char)); + if (e_devname.elm_devnames == NULL) + xo_err(EXIT_FAILURE, "calloc()"); + e_devname.elm_names_size = 128; + /* Get the list of ses devices */ if (glob(uflag, 0, NULL, &g) == GLOB_NOMATCH) { globfree(&g); @@ -481,28 +492,16 @@ objmap(int argc, char **argv __unused) xo_err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); } /* Get the description of the element */ - memset(&e_desc, 0, sizeof(e_desc)); e_desc.elm_idx = e_ptr[j].elm_idx; e_desc.elm_desc_len = UINT16_MAX; - e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); - if (e_desc.elm_desc_str == NULL) { - close(fd); - xo_err(EXIT_FAILURE, "calloc()"); - } if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t) &e_desc) < 0) { close(fd); xo_err(EXIT_FAILURE, "ENCIOC_GETELMDESC"); } + e_desc.elm_desc_str[e_desc.elm_desc_len] = '\0'; /* Get the device name(s) of the element */ - memset(&e_devname, 0, sizeof(e_devname)); e_devname.elm_idx = e_ptr[j].elm_idx; - e_devname.elm_names_size = 128; - e_devname.elm_devnames = calloc(128, sizeof(char)); - if (e_devname.elm_devnames == NULL) { - close(fd); - xo_err(EXIT_FAILURE, "calloc()"); - } if (ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t) &e_devname) <0) { /* Continue even if we can't look up devnames */ @@ -525,14 +524,14 @@ objmap(int argc, char **argv __unused) } print_extra_status(e_ptr[j].elm_type, e_status.cstat, PRINT_STYLE_DASHED); xo_close_instance("elements"); - free(e_desc.elm_desc_str); - free(e_devname.elm_devnames); } xo_close_list("elements"); free(e_ptr); close(fd); } globfree(&g); + free(e_devname.elm_devnames); + free(e_desc.elm_desc_str); xo_close_list("enclosures"); xo_close_container("sesutil"); xo_finish(); @@ -727,6 +726,10 @@ show(int argc, char **argv __unused) first_ses = true; + e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); + if (e_desc.elm_desc_str == NULL) + xo_err(EXIT_FAILURE, "calloc()"); + /* Get the list of ses devices */ if (glob(uflag, 0, NULL, &g) == GLOB_NOMATCH) { globfree(&g); @@ -808,19 +811,14 @@ show(int argc, char **argv __unused) continue; /* Get the description of the element */ - memset(&e_desc, 0, sizeof(e_desc)); e_desc.elm_idx = e_ptr[j].elm_idx; e_desc.elm_desc_len = UINT16_MAX; - e_desc.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); - if (e_desc.elm_desc_str == NULL) { - close(fd); - xo_err(EXIT_FAILURE, "calloc()"); - } if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t) &e_desc) < 0) { close(fd); xo_err(EXIT_FAILURE, "ENCIOC_GETELMDESC"); } + e_desc.elm_desc_str[e_desc.elm_desc_len] = '\0'; switch (e_ptr[j].elm_type) { case ELMTYP_DEVICE: @@ -853,7 +851,6 @@ show(int argc, char **argv __unused) */ break; } - free(e_desc.elm_desc_str); } if (prev_type != (elm_type_t)-1 && prev_type != ELMTYP_DEVICE && prev_type != ELMTYP_ARRAY_DEV) @@ -863,6 +860,7 @@ show(int argc, char **argv __unused) close(fd); } globfree(&g); + free(e_desc.elm_desc_str); xo_close_list("enclosures"); xo_close_container("sesutil"); xo_finish(); From nobody Mon Feb 13 16:08:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFq4l5bw5z3rMSH; Mon, 13 Feb 2023 16:08: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 4PFq4l55kbz3Jl9; Mon, 13 Feb 2023 16:08:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676304487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nOZ96H7ZNHZbYR4ClX6orsoi2p0RE/iP9vQ2O2KVF84=; b=bHeEIP8+s+pqz99h7WF72afDvA6ZhtsHU+Vf/pFuwNe4hpQdtshiNOjXXUfyiL7Kp9EdaA A+jhE8H2kgWR17AjGjchAR0BIx5G4XyOu33y6xfLuUgRWXAa76BrkHGbhRjBrpCiWvrmT0 tOG9dkZnQuIP8HHq0C83DeV1oscRC4Z4L7ShSrAOe/dYVmpZCFHE40Hb6xFYgXXPefKSoD vNxRFxHDI56aka0RGH9zC3ozdOuYV5C3CMqU6JP+BL9hnKLdAWvCbtUuyHK4b5dRyKN4lZ 7O0xFMzRyK90rWPkcCl5btmzzZ/rTsSNpd8XbygGwZb+QPKAIwwXxSGxo5N/nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676304487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nOZ96H7ZNHZbYR4ClX6orsoi2p0RE/iP9vQ2O2KVF84=; b=ZlCdqAnXgCtoLMioG/0PkvRBeb3iOuI9Ku73SMVCe+ABrioMgBmazFL9WNZFcNWQW5w7tv Bm8O38Y8RLM2NROQ22lZ0btvedNvT77e2G4qsqnBbc0+lynx7LLpT6kUKoxlCHJdaGOUXi t6qEDVQweAIHqgnLVTLtpuQaMcw+3FhNaVkt5c7hgqPqHZoPB50h4g8IWl+AheJR9lcvF4 4dEwc3dhvf40siDmYtDlcPGIGJPMXSysTSfp4WFVVYCf4suRQyBFvO/ahtlUoq2x+By2HX 0VNZPYHskX9NJtI4vO/x85Ydh+Yv3CuWiCjSIpx+PYU/I38MZAplw1eZ7PwurQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676304487; a=rsa-sha256; cv=none; b=ny3gnvgKbwfp5m8R4zsGjrrnWOHIcPTAEsCVFN2m8fvLqSdiXGpJL28zeT+8h6cl4N9//5 NXTxbqjNRLxla7+worZirwXQPaZ8fB4C7mFM7VUw5KQQGBLyBTqcvmmJQy5+Ld6iR8O0Gb uNF3IdPa0avjoM/ZEk1ybMfvGTi1X6MLFYjCyVK/Zx0U6ppZ622XPmWxFkr76G/i0gvKpm kCrQrk6jYCUHLPLnqcmKm23tIlnCyokoD17e1A+Vwg2d8qFZCt0W8j5G5tnnKfYovdsVIe hMW8pCZKeZXbxxiXWc9nKropk/zBTIkMUxzLLyzVKQg7/A8gamkK0yrX7giPGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFq4l47vDzPtN; Mon, 13 Feb 2023 16:08: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 31DG87rV026219; Mon, 13 Feb 2023 16:08:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DG875C026218; Mon, 13 Feb 2023 16:08:07 GMT (envelope-from git) Date: Mon, 13 Feb 2023 16:08:07 GMT Message-Id: <202302131608.31DG875C026218@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: 06c07e120332 - main - Complete removal of opt_compat.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 06c07e1203324bfe8ab4526c82dbb750864272d5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=06c07e1203324bfe8ab4526c82dbb750864272d5 commit 06c07e1203324bfe8ab4526c82dbb750864272d5 Author: Dmitry Chagin AuthorDate: 2023-02-13 16:07:38 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-13 16:07:38 +0000 Complete removal of opt_compat.h Since Linux emulation layer build options was removed there is no reason to keep opt_compat.h. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38548 MFC after: 2 weeks --- sys/amd64/amd64/trap.c | 1 - sys/conf/options | 1 - sys/i386/i386/trap.c | 1 - sys/modules/crypto/Makefile | 1 - sys/opencrypto/crypto.c | 1 - 5 files changed, 5 deletions(-) diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 39a2ef1d373f..28ee3a3b6959 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); */ #include "opt_clock.h" -#include "opt_compat.h" #include "opt_cpu.h" #include "opt_hwpmc_hooks.h" #include "opt_isa.h" diff --git a/sys/conf/options b/sys/conf/options index 3b2be66ba602..7855a2f3f20e 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -100,7 +100,6 @@ COMPAT_FREEBSD11 opt_global.h COMPAT_FREEBSD12 opt_global.h COMPAT_FREEBSD13 opt_global.h COMPAT_LINUXKPI opt_dontuse.h -_COMPAT_LINUX32 opt_compat.h # XXX: make sure opt_compat.h exists COMPILING_LINT opt_global.h CY_PCI_FASTINTR DEADLKRES opt_watchdog.h diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index f4f6e7109a16..d80b809eccb5 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); */ #include "opt_clock.h" -#include "opt_compat.h" #include "opt_cpu.h" #include "opt_hwpmc_hooks.h" #include "opt_isa.h" diff --git a/sys/modules/crypto/Makefile b/sys/modules/crypto/Makefile index b93f8d55c41c..a31a266d7e6d 100644 --- a/sys/modules/crypto/Makefile +++ b/sys/modules/crypto/Makefile @@ -98,7 +98,6 @@ SRCS += curve25519.c CFLAGS.curve25519.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT} SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h -SRCS += opt_compat.h SRCS += opt_ddb.h SRCS += cbc_mac.c SRCS += xform_cbc_mac.c diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index 0baa61c089d3..75d00ccb9832 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); * PURPOSE. */ -#include "opt_compat.h" #include "opt_ddb.h" #include From nobody Mon Feb 13 16:19:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFqKL4nMlz3rNkg; Mon, 13 Feb 2023 16:19: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 4PFqKL48G7z3MWT; Mon, 13 Feb 2023 16:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676305142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+nVB5L8ukv6KxfV0oo3EUQOAlUS5i21R3zgT2s24Bao=; b=sTu7Xgmzyob38zqqcWNpeCEUQCYucY5k/0XOny5bXO38li0MPSxcz/LqFATc3UH22LeqeS vhuFjf5hzkwaNkr8Ss/10TpzdVsWHSj4VDx9tN4/OH48on3B8eAPgKhPu6TMB1p5OZsMCv vNd1hzG8UIvgL4gigqW7mG/3d2uRTlQwugUJntniaWnEbe4AnTuSFVPVarFPn13znzkZjr yGquxi6JUcBOIgXu3w1JJ2v53gF+O74qPIi74NjfExu5M4fjBviADlu9pr9EQksbR5YgxB dsTVTtewxe4kd/gIF/jPYQM9oVDTR9ulM9YrAlTCXyGve9VW6IMN6HfhfSDJhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676305142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+nVB5L8ukv6KxfV0oo3EUQOAlUS5i21R3zgT2s24Bao=; b=PUsZ7J1Rjk9boqf2fNgZmhLIQmwo9YvbDpVjiXRfsytRcfqRVz4w8/Pvw6qPpjNnYAICvS EdUTX9ORY6BakRF9r6MUAFYmjdEgcJrJ+TUDd6nSHzMevxuO47yCqijtLgO6aKvvB9AAyE WkOzNL8CleyG43unLntXlZ8G5dRY9hqTBB6P8RfepqBkC8v1gdbl9nYlknNOz170iiDK+V Tl9lxRxSnGcyvL4jP24H5Vp+l6r8B5XcZ6XQBPF3jO3csCM0kAe+vMV4U7/n0yF90Jkdzc SVUNtQJq5QjqSB0J4xlmEVRLwKnFqVHWsjPy40gczI80p3gl8D/+P4frmZPJ/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676305142; a=rsa-sha256; cv=none; b=aK1xVHkBgJvXLMcmoOLeh/xj6fktABWG9o9bibSSu2cCSqPrmQOKlOkn7d9YHRYgOv+H4Q qVr3TD3WZAv45Oqx9n8xprokvO21A2apZ1cZ6aRJvA3Vw/sgAvy4tWu1xNfcPHLiadVHE6 IcsAOzT/vv6GuqOJzLipc8EjNGtn97oIXQhZwz9ZQGkuyv7t3PEhsVURepTyfkgDT55FAs I/zFz+byqDW9OMBoPpt9/c/i+raBDoYYgyZHDnwvkG9qvwv39c772defBe1+9WETUkZs8n /ylePS+/MT0rbF+6lP+U1uuT+WgJeBzH3nGN1unBYwoG/1nqGSyRoSbJGQ9o/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 4PFqKL3FW7zPdF; Mon, 13 Feb 2023 16:19: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 31DGJ2x0040729; Mon, 13 Feb 2023 16:19:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DGJ2EU040728; Mon, 13 Feb 2023 16:19:02 GMT (envelope-from git) Date: Mon, 13 Feb 2023 16:19:02 GMT Message-Id: <202302131619.31DGJ2EU040728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 4c163a548080 - main - Change "ctlstat -P"'s schema List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c163a5480809d0dc8b68dd00bf2ba7d882450f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4c163a5480809d0dc8b68dd00bf2ba7d882450f9 commit 4c163a5480809d0dc8b68dd00bf2ba7d882450f9 Author: Alan Somers AuthorDate: 2023-01-25 18:00:49 +0000 Commit: Alan Somers CommitDate: 2023-02-13 16:18:38 +0000 Change "ctlstat -P"'s schema It now reports stats separately for both ports and luns. Also, prohibit using both "-p" and "-P" at the same time. MFC after: 1 week Sponsored by: Axcient Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D38500 --- usr.bin/ctlstat/ctlstat.c | 226 +++++++++++++++++++++++++++++----------------- 1 file changed, 141 insertions(+), 85 deletions(-) diff --git a/usr.bin/ctlstat/ctlstat.c b/usr.bin/ctlstat/ctlstat.c index 50b9e3b1445b..d607ab9f4523 100644 --- a/usr.bin/ctlstat/ctlstat.c +++ b/usr.bin/ctlstat/ctlstat.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -137,6 +138,7 @@ struct ctlstat_context { struct cctl_portlist_data { int level; struct sbuf *cur_sb[32]; + int id; int lun; int ntargets; char *target; @@ -149,7 +151,8 @@ struct cctl_portlist_data { static void usage(int error); static int getstats(int fd, int *alloc_items, int *num_items, - struct ctl_io_stats **xstats, struct timespec *cur_time, int *time_valid); + struct ctl_io_stats **xstats, struct timespec *cur_time, int *time_valid, + bool ports); static int getcpu(struct ctl_cpu_stats *cpu_stats); static void compute_stats(struct ctl_io_stats *cur_stats, struct ctl_io_stats *prev_stats, @@ -168,7 +171,7 @@ usage(int error) static int getstats(int fd, int *alloc_items, int *num_items, struct ctl_io_stats **stats, - struct timespec *cur_time, int *flags) + struct timespec *cur_time, int *flags, bool ports) { struct ctl_get_io_stats get_stats; int more_space_count = 0; @@ -184,8 +187,8 @@ retry: memset(*stats, 0, get_stats.alloc_len); get_stats.stats = *stats; - if (ioctl(fd, (*flags & CTLSTAT_FLAG_PORTS) ? CTL_GET_PORT_STATS : - CTL_GET_LUN_STATS, &get_stats) == -1) + if (ioctl(fd, ports ? CTL_GET_PORT_STATS : CTL_GET_LUN_STATS, + &get_stats) == -1) err(1, "CTL_GET_*_STATS ioctl returned error"); switch (get_stats.status) { @@ -395,24 +398,33 @@ ctlstat_json(struct ctlstat_context *ctx) { printf("]}"); } -#define CTLSTAT_PROMETHEUS_LOOP(field) \ +#define CTLSTAT_PROMETHEUS_LOOP(field, collector) \ for (i = n = 0; i < ctx->cur_items; i++) { \ if (F_MASK(ctx) && bit_test(ctx->item_mask, \ (int)stats[i].item) == 0) \ continue; \ for (iotype = 0; iotype < CTL_STATS_NUM_TYPES; iotype++) { \ - int lun = stats[i].item; \ - if (lun >= targdata.ntargets) \ - errx(1, "LUN %u out of range", lun); \ - printf("iscsi_target_" #field "{" \ - "lun=\"%u\",target=\"%s\",type=\"%s\"} %" PRIu64 \ + int idx = stats[i].item; \ + /* \ + * Note that Prometheus considers a label value of "" \ + * to be the same as no label at all \ + */ \ + const char *target = ""; \ + if (strcmp(collector, "port") == 0 && \ + targdata.targets[idx] != NULL) \ + { \ + target = targdata.targets[idx]; \ + } \ + printf("iscsi_%s_" #field "{" \ + "%s=\"%u\",target=\"%s\",type=\"%s\"} %" PRIu64 \ "\n", \ - lun, targdata.targets[lun], iotypes[iotype], \ + collector, collector, \ + idx, target, iotypes[iotype], \ stats[i].field[iotype]); \ } \ } \ -#define CTLSTAT_PROMETHEUS_TIMELOOP(field) \ +#define CTLSTAT_PROMETHEUS_TIMELOOP(field, collector) \ for (i = n = 0; i < ctx->cur_items; i++) { \ if (F_MASK(ctx) && bit_test(ctx->item_mask, \ (int)stats[i].item) == 0) \ @@ -420,20 +432,29 @@ ctlstat_json(struct ctlstat_context *ctx) { for (iotype = 0; iotype < CTL_STATS_NUM_TYPES; iotype++) { \ uint64_t us; \ struct timespec ts; \ - int lun = stats[i].item; \ - if (lun >= targdata.ntargets) \ - errx(1, "LUN %u out of range", lun); \ + int idx = stats[i].item; \ + /* \ + * Note that Prometheus considers a label value of "" \ + * to be the same as no label at all \ + */ \ + const char *target = ""; \ + if (strcmp(collector, "port") == 0 && \ + targdata.targets[idx] != NULL) \ + { \ + target = targdata.targets[idx]; \ + } \ bintime2timespec(&stats[i].field[iotype], &ts); \ us = ts.tv_sec * 1000000 + ts.tv_nsec / 1000; \ - printf("iscsi_target_" #field "{" \ - "lun=\"%u\",target=\"%s\",type=\"%s\"} %" PRIu64 \ + printf("iscsi_%s_" #field "{" \ + "%s=\"%u\",target=\"%s\",type=\"%s\"} %" PRIu64 \ "\n", \ - lun, targdata.targets[lun], iotypes[iotype], us); \ + collector, collector, \ + idx, target, iotypes[iotype], us); \ } \ } \ static void -cctl_start_pelement(void *user_data, const char *name, const char **attr __unused) +cctl_start_pelement(void *user_data, const char *name, const char **attr) { struct cctl_portlist_data* targdata = user_data; @@ -448,9 +469,24 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr __unuse err(1, "%s: Unable to allocate sbuf", __func__); if (strcmp(name, "targ_port") == 0) { + int i = 0; + targdata->lun = -1; + targdata->id = -1; free(targdata->target); targdata->target = NULL; + while (attr[i]) { + if (strcmp(attr[i], "id") == 0) { + /* + * Well-formed XML always pairs keys with + * values in attr + */ + assert(attr[i + 1]); + targdata->id = atoi(attr[i + 1]); + } + i += 2; + } + } } @@ -486,25 +522,22 @@ cctl_end_pelement(void *user_data, const char *name) if (strcmp(name, "target") == 0) { free(targdata->target); targdata->target = str; - } else if (strcmp(name, "lun") == 0) { - targdata->lun = atoi(str); - free(str); } else if (strcmp(name, "targ_port") == 0) { - if (targdata->lun >= 0 && targdata->target != NULL) { - if (targdata->lun >= targdata->ntargets) { + if (targdata->id >= 0 && targdata->target != NULL) { + if (targdata->id >= targdata->ntargets) { /* * This can happen for example if there are - * holes in CTL's lunlist. + * targets with no LUNs. */ targdata->ntargets = MAX(targdata->ntargets * 2, - targdata->lun + 1); + targdata->id + 1); size_t newsize = targdata->ntargets * sizeof(char*); targdata->targets = rallocx(targdata->targets, newsize, MALLOCX_ZERO); } - free(targdata->targets[targdata->lun]); - targdata->targets[targdata->lun] = targdata->target; + free(targdata->targets[targdata->id]); + targdata->targets[targdata->id] = targdata->target; targdata->target = NULL; } free(str); @@ -514,7 +547,7 @@ cctl_end_pelement(void *user_data, const char *name) } static void -ctlstat_prometheus(int fd, struct ctlstat_context *ctx) { +ctlstat_prometheus(int fd, struct ctlstat_context *ctx, bool ports) { struct ctl_io_stats *stats = ctx->cur_stats; struct ctl_lun_list list; struct cctl_portlist_data targdata; @@ -522,6 +555,7 @@ ctlstat_prometheus(int fd, struct ctlstat_context *ctx) { char *port_str = NULL; int iotype, i, n, retval; int port_len = 4096; + const char *collector; bzero(&targdata, sizeof(targdata)); targdata.ntargets = ctx->cur_items; @@ -556,30 +590,23 @@ retry: } XML_ParserFree(parser); - /* - * NB: Some clients will print a warning if we don't set Content-Length, - * but they still work. And the data still gets into Prometheus. - */ - printf("HTTP/1.1 200 OK\r\n" - "Connection: close\r\n" - "Content-Type: text/plain; version=0.0.4\r\n" - "\r\n"); - - printf("# HELP iscsi_target_bytes Number of bytes\n" - "# TYPE iscsi_target_bytes counter\n"); - CTLSTAT_PROMETHEUS_LOOP(bytes); - printf("# HELP iscsi_target_dmas Number of DMA\n" - "# TYPE iscsi_target_dmas counter\n"); - CTLSTAT_PROMETHEUS_LOOP(dmas); - printf("# HELP iscsi_target_operations Number of operations\n" - "# TYPE iscsi_target_operations counter\n"); - CTLSTAT_PROMETHEUS_LOOP(operations); - printf("# HELP iscsi_target_time Cumulative operation time in us\n" - "# TYPE iscsi_target_time counter\n"); - CTLSTAT_PROMETHEUS_TIMELOOP(time); - printf("# HELP iscsi_target_dma_time Cumulative DMA time in us\n" - "# TYPE iscsi_target_dma_time counter\n"); - CTLSTAT_PROMETHEUS_TIMELOOP(dma_time); + collector = ports ? "port" : "lun"; + + printf("# HELP iscsi_%s_bytes Number of bytes\n" + "# TYPE iscsi_%s_bytes counter\n", collector, collector); + CTLSTAT_PROMETHEUS_LOOP(bytes, collector); + printf("# HELP iscsi_%s_dmas Number of DMA\n" + "# TYPE iscsi_%s_dmas counter\n", collector, collector); + CTLSTAT_PROMETHEUS_LOOP(dmas, collector); + printf("# HELP iscsi_%s_operations Number of operations\n" + "# TYPE iscsi_%s_operations counter\n", collector, collector); + CTLSTAT_PROMETHEUS_LOOP(operations, collector); + printf("# HELP iscsi_%s_time Cumulative operation time in us\n" + "# TYPE iscsi_%s_time counter\n", collector, collector); + CTLSTAT_PROMETHEUS_TIMELOOP(time, collector); + printf("# HELP iscsi_%s_dma_time Cumulative DMA time in us\n" + "# TYPE iscsi_%s_dma_time counter\n", collector, collector); + CTLSTAT_PROMETHEUS_TIMELOOP(dma_time, collector); for (i = 0; i < targdata.ntargets; i++) free(targdata.targets[i]); @@ -779,6 +806,45 @@ ctlstat_standard(struct ctlstat_context *ctx) { } } +static void +get_and_print_stats(int fd, struct ctlstat_context *ctx, bool ports) +{ + struct ctl_io_stats *tmp_stats; + int c; + + tmp_stats = ctx->prev_stats; + ctx->prev_stats = ctx->cur_stats; + ctx->cur_stats = tmp_stats; + c = ctx->prev_alloc; + ctx->prev_alloc = ctx->cur_alloc; + ctx->cur_alloc = c; + c = ctx->prev_items; + ctx->prev_items = ctx->cur_items; + ctx->cur_items = c; + ctx->prev_time = ctx->cur_time; + ctx->prev_cpu = ctx->cur_cpu; + if (getstats(fd, &ctx->cur_alloc, &ctx->cur_items, + &ctx->cur_stats, &ctx->cur_time, &ctx->flags, ports) != 0) + errx(1, "error returned from getstats()"); + + switch(ctx->mode) { + case CTLSTAT_MODE_STANDARD: + ctlstat_standard(ctx); + break; + case CTLSTAT_MODE_DUMP: + ctlstat_dump(ctx); + break; + case CTLSTAT_MODE_JSON: + ctlstat_json(ctx); + break; + case CTLSTAT_MODE_PROMETHEUS: + ctlstat_prometheus(fd, ctx, ports); + break; + default: + break; + } +} + int main(int argc, char **argv) { @@ -787,7 +853,6 @@ main(int argc, char **argv) int fd, retval; size_t size; struct ctlstat_context ctx; - struct ctl_io_stats *tmp_stats; /* default values */ retval = 0; @@ -890,10 +955,11 @@ main(int argc, char **argv) if (ctx.mode == CTLSTAT_MODE_PROMETHEUS) { if ((count != -1) || (waittime != 1) || + (F_PORTS(&ctx)) || /* NB: -P could be compatible with -t in the future */ (ctx.flags & CTLSTAT_FLAG_TOTALS)) { - errx(1, "Option -P is exclusive with -c, -w, and -t"); + errx(1, "Option -P is exclusive with -p, -c, -w, and -t"); } count = 1; } @@ -908,37 +974,27 @@ main(int argc, char **argv) if ((fd = open(CTL_DEFAULT_DEV, O_RDWR)) == -1) err(1, "cannot open %s", CTL_DEFAULT_DEV); + if (ctx.mode == CTLSTAT_MODE_PROMETHEUS) { + /* + * NB: Some clients will print a warning if we don't set + * Content-Length, but they still work. And the data still + * gets into Prometheus. + */ + printf("HTTP/1.1 200 OK\r\n" + "Connection: close\r\n" + "Content-Type: text/plain; version=0.0.4\r\n" + "\r\n"); + } + for (;count != 0;) { - tmp_stats = ctx.prev_stats; - ctx.prev_stats = ctx.cur_stats; - ctx.cur_stats = tmp_stats; - c = ctx.prev_alloc; - ctx.prev_alloc = ctx.cur_alloc; - ctx.cur_alloc = c; - c = ctx.prev_items; - ctx.prev_items = ctx.cur_items; - ctx.cur_items = c; - ctx.prev_time = ctx.cur_time; - ctx.prev_cpu = ctx.cur_cpu; - if (getstats(fd, &ctx.cur_alloc, &ctx.cur_items, - &ctx.cur_stats, &ctx.cur_time, &ctx.flags) != 0) - errx(1, "error returned from getstats()"); - - switch(ctx.mode) { - case CTLSTAT_MODE_STANDARD: - ctlstat_standard(&ctx); - break; - case CTLSTAT_MODE_DUMP: - ctlstat_dump(&ctx); - break; - case CTLSTAT_MODE_JSON: - ctlstat_json(&ctx); - break; - case CTLSTAT_MODE_PROMETHEUS: - ctlstat_prometheus(fd, &ctx); - break; - default: - break; + bool ports; + + if (ctx.mode == CTLSTAT_MODE_PROMETHEUS) { + get_and_print_stats(fd, &ctx, false); + get_and_print_stats(fd, &ctx, true); + } else { + ports = ctx.flags & CTLSTAT_FLAG_PORTS; + get_and_print_stats(fd, &ctx, ports); } fprintf(stdout, "\n"); From nobody Mon Feb 13 17:15:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFrZb4L6lz3rVCd; Mon, 13 Feb 2023 17:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFrZb3s0Cz3mcq; Mon, 13 Feb 2023 17:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676308535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j2uNWKZS6gwMFmESi8IeLHVawv/v4VxVhgNc1qLU2M8=; b=u33UP6+VnOC0iHupF8lCrrG6DMVcCtqI8LM8DVojhINcbWt63nCe0g1MSZt+r3/gRG8BR3 8z31LEONSvWT19A8KRBqzkFGLiiM4axWq7W9dfAlZ5Q6HpLWO3kBbGAX4fgZhX673qkcZP x6+YQGWgT57w4GTo6sOzWpEdXiUp6XtzXLkiIJiWp6AKruWJVgxhmW2vXF88V/dfxWwQA5 sgiWUw3r5R7GoQr85ROKroLQZ+eTo2vdwF5vpuxHKNlHf/8WMetSyURxywaJeiqN8A4Iv9 U7lZU56dJAyPmkUmWzY+JtXCjoXlz5eUtUn7lxnhDKSYS80NrpuMFpxQ9th8tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676308535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j2uNWKZS6gwMFmESi8IeLHVawv/v4VxVhgNc1qLU2M8=; b=DzelDL4alUwh9DEUY/xh6M8O7E1mK/gD0xIKHNZShdd5i8NGsjVfAYibE+izAtG1/fiLZe qR4w5DB4tFe61/WSIixjH/AEpBAi/z/14y0pbvkioHkEjUDT+k4VbYL3c/OSFo8CXVPUf7 Z6vVkMS8eAmAbXEBNuE1UoY8Vmou/WM/62bU3N+PwqPr91opZM3dT2HT2V+kUps8aU+Q1Q Cxi5EA6Ee2KcYk+ySkF1dsdi59oPIbMlYYb1Mb7cxHg5BvRzQufroR5IqJ760WspHPDFUo yjv/r83atfMDLMpjJCgWxqNFsMeddmHSrw/6d0uRodqUUVLA40SQ7Ph24V01Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676308535; a=rsa-sha256; cv=none; b=XYjUOlBTspoUmH50O3eZhCIzQ29BRtbJbSS/GVOUrn231zs1sXrBqxvQ8/w3e2yco0nZLZ 4AWOxIwssJK77Yy3wE6+PDtbuivysf5aQLWg7r2myzEtOq2UfEhIYeibrOOUjqX7onPI6k tcMks7u1+dfWDorVGhrHyOzGxy09V01jyPSclssSvwpjF5ff6+F7D4Yhh7x9A/hhgeMrh2 rTWFjspjLbJ8yAZ1X75NiP0wjT6aDOlDnbe69goPDw1zUWejbmbqiZxy7o97Z23nJkbHTt YnPokBkaHrrWzzAJqjgfjNlTPExabGxoCn19LeU/uc8CcdkjsN23X51dh8YTZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFrZb2vCJzQp9; Mon, 13 Feb 2023 17: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 31DHFZrc025864; Mon, 13 Feb 2023 17: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 31DHFZUE025863; Mon, 13 Feb 2023 17:15:35 GMT (envelope-from git) Date: Mon, 13 Feb 2023 17:15:35 GMT Message-Id: <202302131715.31DHFZUE025863@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b80185c26724 - main - zlib: Use NO_WDEPRECATED_NON_PROTOTYPE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b80185c267243a57bbc3e03fd2b47680672d6050 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b80185c267243a57bbc3e03fd2b47680672d6050 commit b80185c267243a57bbc3e03fd2b47680672d6050 Author: Warner Losh AuthorDate: 2023-02-13 16:15:58 +0000 Commit: Warner Losh CommitDate: 2023-02-13 16:59:51 +0000 zlib: Use NO_WDEPRECATED_NON_PROTOTYPE Also add it to kern.mk so it's available for module builds. Sponsored by: Netflix Noticed by: mjg Fixes: b9f235ba3178 Differential Revision: https://reviews.freebsd.org/D38550 --- sys/conf/kern.mk | 1 + sys/modules/zlib/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index bdceeba3a5b3..2668b7e5296e 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -53,6 +53,7 @@ CWARNEXTRA+= -Wno-error=array-parameter CWARNEXTRA+= -Wno-error=deprecated-non-prototype CWARNEXTRA+= -Wno-error=strict-prototypes CWARNEXTRA+= -Wno-error=unused-but-set-variable +NO_WDEPRECATED_NON_PROTOTYPE=-Wno-deprecated-non-prototype .endif .endif # clang diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile index 178d3a3f7ab7..b5a55b9812bb 100644 --- a/sys/modules/zlib/Makefile +++ b/sys/modules/zlib/Makefile @@ -25,6 +25,6 @@ CWARNFLAGS.crc32.c+=${NO_WSTRICT_PROTOTYPES} # crc32.c:586 CWARNFLAGS.trees.c+=${NO_WSTRICT_PROTOTYPES} # trees.c:232 CWARNFLAGS.zutil.c+=${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32 -CWARNFLAGS+=-Wno-deprecated-non-prototype - .include + +CWARNFLAGS+=${NO_WDEPRECATED_NON_PROTOTYPE} # https://github.com/madler/zlib/issues/633 From nobody Mon Feb 13 17:52:25 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFsP56LrPz3rYSQ; Mon, 13 Feb 2023 17:52: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 4PFsP55QZJz3sZD; Mon, 13 Feb 2023 17:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676310745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U3vgnugvT1ILNsiHFsbe0is8xhurjI1xiUYpgkYu+mM=; b=KjO7udnsHGzm+GSw9AgAQUsXVZu2+6eiy167Ks9B9olFCxOd59eH3wjAKvY20346us8lY4 kkHiIW+ejin6jl0vcz2P3xMRCMcRDLdvl0z2dD1TtrKcK2i/KDN8PYUmjH+jQKbNNF7/dw 6J5Gy3C3UqPRnCPRzL2H84Nhk5qYF65P5thSwXvFVmnP/O7WtcI7ha8F4Q0BTJm+uC74MY Si0Z0sixdoyN9Ly4MlNumGaGKHYqEHrer3EB4bTIvgzoD643aMwBPco2bgI0KRQxciCeIg pNICrf2RMUWPECLdyIw3sx5yaqo4+6en8C2SbUGit/fSGmNTYeiWfNvHIxUE3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676310745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U3vgnugvT1ILNsiHFsbe0is8xhurjI1xiUYpgkYu+mM=; b=we0jQb2VfEthN+KRIkaNNtqk+r7YRWqLhGIOqA5j0TH5ZTePpuAYGEczL4MUT9waFaB/sy 5LnQNMnW2O3cmicgmMg7X+rcz1fux4+utVchRGYp05ES/ZXHEZeU6Zt/ThncM3QzsUp4cI 3kbwfChxCL7MJDQZXy4uxPoiR8tI0g+x/qO1NRoc/QyyZsU5vAn9s2mmgaMQcqjP28yumh hPyO74sDXen8Dd7B/d52x/h24J0SGdCTOe6qWeoUqS3Ma3M0x7AfG0zz/LNlW9KquKQ8Lk LI3w3LXnuHRqQdk7jqzZp0ZLT/j372nlBkQwtvKLUonSWgiLYdhXQbxTAvrung== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676310745; a=rsa-sha256; cv=none; b=AoOShm962VTsPUbqHt9OFMLnNt0U9eOrRuaxnlr5B0rsM9KlOWuyXxkHi+fCBheJH+xKVS nrTly/iwU4RIcGWeeyCKRUFEOf5rmErC1L13hEt56jn41324OvN4cZH1hTtgGJmOkZMc4Y pYHxfTFcWcKv0yOsai3+e0uxrtwl9g13ODeElyJ3TzyjHdlddUYurUatbux3KbvRaO4Zql pGnXsfeDjc3yHnIynbnog7JHl8/KY0lfMED5QJ7cd/nKluTD453VBRetCgfmxYiqFAucTN 1RzbMDj/7EzkTqGVzxG/UyYu52ds0vDo29BGasLkjegckbLhZlLzC/vekEO0XA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFsP54VwFzSMw; Mon, 13 Feb 2023 17:52: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 31DHqPnI082088; Mon, 13 Feb 2023 17:52:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DHqP7m082087; Mon, 13 Feb 2023 17:52:25 GMT (envelope-from git) Date: Mon, 13 Feb 2023 17:52:25 GMT Message-Id: <202302131752.31DHqP7m082087@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 99553344e984 - main - ofwbus: trim includes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99553344e984929dd9f409ed30532902bc85791d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=99553344e984929dd9f409ed30532902bc85791d commit 99553344e984929dd9f409ed30532902bc85791d Author: Mitchell Horne AuthorDate: 2023-02-13 17:42:56 +0000 Commit: Mitchell Horne CommitDate: 2023-02-13 17:45:01 +0000 ofwbus: trim includes Nothing in the file today relies on these. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D38491 --- sys/dev/ofw/ofwbus.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c index 5ea0ba313353..a466da546579 100644 --- a/sys/dev/ofw/ofwbus.c +++ b/sys/dev/ofw/ofwbus.c @@ -39,16 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include -#ifdef INTRNG -#include -#endif - -#include -#include #include #include From nobody Mon Feb 13 17:52:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFsP71Rnbz3rYL0; Mon, 13 Feb 2023 17: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 4PFsP66fZBz3srG; Mon, 13 Feb 2023 17:52:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676310746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zu827UAFCDJZ2QyysD17yyQmu723E55EWGkIYoQcOzM=; b=b2bCMO1nabyiyL0qTsr6NSPhRtq6xRL/sdi2Am+VQIwxt7TZ6SmmHAAbARzVUOnp9B2p4N bSMZY7iIXUt3dL2n8mjq9g/Kie9/xhXsuYY20b7Lbe1zni8JVhw3MXF1o3gdzSb2GqtoRy 85/ogZeS7ERNw0WZgdUDgBlnDS1aiZlNxn5qZCiBlVnRsDLL/nu5i6qZl61AQ6CVFVuTlV 4oBAEB3enkxOa4+RZTpHsUZar1JZ1ELPcbMxavQmfgLwzska5CflqIjK52hsJi01bFBThT kW+aIhFl+e7d5/65weJV32XoCTGfzz2mRlLRinJV/7pdwGCmrVIVDq6eIk75KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676310746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zu827UAFCDJZ2QyysD17yyQmu723E55EWGkIYoQcOzM=; b=fDX9XxuVocMAJxibSGKUprVLz0uJ7WtYlOrC5hw1v0/4s2dCrjXu6zL94vcLf/D6ng3F41 LPJ+Ht31h+8ygKXerCVSyd16S3GxwztlBmXEi06FkR6pFNrG/vAOpqcAb1Znb96A2g/ToG R6tRwHckKd1bfayY1jU1hWFJktmQmlOxX9q6frveWB9ovAD+D1YfIZ1hxdTP8NL2gS9p4Y x3Mkr824/6vMWu4n5HKSBgTtSa2i6KhnYDAe9f/CGy1IXd6kP9c28SNyfImhLEJ10Wh9MJ LXEPMyka5AwusDN7p41X//o1yHGbaT9I/CTcVhR6mInO7zd3PI7flB6X9TX3Uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676310746; a=rsa-sha256; cv=none; b=hdI89sKmw4r0W6zLt4NzZpokd/G9e8TLfkhUg8PPbWFNB8fGrWGSjPI+Iblkoof6ap12Sx VZx4mmfwZyc+kLJlXDKCEbETdfJaGQSDovcMV6ffkkol7shdRm4bxEwkPQ9hSK0h/ADM8h LyZ6hz3gQth/+rfoCrFUaI4zxBihBR9ao2XER9HVW4egHk11rOcuy/G/70yWT9PhaxyaRi cKRi7FDs58VZxejBtqvlrIjvI2oRRc3gyKr7TCSWVRx6A4uhJJ0ErKhqevY8WGkU/V/xNB bKhjkmZZ/IeOAcO6stIT48LeYWVJl7YEUEwdOerEmPZOiW2wqNurxCjBPfpEGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFsP65BgGzS99; Mon, 13 Feb 2023 17:52: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 31DHqQQZ082112; Mon, 13 Feb 2023 17:52:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DHqQrC082111; Mon, 13 Feb 2023 17:52:26 GMT (envelope-from git) Date: Mon, 13 Feb 2023 17:52:26 GMT Message-Id: <202302131752.31DHqQrC082111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 53d5e65eead0 - main - ofwbus: remove arm64 ifdefs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53d5e65eead0f713c5e256018d46edbec0a96c11 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=53d5e65eead0f713c5e256018d46edbec0a96c11 commit 53d5e65eead0f713c5e256018d46edbec0a96c11 Author: Mitchell Horne AuthorDate: 2023-02-13 17:43:25 +0000 Commit: Mitchell Horne CommitDate: 2023-02-13 17:45:01 +0000 ofwbus: remove arm64 ifdefs Rather than using the DEVICE_IDENTIFY method, let's have other ofwbus-using platforms add ofwbus0 explicitly in nexus, like arm64. This gives them the same flexibility, e.g. if riscv starts supporting ACPI, and cleans up the #ifdefs. We were doing this already on riscv, but adjust the 'order' parameters. Reviewed by: andrew, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38492 --- sys/arm/arm/nexus.c | 5 ++++- sys/dev/ofw/ofwbus.c | 25 ++----------------------- sys/powerpc/powerpc/nexus.c | 4 ++++ sys/riscv/riscv/nexus.c | 10 +++++++--- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index a2e043ff7c31..0cd960ec3682 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -182,8 +182,11 @@ nexus_attach(device_t dev) if (rman_init(&irq_rman) || rman_manage_region(&irq_rman, 0, ~0)) panic("nexus_attach irq_rman"); + /* First, add ofwbus0. */ + device_add_child(dev, "ofwbus", 0); + /* - * First, deal with the children we know about already + * Next, deal with the children we know about already. */ bus_generic_probe(dev); bus_generic_attach(dev); diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c index a466da546579..cc8c66170cdb 100644 --- a/sys/dev/ofw/ofwbus.c +++ b/sys/dev/ofw/ofwbus.c @@ -54,12 +54,10 @@ __FBSDID("$FreeBSD$"); * The ofwbus (which is a pseudo-bus actually) iterates over the nodes that * hang from the Open Firmware root node and adds them as devices to this bus * (except some special nodes which are excluded) so that drivers can be - * attached to them. + * attached to them. There should be only one ofwbus in the system, added + * directly as a child of nexus0. */ -#ifndef __aarch64__ -static device_identify_t ofwbus_identify; -#endif static device_probe_t ofwbus_probe; static device_attach_t ofwbus_attach; static bus_alloc_resource_t ofwbus_alloc_resource; @@ -67,9 +65,6 @@ static bus_release_resource_t ofwbus_release_resource; static device_method_t ofwbus_methods[] = { /* Device interface */ -#ifndef __aarch64__ - DEVMETHOD(device_identify, ofwbus_identify), -#endif DEVMETHOD(device_probe, ofwbus_probe), DEVMETHOD(device_attach, ofwbus_attach), @@ -87,28 +82,12 @@ EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbus_driver, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(ofwbus, 1); -#ifndef __aarch64__ -static void -ofwbus_identify(driver_t *driver, device_t parent) -{ - - /* Check if Open Firmware has been instantiated */ - if (OF_peer(0) == 0) - return; - - if (device_find_child(parent, "ofwbus", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "ofwbus", -1); -} -#endif - static int ofwbus_probe(device_t dev) { -#ifdef __aarch64__ if (OF_peer(0) == 0) return (ENXIO); -#endif device_set_desc(dev, "Open Firmware Device Tree"); return (BUS_PROBE_NOWILDCARD); diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index 2e756782d47d..c0d4f8396cfa 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -146,6 +146,10 @@ nexus_attach(device_t dev) rman_manage_region(&mem_rman, 0, BUS_SPACE_MAXADDR) != 0) panic("%s: failed to set up rmans.", __func__); + /* Add ofwbus0. */ + device_add_child(dev, "ofwbus", 0); + + /* Now, probe children. */ bus_generic_probe(dev); bus_generic_attach(dev); diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c index ae0bfe388484..33720475844f 100644 --- a/sys/riscv/riscv/nexus.c +++ b/sys/riscv/riscv/nexus.c @@ -165,9 +165,13 @@ nexus_attach(device_t dev) if (rman_init(&irq_rman) || rman_manage_region(&irq_rman, 0, ~0)) panic("nexus_attach irq_rman"); - nexus_add_child(dev, 8, "timer", 0); - nexus_add_child(dev, 9, "rcons", 0); - nexus_add_child(dev, 10, "ofwbus", 0); + /* + * Add direct children of nexus. Devices will be probed and attached + * through ofwbus0. + */ + nexus_add_child(dev, 0, "timer", 0); + nexus_add_child(dev, 1, "rcons", 0); + nexus_add_child(dev, 2, "ofwbus", 0); bus_generic_probe(dev); bus_generic_attach(dev); From nobody Mon Feb 13 17:52:27 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFsP83RCQz3rYR7; Mon, 13 Feb 2023 17: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 4PFsP807kWz3srY; Mon, 13 Feb 2023 17: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=1676310748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y7W5RiSsqc2VVLoZuTUL242bNFgQiCfdq9ZNWTK+g1E=; b=ewcMQYh+Zr+eVL3Np/9/vAs2jmAH0b3CdN8lnG59c+IWaMshvpd+vZtyRztmgNS/KOoCmd C23sFmpyZgT7eCFEsB714VFMjOht6PDTuKtZzTyB5a1rNqcmElleoHgiMXmwDfMI7XdX1o mnF7fiBQu/sAjE2vmw6xPdQtgbwyRw66BxUZP7lyyFpyV0pjka78Yu0+1KXIqkON9weqrP WytbhubbECDG/9yBTEb14zJ1m5MwcdVHEU2qLslydK2++E7+U/SgRdAjAH9JGCmYCrgWSs uUT3XZUiJQTxGyHjMM82gQOvqhL4w0WAh4DEC1AiUbEcrymBUlGsaSgf8oc3cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676310748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y7W5RiSsqc2VVLoZuTUL242bNFgQiCfdq9ZNWTK+g1E=; b=Ta3WCfDhKYwQLpHSKC/KV6WF0xzX+JCghNosDzZjnWUn05hESMT2Atm1I1EJQbSkaQI0ND tSMSkHzOEtDUQTFqc7UwmCwKaTG1OxAWZnP5BTAE8L7nixH6LOr+h+2Qyu8HEkm/e7rbA2 xUj6NDiR7cI6/E+4auKeKpEMrINoqZ9Fin7Omsyzi+Z/tlEaa3gzUG+q39FQq94ab441a4 1IiyfUxwotKkJOOos5fNH9zugux9iJblci+33JL6n8RQI5ZSLZo8Zrw1cHz3t58cDFWZCo 6xeIJub2gTaYpIPy28SqRMSJOAyYTL3V9zp575QHaxOR2bHPxnog0ZWxj317Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676310748; a=rsa-sha256; cv=none; b=SvYqpeEry/eTQnDKY2YaTmVHx9Xc9GX4nYH65uXGDTBeFD8biGyEUzMZdBIsw4IMMY60hS A2Z46NCacpYTyKaDMzFkh2CS8utWj/qJB0wglJ+Py/pNx9KNxlT6sVF3JHufhIldNlUvRR +yDP3SGePbD/iw9xAw1KpTwG1A1CUxukxmHLTc8YALrUrNsxvQJrZP+iYPI3CQ9Aofr3Tm MIS08bYeZ5oKBlBVdywazeFSjfZPzRsPj03BRk56VjanTbBSF2tg0mgsdSnwX9+tTQAPr5 ya5NHllaaKaWNV1DAcOnYzlZYJfKG86VsOKTOiyfR0Ci1rQjsXP97wftaeM0JA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFsP767KwzS9B; Mon, 13 Feb 2023 17: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 31DHqRdA082145; Mon, 13 Feb 2023 17: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 31DHqRAB082144; Mon, 13 Feb 2023 17:52:27 GMT (envelope-from git) Date: Mon, 13 Feb 2023 17:52:27 GMT Message-Id: <202302131752.31DHqRAB082144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: afca197f5240 - main - ofwbus: only allow unit number zero List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: afca197f5240ce2c2c7abfe5c9fbc50ba55f178b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=afca197f5240ce2c2c7abfe5c9fbc50ba55f178b commit afca197f5240ce2c2c7abfe5c9fbc50ba55f178b Author: Mitchell Horne AuthorDate: 2023-02-13 17:44:03 +0000 Commit: Mitchell Horne CommitDate: 2023-02-13 17:45:01 +0000 ofwbus: only allow unit number zero ofwbus has always been the root of attachment for OFW/FDT platforms. It may have simplebus children, but we expect only one instance of the ofwbus driver, added directly by nexus. We may as well ensure this remains the case. Reviewed by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38493 --- sys/dev/ofw/ofwbus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c index cc8c66170cdb..80d013cd06ee 100644 --- a/sys/dev/ofw/ofwbus.c +++ b/sys/dev/ofw/ofwbus.c @@ -89,6 +89,11 @@ ofwbus_probe(device_t dev) if (OF_peer(0) == 0) return (ENXIO); + /* Only one instance of ofwbus. */ + if (device_get_unit(dev) != 0) + panic("ofwbus added with non-zero unit number: %d\n", + device_get_unit(dev)); + device_set_desc(dev, "Open Firmware Device Tree"); return (BUS_PROBE_NOWILDCARD); } From nobody Mon Feb 13 18:06:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFsjs3gx8z3rZty; Mon, 13 Feb 2023 18:06: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 4PFsjs2vtJz3w1C; Mon, 13 Feb 2023 18:06:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676311617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9yyPBdIfORxmlMUFlHLkDz/YQIDVvzNhp450wn7non0=; b=UVcBLiVX4uajM3+VpWlxYk6BF4/PDMRu6cO1Od3YoylxURmMNG6xzweO4klYTtpNB7RGmH jQw8+2yaQUaJm8iVUo46L3gpanbyT202tIj8/+eXiIP1q1e0zXMBRCqchHc7dvf4OjlmlG xE2weSqjtOijqVDhrBnFMoUrmeGdbfcZG4KpRkbq7Kww9iVUq2mFDJxhv84d+aFGScP0qM e1++Kz2BkD/21cS1en9POPUaATpHw6xlbUtZM3ikseyuN9gjeVJ9Ch4UIFNA0zxdnFsZAw s8X0vQ/L7OwgIirKuaohHHTE4RxT0L40+bnUbbd1hs3ZnQ9KHA/m/OJD74+Ipw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676311617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9yyPBdIfORxmlMUFlHLkDz/YQIDVvzNhp450wn7non0=; b=ZekuBwlBZPwsZOE+AAG+GAv1O01qqGj4Ngwx1WkLBK3GUhow2T3UNG2se+6S2+Os2s1w88 eLxYf3jOquuIfaxrBZxTtS9IzcZXhVGR6XrxzegYOxuVxxdwgvvYDse19dsvMktZKphTET x1qaOuK+l1pxIYW5pUS7SuS1itcE3vwYGwjXYC/+NRnIypfBxIQI1mbpeND5PGiXNcmsnA ht8zD8TULBE0BcBkmu5ilS2bW1iMhLvcLwFpgBb+BqGCKNE4/UsiCffhWd7af1ODieeOzt RTsem6+B2SkvhG46phXKvD//G0ffS5/XWqDaBZnNcQYcWQOXAiRzNj5rd8xVNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676311617; a=rsa-sha256; cv=none; b=D5I8qAwVwyLXyBwIW2Lidn6wTws+tzg5NICm/nCJaEPM36WmUaf7cZle3sMDtXNf7HiKfm gUCuhxIDl8iweAhVZAEqD4/4ubnPC0JnWT29CLULmOqwAGANMNjdSAyCsWuQV8HVPc7GoJ io5TJl52fRwt7NNRj5WpT0DCvaecgNS/FIkWrn5aXJby7wKte+0hMbiS+iBraM3C9EyLlv CT8mAMb3aT53/AO3+nx+mP3eIV5fX2St7+aD4r34nQlxXAiGOVHaRhb4YF2gq4fm5h0LSU /QfaeixKZB9thUhv44rk5MyC63Ovw2XXn1TtuI5cLfyPKfnLj0M2mr2m3PCtRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFsjs21tzzS7L; Mon, 13 Feb 2023 18:06: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 31DI6v3E097604; Mon, 13 Feb 2023 18:06:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DI6vqF097603; Mon, 13 Feb 2023 18:06:57 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:06:57 GMT Message-Id: <202302131806.31DI6vqF097603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: ec6b2822188a - main - ipfilter: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec6b2822188a8103807b5eb5d70128c1ae2e9c6d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ec6b2822188a8103807b5eb5d70128c1ae2e9c6d commit ec6b2822188a8103807b5eb5d70128c1ae2e9c6d Author: Mateusz Guzik AuthorDate: 2023-02-13 18:05:57 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:05:57 +0000 ipfilter: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 6 ++---- sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_htable.c | 4 +--- sys/netpfil/ipfilter/netinet/ip_state.c | 4 +--- sys/netpfil/ipfilter/netinet/mlfk_ipl.c | 16 ++++++++-------- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 0dfc23d3dd1f..95c8b73e6388 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -924,8 +924,7 @@ bad: int -ipf_verifysrc(fin) - fr_info_t *fin; +ipf_verifysrc(fr_info_t *fin) { struct nhop_object *nh; @@ -1010,8 +1009,7 @@ ipf_ifpaddr(ipf_main_softc_t *softc, int v, int atype, void *ifptr, u_32_t -ipf_newisn(fin) - fr_info_t *fin; +ipf_newisn(fr_info_t *fin) { u_32_t newiss; newiss = arc4random(); diff --git a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c index b305094e9704..fff99c8c5b33 100644 --- a/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/netpfil/ipfilter/netinet/ip_ftp_pxy.c @@ -266,9 +266,7 @@ ipf_p_ftp_setpending(ipf_main_softc_t *softc, ftpinfo_t *ftp) void -ipf_p_ftp_del(softc, aps) - ipf_main_softc_t *softc; - ap_session_t *aps; +ipf_p_ftp_del(ipf_main_softc_t *softc, ap_session_t *aps) { ftpinfo_t *ftp; diff --git a/sys/netpfil/ipfilter/netinet/ip_htable.c b/sys/netpfil/ipfilter/netinet/ip_htable.c index acdd441e0476..3e67242f3624 100644 --- a/sys/netpfil/ipfilter/netinet/ip_htable.c +++ b/sys/netpfil/ipfilter/netinet/ip_htable.c @@ -177,9 +177,7 @@ ipf_htable_soft_destroy(ipf_main_softc_t *softc, void *arg) /* Initialise the hash table ready for use. */ /* ------------------------------------------------------------------------ */ static int -ipf_htable_soft_init(softc, arg) - ipf_main_softc_t *softc; - void *arg; +ipf_htable_soft_init(ipf_main_softc_t *softc, void *arg) { ipf_htable_softc_t *softh = arg; diff --git a/sys/netpfil/ipfilter/netinet/ip_state.c b/sys/netpfil/ipfilter/netinet/ip_state.c index 463416f454a9..2e6913db8f88 100644 --- a/sys/netpfil/ipfilter/netinet/ip_state.c +++ b/sys/netpfil/ipfilter/netinet/ip_state.c @@ -4551,9 +4551,7 @@ ipf_checkicmp6matchingstate(fr_info_t *fin) /* Initialise the array of timeout queues for TCP. */ /* ------------------------------------------------------------------------ */ void -ipf_sttab_init(softc, tqp) - ipf_main_softc_t *softc; - ipftq_t *tqp; +ipf_sttab_init(ipf_main_softc_t *softc, ipftq_t *tqp) { int i; diff --git a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c index aa55ef2d8aec..6d4ec5e5a408 100644 --- a/sys/netpfil/ipfilter/netinet/mlfk_ipl.c +++ b/sys/netpfil/ipfilter/netinet/mlfk_ipl.c @@ -542,14 +542,14 @@ ipfclose(dev_t dev, int flags) * called during packet processing and cause an inconsistancy to appear in * the filter lists. */ -static int ipfread(dev, uio, ioflag) - int ioflag; #ifdef __FreeBSD__ - struct cdev *dev; +static int ipfread(struct cdev *dev, struct uio *uio, int ioflag) #else +static int ipfread(dev, uio, ioflag) + int ioflag; dev_t dev; -#endif struct uio *uio; +#endif { int error; int unit = GET_MINOR(dev); @@ -585,14 +585,14 @@ static int ipfread(dev, uio, ioflag) * called during packet processing and cause an inconsistancy to appear in * the filter lists. */ -static int ipfwrite(dev, uio, ioflag) - int ioflag; #ifdef __FreeBSD__ - struct cdev *dev; +static int ipfwrite(struct cdev *dev, struct uio *uio, int ioflag) #else +static int ipfwrite(dev, uio, ioflag) + int ioflag; dev_t dev; -#endif struct uio *uio; +#endif { int error; From nobody Mon Feb 13 18:10:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFsnt4dp7z3rbP0; Mon, 13 Feb 2023 18:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFsnt49q8z3wg3; Mon, 13 Feb 2023 18:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676311826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tc+18dZRKAD9TY8xPfMq8fZ9E7TnijLcrYEujwHwVmM=; b=u+MHlf9hvyJSoRzuP5z5jhSy9xorbzsxY7DRNZsoTjvLAIJD9b2fZKTWX7MkEOaLKL6nni IrmqzLsHZCx3pMWetUTk8lQ2uWkVoq97sDTgxXkzOlJATc12bhkH9mc2hB3gZogyLqsOAy 2dZp6XvIIlNxVQQs0lzG2msymMz5dm8BE1lGXYdNpmMRKlDWEghpzvR8uUeu8jrNsQ+u1i V6xCQiwXv2l34N2pNiwpkmAA9HNwinDXlKyhAfXDMqao7FhdMm5z/wudhkzcCf/j9RKaDD l1+24ldUGTu1a85Ui6I24Ud1oNe1X3FPAQauMYwsX8FjT8nMJJdZuAVvUSLsyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676311826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tc+18dZRKAD9TY8xPfMq8fZ9E7TnijLcrYEujwHwVmM=; b=MYua4JD3sIpvoF8yFhDPYmPRkq8WooiXN9lFE/A1HlT0o57lmuoxzp38721r0X8a3XB25Y tEbNWuIHQ9YvsmmmbAcBUR9PGpvy7+XVQg8/utrOR3Jpv2Sy4eLnpw2lX9UiN+ocPcDsGB 6gUFoe015mCn0PL4qRFNTr5eO3DJX/nnbhZrDNRRc/xqxOH0tTgcB/HOkNjkZz7slR76PU t2SRxCivLSAhdyhJP+ecr+IArs42Ph72sCKBtTJEz5JRd+fc+BtogEzgKXiLIHHkbz2wAW NIsz/k79+Ck/C9Xs/nQs+ZWBV5LrJyA3h9yF68X1yAKxWX07VgRn5Ybb8M3bDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676311826; a=rsa-sha256; cv=none; b=yg5KbVew1gNdSx+ofM7G4UNg8XcNzWI2xpApT5eDDqR6fO3KOzWIIpUFyXCJ9Ll2VnG4Ds aJ+8zBJg/ZfnDluYnnspvnD+G7C4cHkY0CIX/v36VxDcwIRbl6/PkQor5qNTahp3ctOeED iHKkyRqUL+iZxWkLpSg1JYQ1VtBtbTaY1qv785kQlL9dj04RDFoMVya0rqv+4TCgLStlBR E5+tb9i4JeN5kVudkGF0Nmq6/IHGrlaavgJHJTyF8iM9t3oFuAHSiR2DZ1HWnpqiAbiTVE 4cRmtwHtQ7pn92Avd+AbU9nt5DFiEwBsQC0GGAuv+rGsFpKOnle09davlycQSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFsnt32pMzSdp; Mon, 13 Feb 2023 18:10: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 31DIAQKf006555; Mon, 13 Feb 2023 18:10:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DIAQEE006554; Mon, 13 Feb 2023 18:10:26 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:10:26 GMT Message-Id: <202302131810.31DIAQEE006554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: a4532c4c5a86 - main - intr_event(9): fixup Nm field List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4532c4c5a866c90de4967d516241149892cca2e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=a4532c4c5a866c90de4967d516241149892cca2e commit a4532c4c5a866c90de4967d516241149892cca2e Author: Mitchell Horne AuthorDate: 2023-02-12 18:58:25 +0000 Commit: Mitchell Horne CommitDate: 2023-02-13 18:08:12 +0000 intr_event(9): fixup Nm field --- share/man/man9/intr_event.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/intr_event.9 b/share/man/man9/intr_event.9 index 70ea1e1bfc43..58322caee604 100644 --- a/share/man/man9/intr_event.9 +++ b/share/man/man9/intr_event.9 @@ -36,7 +36,7 @@ .Nm intr_event_add_handler , .Nm intr_event_create , .Nm intr_event_destroy , -.Nm intr_event handle , +.Nm intr_event_handle , .Nm intr_event_remove_handler , .Nm intr_priority .Nd "kernel interrupt handler and thread API" From nobody Mon Feb 13 18:17:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFsxl2DPKz3pdcT; Mon, 13 Feb 2023 18:17: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 4PFsxl1Xbqz3xXM; Mon, 13 Feb 2023 18:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXghk/VkBu0MYyfPKpUFqJmqOIcZi0/KOI8+FM9jCeM=; b=LiNGjaoX8oGV2tuErIkHNbyAJYQSwi6jA7Ht6eZahLoY6MlvVbix2hbHExG9jTTeAchIbw 8yg0CI8qJCoAlgOJQV8GUwzDn2IDIYGgvsHGmhxhMXTtmeesA9xpNvwRxhW3BSAAEHshrb Ev70R/p/pBXNRwsc8rbAfARbagh3TEhuPZm86KDyuw8mTNK05wFEdiyHdyeM0bV/I0DZLa aY/xKBFkUzL6G/63OznB66Ql61nMgFB6ZGO2jdsL3hTKOnA0W0pJ/cNsQuHhH0+MFam3wQ hKYQ5KJFbO6C+UtZAx2/rftrQfNE7mLLgw9LfT6TTwJ3stkC9hjIVoB3ZAy7Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXghk/VkBu0MYyfPKpUFqJmqOIcZi0/KOI8+FM9jCeM=; b=SNAxaZlWOnijHWU8CqLKHOMezYoigkwd2lb95lUSzPZ9TvfSllsqdjzhnwEMtC2D8YqwFN PF2WrBsoUd9iQGMGqIhGRYgzOlU4ywvsPKwtpJq55QkNGaw2iPfIBRsDCKwJuEEKkV6UiK Z7NXHyGpKxMYBDXP/IrTLLO8nyegCM5WfFEuWsOnR/N0DeXWyMvVOn/q6AZ+hlZLQDU88W zF25DdeSNvnq83Pjacqvat9WsbWSqkIghmpQtqIrz7kkRUpDIkBAymfRAQXgAYTlpapmCn pgsQg6ADfzCHs+v0qFuwcxc1qUqucKftzv9lZ9DVRDISnYsNGqD/yrF75JqYWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676312235; a=rsa-sha256; cv=none; b=Kbl1FeOoU91L5ENXE8zVYjeTdizW32n+ULeOYvCvdgzSU9mTwBSltcJB7+fV0ZkfVFCZjI ASUE2VQwh87KFVeZcZ2KchmyJW5GpecJoJESH2DCr6GTGA5gMgRl+2OoXa6q9CEYvY4/mD gSYwsc7xnA1NrSdmtkWoNixym3xBGTn5hxFlpvYIJR2j7IXKyRabbSRYsR+OD8n8209rm4 zRMgKK19SJvPrbj5N+eoZ5BmNeqYG4ro1CMKtuXA8zja1UZJPkKgLHRaRuQ3TDQYIrnZAN pqNVMJd3t0EgB2KmkENyoBkG64tDXXvB8Qc6WZ55hALmqkjh53Tr3pbhjrx+5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFsxl0TmZzSlN; Mon, 13 Feb 2023 18:17: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 31DIHEgl012282; Mon, 13 Feb 2023 18:17:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DIHEWa012281; Mon, 13 Feb 2023 18:17:14 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:17:14 GMT Message-Id: <202302131817.31DIHEWa012281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: e4542107d8a6 - main - sctp: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4542107d8a6d3bb5174136e7e6b7262c0343337 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e4542107d8a6d3bb5174136e7e6b7262c0343337 commit e4542107d8a6d3bb5174136e7e6b7262c0343337 Author: Mateusz Guzik AuthorDate: 2023-02-13 18:16:28 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:17:10 +0000 sctp: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netinet/sctp_syscalls.c | 43 ++++--------------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/sys/netinet/sctp_syscalls.c b/sys/netinet/sctp_syscalls.c index 5ae1da98e5da..a4824e963bfa 100644 --- a/sys/netinet/sctp_syscalls.c +++ b/sys/netinet/sctp_syscalls.c @@ -139,12 +139,7 @@ sctp_syscalls_uninit(void) * SCTP syscalls. */ int -sys_sctp_peeloff(td, uap) - struct thread *td; - struct sctp_peeloff_args /* { - int sd; - caddr_t name; - } */ *uap; +sys_sctp_peeloff(struct thread *td, struct sctp_peeloff_args *uap) { struct file *headfp, *nfp = NULL; struct socket *head, *so; @@ -211,17 +206,7 @@ done2: } int -sys_sctp_generic_sendmsg (td, uap) - struct thread *td; - struct sctp_generic_sendmsg_args /* { - int sd, - caddr_t msg, - int mlen, - caddr_t to, - __socklen_t tolen, - struct sctp_sndrcvinfo *sinfo, - int flags - } */ *uap; +sys_sctp_generic_sendmsg(struct thread *td, struct sctp_generic_sendmsg_args *uap) { struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL; struct socket *so; @@ -320,17 +305,7 @@ sctp_bad2: } int -sys_sctp_generic_sendmsg_iov(td, uap) - struct thread *td; - struct sctp_generic_sendmsg_iov_args /* { - int sd, - struct iovec *iov, - int iovlen, - caddr_t to, - __socklen_t tolen, - struct sctp_sndrcvinfo *sinfo, - int flags - } */ *uap; +sys_sctp_generic_sendmsg_iov(struct thread *td, struct sctp_generic_sendmsg_iov_args *uap) { struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL; struct socket *so; @@ -446,17 +421,7 @@ sctp_bad2: } int -sys_sctp_generic_recvmsg(td, uap) - struct thread *td; - struct sctp_generic_recvmsg_args /* { - int sd, - struct iovec *iov, - int iovlen, - struct sockaddr *from, - __socklen_t *fromlenaddr, - struct sctp_sndrcvinfo *sinfo, - int *msg_flags - } */ *uap; +sys_sctp_generic_recvmsg(struct thread *td, struct sctp_generic_recvmsg_args *uap) { uint8_t sockbufstore[256]; struct uio auio; From nobody Mon Feb 13 18:24:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFt6L1G86z3pg3C; Mon, 13 Feb 2023 18:24: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 4PFt6L0qCwz3yf6; Mon, 13 Feb 2023 18:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bvTEAYMCHOLq6f9LB++jvbxCNlc/5nEqtxFTGQ8j7sw=; b=yVAYPa5AxIes/k7V5JCNWa8DTpiAArSYJrbxlHjfkjTimAkds0o+bq8bk2qSez1EN93SeO KIpOQh3MjPvFIjBD2VLFSnMxDTBcRUEkgR2EL3RZ3xrb7lXLpcBrv8VzUvmhuWMlbmd2Uv goNVSBDI2gaRhFK5Wj0mmQrfdwOXFHKYzJcQ/0JJAruzcw71Umqbj0kxg2VFioazweFA+6 aETYRpxI4cbkyfiWkyjm0c5OKS873nvuCk3gOFdIKetFtvi9bB12UZjT90eatfRHVaH6E1 5RcU+HdR1WpzOE2Mq1nZQ0e5P/vguXOFiat6Yf3U66fh2UHVGTWSmG86XmKPTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bvTEAYMCHOLq6f9LB++jvbxCNlc/5nEqtxFTGQ8j7sw=; b=YeKWp61oCqV+fCY5QULdYQfv3KF0plu1g4jod1QssuyXaRc6/KEYdsn4vImPwLPnOGT1Kf 8pNFTyki2UO7f+GLsGXs5P43TE/NVsNflacFOGh2fNR8USDu+AdFfbPecBTprdD8R4yE22 0s7nFdb7lnCpV2qHA7wxh5IQg5uvNNq0PTYV4IZS+tN8Q3Hd2M/w5tHwg4NkAeV9EFjRot hMHi7+UpuJo7LbEGmRTpYgCO8VwRrubh5FIY4HoCzIT4C+4hhZgLrqlz325qH3Ua5klwHi QyS3L2qPIin/m67AzrIzsxkClWsiTcJB14ij3SwQGLfcnyms+ImFscZiq2b8pQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676312682; a=rsa-sha256; cv=none; b=nx/k953eegoA5Q5xXQaVG2GBibmePuYp833vPbQRKvOZL4jqA4cW7UWOF+7QHm84RMqq/e +78nGzWalbMzmHjDtCMF/zNR5/TQjATAr8XjlHseLzFaBgkuw+z7InaDYhLnoUy9r4ATp0 4LG9mqDFT3y491nRoSrcnecyuEs8993RUmtCiUuTX1DP5J63eSXy6fM+Ju9ad1ogrqqqqO EH5FT4hNflI8u66FSX42o+qZPZxQGaLaOvyZgnvROAHkuWyqdHs9NXjSscE0zZwtCHNc22 Q5Njv9JQLbHr+THBuEJIWY5ufDZ8WnUfk9r4ayfFfqtLZLgEg5fHxMgchsx96w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFt6K6zZhzT2m; Mon, 13 Feb 2023 18:24: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 31DIOf7j025991; Mon, 13 Feb 2023 18:24:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DIOfR9025990; Mon, 13 Feb 2023 18:24:41 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:24:41 GMT Message-Id: <202302131824.31DIOfR9025990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 00343b4adcfa - main - uipc: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00343b4adcfa01d7e64ae345768af8f11a10d816 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=00343b4adcfa01d7e64ae345768af8f11a10d816 commit 00343b4adcfa01d7e64ae345768af8f11a10d816 Author: Mateusz Guzik AuthorDate: 2023-02-13 18:20:29 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:20:29 +0000 uipc: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/kern/uipc_syscalls.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index cbf45e53f96f..496e93d76bb0 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -278,12 +278,8 @@ kern_listen(struct thread *td, int s, int backlog) * accept1() */ static int -accept1(td, s, uname, anamelen, flags) - struct thread *td; - int s; - struct sockaddr *uname; - socklen_t *anamelen; - int flags; +accept1(struct thread *td, int s, struct sockaddr *uname, socklen_t *anamelen, + int flags) { struct sockaddr *name; socklen_t namelen; @@ -447,18 +443,14 @@ done: } int -sys_accept(td, uap) - struct thread *td; - struct accept_args *uap; +sys_accept(struct thread *td, struct accept_args *uap) { return (accept1(td, uap->s, uap->name, uap->anamelen, ACCEPT4_INHERIT)); } int -sys_accept4(td, uap) - struct thread *td; - struct accept4_args *uap; +sys_accept4(struct thread *td, struct accept4_args *uap) { if (uap->flags & ~(SOCK_CLOEXEC | SOCK_NONBLOCK)) From nobody Mon Feb 13 18:24:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFt6M2Wqdz3pg0p; Mon, 13 Feb 2023 18:24: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 4PFt6M1yB1z3ypJ; Mon, 13 Feb 2023 18:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8gqhJJurY5p2LYb1+DO7jcPOwlGwALzPFREJ9HoR6DU=; b=TrVMLTELn5ODImmfeUVY5wmNrD9CZG7bng5h6U3+1cG2Z6B6G9mC67mTPyKDMa4bhNgPJh efdEle2ZzdkVLmVUwdlZ68+kNt/kWdGxuc4GU2oFy+U+s7B1UTVhRo0F96diuaNdAEORsL enFeJWvVL5Ek08bKykYeLreaTKpnbBujjU8Y6eqeK38B1wlBksEyUS1naIwa8wOptPuNPS ssrNflTZMV0y2ZvKrKh5uLc9aKAH/4rO3tMn9cickjjffhD9xyBR4GIVtsKJKitNm63kaR t2MP0zIIT6grDCNAOvFc2Yr7T7EKnkkBAbu6lAY+CRAw+OerJn/iJlEmRWHz9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8gqhJJurY5p2LYb1+DO7jcPOwlGwALzPFREJ9HoR6DU=; b=rQxZ/IbRWO04s98yWh2nsUapJVXSl69gpusNg5so0ZzSFo9CuR6sN+sXadPyAnYz2knctq WReCkoe9Loj5QuslJVpMAGyRy91IYk4JejgKr9WHkM50D5XidwdmqTo/4G80KBlFqXzcwL uwHePAfOpdt6TMNrhE8luG4I8TkNgLV/LzoQDF+Mc4MQl377CGdRmJaQYslhvAr+0jZ+Iw sCIIz1Z2CCTNFOTKNhDdPYBmzJJyDUGdeD099M6K107eFdXun71Uv5cXRv6pEwUlTK6tSY b4tVbQM8yrkTl6iONzyant1F8M5sDl4M5ewI6oj+YLBLB1YvR9hj73nh2tDx9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676312683; a=rsa-sha256; cv=none; b=ivJARsyeJ2vJlXV2xNY8TogSYFL8o6fpvJQyStCPtg7l/TXCgnuTLeSXtTlHEdBKtPHk0r uInzViAJjRAN3xi6W2/Jpq7Jcr/QKSu+fbe+6/DdyQVaNRxJ/bxc9+kmyUiFaOpdqfwOvz hXLoRxWCZTsi41DWJIqyA3CE0dUhcttpQyc+pbNjFMpY2LlTW1kISQ5HOmRoISUONhH3I8 aMKbzfHNtqILg2TPbZIr/9t8UIOoUryV6kTC9be1zB5kjWzjmh+JiBuvOxD4w/6B8O0MBJ w8aSzFiyi0Xb2wIzN97igQBS48DFA+F4xjIlLmhUYW1w4M/j0xXUwnUD3rUOIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFt6M0qgGzT0D; Mon, 13 Feb 2023 18:24: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 31DIOhRd026016; Mon, 13 Feb 2023 18:24:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DIOhaF026015; Mon, 13 Feb 2023 18:24:43 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:24:43 GMT Message-Id: <202302131824.31DIOhaF026015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: bbb6228eae32 - main - vm: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbb6228eae32d30d7f968f1ebe44a5e2d524d254 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bbb6228eae32d30d7f968f1ebe44a5e2d524d254 commit bbb6228eae32d30d7f968f1ebe44a5e2d524d254 Author: Mateusz Guzik AuthorDate: 2023-02-13 18:23:21 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:23:21 +0000 vm: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/vm/vm_glue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 21d49d976e5a..377df8c18e39 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -580,8 +580,7 @@ vm_forkproc(struct thread *td, struct proc *p2, struct thread *td2, * the process was still executing. */ void -vm_waitproc(p) - struct proc *p; +vm_waitproc(struct proc *p) { vmspace_exitfree(p); /* and clean-out the vmspace */ From nobody Mon Feb 13 18:24:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFt6P071yz3pfrh; Mon, 13 Feb 2023 18:24: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 4PFt6N4xNwz40MK; Mon, 13 Feb 2023 18:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEYLN1L3y0j8/U9MBdX9TOEn/50NzosDmg8Os4c04u0=; b=DxS8vg4NJdjliYOPWN9Q/UCIrAQVfGXn/aHkWFBx80ewYo1cLzCTICYS6T44kxPPiPDXg1 Ooiosw4EoRNTSmRIgUEdPNu0mz+9XsGPQyjyRpYaChYxy3PqgkDlPvroZ6uQqRvW+0t0/o sEUp9i60Elm6mx9F8/OyrA5EOjSVL0O933RUQY8HJg5+QALzu22SZHdg4xsBsm92MfPLzs 0Sg/GLoxk8V3xlskl8rjZESx98us9HWa790v+LdijaaTeP2fJ/CgdmHbkjI5mQN4Zc0oQN /sebdVXj9rmZzvjP7TF3+UHELuLube4QyYZ3iWrljEm2GgC+H1MbPc3QJ+VDXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEYLN1L3y0j8/U9MBdX9TOEn/50NzosDmg8Os4c04u0=; b=ng3hwSAmpQjWA1TV1roQzH/x1hw59/+0dNldxghiu8lEJlM2e9IeeY/ftSfkgeuhL3GIIl XIog+cDYvVJXQd0f8SKQkh2OM6rdq+TMoqym/Y8Xsp+5z0FooN4ljx8l4ku4XYZDKZeRzX 3UmpIiufMJUBW99/DzFTFYR67O4yqGZPUPYu2dee9MimT6f4MSIlSa95D4BBR50Zy/vKkF +KnI9M2yDkFcrNvqkMQ51kIBuOQQ367DOEMseSTezAMvtz8uDyATwqBNhRugDK0/1BQYuS aGCfs4KYdolibWatP1hGloMw7Qh0CAUTX1q7r3rd96VXqrdm+eOqpUSq1t/vYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676312684; a=rsa-sha256; cv=none; b=cqGlRrwafkgOShut4SMTvmA3PgqYysx/+qNFFsZqCn5FC6Uwxdvobjyqi+s+DsrU4G0dpn MYMij3dBSFnSnN6BulGKLzJ/5pGqdHbeFoyvx1vLGXa2cCD4SBy7SmwK9tK1WUgEM38JbV XCQKHrP0629yLnXgzNe6wUsTpXaX5uQ8u7IcdoK+cowP4jSVHR2JBSmPAQIXwFVHN5N917 dAr8pSATwFTgDvrKI6K0jniegvobOsosNmS9VYNEy9/N5+utb4QHFot3ef5WuM8vd6eG+h q1Nbq0C/V6MIADbyI7bY7xNPG+N8Exgrk58P1AiVPJSAlsbjdnehVGc65hbGOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFt6N1ZTBzT79; Mon, 13 Feb 2023 18:24: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 31DIOiQg026040; Mon, 13 Feb 2023 18:24:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DIOiC0026039; Mon, 13 Feb 2023 18:24:44 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:24:44 GMT Message-Id: <202302131824.31DIOiC0026039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: a066bba2daea - main - ntptime: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a066bba2daeafe5e956abedc43ce64594985391c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a066bba2daeafe5e956abedc43ce64594985391c commit a066bba2daeafe5e956abedc43ce64594985391c Author: Mateusz Guzik AuthorDate: 2023-02-13 18:24:13 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:24:13 +0000 ntptime: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/kern/kern_ntptime.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 6d03413a3113..b632cecdfadb 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -653,8 +653,7 @@ ntp_update_second(int64_t *adjustment, time_t *newsec) * is selected by the STA_MODE status bit. */ static void -hardupdate(offset) - long offset; /* clock offset (ns) */ +hardupdate(long offset /* clock offset (ns) */) { long mtemp; l_fp ftemp; From nobody Mon Feb 13 18:28:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFtCF0b7Dz3pfn3; Mon, 13 Feb 2023 18:28: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 4PFtCF04Ybz40rB; Mon, 13 Feb 2023 18:28:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yObD1xtcEtnrxiRt7SVpLjjFSLnWb2p4yNcEBSdkSJI=; b=AaJT4LZpGZfaAASZqqa6Sdjl9n06/S8pThidlMuPSpBoal2DCAbWYDEks/GyGLsd6pg6/n Q48JkH4/8wUH3+LpZCaOIUS57P6T8pSoobsz3AK0XjNojlu+Qkw6vzh+lRCRwqGLpoxwcH gdTy2Lo0SRjZ3q8ysQUv73LvSTCzDFfF/SddyjP3oEpsU7XdQANW3SfTIMQ8RYyn4BKAze LgELNEYYCPfHQ71CA3mlWQlWmglkM2pqdGidA6NTDgfI8B2/ioEtJXIbAmwkl8qMXtNfhz UCLFmhj/zVV17eLfS6qfAMgLc54huaTr9ivPFLkNzhpwBlWmgyLecZkk28ob4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676312937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yObD1xtcEtnrxiRt7SVpLjjFSLnWb2p4yNcEBSdkSJI=; b=v4EzrAH0Xa3jmJg5Euvg/BcI3Zh0tsjg0+fqG0WZaJ7/R95z+31JjFwG89ZX3sNjtjYAGU jXMMAhi/wCVtZGq3JpCmnM4VkYgfJLj999maBRXoRLePOMmbGgo7js9oMuV4IfjdNy2Emf ETGIsCtwUXeQ+w740ykjQVVpmDnnvAHaLbrFjqZnOrkCF7UWMPijtNpEnn0DFET68fX5Y2 5lgH6xw50dIbInF+mFIhNQm/ICt+pepDTVbDHOGtyhYQCsYlQ+ivv909rmz7HNqYE6DfEX gQ6WdKBPxhDOdToX+jV2Y9UME9sq/vW9asxhZQANw88HTwmWjkkd3G7+vFDr9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676312937; a=rsa-sha256; cv=none; b=lZft8SJouiYzsVXYPs0IECNfWfLGzOF/zLDAs3HCY2j86mX80BQqsRF4UDO11KUi+Duv5b Ny2fI9ZEoqyJHhXZx8Wp468CLA6H/J1uJVmejfFIK5Wbu/LjXCaZJIPrhuLJnTcGsSULiO oOPrgy1FPjzXtXT89uOr9QS0Tlbx8yas16Ia5aeZy4Mzl/wFH6+hwJzPm3UTAr6FgM3BEd fNTANKN2htEwFaZgryXRzqBxNfe0pd6qS5IXXRcBFNvjA+E81vb0EHpJ1faQgm2o9dMSl2 VVXSRYwVvp2p9PJy0f9WYkuuZ2Pc83fXICnHweF3wNUV/kw+hQ0FMw2VaWM84Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFtCD6CbSzSgP; Mon, 13 Feb 2023 18:28: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 31DISuh4026656; Mon, 13 Feb 2023 18:28:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DISu5k026655; Mon, 13 Feb 2023 18:28:56 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:28:56 GMT Message-Id: <202302131828.31DISu5k026655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: aa0b46948e92 - main - speaker: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa0b46948e92bbfb09002dce083993c0b2465c56 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=aa0b46948e92bbfb09002dce083993c0b2465c56 commit aa0b46948e92bbfb09002dce083993c0b2465c56 Author: Mateusz Guzik AuthorDate: 2023-02-13 18:28:09 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:28:09 +0000 speaker: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/speaker/spkr.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c index 86b58cda9843..b12effe4ea93 100644 --- a/sys/dev/speaker/spkr.c +++ b/sys/dev/speaker/spkr.c @@ -403,11 +403,7 @@ static int spkr_active = FALSE; /* exclusion flag */ static char *spkr_inbuf; /* incoming buf */ static int -spkropen(dev, flags, fmt, td) - struct cdev *dev; - int flags; - int fmt; - struct thread *td; +spkropen(struct cdev *dev, int flags, int fmt, struct thread *td) { #ifdef DEBUG (void) printf("spkropen: entering with dev = %s\n", devtoname(dev)); @@ -427,10 +423,7 @@ spkropen(dev, flags, fmt, td) } static int -spkrwrite(dev, uio, ioflag) - struct cdev *dev; - struct uio *uio; - int ioflag; +spkrwrite(struct cdev *dev, struct uio *uio, int ioflag) { #ifdef DEBUG printf("spkrwrite: entering with dev = %s, count = %zd\n", @@ -456,11 +449,7 @@ spkrwrite(dev, uio, ioflag) } static int -spkrclose(dev, flags, fmt, td) - struct cdev *dev; - int flags; - int fmt; - struct thread *td; +spkrclose(struct cdev *dev, int flags, int fmt, struct thread *td) { #ifdef DEBUG (void) printf("spkrclose: entering with dev = %s\n", devtoname(dev)); @@ -474,12 +463,8 @@ spkrclose(dev, flags, fmt, td) } static int -spkrioctl(dev, cmd, cmdarg, flags, td) - struct cdev *dev; - unsigned long cmd; - caddr_t cmdarg; - int flags; - struct thread *td; +spkrioctl(struct cdev *dev, unsigned long cmd, caddr_t cmdarg, int flags, + struct thread *td) { #ifdef DEBUG (void) printf("spkrioctl: entering with dev = %s, cmd = %lx\n", From nobody Mon Feb 13 18:34:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFtKk6rRrz3pgkN; Mon, 13 Feb 2023 18:34: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 4PFtKk6Kbdz41tQ; Mon, 13 Feb 2023 18:34:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676313274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cqwuzh8jSKuYvVQYga5bhi481D4/tze0UDrp0xVElJk=; b=bwhnaxGWvCHuh3OK/R9WeQvqbzNjA1HguNC0Oy5Kwy5wQwSKt6PfyeBO6h0qsGqljLMvoh 6fSe2zhRgg5OlMhYVs5PtWqbditn1YHawPPMQFAxcQeqErytKyooqHGye24c6ueVKr5C4V aEN3uS55q/cxnrj8vC5IEwcPJTPEQND6eewh6HpmedQSdy39Hyt4mGoNuEEDOn2hJdpFUG b8M0qfPEs+WIFWLAAuyXJ0xorlkG2J7JXeSqSY3xi5dZOT0CsrHeH4FuPs5hXIlKcYmqQG PdYXmXqb3gHUQZWYJgCC3LM/Kk/YO1NQ7fpLUBtBaRppxwI4zuWpGe/ggcOkqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676313274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cqwuzh8jSKuYvVQYga5bhi481D4/tze0UDrp0xVElJk=; b=TcbEqxEAxkZn2FvUAMNlLZ/NDMAWo2r/rSOuyMMF7owMXZivyXwEtgQd8p/QYjy1I7HJTu Cod7IrOpgR0UmY0ItCEh+6+j2Fcjg8GJbKlZ19jvfopee2o34rDO1nUO/H6nIYovNYUXMY zT0g4iPRK6eByBXqcCtbo+1RIr0FLce90loxvE6Z08zoVL9zEaNWWiqHo/C+2h4fwcJrmA VDbEuXCukKR0vVu2ajdZY9Z16xQJXOwh8TymuUXT5s/nLdNDQF6wI8KzcP29+KSgqsRjTQ xDc2nx0K4Tell+qlx5D1i8O/HCmmg387MwIkWDDPkd+BAyiX32tUY346jO2X7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676313274; a=rsa-sha256; cv=none; b=IqC55M0Y3/pZZEBpNFlirlj1DYz15tA6gcTMywqrUICax9/BHBqycyk2YLzmnPws8N9OoC 1xqhpT5Bu86d46XetkPXI9/AXzNu9kg5ZxdQudKRrzBRbHjUU9nl/1IdP1wC9jd2rjs1wu PBg5dEEQQ1gThciYepQROODP9m9zjssLLEkS6mLZm9OqEZ/UD8p5iwbzqK3ZrhUcPl6XBk CXa9owjQFwfSAxfSJVEzbb0FzfYgs2SEi5BOP5DjM5ZwGKfw+2p5IRJodfwRVudH+81izt dQOR4svzup8qlt2yTu39OphEpR8iu3v7t0/cdgwuXKJe8gS6RH9cXxAi/t9+MQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFtKk5HYMzSxx; Mon, 13 Feb 2023 18:34: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 31DIYYn8040145; Mon, 13 Feb 2023 18:34:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DIYYou040144; Mon, 13 Feb 2023 18:34:34 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:34:34 GMT Message-Id: <202302131834.31DIYYou040144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: c492eb60b303 - main - altq: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c492eb60b30328035129a11c222aaded4d499b44 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c492eb60b30328035129a11c222aaded4d499b44 commit c492eb60b30328035129a11c222aaded4d499b44 Author: Mateusz Guzik AuthorDate: 2023-02-13 18:32:45 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:32:45 +0000 altq: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/altq/altq_priq.c | 3 +-- sys/net/altq/altq_red.c | 4 +--- sys/net/altq/altq_subr.c | 43 +++++++++++++------------------------------ 3 files changed, 15 insertions(+), 35 deletions(-) diff --git a/sys/net/altq/altq_priq.c b/sys/net/altq/altq_priq.c index bb679baa236d..6d26116a601b 100644 --- a/sys/net/altq/altq_priq.c +++ b/sys/net/altq/altq_priq.c @@ -575,8 +575,7 @@ priq_getq(struct priq_class *cl) } static struct mbuf * -priq_pollq(cl) - struct priq_class *cl; +priq_pollq(struct priq_class *cl) { return qhead(cl->cl_q); } diff --git a/sys/net/altq/altq_red.c b/sys/net/altq/altq_red.c index cd180f4fca2f..e6fc423f48b9 100644 --- a/sys/net/altq/altq_red.c +++ b/sys/net/altq/altq_red.c @@ -523,9 +523,7 @@ mark_ecn(struct mbuf *m, struct altq_pktattr *pktattr, int flags) } struct mbuf * -red_getq(rp, q) - red_t *rp; - class_queue_t *q; +red_getq(red_t *rp, class_queue_t *q) { struct mbuf *m; diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c index d569aa3f3ab3..c8b98beaba07 100644 --- a/sys/net/altq/altq_subr.c +++ b/sys/net/altq/altq_subr.c @@ -148,9 +148,7 @@ ALTQ_FEATURE(fairq, "ALTQ Fair Queuing discipline"); /* look up the queue state by the interface name and the queueing type. */ void * -altq_lookup(name, type) - char *name; - int type; +altq_lookup(char *name, int type) { struct ifnet *ifp; @@ -164,13 +162,10 @@ altq_lookup(name, type) } int -altq_attach(ifq, type, discipline, enqueue, dequeue, request) - struct ifaltq *ifq; - int type; - void *discipline; - int (*enqueue)(struct ifaltq *, struct mbuf *, struct altq_pktattr *); - struct mbuf *(*dequeue)(struct ifaltq *, int); - int (*request)(struct ifaltq *, int, void *); +altq_attach(struct ifaltq *ifq, int type, void *discipline, + int (*enqueue)(struct ifaltq *, struct mbuf *, struct altq_pktattr *), + struct mbuf *(*dequeue)(struct ifaltq *, int), + int (*request)(struct ifaltq *, int, void *)) { IFQ_LOCK(ifq); if (!ALTQ_IS_READY(ifq)) { @@ -189,8 +184,7 @@ altq_attach(ifq, type, discipline, enqueue, dequeue, request) } int -altq_detach(ifq) - struct ifaltq *ifq; +altq_detach(struct ifaltq *ifq) { IFQ_LOCK(ifq); @@ -219,8 +213,7 @@ altq_detach(ifq) } int -altq_enable(ifq) - struct ifaltq *ifq; +altq_enable(struct ifaltq *ifq) { int s; @@ -247,8 +240,7 @@ altq_enable(ifq) } int -altq_disable(ifq) - struct ifaltq *ifq; +altq_disable(struct ifaltq *ifq) { int s; @@ -270,9 +262,7 @@ altq_disable(ifq) #ifdef ALTQ_DEBUG void -altq_assert(file, line, failedexpr) - const char *file, *failedexpr; - int line; +altq_assert(const char *file, int line, const char *failedexpr) { (void)printf("altq assertion \"%s\" failed: file \"%s\", line %d\n", failedexpr, file, line); @@ -293,9 +283,7 @@ altq_assert(file, line, failedexpr) #define TBR_UNSCALE(x) ((x) >> TBR_SHIFT) static struct mbuf * -tbr_dequeue(ifq, op) - struct ifaltq *ifq; - int op; +tbr_dequeue(struct ifaltq *ifq, int op) { struct tb_regulator *tbr; struct mbuf *m; @@ -345,9 +333,7 @@ tbr_dequeue(ifq, op) * if the specified rate is zero, the token bucket regulator is deleted. */ int -tbr_set(ifq, profile) - struct ifaltq *ifq; - struct tb_profile *profile; +tbr_set(struct ifaltq *ifq, struct tb_profile *profile) { struct tb_regulator *tbr, *otbr; @@ -425,8 +411,7 @@ tbr_set(ifq, profile) * MPSAFE */ static void -tbr_timeout(arg) - void *arg; +tbr_timeout(void *arg) { VNET_ITERATOR_DECL(vnet_iter); struct ifnet *ifp; @@ -754,9 +739,7 @@ altq_getqstats(struct pf_altq *a, void *ubuf, int *nbytes, int version) * read and write diffserv field in IPv4 or IPv6 header */ u_int8_t -read_dsfield(m, pktattr) - struct mbuf *m; - struct altq_pktattr *pktattr; +read_dsfield(struct mbuf *m, struct altq_pktattr *pktattr) { struct mbuf *m0; u_int8_t ds_field = 0; From nobody Mon Feb 13 18:36:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFtMQ4fz3z3ph0R; Mon, 13 Feb 2023 18: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 4PFtMQ49qDz42H4; Mon, 13 Feb 2023 18: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=1676313362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iVs+Yp1xAqAZv/J8+xsTarpycZCgI5oZMmtOYut/jbg=; b=CAzsLYspjXsKEsBqWVeW1yyk3OaEwwEmc1xtEXtL+lNvAds/HMmd9/cI8X+q8Ki+5ewHDu 4S3EoCUekmyvWtKXxzsOXxNjkmNoQqCXqn0R3gVjfOPAEeIDbc2k4Uh43zD35Kq/JiEGRM Lpg8EvyLP59AqJpKm29zAz4ujGJ+bHzDudCxm2wSdwYTKxzbukudibPc6MQCxjHSj3FE/3 zZMZO9iB39pbAovocuUS/j+QOjT7hnkMzofs8u84+2ki4DbC8xtSAYSIzDtbjuep7fBxZs A0ApvYHd6UFG9MdCjDtZO0XmAIlSn5X8gpS6H/npxMTtG+sqf3Khr28aQPIjAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676313362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iVs+Yp1xAqAZv/J8+xsTarpycZCgI5oZMmtOYut/jbg=; b=fcHSOZjNMfu6FQQnHRCcfht8vt4rJ0y0TB6ijAIWb8cFRPgdiBtZkkXH0IiXsnDK84kDSq MsPtuMupygBWFdarJUJOOUTL9Y6SYAG7zj8cXqouRmurPXA3/im+jpWJ7/LSrUho1SfqAq hMlDBT6Etda+IeEruQ/FzE2xhU2GIWzZlbK9HteH9SG2KQa1IshD+SG9Cwk5fTBq08bJDe HnEjUlpNFAw9AIRqWqsD7Z2Btm/WHXhDf46+n83gCg17dkKMQC0S/GUCBQrxMm3K0kOLAZ 2Pz1gkVs0y3OckfeBifu36idWF97P0aldQglrQMBqzwqaPQ5FNej1ApBp0HJ0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676313362; a=rsa-sha256; cv=none; b=jMaNle7TUVfqcg+1nEAtdfyKJu2+rDP1znv0s5nGbLabn9kAqGJ86dKeV9UPoBqMD9rurB 9Um1u4TFoSqvgdxk2EId3HkN3BO7PTAERb1qA27Meovl3mU/m5wsXuoZWx8OSUmncwk1ax oLJ5G71UIyVpxJG9cgq4FLSb1Gax+6GDg1ZtHlIKpK8b6fTZfH5uIvN/gP4Pz/mwsHqJxv 2tn8HAqDbQVFB5+QPERv5HCe4TKp+Zg28DCu9fCf5lgL4Pf8p2WoqqHMzrrgHW7sAlkduc xWp29eCIcuxNmxqoyUJvHwGDlorENEa6Vwqzt2g5DLrRFIyZBIBSDlLWXQjQtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFtMQ3D9mzTDr; Mon, 13 Feb 2023 18: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 31DIa22m040429; Mon, 13 Feb 2023 18: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 31DIa2OE040428; Mon, 13 Feb 2023 18:36:02 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:36:02 GMT Message-Id: <202302131836.31DIa2OE040428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 85d4483d5ead - main - ufs: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85d4483d5ead1c94acfce44d3bfd03236536f9b9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=85d4483d5ead1c94acfce44d3bfd03236536f9b9 commit 85d4483d5ead1c94acfce44d3bfd03236536f9b9 Author: Mateusz Guzik AuthorDate: 2023-02-13 18:35:54 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:35:54 +0000 ufs: ansify Reviewed by: Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: --- sys/ufs/ufs/ufs_acl.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/sys/ufs/ufs/ufs_acl.c b/sys/ufs/ufs/ufs_acl.c index c05fade2d645..112cbf5f3018 100644 --- a/sys/ufs/ufs/ufs_acl.c +++ b/sys/ufs/ufs/ufs_acl.c @@ -354,14 +354,7 @@ ufs_getacl_posix1e(struct vop_getacl_args *ap) } int -ufs_getacl(ap) - struct vop_getacl_args /* { - struct vnode *vp; - acl_type_t type; - struct acl *aclp; - struct ucred *cred; - struct thread *td; - } */ *ap; +ufs_getacl(struct vop_getacl_args *ap) { if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) @@ -606,14 +599,7 @@ ufs_setacl_posix1e(struct vop_setacl_args *ap) } int -ufs_setacl(ap) - struct vop_setacl_args /* { - struct vnode *vp; - acl_type_t type; - struct acl *aclp; - struct ucred *cred; - struct thread *td; - } */ *ap; +ufs_setacl(struct vop_setacl_args *ap) { if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) return (EOPNOTSUPP); @@ -681,14 +667,7 @@ ufs_aclcheck_posix1e(struct vop_aclcheck_args *ap) * Check the validity of an ACL for a file. */ int -ufs_aclcheck(ap) - struct vop_aclcheck_args /* { - struct vnode *vp; - acl_type_t type; - struct acl *aclp; - struct ucred *cred; - struct thread *td; - } */ *ap; +ufs_aclcheck(struct vop_aclcheck_args *ap) { if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) From nobody Mon Feb 13 18:37:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFtPN0b0fz3ph5q; Mon, 13 Feb 2023 18:37: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 4PFtPM6tjqz42qb; Mon, 13 Feb 2023 18:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676313464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YOZRThvg0ivoAM2jFUZyE5DZ9KDmypPe7cRKaqTE8eM=; b=GFJyLZMoX7toUmC1xxIuWeXa3Sj4pFtzBSrsqFE7XlucmBkvStmzKXF7jBC5E8Uj01oRy/ YoO1TWKWbjyeegsn8B579s7RRE/3oNZheOnFtiiwWtrfgvIbf2cCL1BSC+pEhB/GxSMhSQ KUkwhd0wF4Q1UoWr15iCaB4SQA1FwTMySlXPLi3t1SbDoiutmWpwNfcqIrH/uA8sKMWf7J TSRSnQMcloo/CPy/2NrBSBGe2SYWUE7FSX90y6tJhBJ8t8pFlRRsKCdAko9Ikr6URZkUib 4IKwTQ60BXWDyWXSAOTyC2XxFr1lWrvt/WdMl+EO0jv8nDolwxWZKLuzYndZAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676313464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YOZRThvg0ivoAM2jFUZyE5DZ9KDmypPe7cRKaqTE8eM=; b=d6ikl2kaMnetxOJL0n7+0zveK66avutTnKiwfBzL1R/nVNdBaSdb7TpNlO1J9PtKvbfP6S t5dnglC2MVS2lw+tP7uR8dfSGtMQpqMVXJzrPHoim3/kR0syFJfEFCuxcE2bQUJXNCq8Uv a893OxQ7/0O8Vv1Ll3GUZIQyqh1AFuN4hfXs2I3LVFl96nGQVwqs0UVFlakrIryrmaqE9c sXUxqNuEzLzlAqlaSqYywnlhtda31X/z0aE2GpLtQq2eNnZIMMyvVOP4gjadadSwd4h8Lo jsgR6pE1VwnaGV6IPAbQ8TEcPgGw9DIyGqADNt14EJRDrJLwzP2AsChdxtylPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676313464; a=rsa-sha256; cv=none; b=MJxOOrqUkUOolUiekpWeUTm/YisyW1OCHS7rLzGlnPuhuk1m37xTgaRfjJw7JhHSlK2vwm hIzkv7t4RTlcIehJ1OPxIMguSGwaUVg0HmhvD2RClWHaWVMxUoOiH6txGC4GTqVz/XwJd7 Fugc17voypIDcVz9HhZP5+eW70pkBwmbhgr2x3o3CdnJeusN4vMNvBhuZf9dLwgRSd43W4 SCgwuZwtQ7cNxpAkYOI85o3xnq+fGpX9vHT9z/NMOXe56CDDI5KvuV6KdKYrHxaQmK4fCv G+PwHboZen4g0iUKiR3Z8k7f3/aNgxpq+/T0XIg5I2ABom6WH+o1Fi3nAL/PoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFtPM5x5DzSxy; Mon, 13 Feb 2023 18:37: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 31DIbhG7040749; Mon, 13 Feb 2023 18:37:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DIbh7n040748; Mon, 13 Feb 2023 18:37:43 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:37:43 GMT Message-Id: <202302131837.31DIbh7n040748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 1842178ad311 - main - xdr: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1842178ad311267b9c81aaeead9c7b5f2724f8c5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1842178ad311267b9c81aaeead9c7b5f2724f8c5 commit 1842178ad311267b9c81aaeead9c7b5f2724f8c5 Author: Mateusz Guzik AuthorDate: 2023-02-13 18:37:31 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:37:31 +0000 xdr: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/xdr/xdr_mbuf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/xdr/xdr_mbuf.c b/sys/xdr/xdr_mbuf.c index 0cd0b639da68..1f61e7613434 100644 --- a/sys/xdr/xdr_mbuf.c +++ b/sys/xdr/xdr_mbuf.c @@ -158,9 +158,7 @@ xdrmbuf_getlong(XDR *xdrs, long *lp) } static bool_t -xdrmbuf_putlong(xdrs, lp) - XDR *xdrs; - const long *lp; +xdrmbuf_putlong(XDR *xdrs, const long *lp) { int32_t *p; int32_t t = htonl(*lp); From nobody Mon Feb 13 18:38:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFtQ30lM8z3ph5y; Mon, 13 Feb 2023 18:38:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFtQ30CZ9z43DV; Mon, 13 Feb 2023 18:38:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676313499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LqmoeIiNXn0DxKx8npKwgo7Nx3MMOTFzAwYjrKxJ3eA=; b=AoeeQaRRAIlDP9zAhpw8rV9VjutbBJb2/FzqWB7P0CtFujybzEkOG9j0XXcjjBQ5hvzu0s O+JgOuWVb+/nc9HnDSErpigBxQbXHJsR9b3bs0NHVAnEvtomLSUfazWi3nYLBqqaYNYJrR R4DDiqzLwOqZHlT4ZWXow9Kh43LUyJjrJswwMyf+LKK50F2jQZTax0JYD9tcQFu8vT/R5K hl2A6ER25eTsxJoS8wN1lDuKUHPWdlsMSRUoM7XOloqe8YC15AjYlhV1pvjTnghEqP7SOa P2SgD0fNUN37GcQj9L9MEgfJOWCg5+Ugt2b9AGpz/tCzYVcVwL6+MxA9NZCZPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676313499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LqmoeIiNXn0DxKx8npKwgo7Nx3MMOTFzAwYjrKxJ3eA=; b=leqz7vTDAbNoOVep1CIfz13FiAIeHqXsLy89/YQmlH60FItNO17TLn1CxZDokYSxxsu/gQ 2T2DMJRuyoV3d37G7EQmpXsS0usvJlxKcG3zVHOrOrJpyf+P8iMmA4zBLUOUG1aoRD2MQG OCYjubiM4spfoc8+/JZWwcCiKN4/7hIdAF4fKXE+/PrC81x2aILDRtXRg47yPEfU31tIL2 hS2Uv6UUR+R67PvPe/vWyUv56hKq8oiB7x4C1f6bPXdcKPBiQRBPlQpXked5Tv0G2k0FbA hhOQpu1+sPEEh2qDbwmKEv/Dw+8pIRuCbq2acpUVlUXXMSWI8ok0TP1lSthtXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676313499; a=rsa-sha256; cv=none; b=JZSsaQkuAqtbDYWv7lFiWFe2dA0LLFZMNjy0B6ePD5sDaA3YojHmA+vxJpfEY46TbdElJ0 46ZhjzaotcHedgLNsFtUl75ylqej0+1Dh2MttMRCGfy0C2uRGi3LjqpQ35U7E2DndJjh0A vNEygE9vkUk9PIzMACei3z/hbb4AUsKEYVqf2NySZc5+FoFAkRtnznDyUBIeUMkaZ1qfu3 g/yuvVA33e5XZaAFBi/UEx1YC+FTPJn25nS/rWZ0hrGfKtPIf7mihKkO3pPqX8f2Om6GQ1 /LQyav2uoXqMtEIc09hG+vC9IpX4/vj12ncReslQoJ1h33phu+2/R9W20FvWUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFtQ26MSWzSmY; Mon, 13 Feb 2023 18:38: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 31DIcIaG040917; Mon, 13 Feb 2023 18:38:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DIcIde040916; Mon, 13 Feb 2023 18:38:18 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:38:18 GMT Message-Id: <202302131838.31DIcIde040916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 937b00ac0d2d - main - tcp: add missing void keyword to tcp_stats_init List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 937b00ac0d2ded92e241994c8557d13d68c29b58 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=937b00ac0d2ded92e241994c8557d13d68c29b58 commit 937b00ac0d2ded92e241994c8557d13d68c29b58 Author: Mateusz Guzik AuthorDate: 2023-02-13 18:38:04 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:38:04 +0000 tcp: add missing void keyword to tcp_stats_init Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netinet/tcp_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_stats.c b/sys/netinet/tcp_stats.c index 9a01bc789851..4baf964ff9b4 100644 --- a/sys/netinet/tcp_stats.c +++ b/sys/netinet/tcp_stats.c @@ -92,7 +92,7 @@ static int /* Ensure all templates are also added to the userland template list. */ __attribute__ ((constructor)) #endif -tcp_stats_init() +tcp_stats_init(void) { int err, lasterr; From nobody Mon Feb 13 18:38:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFtQp1RMRz3ph3q; Mon, 13 Feb 2023 18:38: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 4PFtQp0tClz43j6; Mon, 13 Feb 2023 18:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676313538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GB+cz7gGDQn35MZE5O7wZDpHLW/9gwCvB+99bQ0f3fM=; b=g1cJ6oWpdMdbkvvbKeCdwJfegGjiDtXq0wLUYdV+MN5tRdScjAouHF2XkWXVGheuRaxO1O 3NwD/fu4EE+gVXqYYKFPfFuMDJacYBw3uFNrtCLAmI8Wl9lpfkxIEBxwoe2+GdPr0QtbNY UvmR4TTp5311OvJFH2pgkJzCidtn5p3EnZbb1lOM+weMn4FzwZ/M5Ql7nZiVzhCXTWaThg Fx943TdDNiIY3Z1Pf0KzFZxu6kajT0RiMiplr/KHuzg1ksk1anAEYqVYc+KR7YtijpJ+cY AXAr4EXSAqUDFa8MhuQkg4XLYTOajIldfM/3DgC/uUUr48ctgO9LOsJBeuVkqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676313538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GB+cz7gGDQn35MZE5O7wZDpHLW/9gwCvB+99bQ0f3fM=; b=CdknYLYRPTiqUIwZqag1q9fxHik0nS8v6v8CxDVCZ6+OtjsVhLQwcaEz4zvKB3dzUh8pce ++nPBahvLJHwmGFJXJ94t28OOhBcoXzkBBPjZXUTEYOH1qsVhne+RzPmypiR4Hx7koA/SX fb1zypJju7FvLKp2OQilgydCvIytbP/jljvFys7snnA6iMLileoYa0b8r1rVyyGsW5+N1t yPXnzA7TvHq1me65i+1A8AxbtVYeIiraPSNQGW8A1i8VbJ4m67Pe/s+bVkjXgwwTu/808s siekS2En37zgy1s8oGDz8lgviUqidUkhD+RVRQwFDqCVkeKWSN4brrb+5PS2uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676313538; a=rsa-sha256; cv=none; b=PeWBIohJ51owBOmUhleNuLG/l4pGJulUyQP6Qp4GsJ8U8+n2jTaoxuESeCVakZzpZuZ7St 50ZydUOYUa9jsbJtfpULnZVfwphRJI6peryQiZNlXneAnxkYSaPYVk/D9mceE9j4rOvBqy D6qjBljFyN6dNutoxqHa/yLFJJMjm/cHwRVfEXukYs3j/hQ8W6LHbC3smhQlICuQ9y+0DV O15wSWJ5e1qgguPeAIrYqNiluFCXsv/HW9ZR7wihm1ihaJu8WJHXzmbxacb+4wWa5XVisG Nw5SBEvFNGzWP6/KaqeZvPKg1CDE/GaJ6ZMDnKNA4mnSFPZrFM9YML78R5zbWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFtQn746czSjs; Mon, 13 Feb 2023 18:38: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 31DIcvn2041103; Mon, 13 Feb 2023 18:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DIcvtP041102; Mon, 13 Feb 2023 18:38:57 GMT (envelope-from git) Date: Mon, 13 Feb 2023 18:38:57 GMT Message-Id: <202302131838.31DIcvtP041102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 5173c996bc83 - main - psm: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5173c996bc835988a903d23ad384429e815c7042 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5173c996bc835988a903d23ad384429e815c7042 commit 5173c996bc835988a903d23ad384429e815c7042 Author: Mateusz Guzik AuthorDate: 2023-02-13 18:38:49 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-13 18:38:49 +0000 psm: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/atkbdc/psm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 97bf1b859dd2..a308cc81cd3a 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -7395,9 +7395,8 @@ found: * All values should be numbers derived from getmicrouptime(). */ static int -timeelapsed(start, secs, usecs, now) - const struct timeval *start, *now; - int secs, usecs; +timeelapsed(const struct timeval *start, int secs, int usecs, + const struct timeval *now) { struct timeval snow, tv; From nobody Mon Feb 13 19:51:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFw2z0nxlz3pvV7; Mon, 13 Feb 2023 19:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFw2z0J1dz4CcG; Mon, 13 Feb 2023 19:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676317915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bkwDRcigsCYQeHzffEAaf9LExWIqbzOhc1XfjuLjGc8=; b=Xur+pPeVvvdtIiseEAuFqKlXhqiHu8BRe8dNGpRHAfjaSHMGWOE21kjvJanhAr+ZyMzru9 r4cRqytFEPx58lI2/sN4iLatMtGwGjf46+/t9riZgRAXesZBz5lTAx6YsyK6eBLWHAShEM 16QMWb7AXwwXBDVO4MhHp229SBYrD1h3Xlh71+qkHMQhQLY1q/QwYLswybAuU6k9VxkSDC CmXlC6YFoDpeyeTiBAVRGQU3S/vuoreHBuKRdagzusd3yTXavPtYDuwuQJZAQB6CArJuKs T5TqrPl0jTveGJKJK6AJKi1EaVuAODmxUEpCvTVbb5lg4tEwTsZN9umy2ruP4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676317915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bkwDRcigsCYQeHzffEAaf9LExWIqbzOhc1XfjuLjGc8=; b=GRgDGTbRkiSaWOqCteAs0uWr2SUgYN1pQownR9Hy9ZaP+7ePFHcydHesqDEdgIfm1KUu2Z tDGYAWne2NW1i/V19LgZT1q7WRxjl8LvKc4HqDDedRlmXXpCOh1aoUbrTfpcHKkU9XC7D/ E+ekHXJNY7+3iUWUZi3JXg9yhaJoJCUSlHBZtlrBkEL4SA13C8ggBQXdXWPFN18iFIeiCT tVoQD3JzQpeRSfOPisfZ/rZrLfztaoZVmAHPH8W6rQUZam+oLC9q8bvuB3Pbot0xlCDxuy r251r9bavkTmjGRViHqZKifzD7TWyxSme9QCv9AlwTEe0yjeGuSLVQ/oNx9kfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676317915; a=rsa-sha256; cv=none; b=lQcQ7Ub1pUMUd2ltyckhUFjBx/9SpJm3YZDer39JeGb3N2gLW/MpXmus5naARYh2cwz1KI 9AXJtXoLtfbLekHi8egbvcZyn6nYs8JEpdGtzy9r4HZadYG5rNyqk40j28f0XPLEz8uPOl gx0u8LG1maNKfPdRWXvqrX74whQGFmt9ainu5lM33ZhRko6gRHFZ+vVoNfom4zyeHbGVIH 9ByynXzpVNTPOmHLKBbZE4U3zTzwGQuipTVDpIxfRjqvWkpwyi697HLUYaWhFpaDWZxCej hNwLLAIy/HfLblz6EETZv9Uef66vPvjipKiPy0SF7KSrorJ+9WF0rc+ntK4cag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFw2y6VBPzW9r; Mon, 13 Feb 2023 19:51: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 31DJpsFr051988; Mon, 13 Feb 2023 19:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DJpspq051987; Mon, 13 Feb 2023 19:51:54 GMT (envelope-from git) Date: Mon, 13 Feb 2023 19:51:54 GMT Message-Id: <202302131951.31DJpspq051987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1a1f7b7df7dd - main - zlib: Add proper NO_WSTRICT_PROTYPES too List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a1f7b7df7dd7c0638b6425dab4d1aea06441168 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1a1f7b7df7dd7c0638b6425dab4d1aea06441168 commit 1a1f7b7df7dd7c0638b6425dab4d1aea06441168 Author: Warner Losh AuthorDate: 2023-02-13 19:00:50 +0000 Commit: Warner Losh CommitDate: 2023-02-13 19:50:56 +0000 zlib: Add proper NO_WSTRICT_PROTYPES too Also move NO_WDEPRECATED_NON_PROTOTYPE to a better place... Sponsored by: Netflix Noticed by: jhb Fixes: b9f235ba3178 --- sys/conf/kern.mk | 2 +- sys/conf/kern.pre.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 2668b7e5296e..74c47479ab9e 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -36,6 +36,7 @@ NO_WBITWISE_INSTEAD_OF_LOGICAL= -Wno-bitwise-instead-of-logical .endif .if ${COMPILER_VERSION} >= 150000 NO_WSTRICT_PROTOTYPES= -Wno-strict-prototypes +NO_WDEPRECATED_NON_PROTOTYPE= -Wno-deprecated-non-prototype .endif # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is @@ -53,7 +54,6 @@ CWARNEXTRA+= -Wno-error=array-parameter CWARNEXTRA+= -Wno-error=deprecated-non-prototype CWARNEXTRA+= -Wno-error=strict-prototypes CWARNEXTRA+= -Wno-error=unused-but-set-variable -NO_WDEPRECATED_NON_PROTOTYPE=-Wno-deprecated-non-prototype .endif .endif # clang diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 1a94709eaded..e347f9fb9903 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -280,7 +280,7 @@ DTRACE_S= ${CC} -c ${DTRACE_ASM_CFLAGS} ${WERROR} ${.IMPSRC} # zlib code supports systems that are quite old, but will fix this issue once C2x gets radified. # see https://github.com/madler/zlib/issues/633 for details -ZLIB_CFLAGS= -Wno-cast-qual ${NO_WDEPRECATED_NON_PROTOTYPE} -Wno-strict-prototypes +ZLIB_CFLAGS= -Wno-cast-qual ${NO_WDEPRECATED_NON_PROTOTYPE} ${NO_WSTRICT_PROTOTYPES} ZLIB_C= ${CC} -c ${CFLAGS} ${WERROR} ${ZLIB_CFLAGS} ${.IMPSRC} # Special flags for managing the compat compiles for DTrace/FBT From nobody Mon Feb 13 21:09:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmm0ZPQz3q5KJ; Mon, 13 Feb 2023 21:09:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFxml6yxYz4RhB; Mon, 13 Feb 2023 21:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pT0EXrfbLOEFhc+gZNX1Na1/hxgcmm6q4Q95QOGLMlw=; b=OoPc1maW3RR+ab5u5pvCet9/QOISwF+ly8HwFDUD6W6u9XIQKwNoYAy7kde9Lu44Tx6afP M2Elmyv3PNML+mTxv9ZsZA4qtUeLmReNpO0j/8QKvx9i5kaTXZg16pESiemTpf6onLUrj+ FAENcx1p9ECLiAItNJ4MymLdwBbMJ5bZ+GvkF3zQZIEjURyOd31uvVF1icL0mtcLhLV6z4 1FcccmU081d8a76VQQmEk8HVPE8gWrhjalF+RhZJXpB2DUtNrteoB+UAhkZoVaGixuvy/A AcxizNOZMeP1xT/PTAkVp+eJjppAUGdkbihyw/oaYnAe2W4Z39vmDn6jE5FhvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pT0EXrfbLOEFhc+gZNX1Na1/hxgcmm6q4Q95QOGLMlw=; b=nLQGrZecHmvE6cmoXeI6w5gCCXSTx+aj7Sk40DLqNiSvCP0yHJOvs4VvUE0Em6rQLQW4q8 Gnn404lcvPMiacdmgUR+acyGrMaefognRVf+1mONehtFsKSnZ8t6IIAiKiWuQ/WzUXsbQU ZtKvY4IiCe1bOAxkyvNZxkvEYIed/L6L0I6GNeKeDoYLod8/ZKd+LsrqFxyVwInLatCyDg SuiWt4kRbsBNi+ik+xIkiX0+w8XHhr7yWIV76xMhWsYLseTpTlooLTcqqNO05mQR/kqzue xOCQlgOJDCHbfgBIcfgPWw9Tt9N2rpn/nPJimNRLTn6Aj6vZtWo1f50BZO4naw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322584; a=rsa-sha256; cv=none; b=XpHb96ppbpCW/uiKQXL9pCtbi/jbnoKfSXs0zpfjVCgN2uxCZ56Q5GkOxiy3PEFOEKsa22 FIG4V/qcoOM0L8Dl2Q5aETvbNcyB5axOLIhwSUtXcSy/Q6/RL1Tor8WwmAFW6Yf4JE6abf phrJoNsivz1+zhdkbMwra1AHSl0XBCjX9vHGd9qyaJbYFGgFTguFTRgjtOdh/6/eUaSikV 9p48GxHQKRh7he4GoLztYefzg33cpKpeMps88tuMBxV3MTBATDnpRkliq+wwtPo2nzfJwR waZHGTom6AjsieXW6yCFJ39QOlrhjc5FK/zzdtY4Q2FbkqbNea4ywOB+FmrZag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxml5xX2zY4w; Mon, 13 Feb 2023 21:09: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 31DL9hgF056259; Mon, 13 Feb 2023 21:09:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9hUs056258; Mon, 13 Feb 2023 21:09:43 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:43 GMT Message-Id: <202302132109.31DL9hUs056258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: a82a8a5e1935 - main - linuxkpi: Define `backlight_get_brightness()` and `backlight_is_blank()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a82a8a5e193587d819288c3c27f1c9472178e10e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a82a8a5e193587d819288c3c27f1c9472178e10e commit a82a8a5e193587d819288c3c27f1c9472178e10e Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-08 17:51:16 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:26 +0000 linuxkpi: Define `backlight_get_brightness()` and `backlight_is_blank()` This is not used by the DRM driver yet because we comment out the code calling them, but they are easy to implement. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38530 --- sys/compat/linuxkpi/common/include/linux/backlight.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/backlight.h b/sys/compat/linuxkpi/common/include/linux/backlight.h index 9591a4b671ab..5a3c7080b55d 100644 --- a/sys/compat/linuxkpi/common/include/linux/backlight.h +++ b/sys/compat/linuxkpi/common/include/linux/backlight.h @@ -91,6 +91,13 @@ backlight_force_update(struct backlight_device *bd, int reason) bd->props.brightness = bd->ops->get_brightness(bd); } +static inline int +backlight_get_brightness(struct backlight_device *bd) +{ + + return (bd->props.brightness); +} + static inline int backlight_device_set_brightness(struct backlight_device *bd, int brightness) { @@ -119,4 +126,11 @@ backlight_disable(struct backlight_device *bd) return (backlight_update_status(bd)); } +static inline bool +backlight_is_blank(struct backlight_device *bd) +{ + + return (bd->props.power != 0/* FB_BLANK_UNBLANK */); +} + #endif /* _LINUXKPI_LINUX_BACKLIGHT_H_ */ From nobody Mon Feb 13 21:09:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmn1JZ2z3q5Mt; Mon, 13 Feb 2023 21:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFxmn0Wtzz4RWV; Mon, 13 Feb 2023 21:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uM68RcXpgbw+EhmlMlc2mJXKgF/HU5h2J2JtSY39vnQ=; b=wkO1qjfChUp34Ed07Tl5sj2pPi8XczJbZx4WCQI5NFwmo2pnQiWFeiXlphc+wEaFWH+1Ij V71b+Kn9p6Y0lmhmcoCPdhVQoWW2yHbLGrYE9c0JWmF5t/wAmBWX38RbraZAZeRH8p1PCe dA4X3M8dZ4rukFpB5O44hCbNpg/C8jeLHBmjCSL3+nsqTt2crUcjQw/+wQcpYKaKwnaxoU sgPWiLbrec46LRECPpBjvLau0QLUM51pMbBR4Dv7yN7W3NmPOYvRLek2ZBVn0tKHJnIedq qeyUx2m5yBGcYP4HpmmgEBl5Ujoi10VdF+dXI7H+BUP8ZOA3vyVGApPrNBsMYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uM68RcXpgbw+EhmlMlc2mJXKgF/HU5h2J2JtSY39vnQ=; b=Ol/HBXl8yRM9c5c2vMhByV+c9mK7AAglJOwYXK5YKtQCH2LLyKLywMQVtzJfBsejYH3YMh +pbYbwLkjDnfm5wjOqY7bY2IUyDv2uT0BIGj77vwTMwaFgn0vnqpGj2CBdB9Tuz55ZgQBJ IOCfmjRiehHcLDwfajGCZDtUl7cdiwQQgjL/D/lr7JOfquitng/6iZ9z/KIoXnhmhPfV3l F95ikwiOPBKiEPw7HQd6+oOn990Tpp8ZZSZFxJWPifw24quKxidELSVhjCgLDV5aKqbMEb ETsUFrxjI7Y8h4S31yUMRNUzFfkGl8+HD7U4mwMRM+Jk55lIWSUdxL2s9u/0ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322585; a=rsa-sha256; cv=none; b=oX7/RWl7pC5lmOafPrHfYZn2/9yrGHFtRHUm7UkIcnbvioTRDaoD+e2CFv7R4Ubm0+JjrJ k2tmc1mssyELlRl/vR4yPKG/bEiV1x/DcRDwv4TkFK11NuSAnrqFJQRfMgnPTIIxVACDUY q1yUl31dqeNHMKtO0mRnJWdoDpqSg9giFHdG1r3Q7ri0/SSLJmzHrKATyK4x9leBRZdT7z Sd6id3nLdc92N4vttL4OrgBMefphxkjd+fX12S8g+Rz51O5mIoexKNAv4aMjT6s4SAdCzp gFduop0tiWUggEzjQ8px+B09C0hqGWLid1m25LKCldqiP2/w+XE+ZvF5Kh7Qug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxmm6d5NzXYg; Mon, 13 Feb 2023 21:09: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 31DL9ifT056288; Mon, 13 Feb 2023 21:09:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9in6056287; Mon, 13 Feb 2023 21:09:44 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:44 GMT Message-Id: <202302132109.31DL9in6056287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: cf5416908658 - main - linuxkpi: Declare missing `DMI_*` enum entries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf5416908658ed0e4f2ae72916dfe1a84d7fd61c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=cf5416908658ed0e4f2ae72916dfe1a84d7fd61c commit cf5416908658ed0e4f2ae72916dfe1a84d7fd61c Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-08 17:53:23 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:30 +0000 linuxkpi: Declare missing `DMI_*` enum entries Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38532 --- sys/compat/linuxkpi/common/include/linux/mod_devicetable.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h b/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h index 804fbb1df198..076cdffbf2f2 100644 --- a/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h +++ b/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h @@ -36,11 +36,15 @@ enum dmi_field { DMI_BIOS_VENDOR, DMI_BIOS_VERSION, DMI_BIOS_DATE, + DMI_BIOS_RELEASE, + DMI_EC_FIRMWARE_RELEASE, DMI_SYS_VENDOR, DMI_PRODUCT_NAME, DMI_PRODUCT_VERSION, DMI_PRODUCT_SERIAL, DMI_PRODUCT_UUID, + DMI_PRODUCT_SKU, + DMI_PRODUCT_FAMILY, DMI_BOARD_VENDOR, DMI_BOARD_NAME, DMI_BOARD_VERSION, @@ -52,6 +56,7 @@ enum dmi_field { DMI_CHASSIS_SERIAL, DMI_CHASSIS_ASSET_TAG, DMI_STRING_MAX, + DMI_OEM_STRING, }; struct dmi_strmatch { From nobody Mon Feb 13 21:09:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmp2LzPz3q5Mx; Mon, 13 Feb 2023 21:09: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 4PFxmp1Z58z4RZQ; Mon, 13 Feb 2023 21:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=66/kRhUkCSdUPS3FBLaKd0E23AnkDpQiEd/4g+koN5E=; b=e0ROi2XaekIyY4ForUoDb7BtKVoi6lL9fwxf8uVHD6yIgqoa5yajWyza68aHOpRFBiDzTl Yq0hmgHIo+kNEIFnf4sZB1iGnPqgft2naA0/wi4B9yIkyBRux6novWVUsnvaEMXw709fLi TUaeLqO421DtZ4p/eRG5OhfKYiG0UzdspxoBEuI5y2y2j4B+1e9rD2i6zH76/Vv3lIqgw2 3WMIscwiWlA+vRlo8mp53WqbRRiGtc7tgw+E0mAQjcjy7uZ0ORWFr3u3ti5K05Q5Qb2eeW aPvVjLHfSDYUucZ7fE9VR2C3qqRWwg4/nwtIICB/CV6mSQSZdaeJ7r6L/w/BSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=66/kRhUkCSdUPS3FBLaKd0E23AnkDpQiEd/4g+koN5E=; b=lM2dSI81gKd4+s4Bcbcm+Yknd3116weCNn9VmSfU5kUk5/1DvPuvez3XvWFu24Suve+kYj Vn9RCBH5LK9Jhou9UBIKn3H2Q+iLYc19ShBI4l69IpsPd5OhWuhNdeGM9DN305ANelvPhf 8gNWbT6mqLaTdQvu2P+b8VX7AmMiEkEUklZc1op78+/Dn0sgojImhqmn0B/etXVM6Vbrem raBVgvqGYlrjthpu/Mf1LCMXSA0MR1B6WO+WVHuH+G2AHdyOlpfYVdAbUeKADIcv/wI5R9 fHm9m6QFVz2OmiZ5ABvPH9HrBZWoz3qLMbxU33LUZEPTVZwu1poZJGgdQxhf0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322586; a=rsa-sha256; cv=none; b=YHHexaYPHoIyjmBEo9/HNTaiopLEC0AZz4OvBZUFiIUXXjlCOqLCYvv4lOAg7v803ZuFnm he5fXVH2HuvHmJ0WmZMyg/AfCW+IzLCq/EQyc771uhQCHt5QewouQF0KZTMuMI6ld6DAm7 OuO8DV7rq9pZd4RnFYCSZ10DQ4dTTXdXFdGB3MTELyKFXYPGFH9srD0AJk/d9YoP2gmW33 GfV/1iJ2xmId+tUHAIaQMduK5MZ2EY5ZmVihBva/0s5CtD2xFBXxLNvWUrFFML8mpCqDJM PQV8sx/qd/qI8EHolDe3KmL/lTB7TcOcV92jWL2L84dfMcMq8rqXj9dn7UN6+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 4PFxmp0SPhzXrW; Mon, 13 Feb 2023 21:09: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 31DL9jxw056319; Mon, 13 Feb 2023 21:09:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9jSU056318; Mon, 13 Feb 2023 21:09:45 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:45 GMT Message-Id: <202302132109.31DL9jSU056318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 1c6d8146fdec - main - linuxkpi: Update `vga_client_register()` and add `vga_client_unregister()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c6d8146fdec8267712615c261bf6c8800f8ecfe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1c6d8146fdec8267712615c261bf6c8800f8ecfe commit 1c6d8146fdec8267712615c261bf6c8800f8ecfe Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-08 17:53:57 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:31 +0000 linuxkpi: Update `vga_client_register()` and add `vga_client_unregister()` For `vga_client_register()`, the API is modified twice in a row. To keep the API compatible with all commits in the DRM driver, we introduce two `LINUXKPI_VERSION` version bumps. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38533 --- sys/compat/linuxkpi/common/include/linux/vgaarb.h | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/vgaarb.h b/sys/compat/linuxkpi/common/include/linux/vgaarb.h index 853927f1c049..d43a88136864 100644 --- a/sys/compat/linuxkpi/common/include/linux/vgaarb.h +++ b/sys/compat/linuxkpi/common/include/linux/vgaarb.h @@ -239,16 +239,43 @@ static inline int vga_conflicts(struct pci_dev *p1, struct pci_dev *p2) * by userspace since we some older X servers have issues. */ #if defined(CONFIG_VGA_ARB) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51501 +int vga_client_register(struct pci_dev *pdev, + unsigned int (*set_vga_decode)(struct pci_dev *pdev, bool state)); +#elif defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51500 +int vga_client_register(struct pci_dev *pdev, void *cookie, + unsigned int (*set_vga_decode)(void *cookie, bool state)); +#else int vga_client_register(struct pci_dev *pdev, void *cookie, void (*irq_set_state)(void *cookie, bool state), unsigned int (*set_vga_decode)(void *cookie, bool state)); +#endif +#else +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51501 +static inline int vga_client_register(struct pci_dev *pdev, + unsigned int (*set_vga_decode)(struct pci_dev *pdev, bool state)) +#elif defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51500 +static inline int vga_client_register(struct pci_dev *pdev, void *cookie, + unsigned int (*set_vga_decode)(void *cookie, bool state)) #else static inline int vga_client_register(struct pci_dev *pdev, void *cookie, void (*irq_set_state)(void *cookie, bool state), unsigned int (*set_vga_decode)(void *cookie, bool state)) +#endif { return 0; } + +static inline int vga_client_unregister(struct pci_dev *pdev) +{ +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51501 + return (vga_client_register(NULL, NULL)); +#elif defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51500 + return (vga_client_register(NULL, NULL, NULL)); +#else + return (vga_client_register(NULL, NULL, NULL, NULL)); +#endif +} #endif #endif /* _LINUXKPI_LINUX_VGA_H_ */ From nobody Mon Feb 13 21:09:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmq2YcVz3q5KP; Mon, 13 Feb 2023 21:09: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 4PFxmq26vPz4Rqw; Mon, 13 Feb 2023 21:09:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sS+YdkeZhyAMOuCkBqOBQANqdb2C8+tlJZuhPqGVR20=; b=o2io79f1HefXuUm/JTt0YVAWSLrxt0f7LfJHhRGbaJdRB4xTE9POClethY8HvRWn2U4Jaf Et1KRIqgCsX+qaXHv5Nr8AhIcP/yrlyrNH7+CaQ8PSz69Zsrwgu4t5L/6jM4JFFA4fWytX A53XDfed8YzQACRODA7n3EvJk0y3KhS1f5ADgsJ4j1WQw9Rp/Vy1Nq+/UvvAYRr2sqIjQd WE3RuHRZA2GccD22/SSfi8zB1ZnfFG+tr2hA7o14s4ugEnqlUfFzBuFbl7KNWShoAa0ch2 /EoJn2hAtILyu3O3P5UYFc5RGBR6gDbzc9F7APdBMd7EUFrkAwIuvV7qcCKkZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sS+YdkeZhyAMOuCkBqOBQANqdb2C8+tlJZuhPqGVR20=; b=e6O1sEvMt6QWvyKeudvjjOPW7Odlg9r5Rse0cq7LhosrbDl0S4v5BWFLxFTjnE0ILI93Mm IdAlEIOwM6TwiRpHFRTWvUjl7UIESHI1+IrDIlJ7Rc9U0dZYk1Hx9gHyjNUbkZqSKcpQGk XBDKnyArX3+8iHdfOR+LgXiWiTg4Ci5B1xFNoJCKWAzrJP+i4Zy/qq4z++pu/UnmMYowiH vsVs5cXGkY7CSU8Gp25nmTav5IfPFSXuH3INS2rNBXIf7fcRxEAU09ULSFSPNzSMKvgwCe N0TrDemm2nBvAQJ1hTkvOX6jOsAn953SShPe6+Rqns2ozm1D939KQglckU44Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322587; a=rsa-sha256; cv=none; b=mDWktXozSoS9slzb6DDaS6O+wEJTrdY23MxnQcJtGyE6F0ZPCkG2MSXzWlSapRTZglmW4L iMvTiuAO2AHbNE85RKpX4hJ/6SZW3xDOistxOY6lsWCJ/49XRIGJRI1gXQEaB5BHG0L6xu aSxQOwjnVen2Ps39ALe0twgB1N54zDYLYQosZdeyMVqHRPfwtWEAXV93UYnqbBPaantvOH 2G0IkEKdlzgrdyI2Pir9WbVpy4AEBben3viMW1JDRqFAA5BpBuHBe9aWXliOlUezEF+k0U n26861SfsxCFnwYwubADFIV1DWhKRZNVu6ikFZbdvjn+HAzg6CakJjOXgV5ZRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxmq1CBjzXrX; Mon, 13 Feb 2023 21:09: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 31DL9lal056353; Mon, 13 Feb 2023 21:09:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9loE056352; Mon, 13 Feb 2023 21:09:47 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:47 GMT Message-Id: <202302132109.31DL9loE056352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 5542309ec6eb - main - linuxkpi: Define `xa_is_err()`, `xa_{store,erase}_irq()` and `xa_{,un}lock_irq*()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5542309ec6eba3af9e26c50acd654de462181b8e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5542309ec6eba3af9e26c50acd654de462181b8e commit 5542309ec6eba3af9e26c50acd654de462181b8e Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-08 17:55:29 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:31 +0000 linuxkpi: Define `xa_is_err()`, `xa_{store,erase}_irq()` and `xa_{,un}lock_irq*()` `xa_is_err()` is synonymous to `IS_ERR()`. Other introduced functions call their equivalent without the `irq*` suffix. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38534 --- sys/compat/linuxkpi/common/include/linux/xarray.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/xarray.h b/sys/compat/linuxkpi/common/include/linux/xarray.h index 408906867479..8a9d8fa3ea41 100644 --- a/sys/compat/linuxkpi/common/include/linux/xarray.h +++ b/sys/compat/linuxkpi/common/include/linux/xarray.h @@ -45,6 +45,9 @@ #define XA_ERROR(x) \ ERR_PTR(x) +#define xa_is_err(x) \ + IS_ERR(x) + #define xa_limit_32b XA_LIMIT(0, 0xFFFFFFFF) #define XA_ASSERT_LOCKED(xa) mtx_assert(&(xa)->mtx, MA_OWNED) @@ -87,6 +90,24 @@ void *__xa_store(struct xarray *, uint32_t, void *, gfp_t); bool __xa_empty(struct xarray *); void *__xa_next(struct xarray *, unsigned long *, bool); +#define xa_store_irq(xa, index, ptr, gfp) \ + xa_store((xa), (index), (ptr), (gfp)) + +#define xa_erase_irq(xa, index) \ + xa_erase((xa), (index)) + +#define xa_lock_irqsave(xa, flags) \ + do { \ + xa_lock((xa)); \ + flags = 0; \ + } while (0) + +#define xa_unlock_irqrestore(xa, flags) \ + do { \ + xa_unlock((xa)); \ + flags == 0; \ + } while (0) + static inline int xa_err(void *ptr) { From nobody Mon Feb 13 21:09:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmr3qJ8z3q5WS; Mon, 13 Feb 2023 21:09: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 4PFxmr336zz4Rrh; Mon, 13 Feb 2023 21:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UdMG7b7PhKK2Q0PzHZ13GmPU4b5Kjvaua6aeFwkjMg8=; b=h1onaX1XbBSBuVgDWPP7BWWNJe9hZaem0d/1lnUDDEoSpGcAnzA+gU6RH/Zl/2WzIv2yk3 YAyz+k7LLCx6+sFnZUTqLNyrvWYI/kcl1Bl3VlgulnkTt9iH7z5fagLx1XmUqXmH/m2NvC me8zWEpT+KorPXCEHcz311bdiAdecRxAMkBFplcYS60KnzGOjnchQwEP8SOo86zZcaAJ07 FP6C8CjkaWYnFrXDrfyBc7LoQm7sFLnyMrwCUHVnYxjS6OQlXWkdelSKoXiHvGJ3HjVrN6 BdmwVr4BBlHuVzbVrfaBjeMypgKwmQ7VI+Gm8v6Rqj8Iklaw/MTvz0gtL6bFKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UdMG7b7PhKK2Q0PzHZ13GmPU4b5Kjvaua6aeFwkjMg8=; b=uZcfJKzR8oRlA/nC4KK+LuSimcM3TQJjLTDBkuXritpuq4bAHDw4uC20Ex13r2bPKVcrnU Ax/8eNzLZxvcYJDKjo2F5fjh2l6REYRcr6omhf7PBvGvshbH11vNq+VEg9IZNMyW6L1dQd cdkwUn0LbYm3Ath1E7aYaCO+/hDC3/+yAme2pcp2DWpNY1rxFz8f031V7U+WHc0FWUlKHI 7T0Kh/b5OgEJdPGtU2SVWRFBVM/wyU2Xd9g2K7w3kkpatpygMVlaltE8UWZ6VFdQRMnW0M 4z/bWgJBClZUANiSvPk3+dvOP6trnHZ9zjENYOc8KEf2IkjgnFu6Ouoe4eeLSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322588; a=rsa-sha256; cv=none; b=tV+Oc7ewy6K5hr+gj29uvrKTzgu6c2I40x9shWQayfP3ngYCfviMYGizNs6Fh/KncIL7bN DkyQWOqy8O6O4r+zfgpjS0Biwk4AsPp1Hf5F/wwBX67bOxEFfzw4qSz1dycQOsiri2id5Q sFD6D0BybPbNgVGjifsSlwMkZgW0c6hAX8VJUSc+KrwXoxnKhpigiBV1BVZcI6UnJyA1U0 XipXZs7aWwo7CXLMxCpED3bnIXThCdbxqeyNyOaI4j9GQOZWj9qoRC873UovFPN9rClEPK dMsP6Oub4xk84jQdFxLMsDxwJYm8Xcxvq++lFLHyn7x5w4lAtVihe8wK5iDosg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxmr27xHzY4x; Mon, 13 Feb 2023 21:09: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 31DL9mL2056386; Mon, 13 Feb 2023 21:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9mYe056385; Mon, 13 Feb 2023 21:09:48 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:48 GMT Message-Id: <202302132109.31DL9mYe056385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 83276e1f952d - main - linuxkpi: Add `i2c_adapter_quirks` support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83276e1f952d720c23092ea17e95c03fef8476b7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=83276e1f952d720c23092ea17e95c03fef8476b7 commit 83276e1f952d720c23092ea17e95c03fef8476b7 Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-08 17:57:32 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:31 +0000 linuxkpi: Add `i2c_adapter_quirks` support While here, also declare `I2C_CLASS_HWMON`. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38535 --- sys/compat/linuxkpi/common/include/linux/i2c.h | 25 ++++++ sys/compat/linuxkpi/common/src/linux_i2c.c | 113 +++++++++++++++++++++++++ 2 files changed, 138 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/i2c.h b/sys/compat/linuxkpi/common/include/linux/i2c.h index 365ab893fdfd..f24d282586f6 100644 --- a/sys/compat/linuxkpi/common/include/linux/i2c.h +++ b/sys/compat/linuxkpi/common/include/linux/i2c.h @@ -46,6 +46,7 @@ #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0 #define I2C_FUNC_10BIT_ADDR 0 +#define I2C_CLASS_HWMON 0x1 #define I2C_CLASS_DDC 0x8 #define I2C_CLASS_SPD 0x80 @@ -58,6 +59,7 @@ struct i2c_adapter { const struct i2c_lock_operations *lock_ops; const struct i2c_algorithm *algo; + const struct i2c_adapter_quirks *quirks; void *algo_data; int retries; @@ -82,6 +84,29 @@ struct i2c_lock_operations { void (*unlock_bus)(struct i2c_adapter *, unsigned int); }; +struct i2c_adapter_quirks { + uint64_t flags; + int max_num_msgs; + uint16_t max_write_len; + uint16_t max_read_len; + uint16_t max_comb_1st_msg_len; + uint16_t max_comb_2nd_msg_len; +}; + +#define I2C_AQ_COMB BIT(0) +#define I2C_AQ_COMB_WRITE_FIRST BIT(1) +#define I2C_AQ_COMB_READ_SECOND BIT(2) +#define I2C_AQ_COMB_SAME_ADDR BIT(3) +#define I2C_AQ_COMB_WRITE_THEN_READ \ + (I2C_AQ_COMB | I2C_AQ_COMB_WRITE_FIRST | \ + I2C_AQ_COMB_READ_SECOND | I2C_AQ_COMB_SAME_ADDR) +#define I2C_AQ_NO_CLK_STRETCH BIT(4) +#define I2C_AQ_NO_ZERO_LEN_READ BIT(5) +#define I2C_AQ_NO_ZERO_LEN_WRITE BIT(6) +#define I2C_AQ_NO_ZERO_LEN \ + (I2C_AQ_NO_ZERO_LEN_READ | I2C_AQ_NO_ZERO_LEN_WRITE) +#define I2C_AQ_NO_REP_START BIT(7) + int lkpi_i2c_add_adapter(struct i2c_adapter *adapter); int lkpi_i2c_del_adapter(struct i2c_adapter *adapter); diff --git a/sys/compat/linuxkpi/common/src/linux_i2c.c b/sys/compat/linuxkpi/common/src/linux_i2c.c index 72ad37919d7f..253482b52550 100644 --- a/sys/compat/linuxkpi/common/src/linux_i2c.c +++ b/sys/compat/linuxkpi/common/src/linux_i2c.c @@ -167,6 +167,116 @@ lkpi_i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) return (0); } +static int i2c_check_for_quirks(struct i2c_adapter *adapter, + struct iic_msg *msgs, uint32_t nmsgs) +{ + const struct i2c_adapter_quirks *quirks; + device_t dev; + int i, max_nmsgs; + bool check_len; + + dev = adapter->dev.parent->bsddev; + quirks = adapter->quirks; + if (quirks == NULL) + return (0); + + check_len = true; + max_nmsgs = quirks->max_num_msgs; + + if (quirks->flags & I2C_AQ_COMB) { + max_nmsgs = 2; + + if (nmsgs == 2) { + if (quirks->flags & I2C_AQ_COMB_WRITE_FIRST && + msgs[0].flags & IIC_M_RD) { + device_printf(dev, + "Error: " + "first combined message must be write\n"); + return (EOPNOTSUPP); + } + if (quirks->flags & I2C_AQ_COMB_READ_SECOND && + !(msgs[1].flags & IIC_M_RD)) { + device_printf(dev, + "Error: " + "second combined message must be read\n"); + return (EOPNOTSUPP); + } + + if (quirks->flags & I2C_AQ_COMB_SAME_ADDR && + msgs[0].slave != msgs[1].slave) { + device_printf(dev, + "Error: " + "combined message must be use the same " + "address\n"); + return (EOPNOTSUPP); + } + + if (quirks->max_comb_1st_msg_len && + msgs[0].len > quirks->max_comb_1st_msg_len) { + device_printf(dev, + "Error: " + "message too long: %hu > %hu max\n", + msgs[0].len, + quirks->max_comb_1st_msg_len); + return (EOPNOTSUPP); + } + if (quirks->max_comb_2nd_msg_len && + msgs[1].len > quirks->max_comb_2nd_msg_len) { + device_printf(dev, + "Error: " + "message too long: %hu > %hu max\n", + msgs[1].len, + quirks->max_comb_2nd_msg_len); + return (EOPNOTSUPP); + } + + check_len = false; + } + } + + if (max_nmsgs && nmsgs > max_nmsgs) { + device_printf(dev, + "Error: too many messages: %d > %d max\n", + nmsgs, max_nmsgs); + return (EOPNOTSUPP); + } + + for (i = 0; i < nmsgs; i++) { + if (msgs[i].flags & IIC_M_RD) { + if (check_len && quirks->max_read_len && + msgs[i].len > quirks->max_read_len) { + device_printf(dev, + "Error: " + "message %d too long: %hu > %hu max\n", + i, msgs[i].len, quirks->max_read_len); + return (EOPNOTSUPP); + } + if (quirks->flags & I2C_AQ_NO_ZERO_LEN_READ && + msgs[i].len == 0) { + device_printf(dev, + "Error: message %d of length 0\n", i); + return (EOPNOTSUPP); + } + } else { + if (check_len && quirks->max_write_len && + msgs[i].len > quirks->max_write_len) { + device_printf(dev, + "Message %d too long: %hu > %hu max\n", + i, msgs[i].len, quirks->max_write_len); + return (EOPNOTSUPP); + } + if (quirks->flags & I2C_AQ_NO_ZERO_LEN_WRITE && + msgs[i].len == 0) { + device_printf(dev, + "Error: message %d of length 0\n", i); + return (EOPNOTSUPP); + } + } + } + + return (0); +} + static int lkpi_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { @@ -177,6 +287,9 @@ lkpi_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) sc = device_get_softc(dev); if (sc->adapter == NULL) return (ENXIO); + ret = i2c_check_for_quirks(sc->adapter, msgs, nmsgs); + if (ret != 0) + return (ret); linux_set_current(curthread); linux_msgs = malloc(sizeof(struct i2c_msg) * nmsgs, From nobody Mon Feb 13 21:09:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxms6S5hz3q5bW; Mon, 13 Feb 2023 21:09: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 4PFxms42VWz4S7s; Mon, 13 Feb 2023 21:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pTDeemukeZNPP/9q7aqIgxy9xXrcD+jecxQSmEV3WZ8=; b=DJ79t8ZM3uof7uorIfyY18jFL3DESx0v+dIyxJkrj9+AKYxAH9hEx56i6Sb/TZIXrvsEjp pfch2fnRds+f++0PxEgOSee1vfVqBRBHxEcAkR/gZXor8pxz3+jy+lxJxt4apA7oYOCqo6 w/gu690v707natwzGSIK42Oc71Bb38J9AILftA3hb5uKYL+axYLuxu2Mvke5/g3Y2n4sPt wFrUD0UqWPpFlwxYPWLIiuV29rTLx0mx/sg29O79Spm+YLAyfX6UIwm+WWY7A6vQHdJ9np Jzx/FeIJKSqKz5ALAX1Rnb3D6pSIowOTRWeFmytOGyLOG+l7HXksv3yMyAiNlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pTDeemukeZNPP/9q7aqIgxy9xXrcD+jecxQSmEV3WZ8=; b=vbqwfq8gw9TLjxuEwCuQA4e9tSkVvsrSASJbwXNuitwjeJtkdCEU1r5Hfr4JnMZI5/ANRU jexrpwOfIEHYCMFCwiBg6TeIzTQymlZYeVc10beqyLSOh+TIkn/HKe/06FZaputS/v6vLi Ulyln1N87pawvMbV48s7PLaLb3BNOIClU61EoBDxoQJtyuDFO69XiwBVVTFpt+fmFf/iXt FKr4CI/mXH0KZ4jk9bvwkLOi7RJYGoW8znLyf1xdVv05K3oJA22nXUTbr2vG5yfbJ53pyl k6pjFfb4kMjowdSrK9p0qEVxqncRvIZrZujmrTcnnUGpsZdkficx5YK6EcW/bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322589; a=rsa-sha256; cv=none; b=Z4KmDC9Z16A616uvu30GKRwEWdEtvJ2FAMzxmdRlCk6bk4PJ20csLcLH7ErQQOkCZ0TmAX 1SewAiMYoHYKpzqC07MpLaqQhDC/wEm2Homo8CFedFX+KCg7rKMBswpUuy08RWn+RrOfCT okAaGiCPeUJNItv/Qgh9N/Ddricckw5VKKIQhbEzo0grgP7PlmBtV/JM7NBeYp7fwS85x5 ENXfn3QORjjY7tFtrsUwPG5R4ILtvmTNmUeizi71OuL7Yzjab4eYxB4q27BedQzaKOZWQu Y70HZiBpuAhZvrFGkiiYxSXOJwXwQwZ/XG+OwLgwRPVGbLFN8Y6y5Ql3AE99fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxms35GrzXbg; Mon, 13 Feb 2023 21:09: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 31DL9n7a056417; Mon, 13 Feb 2023 21:09:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9nqG056416; Mon, 13 Feb 2023 21:09:49 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:49 GMT Message-Id: <202302132109.31DL9nqG056416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: bf6f66508139 - main - linuxkpi: Define `FIELD_FIT()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf6f6650813959ecf3469854ad266c5a5590c754 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bf6f6650813959ecf3469854ad266c5a5590c754 commit bf6f6650813959ecf3469854ad266c5a5590c754 Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-08 23:38:22 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:31 +0000 linuxkpi: Define `FIELD_FIT()` Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38536 --- sys/compat/linuxkpi/common/include/linux/bitfield.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/bitfield.h b/sys/compat/linuxkpi/common/include/linux/bitfield.h index c22757d54290..d21c7f9868dd 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitfield.h +++ b/sys/compat/linuxkpi/common/include/linux/bitfield.h @@ -127,6 +127,9 @@ _uX_replace_bits(8) #define __bf_shf(x) (__builtin_ffsll(x) - 1) +#define FIELD_FIT(_mask, _value) \ + (!(((typeof(_mask))(_value) << __bf_shf(_mask)) & ~(_mask))) + #define FIELD_PREP(_mask, _value) \ (((typeof(_mask))(_value) << __bf_shf(_mask)) & (_mask)) From nobody Mon Feb 13 21:09:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmt5wR6z3q5QG; Mon, 13 Feb 2023 21:09: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 4PFxmt516Nz4S5h; Mon, 13 Feb 2023 21:09:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=48B6aaTTUob2cE8D4TFnDBwZnvy3PlPiJ6eO8wvATyI=; b=okcT2lojVt8IxbSj/PSEPuENeErxir0vvL9DNdFNH5bw0KZL2/InCQZ4xQxYgsGm50dMbl c60GnI19aBdYYQC5KX6xop9xY4ZyhuIfDnsBFdbbgcxiuM43FpnNrazDtCecvyVS9SRXLP aVJzyfVZR75TavcYvyiJOjbSmqEJmodCeJWPbqZhBhzh7e8btJBFhUJEbVJFw0H1STxwm/ Xv5grmlY6MtjbYG2sIKsMWQOU0jk1m5fMc/SKTG3IiXuckzRS+3//KlVEP7R5eaQQAo0v2 +B59/XvAqjRbglu/cvZ1rZkol7Zi5wkjyrEusmNRFHzBRmpzKDMh2Fz22WYxDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=48B6aaTTUob2cE8D4TFnDBwZnvy3PlPiJ6eO8wvATyI=; b=YDMXVS4q07DKFuIVgwib0Jo1B1eWFXHKXT7MuJVBuujpkA5ddxaZxeDwqa8YMZn9u/4LzI KN1DoOow8d2enJD3+KQIXv3E/yvudGVX45VljrWnAyExTsDxY+be6k1z96PbhPEDmH7gPC y0W6rNXunTeQ6LH7UwubGEIne8riT9vFOgCOv8ZvujyhCsXDrxdH48v+88cRyH3vL2BJeP iq6qQJCCUxsZl7snWbMkD7jgzRha11sE+naVxNje4Ac8zsNEbgp+JlZBoWrJ0Q0LRPRlwK i//qjRnUZjbq155flr+Jx4Mj+tiee6MACeZ8UFM5smxfPHuoJT0S7KSXwPcy/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322590; a=rsa-sha256; cv=none; b=Skn7RF8pDHl+rO3lCsW2U5nj/Jfy1KOZPZhqRklR8RVTE0CZw5WHk6RNpY2LyES6achxv+ 3cHtLWtH42CN1i7hXKFXNt5vyxQGrXGYg8vsU/2cplMGG6n2P06u62n2NUbNcf+1zF0juC wuXen031fw/W2yC7U+auK5BhmZYsAfHxmDjm2BiG0dUaWO8IPuWaNvyMb23yaVWAOTOGxQ PnVI7OHtuA8F9tCmDqhwXRnj6MDf8L39jYVWvQOwEY+yELWuNnYe62Y6yTlEX8UvTEV1GQ JCOKvUGLRSpg7Z7RZz1SR00BuY+BWK45xtAN9wP4w6y0eSXqwn1SJCnYX5fxXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxmt45hFzXbh; Mon, 13 Feb 2023 21:09: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 31DL9o1R056446; Mon, 13 Feb 2023 21:09:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9oPs056445; Mon, 13 Feb 2023 21:09:50 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:50 GMT Message-Id: <202302132109.31DL9oPs056445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 54606590dffc - main - linuxkpi: Move definition of `struct list_head` to List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54606590dffcd23136af1c26da38206f4d3a6269 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=54606590dffcd23136af1c26da38206f4d3a6269 commit 54606590dffcd23136af1c26da38206f4d3a6269 Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-09 12:11:34 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:31 +0000 linuxkpi: Move definition of `struct list_head` to This is the case on Linux. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38537 --- sys/compat/linuxkpi/common/include/linux/list.h | 8 -------- sys/compat/linuxkpi/common/include/linux/types.h | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/list.h b/sys/compat/linuxkpi/common/include/linux/list.h index 6ec715291807..46da7cc7bc8e 100644 --- a/sys/compat/linuxkpi/common/include/linux/list.h +++ b/sys/compat/linuxkpi/common/include/linux/list.h @@ -86,14 +86,6 @@ #define LINUX_LIST_HEAD(name) \ struct list_head name = LINUX_LIST_HEAD_INIT(name) -#ifndef LIST_HEAD_DEF -#define LIST_HEAD_DEF -struct list_head { - struct list_head *next; - struct list_head *prev; -}; -#endif - static inline void INIT_LIST_HEAD(struct list_head *list) { diff --git a/sys/compat/linuxkpi/common/include/linux/types.h b/sys/compat/linuxkpi/common/include/linux/types.h index dab5e6ddce42..aa19163ddd26 100644 --- a/sys/compat/linuxkpi/common/include/linux/types.h +++ b/sys/compat/linuxkpi/common/include/linux/types.h @@ -79,6 +79,14 @@ typedef unsigned long kernel_ulong_t; typedef unsigned long irq_hw_number_t; +#ifndef LIST_HEAD_DEF +#define LIST_HEAD_DEF +struct list_head { + struct list_head *next; + struct list_head *prev; +}; +#endif + struct rcu_head { void *raw[2]; } __aligned(sizeof(void *)); From nobody Mon Feb 13 21:09:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmv6Rfbz3q5WY; Mon, 13 Feb 2023 21:09:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFxmv606Kz4S3y; Mon, 13 Feb 2023 21:09:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLFWGCk5Nm5+xZFs7vvnRfqm5ikrTyaFerUXajbi3EM=; b=Xdh3OPX2VE1dmpEdxEQthfGbD1Efe89R2D6283/8jhipm5K0YO907Zzqu1JyvWH+T7KE6L +Nxqy1eBt0JlFIM+8JblOH7Dbllj0ReLRdcy3OiB1hCLaDFPWCz21lhZRAk4zXbgqhR3xg LcYa3qEdTz+Z1xA/D56jFMpGZ7OAtE0PjFTTgNnaP1dGOaVmvynryzkp3oOQkxFoDyF1BN 2aqprtB7PCk0IUPnyZ4uQWgHdWC3YtXKWf8i8FxheSsN6OofcnAlehQHJ0Lz16CFFR3WTN hGdZQxbVe32kQBqryx5bYCv8QpaCPYKRtZoUOPigZgYHMiuH6bZXbQ30n8u29A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLFWGCk5Nm5+xZFs7vvnRfqm5ikrTyaFerUXajbi3EM=; b=tgHuM3PngSL97D+koOAClh4n4Yx/pnkCOaYMRKIekafdP5i4vZHQNx+5BLyFYXxYY0VEQ6 wBElh5tcu4qRfcazS0g3dbRglbi9FmyONWR8IaNxTAjEompEj2u0Zs9bws7sYE09AuN09d UxBOnTxuas08s8VsOJMqyAsgGd+MTOkvH3HB7paNMI2Y92x/NO6yK2Q9Z/diBDxY9o9PLT Hz6rQo4JWoADYedtptMx1UBR+5330Nlz5z1NM/Aywd6jPNiar3GXfPK92u62hcOZ3XxP7i pYyf4lLCeE5PxiDj1CtU4rZ8Q1E8bSeFK6dBBpM5Mdck87jBCOSiDja2k4YthQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322591; a=rsa-sha256; cv=none; b=UpeBzCJIhk6F6pN0M7eZSK91ZDzXE7tOSOU+LxWlGn3b8CFgxiwL1BYTuceCs+DsFYYX8n 0RTRoQSK0k3xAZvbFoQGERPEQalXNMZSiyj4h10zn0nDWaFk7nnjFpcF0gGPm51KDV4Z5D 4qLIrCQF9Ua2AEGl7U0R/aMoKfACWB/cexFo1m6pi41LADZcyLE6nEZOYcQpvc7INIEGSJ ub8Ctt5m4phxq3efISsEm+Yw+6tqyBS9ZUU4FcAnGSARauRkR4nAN4fkl11OdxhX1j6rJ+ 5j8LiDYxTxhRdJbcMW/Zt0/cPJPb4Nsa6SGrYpyh3HQwf/EZjMj/yYfn+/FsvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxmv55fNzY2q; Mon, 13 Feb 2023 21:09: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 31DL9p72056475; Mon, 13 Feb 2023 21:09:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9pPT056474; Mon, 13 Feb 2023 21:09:51 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:51 GMT Message-Id: <202302132109.31DL9pPT056474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: b82bcfb66fa5 - main - linuxkpi: Define `lockdep_assert{,_once}()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b82bcfb66fa5ef30939f3f5169a07bf4bc139e71 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b82bcfb66fa5ef30939f3f5169a07bf4bc139e71 commit b82bcfb66fa5ef30939f3f5169a07bf4bc139e71 Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-09 22:04:26 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:32 +0000 linuxkpi: Define `lockdep_assert{,_once}()` Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38538 --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index 1f68d6fbc22d..97991c4e598a 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -52,6 +52,9 @@ struct pin_cookie { #define lockdep_unregister_key(key) do { } while(0) #ifdef INVARIANTS +#define lockdep_assert(cond) do { WARN_ON(!cond); } while (0) +#define lockdep_assert_once(cond) do { WARN_ON_ONCE(!cond); } while (0) + #define lockdep_assert_not_held(m) do { \ struct lock_object *__lock = (struct lock_object *)(m); \ LOCK_CLASS(__lock)->lc_assert(__lock, LA_UNLOCKED); \ @@ -81,6 +84,9 @@ lockdep_is_held(void *__m) #define lockdep_is_held_type(_m, _t) lockdep_is_held(_m) #else +#define lockdep_assert(cond) do { } while (0) +#define lockdep_assert_once(cond) do { } while (0) + #define lockdep_assert_not_held(m) do { (void)(m); } while (0) #define lockdep_assert_held(m) do { (void)(m); } while (0) #define lockdep_assert_none_held_once() do { } while (0) From nobody Mon Feb 13 21:09:52 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmx2DDqz3q5HJ; Mon, 13 Feb 2023 21:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFxmw6pKZz4Ryj; Mon, 13 Feb 2023 21:09:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYnN95BO47KnbJjemA5OryE9SaiWUbcsGztdNYbErJA=; b=wNruXpX5i6ZcApD8eZry4L0O/hAn5nqcxY/u6wiTN8Av2w4s51plR7tSPfiWZp6nKed44a e8su3AJT5Hgam1HAxmZZjavp4ae61h/tCWJoOtv3rPlG0iAdbNJQNo3h3ffCovFJOeeovu 0+yrJtL2AQAjAvb493C2hPw04VhaPMut5ZFu2CZX4ZAFCVd3Hk/XYfc9KTNQj2TaQvpiGR PT2Ei17Q3q9LPymDJFWqGedMAGd/2PUZa89s0/LK5kv3BN3mBqwKH/EugVyOGZ1zSArtG5 bIUOnedgmbslzV0EcGJ3N7fYX5/5wZm/hrRORcFZ7W7eJfqs63d/w5VvEybxSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYnN95BO47KnbJjemA5OryE9SaiWUbcsGztdNYbErJA=; b=gVY27zBmz8IfFAKoF7QmJ3aLNdeRRqf05sAtWDxVa2b/zkA0gj7y1YvKALz4kKxTFdbj7e pRUGpsOXoKhVyWEFZ7CoZuA0on2JTfC9sM5Wwq+BWwUINTP++VICG27b/HXC4vYEp7W9S0 y1VMpUu5Z9SSNRu33QEiQsDu+Ug2CXoNrhctMQRXPha94MHouLKrrbnOgK1uICQdpvPLKr 1JRydBv3eZ8UeoMru/rgp7JrHTzOBeRNFOtdR/WRxwCa+6qXUiki41HRF9z9QBm4lPJW2k 1V+3rNhSrrAQMaPJX2cZRJJA8WISaLKz+ETD5i77qj2dqbo6ZwKbKu9qMqbzzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322593; a=rsa-sha256; cv=none; b=D2vGigE8PquCF5mEDNBh2NLh110RqYBV7iI0hpzHfKCrHHEpX43LvmRexVQzss2rqe3RRw K1mz5SP/C7+rJ2v8m/gi0WG9kYkxBIHKBhszsS/FTW9efCOsPhB/ptU+pBb5H21xweLtJB pewrZoAGUNJdqPFaGMjiSytMWkw1D7qJRBNnmArptu3L3nqEH8M8o9c1W5JmuXhfWZF4QY uZODhWtjLLEow9lW9ADDod2CC+QzjOTDAqCXxSdAN/UaCDv7bVWd64MLUA1yRDzROi5Jrf AmNambpjP7NcxQooh56NxERYncczeYVEJrdZICCTmMooGMfFvN+kNT/GYnvZ3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxmw5vJmzXYh; Mon, 13 Feb 2023 21:09: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 31DL9qGb056511; Mon, 13 Feb 2023 21:09:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9qIo056510; Mon, 13 Feb 2023 21:09:52 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:52 GMT Message-Id: <202302132109.31DL9qIo056510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 210e756d4b32 - main - linuxkpi: Define `IRQ_NOTCONNECTED` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 210e756d4b32f43e8cc5f748456158757892a46a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=210e756d4b32f43e8cc5f748456158757892a46a commit 210e756d4b32f43e8cc5f748456158757892a46a Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-10 10:26:17 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:32 +0000 linuxkpi: Define `IRQ_NOTCONNECTED` Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38539 --- sys/compat/linuxkpi/common/include/linux/interrupt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h index f7915863525d..03fbcfa76245 100644 --- a/sys/compat/linuxkpi/common/include/linux/interrupt.h +++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h @@ -47,6 +47,8 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); #define IRQ_DISABLE_UNLAZY 0 +#define IRQ_NOTCONNECTED (1U << 31) + int lkpi_request_irq(struct device *, unsigned int, irq_handler_t, irq_handler_t, unsigned long, const char *, void *); int lkpi_enable_irq(unsigned int); From nobody Mon Feb 13 21:09:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmy1k8Lz3q5L0; Mon, 13 Feb 2023 21:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFxmy0xvqz4SHV; Mon, 13 Feb 2023 21:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HNrkHyUkF+oXbO422ARz2/VhIN3hcix6CQqkTPBP4JQ=; b=FU0FIWJoEInaClv5dJBUd/9Ox36NIYTSM4K9aMUTuhOATb+PARqfqN0QGFf0ho7PaUYxxv bwwi9W6mljpmMTn7DzI/QypOPd8mk+Et/tKHcxB9+5vmIhMTf4M2Fhx8bqGSvnXRwCxFnb +714tTOHkAQLp4uDqRhNZJLimtUKMxhdBlXwqCBqcY+Jt2ZbvhFg++68BBc28zzM8Ywpo1 HaN05wabCF4fDFOQCtiSmRFUtflomEgEXAjasZ2GHZucMhdNz88sLhUnGZ8xT74m+htWv2 dd5ZeuE0vymKYXQ1MzcziPsrt/mp9+ESBQxd+hW5sgfoPtgjSGAMxRC4GxtL8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HNrkHyUkF+oXbO422ARz2/VhIN3hcix6CQqkTPBP4JQ=; b=T1d5WgBfOKD4DBm5a1lYMlqyNA4GJxKnLrwV9hJgZAft1CNwScI1poLwyKDYybr6OBXw5L G1jpB5L4fLwgkQwOgzD/yPFS8mD/aLWbJB+ecSCHTEo0NjDAA5YNZO6Hle8wsapfR+V6Z9 NS4C1Tunnr/Dy6P4CtgjGtj+zv2A0uXIG8JYYpGZmlCm1QB9iJHO11tlQtXldECyISOkCu /JoVhujVAdwjpZWE57z142WdgGS3pAYBLyOk0/J3w/01WMwRgsTXj7GfV38/dk1Vupdbau Ga7e1Otwou2YgA08MioPmu2/Vqdc/ZsRAh94jUR6+34ue0FD3Ae+un3cXSMh2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322594; a=rsa-sha256; cv=none; b=rvm5D9nOuqsArtDEvk8i3XKII7mlfg/O+egO3GZ7cO9zK+Ohu1MaxqOC4f+cOw1GBgKmyk TQKnTuc2EBRDxEH8YGMDgErnGeTCWLXQRgjCWj/HqzaZor0TmOteGOyQ/kfmPzLAnybrSN JL9owSJqRVwbRJt5XmIgTom66kHpXCDwpxUVspY4NlLL/ChK++NNdZLAI5A1gySkx0YkSW /rWhZB9+s3KJGPru3UlIxEQOaISfnG8OeaP0yckNMilo2vziDYP1jV517W3NZgJk7OklpG 4uNTS3b0FarbjsxCm2za0Qo0B5TY00UQY/UUpBuK76RUSxiFa0jHMhFmkdkECw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxmx6rnCzYCr; Mon, 13 Feb 2023 21:09: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 31DL9rf0056540; Mon, 13 Feb 2023 21:09:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9rK8056539; Mon, 13 Feb 2023 21:09:53 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:53 GMT Message-Id: <202302132109.31DL9rK8056539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: d91cf060205c - main - linuxkpi: Add + include it from List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d91cf060205cfe479675d7fb4ec95d2ed6a9b76c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d91cf060205cfe479675d7fb4ec95d2ed6a9b76c commit d91cf060205cfe479675d7fb4ec95d2ed6a9b76c Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-10 10:52:12 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:32 +0000 linuxkpi: Add + include it from The header was moved in Linux 5.15. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38540 --- sys/compat/linuxkpi/common/include/linux/kernel.h | 2 +- sys/compat/linuxkpi/common/include/linux/stdarg.h | 33 +++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/string.h | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 54b558d0bea2..aee299efa732 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -58,7 +58,7 @@ #include #include -#include +#include #define KERN_CONT "" #define KERN_EMERG "<0>" diff --git a/sys/compat/linuxkpi/common/include/linux/stdarg.h b/sys/compat/linuxkpi/common/include/linux/stdarg.h new file mode 100644 index 000000000000..b6141038d69a --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/stdarg.h @@ -0,0 +1,33 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Vladimir Kondratyev + * + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _LINUXKPI_STDARG_H_ +#define _LINUXKPI_STDARG_H_ + +#include + +#endif /* _LINUXKPI_STDARG_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index 932bed81d034..65422cac629c 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -39,6 +39,7 @@ #include #include #include /* for BITS_PER_LONG */ +#include #include From nobody Mon Feb 13 21:09:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmz2Gztz3q5by; Mon, 13 Feb 2023 21:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFxmz1qPpz4SR0; Mon, 13 Feb 2023 21:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21sGiAk2Uj+jOHkd4QxZowlXlaDfOaWQJ60EXsAnJS0=; b=srZVzhles8MkhHxKUi9nnfMqjjdq1fgKm6vCBuEOWtcvSvh9B7AZc/xR1t5bE6VGIg6iZE mmjF9TELpBX3VFhwYsO3OVbTzVO/Lp6M+mR9s6Shp+uI1A5wIW4rM2K0sBe7/YmLm2QBbu 3JT/EyymnmqUkZlUXVBzYwVmk0TBSzERFPA7RLUzV3DXVpgaycvUB2s/NKRGr6FtqyUwtD LLsJ1sAQz7GSeQNWaaBozmri7NZ0msMgUaRZE9GRIurkRV10tYXzSlmrv5bhuwz/j8lpa+ vZIB5jKPwlT7sLBMq2pAUviihMj7gZuc3/hzDhghxKG1iASoHnkN33NqWxlukQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21sGiAk2Uj+jOHkd4QxZowlXlaDfOaWQJ60EXsAnJS0=; b=U3He0FBVvUe6kGyZLFPmYz+b9wYSjw6xrvPVsS9bZNzpN057hbISaYWFXy1lxBox5IMBU5 Xd2f6PlE8CYlvhj6TkbXxCm3hSIt/vHx1OpJpHWkwaCqmNcvNmGWYOxJaXysMNcChjvk5e EdEAWjhvxaM4/YMGrYlJlKO51ljUoPEnUdYwtXQGf3BzRh8IAffnZF1iQZcxnHvicl6OZO nlPLPQdApnTYCe3ej9nnM0XSmNaSi80XTXKCL7vk9z1HGBJEM2g0QrBkM4YZIlnBzDZirO IYWHHmESQPkh/zM2oDqe1r787bORUrZDGF2J7f3fi1ki7QgkLWfzUKZTy/iz5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322595; a=rsa-sha256; cv=none; b=Z/QFy35Nm/oFttGvrGNJvPeB+Tzd4fIDNtCCzGeKRdmi40gxo1oGjTAFYJ7PcdYnP02PLv wM9YiL6vDoUltx7gMhE45+c4qAS8PKhLm3iLqULIOHKYFTID8KDMH7Z6j3mfMitE8xxvkP ZRsWoTDHL5XyhOMkC5qWX9TLYSYstpE5UWns8Ht6zj5C12EFCb2NAw6Jbm2cYkL8sDWDSf lr9+ZxAXS9t0zpJ9FNVEDEDQWiskb6Scih1vZpguDbJgJeISyg4e8WTRb7/874G0mOGPW6 J4+jQc47AoOfW5CJToWK7V9QLqQdHFPBNzBATmObsx6N9+DIiPN82NVSm0yyyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxmz0hQVzYCs; Mon, 13 Feb 2023 21:09:55 +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 31DL9t7D056569; Mon, 13 Feb 2023 21:09:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9tT5056568; Mon, 13 Feb 2023 21:09:55 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:55 GMT Message-Id: <202302132109.31DL9tT5056568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: f3490083b731 - main - linuxkpi: Add `sg_alloc_table_from_pages_segment()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3490083b731700f2aa7c17ac6fe159826dc59a5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f3490083b731700f2aa7c17ac6fe159826dc59a5 commit f3490083b731700f2aa7c17ac6fe159826dc59a5 Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-10 15:37:31 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:32 +0000 linuxkpi: Add `sg_alloc_table_from_pages_segment()` Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38541 --- sys/compat/linuxkpi/common/include/linux/scatterlist.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index d1a71258c27d..fe4bce06819d 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -427,6 +427,20 @@ sg_alloc_table_from_pages(struct sg_table *sgt, #endif } +static inline int +sg_alloc_table_from_pages_segment(struct sg_table *sgt, + struct page **pages, unsigned int count, unsigned int off, + unsigned long size, unsigned int max_segment, gfp_t gfp_mask) +{ +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51300 + return (PTR_ERR_OR_ZERO(__sg_alloc_table_from_pages(sgt, pages, count, off, size, + max_segment, NULL, 0, gfp_mask))); +#else + return (__sg_alloc_table_from_pages(sgt, pages, count, off, size, + max_segment, gfp_mask)); +#endif +} + static inline int sg_nents(struct scatterlist *sg) { From nobody Mon Feb 13 21:09:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxn055mCz3q5QW; Mon, 13 Feb 2023 21:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFxn02cq3z4STX; Mon, 13 Feb 2023 21:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gJ9mYL0gg+Td9no5K8/FI1Ai9k79JonRLUHI/nGiWOM=; b=B1GCn+pOhZzGUIPEPn92ZMNJI1uMZ6GmFbRaAUO2to6OE487sXfyt9be/bj2EwhSoJovRn z5+Sz+suMV+zEkuxqeojy7qrHj3zV+fYrQyGbN378Kb50LXUGJmN+hSrmvA85QK+XKH3oM acgMK4KiBbxszIbLR3pXV6P+9hDJh8+fkaarSXosF0a8KWHdcdTFIyXPT5Tff8/6sXGF+G hrk4EwQVC5sJzyBGUfxzRlCuUnsyCH8RnA+8Uhc1cDjqy+F7r0M79NhuywMcZ8cBw504gD 0h72uvxkpW10ThIf1v9M6msH26mvmdfqHU8UAj+YWCqCDPIsgcl6QbBko0GRnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gJ9mYL0gg+Td9no5K8/FI1Ai9k79JonRLUHI/nGiWOM=; b=jRk6GFmKGR4xpGxxEC6SYWJA+pEHGaI4it3d5HDBEstClsP5lGKDJB3iu6XbCtjF+NujPv pAqsxXBxQ2IXRfRL6U5Osz8ccqqYPWWBJFOadkxIhy3AFn9X4HBef1Znl3IIiWtWT0DqGl KfEo2Hc1qI3TPOIyJqJEXmQqVOT4cyi3L8nSlRemKxML+n2ioksK40mggH6Txhl4q8uYVl oiYIrUaFjjmOCbW/6h11gn+xkBc4acK6Cmrn9DbaxLWlkwP+27twDI0DrAlQpnaoghnVOF 6pgt83OPPyCRWuW+8Zx8MPOkehcHzW4JmgSyVdJ0pMEhuUWOJdUzwwMsxls7zA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322596; a=rsa-sha256; cv=none; b=qbJiGp1jLmGCqo67qzTC3+aNtpp5OVIK6CvQDutDsSm+YGQvGuAqpShF/465gWUvBf5KqN eqkO0DWGDoAirFlbiLpAvF1ul5zVUDD5nxXTyirZscu7qUyqzWI/HY8WXlUSOOLfJeH/ak 2KwO9RoqkblyT8AO2zzzNeZLQO8flzTfGH41MmzFjD8W1zWL94mW/JzIlsVwBZyXtSgXLg bHE1QF06htaHY2CQeu5tsXhq2EQaqvQcaVVj4mcF85GXAzRAG4HTlA6E8BRYEY2167quXq ke4hv+3usDfKvF52/kZLTtDjYbd4N/WDkXkFr8sRnav3dEQGMrcp/cpJ2J+KqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxn01hZzzXQ0; Mon, 13 Feb 2023 21:09: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 31DL9uPQ056598; Mon, 13 Feb 2023 21:09:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9uxk056597; Mon, 13 Feb 2023 21:09:56 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:56 GMT Message-Id: <202302132109.31DL9uxk056597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: a27902c18388 - main - linuxkpi: Define `cpu_data(cpu)` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a27902c1838836b3fb00cd660ce37a4f20bd7991 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a27902c1838836b3fb00cd660ce37a4f20bd7991 commit a27902c1838836b3fb00cd660ce37a4f20bd7991 Author: Jean-SĂ©bastien PĂ©dron AuthorDate: 2023-02-10 15:38:43 +0000 Commit: Jean-SĂ©bastien PĂ©dron CommitDate: 2023-02-13 21:09:32 +0000 linuxkpi: Define `cpu_data(cpu)` `cpu_data(cpu)` evaluates to a `struct cpuinfo_x86` filled with attributes of the given CPU number. The CPU number is an index in the `__cpu_data[]` array with MAXCPU entries. On FreeBSD, we simply initialize all of them like we do with `boot_cpu_data`. While here, we add the `x86_model` field to the `struct cpuinfo_x86`. We use `CPUID_TO_MODEL()` to set it. At the same time, we fix the value of `x86` which should have been set to the CPU family. It was using the same implementation as `CPUID_TO_MODEL()` before. It now uses `CPUID_TO_FAMILY()`. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38542 --- sys/compat/linuxkpi/common/include/asm/intel-family.h | 3 +++ sys/compat/linuxkpi/common/include/asm/processor.h | 3 +++ sys/compat/linuxkpi/common/src/linux_compat.c | 11 ++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/asm/intel-family.h b/sys/compat/linuxkpi/common/include/asm/intel-family.h new file mode 100644 index 000000000000..1dae979b3c5e --- /dev/null +++ b/sys/compat/linuxkpi/common/include/asm/intel-family.h @@ -0,0 +1,3 @@ +/* Public domain. */ + +#define INTEL_FAM6_ROCKETLAKE 0xA7 diff --git a/sys/compat/linuxkpi/common/include/asm/processor.h b/sys/compat/linuxkpi/common/include/asm/processor.h index 86d4ab9de98f..9e784396c63a 100644 --- a/sys/compat/linuxkpi/common/include/asm/processor.h +++ b/sys/compat/linuxkpi/common/include/asm/processor.h @@ -35,11 +35,14 @@ #if defined(__i386__) || defined(__amd64__) struct cpuinfo_x86 { uint8_t x86; + uint8_t x86_model; uint16_t x86_clflush_size; uint16_t x86_max_cores; }; extern struct cpuinfo_x86 boot_cpu_data; +extern struct cpuinfo_x86 __cpu_data[]; +#define cpu_data(cpu) __cpu_data[cpu] #endif #define cpu_relax() cpu_spinwait() diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 30cc094a5222..8a2473e82d66 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2745,6 +2745,7 @@ io_mapping_create_wc(resource_size_t base, unsigned long size) #if defined(__i386__) || defined(__amd64__) bool linux_cpu_has_clflush; struct cpuinfo_x86 boot_cpu_data; +struct cpuinfo_x86 __cpu_data[MAXCPU]; #endif cpumask_t * @@ -2767,7 +2768,15 @@ linux_compat_init(void *arg) linux_cpu_has_clflush = (cpu_feature & CPUID_CLFSH); boot_cpu_data.x86_clflush_size = cpu_clflush_line_size; boot_cpu_data.x86_max_cores = mp_ncpus; - boot_cpu_data.x86 = ((cpu_id & 0xf0000) >> 12) | ((cpu_id & 0xf0) >> 4); + boot_cpu_data.x86 = CPUID_TO_FAMILY(cpu_id); + boot_cpu_data.x86_model = CPUID_TO_MODEL(cpu_id); + + for (i = 0; i < MAXCPU; i++) { + __cpu_data[i].x86_clflush_size = cpu_clflush_line_size; + __cpu_data[i].x86_max_cores = mp_ncpus; + __cpu_data[i].x86 = CPUID_TO_FAMILY(cpu_id); + __cpu_data[i].x86_model = CPUID_TO_MODEL(cpu_id); + } #endif rw_init(&linux_vma_lock, "lkpi-vma-lock"); From nobody Mon Feb 13 21:16:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxwy4xp2z3q5qh; Mon, 13 Feb 2023 21:16: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 4PFxwy4S1cz4X3K; Mon, 13 Feb 2023 21:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676323010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CXYi6NSX2I6F4wPKnIEEx3I/KV5QCxyKtAu5bzVmUPg=; b=I/Nwv23f1M65Edkc77P13kcxsM+2A1Y9TJqrMwDWyrDNRXjziH1lW7GsjpiBZbVpme9uFb Qkq8Ia7YNGFbvqzWbIep2UkkyQ2+lD64KsrcKUG+RZcuKnrbgVx1Wn/r5hWikGRYaoSLCF VGvUd/Xk3vVzF5wbA0zENAnY7EysQWAFbKPls1hUM1bOUgny+UfuqQvyMwHwLe0EXBDscz JDVEphTUOkS4wG6OhBL7c1tOrF4APXELmCXEWwqt21epZWvsDhz33oMiVhm9zzXbLOfBZx wct7eNF7bzgMDgqwgGZ4Zh7yShRDslZo6d1VwShpSfcLZcpPIcmZFIywvptl6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676323010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CXYi6NSX2I6F4wPKnIEEx3I/KV5QCxyKtAu5bzVmUPg=; b=evIkRIn+ZCB0ABpa3NsMdUVZ/kmafY5/521AxnXPlhffkB541XFJaoekpLk7B4THgc4vhF bOzns3r+KAr3r2Rp63qgix2WualGlQtXdpVr4DH425FK8ol8AfPlzuheTThdZtGaKwGDpr 4REQicBG18JtVrRyApavOKm8OFdUSeeIGGq2/eye6KGMQqz2VCqwk+/Mu56g9JU+guJAGW WNIcyWzTrJK/k8xourpTd4CUwrgi7W5+GvB+7rL1PR/yzOby+HO4F5bEbm9z2OgmIle68x Pj12PNSjKsHTRniqk0TvoUKUOZFsx38QMWtJYZhB0wXK7jh1euVdVxfNGsB5sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676323010; a=rsa-sha256; cv=none; b=yqTIH3y+GP2cYS+ZM37KFKMU6+fb8LLHYZP/xMqEnyUGyCbTF6guebVyrzpa2n12mBh85N 8+0v9/b2lJCER+quSgF7/5KUi2tceEazTEH/mmwLetbxwy115mHv3XqEQ+Q+c8bkNPl3Rn vW4fhhVnGkdKh5LPao5YRdm4yLlgANrhYgCTw1H9i+SmnSgOR1eyuNyARW5R3TuFxPyDGk amxh8mPk8m143u13wzCTsm/awrl1bfU40tPLodAMy4TszoVFnKQ64bsB5x9ryZv9fV1LrC c89DZhP3ppDZ8gr8xBEZcp3+82NKDWbO/d9RN0eYGaCJzefS8Lxoa37C2ed5YQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxwy3WWTzYDv; Mon, 13 Feb 2023 21:16: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 31DLGoxI070889; Mon, 13 Feb 2023 21:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DLGojF070888; Mon, 13 Feb 2023 21:16:50 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:16:50 GMT Message-Id: <202302132116.31DLGojF070888@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: 3dfd18a769df - main - Remove support for the base/* toolchain ports. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dfd18a769dfee663cd3d5e6eba05bfe8c1d0e2e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3dfd18a769dfee663cd3d5e6eba05bfe8c1d0e2e commit 3dfd18a769dfee663cd3d5e6eba05bfe8c1d0e2e Author: John Baldwin AuthorDate: 2023-02-13 21:16:24 +0000 Commit: John Baldwin CommitDate: 2023-02-13 21:16:24 +0000 Remove support for the base/* toolchain ports. These ports have been removed so these knobs are no longer meaningful. This reverts commit 608289394f655d0635c71233248b734010fb4d2f. This reverts commit 39eb07f172921a581ee9b33ca2765905f4235202. Reviewed by: imp, bapt, emaste Differential Revision: https://reviews.freebsd.org/D38562 --- Makefile.inc1 | 2 -- ObsoleteFiles.inc | 4 ---- tools/build/mk/OptionalObsoleteFiles.inc | 4 +--- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index c6f0269f8885..3399e469ea02 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -67,8 +67,6 @@ TIME_ENV ?= time env .if defined(CROSS_TOOLCHAIN) .if exists(${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk) .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" -.elif exists(/usr/share/toolchains/${CROSS_TOOLCHAIN}.mk) -.include "/usr/share/toolchains/${CROSS_TOOLCHAIN}.mk" .elif exists(${CROSS_TOOLCHAIN}) .include "${CROSS_TOOLCHAIN}" .else diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 59941a50b7d6..2f676ae41e14 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -6382,7 +6382,6 @@ OLD_FILES+=usr/share/man/man9/sglist_count_mb_ext_pgs.9.gz OLD_FILES+=usr/include/opencsd/etmv4/trc_pkt_elem_etmv4d.h # 20200606: retire binutils build infrastructure -.if !defined(WITH_PORT_BASE_BINUTILS) OLD_FILES+=usr/bin/as OLD_FILES+=usr/bin/ld.bfd OLD_FILES+=usr/share/man/man1/as.1.gz @@ -6391,7 +6390,6 @@ OLD_FILES+=usr/share/man/man7/as.7.gz OLD_FILES+=usr/share/man/man7/ld.7.gz OLD_FILES+=usr/share/man/man7/ldint.7.gz OLD_FILES+=usr/share/man/man7/binutils.7.gz -.endif OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.x OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xbn OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xc @@ -7191,12 +7189,10 @@ OLD_FILES+=usr/share/man/man4/bktr.4.gz OLD_FILES+=usr/share/man/man4/brooktree.4.gz # 20200229: GCC 4.2.1 removed -.if !defined(WITH_PORT_BASE_GCC) OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/bin/gcc OLD_FILES+=usr/share/man/man1/g++.1.gz OLD_FILES+=usr/share/man/man1/gcc.1.gz -.endif OLD_FILES+=usr/bin/gcpp OLD_FILES+=usr/bin/gperf OLD_FILES+=usr/include/c++/4.2/algorithm diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index a6b9532fa2f8..b0a425aad67d 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -201,12 +201,10 @@ OLD_FILES+=usr/share/man/man8/bhyveload.8.gz OLD_DIRS+=usr/share/examples/bhyve .endif -.if !defined(WITH_PORT_BASE_BINUTILS) .if ${MK_LLD_IS_LD} == no OLD_FILES+=usr/bin/ld OLD_FILES+=usr/share/man/man1/ld.1.gz .endif -.endif .if ${MK_BLACKLIST} == no OLD_FILES+=etc/blacklistd.conf @@ -2113,7 +2111,7 @@ OLD_FILES+=usr/share/man/man8/strfile.8.gz OLD_FILES+=usr/share/man/man8/unstr.8.gz .endif -.if ${MK_LLVM_COV} == no && !defined(WITH_PORT_BASE_GCC) +.if ${MK_LLVM_COV} == no OLD_FILES+=usr/bin/gcov OLD_FILES+=usr/share/man/man1/gcov.1.gz .endif From nobody Mon Feb 13 21:22:05 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFy321KhTz3q6Wy; Mon, 13 Feb 2023 21:22: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 4PFy320tHyz4Xpj; Mon, 13 Feb 2023 21:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676323326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwjKY5CuSRy6PvzdKGYtQtWtoyjyruAQsmivA/Ia+RE=; b=o3NQmcbBnmxv3OsZLsu9d2wbsbqwOS+gTKO871Mzwi01i5o2As6iFrbkHzhLx4jIjQq/wy CLh7lLR238t7yz9MhSSFBrxqdkOoEaC92ajE6Z7vdmmpAmIccY1/7jIVyctcCRsnveSJCG V0o+FZ65BTGx5tmYhBAUOrqwf6wwNCLCfLVAM/BkrHq2+/H3GQpngNOBDnv/VkMSSuendO 4tYBeZgE5TbYDr3zSKnkNyHe6o9TcuUJlCNliI3b7/yW1+axRAlCJBPgVLCxnihCF6eRXb nPSLEZ8hW8nSj+Ns0IRKZmrukHs509rmpncxittEMaq9PBL3pDvYgQvZVyGBmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676323326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwjKY5CuSRy6PvzdKGYtQtWtoyjyruAQsmivA/Ia+RE=; b=rgetSzb0zd43bmd5IvagDZFzP4U2Ihp0feRdZRZsJ7JgG0ev+Sy97Sp7mZOBPrraoyFcLW VYEoT/ZQZu4aMP+kdLs9WsyXRbEDo1hTezCaJ2Lni7ExJcwS701JM1vzyhqQDOUPyOeVdp VnELsGVyxBgFA7JzWlPIAdbbw+dqGmX4mMx0JdlDMbq3s2KncYol4jqwtRj2m0FgIFMEC/ SEmLmck2Bb0/cezlyV8Dv6xpjafgMPYLQIsbewa1oMnIyOZQy3//Dsh1d9LsJsxCFfCMK3 GT2bAl26jIOO1yI6J5Szgi8VCud/Szb8OW/b+nWpPCqkqCzz2HK9tV8Y9SYwlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676323326; a=rsa-sha256; cv=none; b=vRjupx1ToyT//Ve1ViC3JQEl3GX/lWGQx2o5t+rNQqtQn6Cv0Z3dHooSozaEHHtlLgAF6t T5V1Kw6mIs9kNiNnTgaWuVuRPWwOdfNlJwSUSBUX9hrOfCpfbpw7tX2196/jR3sGydsrmi jXxeSEcr2p20m9eGurp0kGKzH90BjUcTvM3Taq298dKj0ot6G64tiod1M5rrP/cNKPHRAN rut94xzts/PKoFn74yyWx+RFh7ZGdH6o7FOhjbD3bfeIScJd04QdlhatITFifEMk0JgrsY 3BVoG0PP9dY0nhwy5Dgzzr3349XAYG1mv6ZKecQkPJmTZOA0OStGCorv+ZY5Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFy3173TPzYgj; Mon, 13 Feb 2023 21:22: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 31DLM5nq083272; Mon, 13 Feb 2023 21:22:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DLM5qS083271; Mon, 13 Feb 2023 21:22:05 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:22:05 GMT Message-Id: <202302132122.31DLM5qS083271@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: 18bb97b76b26 - main - arm64 pmap: Fix a buffer overrun initializing per-superpage locks. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18bb97b76b269f38407b5c48d53ceaf6447450f1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=18bb97b76b269f38407b5c48d53ceaf6447450f1 commit 18bb97b76b269f38407b5c48d53ceaf6447450f1 Author: John Baldwin AuthorDate: 2023-02-13 21:19:03 +0000 Commit: John Baldwin CommitDate: 2023-02-13 21:19:03 +0000 arm64 pmap: Fix a buffer overrun initializing per-superpage locks. pmap_init_pv_table makes a first pass over the memory segments to compute the amount of address space needed to allocate per-superpage locks. It then makes a second pass over each segment allocating domain-local memory to back the pages for the locks belonging to each segment. This second pass rounds each segment's allocation up to a page size since the domain-local allocation has to be a multiple of pages. However, the first pass was only doing a single round of the total page counts up at the end not accounting for the padding present in each segment. To fix, apply the rounding in each segment in the first pass instead of just at the end. While here, tidy the second pass a bit by trimming some not-quite-right logic copied from amd64. In particular, compute pages directly at the start of the loop iteration to more closely match the first loop. Then, drop an always-false condition as 'end' was computed as 'start + pages' where 'start == highest + 1'. Thus, the actual condition being tested was 'if (highest >= highest + 1 + pages)'. Finally, remove 'highest' entirely by keep the result of the 'pvd' increment in the existing loop. Reported by: CHERI (overflow) Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D38377 --- sys/arm64/arm64/pmap.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 7e2a423025ec..357584e22875 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1347,7 +1347,6 @@ pmap_init_pv_table(void) struct vm_phys_seg *seg, *next_seg; struct pmap_large_md_page *pvd; vm_size_t s; - long start, end, highest, pv_npg; int domain, i, j, pages; /* @@ -1360,14 +1359,13 @@ pmap_init_pv_table(void) /* * Calculate the size of the array. */ - pv_npg = 0; + s = 0; for (i = 0; i < vm_phys_nsegs; i++) { seg = &vm_phys_segs[i]; - pv_npg += pmap_l2_pindex(roundup2(seg->end, L2_SIZE)) - + pages = pmap_l2_pindex(roundup2(seg->end, L2_SIZE)) - pmap_l2_pindex(seg->start); + s += round_page(pages * sizeof(*pvd)); } - s = (vm_size_t)pv_npg * sizeof(struct pmap_large_md_page); - s = round_page(s); pv_table = (struct pmap_large_md_page *)kva_alloc(s); if (pv_table == NULL) panic("%s: kva_alloc failed\n", __func__); @@ -1376,23 +1374,14 @@ pmap_init_pv_table(void) * Iterate physical segments to allocate domain-local memory for PV * list headers. */ - highest = -1; - s = 0; + pvd = pv_table; for (i = 0; i < vm_phys_nsegs; i++) { seg = &vm_phys_segs[i]; - start = highest + 1; - end = start + pmap_l2_pindex(roundup2(seg->end, L2_SIZE)) - + pages = pmap_l2_pindex(roundup2(seg->end, L2_SIZE)) - pmap_l2_pindex(seg->start); domain = seg->domain; - if (highest >= end) - continue; - - pvd = &pv_table[start]; - - pages = end - start + 1; s = round_page(pages * sizeof(*pvd)); - highest = start + (s / sizeof(*pvd)) - 1; for (j = 0; j < s; j += PAGE_SIZE) { vm_page_t m = vm_page_alloc_noobj_domain(domain, From nobody Mon Feb 13 21:35:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFyLy12Jhz3qNbf; Mon, 13 Feb 2023 21:35: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 4PFyLy0CHbz4Ztj; Mon, 13 Feb 2023 21:35:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676324154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UgKTdeRSRA2/MUBPp6QadsTpTSkk2qQvxY7Uj5bEP88=; b=d8KCNI09zcfu4AWwoQe0hnAVYDGYhm67Xy28Nio+u2MO6G2r7FvEnHpkwaHJns/j4JQU9D Rk40cvH/AfpnRZw0fiwlRk/7xZ0oQEQ2hBqPvcBNdte3E/VevsVo1QylcELbDnxNatTPBP q2P4m+sEkeHoNRu0G8wH+2cQ942B1+xzctp4k0AObiACMT7blmmnbICrgm3PFgD0O0B+UM DXNc+GyeVMGdBSJS5yk2CCULhL/5rzGXlAMkpbd7qak150dwrGLeDALJ+99x/TqtGwnCZu yCtbhlT++td/C24026lIYU25qwzC6I3RsWrdn9I+2Hp9eHp7Au4Zc+aqoMh17A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676324154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UgKTdeRSRA2/MUBPp6QadsTpTSkk2qQvxY7Uj5bEP88=; b=M27Hd5Ui5OcuocNv6iOr4EtiwH5qMNBRJdI6kJYMwX7Bj1zRFMCasrLI9E5jBw0imwfRfr RxrYTpDlmURThXlOLbHxHzcGLcZglyooOA5O+mkx43CLlTgGqs2oUjcMGuZeJ8Z1s9tnMa 5aPJwrcoTaQ+VsHd6ekR0pGwEQvBwIiZEnXms1y1sG+DFB/w5cnR4frM0sTohorvayhHUa /exHjpbUmRhkvlxn6W+WTGbbwj78wiUIfIKPYeSUr6RJaDd5Rjj9UzgzsGdCYlSrj57la1 /7qjWsPGhjq7v2k7EDUNRP5VFIKy7HBy1ZUmZ9d8KDQpShToJ44Ipi8NA4e9AQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676324154; a=rsa-sha256; cv=none; b=ZJmyNOYQZkpcIrWVFH37T/iqx3hrnpRRR3zJ6WeDogmW3F61dbT3VE75oHMeiJlL4K+EE1 StT4uJKeXccCZfAzCN1u+HoriD3+VakHZS2ykKkvO/xCC98n6XBQJkMciV/OW7GZxhI83A VVrSh1FrhJCu1cW8c2fZhQqc8TeBUDks//qdELXSos7oRhOKh2c29lFEq9CZlr+fiaU+HN zKvI1r+yTmYd+l1PC5LmDn+hu6YbLmBxL+u+HDOyeL98Ija+nMhj6BCJo9/zd8NEegr0J7 9HomxcMYx3jGWcW5+upvEHmsjPGgask1cWOYrGA5+hwhAoP8bi45F8HdE1UP6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFyLx6MwczZ2Y; Mon, 13 Feb 2023 21:35: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 31DLZrCb099034; Mon, 13 Feb 2023 21:35:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DLZruQ099033; Mon, 13 Feb 2023 21:35:53 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:35:53 GMT Message-Id: <202302132135.31DLZruQ099033@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: 775da7f8a924 - main - tcp: Remove a redundant net_epoch entry in tcp6_connect() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 775da7f8a9248d148ffd50635cf043c015146225 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=775da7f8a9248d148ffd50635cf043c015146225 commit 775da7f8a9248d148ffd50635cf043c015146225 Author: Mark Johnston AuthorDate: 2023-02-13 21:21:10 +0000 Commit: Mark Johnston CommitDate: 2023-02-13 21:35:47 +0000 tcp: Remove a redundant net_epoch entry in tcp6_connect() tcp6_connect() is always called in a net_epoch read section. Fixes: 3d76be28ec60 ("netinet6: require network epoch for in6_pcbconnect()") Reviewed by: tuexen, glebius Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38506 --- sys/netinet/tcp_usrreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index c204fc356ed7..43f2fcfb097a 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1433,16 +1433,14 @@ static int tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *sin6, struct thread *td) { struct inpcb *inp = tptoinpcb(tp); - struct epoch_tracker et; int error; + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); - NET_EPOCH_ENTER(et); INP_HASH_WLOCK(&V_tcbinfo); error = in6_pcbconnect(inp, sin6, td->td_ucred, true); INP_HASH_WUNLOCK(&V_tcbinfo); - NET_EPOCH_EXIT(et); if (error != 0) return (error); From nobody Mon Feb 13 21:35:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFyLz1l0xz3qNhT; Mon, 13 Feb 2023 21:35:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFyLz0wy5z4b60; Mon, 13 Feb 2023 21:35:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676324155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFmObU9peKW0K5XlHs2k5MFNzBV8uER0qyTDk1KowEY=; b=RApzXW6E1vaDORNH5NmLdvwteeiCAjEQk2/epudvh6lsq+jLNQ23giR0cZWH/IXwzpf5x4 3YIvAvnkAJPd3289r38xWyD1f35fDtcVpB0g+ruBgFms/grvKRfDTfQK4PhbBPtylhJ85J KGaghhJ+0/JJxXRtaa2U+XsmBG7cWZyGZ9nLA6OBDENjNYz+97dyU4YWCFpmMXPTurKbRV VKCacdc4u1PI2uZy+zn0+W1qesBe4zM0CU7ldx395fC9pX7xRv37N7SgeHewoKqRyNG42+ bFgg2pg1TSP85xNV4RiU/FSyWKSPvk60ON97OKkcTPfmj/IpRT+NljlERUpyEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676324155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFmObU9peKW0K5XlHs2k5MFNzBV8uER0qyTDk1KowEY=; b=o07Dptt8EaS69ehTrMBLe1SeLMJiOVF/UQaBfgznua+1EQAmAoS3WLLaZSeKPqp5D0S8cp uveGusiOqc+jj5OKED6Dcns/it2lpyWc54/An3hQXok3t00wvixoy1rAQJmKuYW5C7etPf 6P2iqynSyNLEBy5zWECJCfxVbqmFS3D9GOoBPvaDlDs78QdzNibasdcyhQ/IX+eWK70+v9 v+Ah4X1sfwivwtsNu3oQqW44NEHQVNcxV8jGGDbJVwvdyxWZnkb3EpUzKkMnUiFyTCEQ0G 5Fxv1JFPKCxIkeDZUwFc+17yhV2e5GOPPAfHGP4MpwjwsXNLNyBG4S3wdfugAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676324155; a=rsa-sha256; cv=none; b=v+F4gIIE2gZt3x063KXNSXi64+HUFsfsOBWFiIv5b4ZbReV97WFE8OK0BYTrFZWpSOM49X tMM/G1nDygf3QCnpaVwH5+5OkoB6q65Ms6JhvaGQ6oQNCwlU2bQG50NxFs9fAqTeo+s97R pFDhDGw+bN/ygIEPaE07WGR7UXRFC3rfxS47xxxvFkyFBd7fxJ9ueH/e1peqbb3KrMMz18 O0L7hhd3+Bm7qrsBd1eVpMgtd+Cs8r0MZLIBBW0EA99CckpAIyc0XU0OmofmulDql5rFoX TrmAgUtS98kQBDHT7jCXm2kHdkatfzp88T3FQKxBKUM9zP0NxmsU+7RnWKIm+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 4PFyLy71YjzYhc; Mon, 13 Feb 2023 21:35: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 31DLZsKH099061; Mon, 13 Feb 2023 21:35:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DLZsHj099060; Mon, 13 Feb 2023 21:35:54 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:35:54 GMT Message-Id: <202302132135.31DLZsHj099060@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: c7ea65ec69dd - main - inpcb: refcount_release() returns a bool List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7ea65ec69dde90253bd1872fecaeb7c07337f97 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c7ea65ec69dde90253bd1872fecaeb7c07337f97 commit c7ea65ec69dde90253bd1872fecaeb7c07337f97 Author: Mark Johnston AuthorDate: 2023-02-13 21:26:36 +0000 Commit: Mark Johnston CommitDate: 2023-02-13 21:35:47 +0000 inpcb: refcount_release() returns a bool No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. --- sys/netinet/in_pcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 3369f16e15c7..ad889f29de55 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1728,7 +1728,7 @@ in_pcbrele_rlocked(struct inpcb *inp) INP_RLOCK_ASSERT(inp); - if (refcount_release(&inp->inp_refcount) == 0) + if (!refcount_release(&inp->inp_refcount)) return (false); MPASS(inp->inp_flags & INP_FREED); @@ -1745,7 +1745,7 @@ in_pcbrele_wlocked(struct inpcb *inp) INP_WLOCK_ASSERT(inp); - if (refcount_release(&inp->inp_refcount) == 0) + if (!refcount_release(&inp->inp_refcount)) return (false); MPASS(inp->inp_flags & INP_FREED); From nobody Mon Feb 13 21:35:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFyM02W8fz3qNv3; Mon, 13 Feb 2023 21: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 4PFyM01t3Sz4b3p; Mon, 13 Feb 2023 21: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=1676324156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wUbbXmC4xYvxePReXGPAvhg41YVp6reMe1CQjsxC6JU=; b=dsMxAFdSfHsNk9ghYotEIi0R9qKR+0DAb2oxphQEEIFxOfciDBQN+6Z4oxAuZw5h8yOsU7 Dnh7zR5KCesl76T/O7j+wBt9wyFNhpJo2p7dzajPSo7vg9Poknd5CoNykwCWoTS0lLIEXZ KoqVYUbIr5DjJdqrsbz89xOtrZko5g4EJq6dh1mwcTber1kr2HvWe17rF2tsfK9ox/01Za PorgatW90xqB8hEB7EiKRiymhMnZyCWFCj0+MbncEEGq4ICSJSCoqRrFXN97vjWiKo7Diq ECgOFqgbH9iXTJDIf3xcgWqEnu6DfFJSadRMP7wQClorb9ICNOxjRqhT8PLcJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676324156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wUbbXmC4xYvxePReXGPAvhg41YVp6reMe1CQjsxC6JU=; b=TQLdemTwlNVD8XtSjIDRF4g3p9+23a/3t1yTKwUcHzukKXPhYag/Jk7qO4DiPEm6shfepm XMNjV48Px3wqN1/HdIjMumRHjX3pbsnyyV7Drc6CK1H5MADkd5+h2qyjScQ/YAY8jemTFu LH+cawKIXd8YoEjH2RiIQMWqnwbcpiSMoEpwgkx/iUvWlBOUdDAPswS5wZXCyR72BaoBip 7HAVSiuZ+Kt6AC6m3583jT5WQEsaHs8IaihbnBHJR0YAVZhJdHLnKqGQF+5UJIRyHx1Nwm wehZASFuoJXxd7T/z7fHnRg/MemUNO9z/LVF2WxArTZIKYW3LoQxi2a4VtBn4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676324156; a=rsa-sha256; cv=none; b=TTDQbEsQ6HQD4eTJBqqmndqrRf3Goup5kRwJq4vTbdB/QPGag6uviVPHOpcNJoyZDUwzQ7 GAXHWXD3vdy8Rm3w9ThGlF/s71acLqSGa11y2T2SeZTes4R1jM8G8pZpl2nAn1xWukC0Np vV5bvrax9FuSh/EBuF2iMOdjBbIuWPQ97PK039RpTRczVnL4qRuRoUudzphUZaR9X1PwD9 AZqFkuq8HbivMmmz0k8cPaKCFW3aCXzgYzTQ6a6SWxwu+Xebdvn8JjuLSOSdkI6LyJq87x CPRyAAjnIdSoy6N7S/k4z9xj6TlU3jhjg0NeVtzdIPQbBc42h8ZBopXeBfL+Nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFyM00zLrzYlD; Mon, 13 Feb 2023 21: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 31DLZuDI099085; Mon, 13 Feb 2023 21: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 31DLZuMh099084; Mon, 13 Feb 2023 21:35:56 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:35:56 GMT Message-Id: <202302132135.31DLZuMh099084@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: d0991948182a - main - vm_fault: Fix a race in vm_fault_soft_fast() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0991948182a1a149ee84f1b9c4d3e30450c8f0b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d0991948182a1a149ee84f1b9c4d3e30450c8f0b commit d0991948182a1a149ee84f1b9c4d3e30450c8f0b Author: Mark Johnston AuthorDate: 2023-02-13 21:24:40 +0000 Commit: Mark Johnston CommitDate: 2023-02-13 21:35:47 +0000 vm_fault: Fix a race in vm_fault_soft_fast() When vm_fault_soft_fast() creates a mapping, it release the VM map lock before unbusying the top-level object. Without the map lock, however, nothing prevents the VM object from being deallocated while still busy. Fix the problem by unbusying the object before releasing the VM map lock. If vm_fault_soft_fast() fails to create a mapping, the VM map lock is not released, so those cases don't need to change. Reported by: syzkaller Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38527 --- sys/vm/vm_fault.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 959e67b88a38..87c15e972279 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -338,20 +338,16 @@ vm_fault_soft_fast(struct faultstate *fs) #endif int psind; vm_offset_t vaddr; - enum fault_status res; MPASS(fs->vp == NULL); - res = FAULT_SUCCESS; vaddr = fs->vaddr; vm_object_busy(fs->first_object); m = vm_page_lookup(fs->first_object, fs->first_pindex); /* A busy page can be mapped for read|execute access. */ if (m == NULL || ((fs->prot & VM_PROT_WRITE) != 0 && - vm_page_busied(m)) || !vm_page_all_valid(m)) { - res = FAULT_FAILURE; - goto out; - } + vm_page_busied(m)) || !vm_page_all_valid(m)) + goto fail; m_map = m; psind = 0; #if VM_NRESERVLEVEL > 0 @@ -386,10 +382,8 @@ vm_fault_soft_fast(struct faultstate *fs) #endif if (pmap_enter(fs->map->pmap, vaddr, m_map, fs->prot, fs->fault_type | PMAP_ENTER_NOSLEEP | (fs->wired ? PMAP_ENTER_WIRED : 0), psind) != - KERN_SUCCESS) { - res = FAULT_FAILURE; - goto out; - } + KERN_SUCCESS) + goto fail; if (fs->m_hold != NULL) { (*fs->m_hold) = m; vm_page_wire(m); @@ -398,12 +392,13 @@ vm_fault_soft_fast(struct faultstate *fs) vm_fault_prefault(fs, vaddr, PFBAK, PFFOR, true); VM_OBJECT_RUNLOCK(fs->first_object); vm_fault_dirty(fs, m); + vm_object_unbusy(fs->first_object); vm_map_lookup_done(fs->map, fs->entry); curthread->td_ru.ru_minflt++; - -out: + return (FAULT_SUCCESS); +fail: vm_object_unbusy(fs->first_object); - return (res); + return (FAULT_FAILURE); } static void From nobody Mon Feb 13 22:31:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFzbH717Cz3qVhS; Mon, 13 Feb 2023 22:31: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 4PFzbH6Z2Bz3F6B; Mon, 13 Feb 2023 22:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hm1VMOzPLKqQJAHbOuuNH59UB1ZbYqVewTCAVbVaL20=; b=r0AUooJpY8Ln1gY2B4hE+ty9dnxrtRnCRy7C89BcGpYhkzTk1tfK8JU3yZVGGMRJ1iqSzL Cp0m9JmpmebQa5tSnBN/oqoALMkU6yXX/6lOL0kKkKqh7kwGB7aMAFX+uKpxEguXCu7XB1 rSn1QikvTI4RRJI+pv+EISM22ETAzYbeADGqOLQeYYYXTCMcMfSFw1HJHLJN31SvYNCq/V 1DeNrKVPtymVkV7eljHon7NIKne3TZ/yAaAIfFRL5yo1eSTot0M5kCYBkKFYVvsgJHvs/q aRriXB+utkWP8eMh8BuheXPk78sC3nDlMJjmxsM3UIC3JVvRaXmVKsdzHEhTdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hm1VMOzPLKqQJAHbOuuNH59UB1ZbYqVewTCAVbVaL20=; b=MrT4kIOi6ZBM8Bt0wwfSqLWoagezXOkiicJs4zydUmQR1fA3yiWwLiD7m2/ihLvF8UnHaB XvJJLxAc5lb6liOXo7PsIyvOHXxwSyvlWQ+vmmo3n8foElAd8+TxQcuDo1d5QQJuvIty9a ECmNxluFGivofEyUmJkuFlpiykbTIDjGqEgLRjoKg8yjBwmD4feVf/N0GDYIYLnHquBjPD uJS+bxeuT/GOSN12eaYrbMbwk/exOVlNSPf3lThkPz1Qf/lBBvWmcsER6h99pZFzbhOEZK tXhv+no5HVDzp11X1h6NgYeyBZlkz+aSWcDMNtz0g6w+WCZIUiMfJSmHlmonSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676327499; a=rsa-sha256; cv=none; b=srYBvTensLovCPFiwki5IGUbeawyLQu1MRunnS9JKLG4sk9+FFNh0e0SdbxRnMaLi9sOjx +euQHCHgO/HJgpSJbKXza01H6avKPhdlpLOxdpk1jk4gXpC5/oy/jFdqdyfbHC8uTw3JNs rvPCbdObPbM//5T+95mSVJHMgs4anxN68MeOhOXfZikahfklNvlU9DtG7pwa2OSrmnBsvW soJj10kTOuvqW9B1IOXDgN268ECzJ35VHKdKSOJFmTp2X39kk+roJYmZYskMKaTZCEEr8N JmxJCB+aaQ5Qx5vJuB3Np+2gx/ZuCIZymz8R0p4QRc7XctZfFRFrWKno3M3cRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFzbH5chCzbjt; Mon, 13 Feb 2023 22:31: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 31DMVdMW080688; Mon, 13 Feb 2023 22:31:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DMVddp080687; Mon, 13 Feb 2023 22:31:39 GMT (envelope-from git) Date: Mon, 13 Feb 2023 22:31:39 GMT Message-Id: <202302132231.31DMVddp080687@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: 020e8a4d0609 - main - allocbuf(): convert direct panic() calls to KASSERT()s List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 020e8a4d0609d56cb49a9f35258ff07815d5e478 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=020e8a4d0609d56cb49a9f35258ff07815d5e478 commit 020e8a4d0609d56cb49a9f35258ff07815d5e478 Author: Konstantin Belousov AuthorDate: 2023-02-11 18:03:22 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-13 22:28:42 +0000 allocbuf(): convert direct panic() calls to KASSERT()s Also do minor style adjustments. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38549 --- sys/kern/vfs_bio.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 3a5afec88a02..abc3eea9be4e 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -4363,8 +4363,9 @@ allocbuf(struct buf *bp, int size) if (bp->b_bcount == size) return (1); - if (bp->b_kvasize != 0 && bp->b_kvasize < size) - panic("allocbuf: buffer too small"); + KASSERT(bp->b_kvasize == 0 || bp->b_kvasize >= size, + ("allocbuf: buffer too small %p %#x %#x", + bp, bp->b_kvasize, size)); newbsize = roundup2(size, DEV_BSIZE); if ((bp->b_flags & B_VMIO) == 0) { @@ -4381,11 +4382,12 @@ allocbuf(struct buf *bp, int size) } else { int desiredpages; - desiredpages = (size == 0) ? 0 : + desiredpages = size == 0 ? 0 : num_pages((bp->b_offset & PAGE_MASK) + newbsize); - if (bp->b_flags & B_MALLOC) - panic("allocbuf: VMIO buffer can't be malloced"); + KASSERT((bp->b_flags & B_MALLOC) == 0, + ("allocbuf: VMIO buffer can't be malloced %p", bp)); + /* * Set B_CACHE initially if buffer is 0 length or will become * 0-length. From nobody Mon Feb 13 22:31:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFzbK0kTpz3qVnY; Mon, 13 Feb 2023 22:31: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 4PFzbK0HSQz3FJ4; Mon, 13 Feb 2023 22:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mfPMFJ/flNYv5ELplkFlSQWCSHjcqqcF1vFeYRUgvX0=; b=n3FBqBz5J9IwiTggrlg5FpTCG3jBjFHllBZNx1rUVbfsCyqbZIK5i+5XNtRi2iLX03Br1a jBDtqlux2xW2zy3VCfgCiFWY2bnU/oIM1A/GiW3TmT05+8725Rg+ItjAUp0/cQY9Hz2nkN 7rq5CLGsidVI42Pntg9yo4h3qY64C0Lmd+TZSwe1S26BFV3MOJvKKjNxAZMUYfk0yXqhbm yBLYwR+i8poQrLktxDS01RYFwagROyBk1fDb4WMbVJmkrLblRCAPhzL6d96oR+GjXHThRl AhQpdyifIjzN9WGbzOobkVz9XqDwydKt19vqfSzHRrlzJEgpLi3j/tB/p9iUJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mfPMFJ/flNYv5ELplkFlSQWCSHjcqqcF1vFeYRUgvX0=; b=Sv8K949umjTyiLFUXsYf2qqBH+w9dFth0yTZhLl04ravf/uomt2hfuqc+sL8N8I1zOh15t 1ozIcbMJSMrE4fGZDatY7qlHfLBuqPtT4BYVHhObrQ+JOAKCt/a5nZpvt2aoMdoOSWQEWG iYoHaWkakxyqNcxxf9auDciVJq+FsXEC3Fx3dvNU1HE7FfcQ4kuTujpFLzF2TwF0wFzBoh iUZ5TYLW+ZsEESYlEYQbRnW2GZBhQv1aqPLSDB6h17kDA8lT/ycpz+xNDZRlq3oVz8Lilg qjZbxaZp/1fs3u/CrbeSKYNcykjb/3ufAIQiO6W4rW695O7CJZ1/DE86oDWRtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676327501; a=rsa-sha256; cv=none; b=PYzUhXCltrI+xsACZWjP4ffk0y1l046Mruz8trIfj1UR8GIAapI5LqW5hxBUFT+cbVpnYB wX6orxKLY9CmMsLGHoNybXNG2BJCCv2germ5YKw5a9VV9cQjRHE9GappA7Q8vb7N3vc7kX iPG14TxMApxBW/KT0GtHWlS17Cr7aA6Oh95I3pd/NXT7iIs3gofHcY0RlhlwSLhogx6h3w NPeRXL83xKpmz4k7yzRjNsBqo2O91h0wOJhdxizsH70Ib/tWp8STb8ZW0bHOO6U6nMPZxM kTjaiNKj9zgKugdGsxP9ZrOLUXQmjbmLJgLxF/44LwW6DvF6u/BvJSGTe2kl6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFzbJ6VN9zbcs; Mon, 13 Feb 2023 22:31: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 31DMVefv080726; Mon, 13 Feb 2023 22:31:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DMVeKE080725; Mon, 13 Feb 2023 22:31:40 GMT (envelope-from git) Date: Mon, 13 Feb 2023 22:31:40 GMT Message-Id: <202302132231.31DMVeKE080725@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: e59180ea09a1 - main - msdosfs: correct handling of vnode pager size on file extension error List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e59180ea09a1d1d1463f2a269e94efa0f0b677c5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e59180ea09a1d1d1463f2a269e94efa0f0b677c5 commit e59180ea09a1d1d1463f2a269e94efa0f0b677c5 Author: Konstantin Belousov AuthorDate: 2023-02-10 04:58:43 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-13 22:29:19 +0000 msdosfs: correct handling of vnode pager size on file extension error If extension fails, vnode pager recorded size might be left increased. Only update vnode pager when extension is past the point of no rollback. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38549 --- sys/fs/msdosfs/msdosfs_denode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 9a9916e39a67..6c38481681de 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -386,10 +386,8 @@ detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred) return (EINVAL); } - if (dep->de_FileSize < length) { - vnode_pager_setsize(DETOV(dep), length); + if (dep->de_FileSize < length) return (deextend(dep, length, cred)); - } /* * If the desired length is 0 then remember the starting cluster of @@ -530,6 +528,7 @@ deextend(struct denode *dep, u_long length, struct ucred *cred) return (error); } } + vnode_pager_setsize(DETOV(dep), length); dep->de_FileSize = length; dep->de_flag |= DE_UPDATE | DE_MODIFIED; return (deupdat(dep, !DOINGASYNC(DETOV(dep)))); From nobody Mon Feb 13 22:31:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFzbL1w0xz3qW1L; Mon, 13 Feb 2023 22:31: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 4PFzbL1FP6z3FQr; Mon, 13 Feb 2023 22:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MB8dE1Oye9/WMnST/bhHTkEEm/35sTGj4K4hb0/QWGk=; b=a/RjkBfrwc+nvQ7UbAvAvUB8ki9qDDm3joJZ8S49vHwexjyJEIXJhbvWjWZyo04pto3Z+m vOpdVdcGe5kQmenkT11/4rjOWpWdBd9e3hDBpxGLuRNjfhaXmhvSvJnQ4+ACUMwvtnoQ/M 1n61/g9K2trOBGn0tXT47RgoEA4MLCmpzAUrNNxxAXevEzZFtcfxuz0Nu+2+Xddq0ENsLI eO5ED+PnO52HyQaBE92n4N6NZX3piRsl6PVBckxae/k2FumC07hTFs4FVjlcWqTV5pe506 pLDWuAsaXcKt2mpsrYGy6eyFwXX8h8q68TVLKWduU4TdNUu5MZOtXQyHQzmX4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MB8dE1Oye9/WMnST/bhHTkEEm/35sTGj4K4hb0/QWGk=; b=X3TUuttKdvk/VaOJfLrFg/qxr0Hz+2TRPO5CfcCs/kSljSyKBOpgTYDFhHutl9MLovnJAk GfLnZJtG37/5T/0TfoSsfOwFvRWxHqjr5YvgM+Q7AJaglie+mbNGt+5seDJDkcT/suKM9l s+P3xV0bpK12RP/Pve0/JH4V7pyHhdk6GPiriV5iK0dZvvKacUj/nx5xan9zrgm2YaqcXU J2REyy2u8psODff+Ru/1+Ugf4Y5tc7oqbyYrm7nXtN+REugpxple8uT8T7qcQAkieJ4l+0 g5s6U/qR85LJVo5/TjDNp69y/grLTjZoq9ZEvFJejea6aLjZCtjXFxPPttwWFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676327502; a=rsa-sha256; cv=none; b=gnoWGzFIHmqeePwJbR7V17Bmkdi5hXbvC+sSl1uxrMQxNDViU7s7UbsldVgtO8kE/8SVt/ eOnS8PcZ8RZX3PTRESveosiemxhvXdvcMMfTNyhBo1pO2nrx+b+vY6qFAKr0XL3Nik3PBD w2a8/4W6yljpQjjQgNNGjc7gWm+mUJlGMZfK2wQ5jYMZrbyKCAu/W9Zha11ebF/GVPr3DK Y1iHJmUzrCsvVNrApBEo2Mj03Y1ThKw5xnH1+KjOaZ4DDZjA2XtPpnsT/bY4nwd8t6XJwj 0y+Zb/IVZseRj3BThoC5wCKihW+JlhB2PWNpvpAr5/lhaNECtMGFvGeF0+wHDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFzbL0KvxzbmP; Mon, 13 Feb 2023 22:31: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 31DMVfbp080751; Mon, 13 Feb 2023 22:31:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DMVfJn080750; Mon, 13 Feb 2023 22:31:41 GMT (envelope-from git) Date: Mon, 13 Feb 2023 22:31:41 GMT Message-Id: <202302132231.31DMVfJn080750@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: 67dc1e7b0457 - main - msdosfs deextend(): memoize DETOV(dep) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67dc1e7b0457ec014a1291c5874decdefe7bffdd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=67dc1e7b0457ec014a1291c5874decdefe7bffdd commit 67dc1e7b0457ec014a1291c5874decdefe7bffdd Author: Konstantin Belousov AuthorDate: 2023-02-11 18:05:14 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-13 22:29:32 +0000 msdosfs deextend(): memoize DETOV(dep) Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38549 --- sys/fs/msdosfs/msdosfs_denode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 6c38481681de..0b4135d60784 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -496,13 +496,14 @@ int deextend(struct denode *dep, u_long length, struct ucred *cred) { struct msdosfsmount *pmp = dep->de_pmp; + struct vnode *vp = DETOV(dep); u_long count; int error; /* * The root of a DOS filesystem cannot be extended. */ - if ((DETOV(dep)->v_vflag & VV_ROOT) && !FAT32(pmp)) + if ((vp->v_vflag & VV_ROOT) != 0 && !FAT32(pmp)) return (EINVAL); /* @@ -528,10 +529,10 @@ deextend(struct denode *dep, u_long length, struct ucred *cred) return (error); } } - vnode_pager_setsize(DETOV(dep), length); + vnode_pager_setsize(vp, length); dep->de_FileSize = length; dep->de_flag |= DE_UPDATE | DE_MODIFIED; - return (deupdat(dep, !DOINGASYNC(DETOV(dep)))); + return (deupdat(dep, !DOINGASYNC(vp))); } /* From nobody Mon Feb 13 22:31:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFzbM36yJz3qVhj; Mon, 13 Feb 2023 22:31: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 4PFzbM264bz3FLW; Mon, 13 Feb 2023 22:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5izOZXZvgupkobSEM0ZQPZSA7fRnuIAPNEUzVDZhF+g=; b=lQUpfWaa2qxU33JF/tsWFl544yUtB4SutYoSuS9YAXhvjU45rGSU/a0AmgBObRMe50Gr8w n48TFbecUaPFzton3B7zFiP4kbh4Hu2uTSi+JWg290MrYdhfOonOHpGaJS7un0u33DfKxz 4t0i1q3u+fZB4z8YAyZz57KIXaCYz+/uBWs27t0lh+ozgLEV1QJ/VtVFlBm+0Gb8nyNPmD QayrO9YPZWmrEW0FuDOTf9d5B4kH1NcWmiz/joGICVUL0P33zQ6kymLt+9iLnTjOSj47A2 aPP9QQoo3AnB9ugliB2nGIhOu+fF0k1i2JoGoy3T1j3B2qsof96ya0QCpaYXTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676327503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5izOZXZvgupkobSEM0ZQPZSA7fRnuIAPNEUzVDZhF+g=; b=UYPx+65Hon5swND94eIUE5/jZge6u7nB0X+T+Iy0Hfzkak3YBlfxv+vExv1jT7lOWlTpra F8qKm4OA142ODAbyKKZ7lBL0SxNA9ZVWWkksxDfdgV/eVrK/9Yb4r/c8JglLd9ROMafCjf CM8ukNFAMUyU73TsCIvGZ9cGnScYokkz98e/6Zp4MI7XgHI+oX+7lXk9Whcw6YG+hPzYCe WI1QjiTlxelDmzlKnf8J5J2uPtpKPf/odG+TOeMmKl0OG7T0UaGiTfSUVjq3T5XNU05ALH SdDnPH45yuNDlm0ZIN1oop8LDYh3wy/e4FjArH/0BgN7UvYqhgwiS2EX/vyGMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676327503; a=rsa-sha256; cv=none; b=rMiOy0CP0AM+k9QKHLSKOs+j9nhq6r71e2/3nFkkm8Q2HPW6B+aEew3qS6BVjuM/pKOd8f +IHWcGeGgtyCP0c/PwRvjFXHY4lzSuHkNcy4ya2l4QaKkyP6DsgcnAFsBXd7E1cy00x24V qKG7yLw6l9lgzfO0I315jFAamyv6PQygb+l92v+FEch9wbpv9CYWPlyctpTAidfS37tej9 ZhVK4ESorAFr/FpI0pTVxAwxO2GdWFpAKKLIuwZZHMYaTABnofGNk5oPfJK4ilIMu4eqgd Sl5AdM6DXVBXkVbUhKWnUJ5DIgg4az0QLqbN2ObL4tyBxog7udPno9QjWIJwCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFzbM1D9XzbgT; Mon, 13 Feb 2023 22:31: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 31DMVhjB080776; Mon, 13 Feb 2023 22:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DMVhCv080775; Mon, 13 Feb 2023 22:31:43 GMT (envelope-from git) Date: Mon, 13 Feb 2023 22:31:43 GMT Message-Id: <202302132231.31DMVhCv080775@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: 0152d453a08f - main - msdosfs deextend: validate pages of the partial buffer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0152d453a08fa2bad694dc04a8184fce2b7faa10 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0152d453a08fa2bad694dc04a8184fce2b7faa10 commit 0152d453a08fa2bad694dc04a8184fce2b7faa10 Author: Konstantin Belousov AuthorDate: 2023-02-11 18:09:30 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-13 22:29:42 +0000 msdosfs deextend: validate pages of the partial buffer Suppose that the cluster size is larger than page size. If the buffer at the old EOF (before extending) was partial and dirty, it cannot be automatically neither written out nor validated by the buffer cache, since extending buffer adds invalid pages at the end. Correct the buffer state by calling vfs_bio_clrbuf() on it, to mark newly added and zeroed pages as valid. Note that UFS is immune to the problem because ffs_truncate() always allocate the block and buffer for the last byte of the file. PR: 269341 Reported by: asomers In collaboration with: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38549 --- sys/fs/msdosfs/msdosfs_denode.c | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 0b4135d60784..a82517acbdfe 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -497,6 +497,7 @@ deextend(struct denode *dep, u_long length, struct ucred *cred) { struct msdosfsmount *pmp = dep->de_pmp; struct vnode *vp = DETOV(dep); + struct buf *bp; u_long count; int error; @@ -523,16 +524,41 @@ deextend(struct denode *dep, u_long length, struct ucred *cred) if (count > pmp->pm_freeclustercount) return (ENOSPC); error = extendfile(dep, count, NULL, NULL, DE_CLEAR); - if (error) { - /* truncate the added clusters away again */ - (void) detrunc(dep, dep->de_FileSize, 0, cred); - return (error); - } + if (error != 0) + goto rewind; } + + /* + * For the case of cluster size larger than the page size, we + * need to ensure that the possibly dirty partial buffer at + * the old end of file is not filled with invalid pages by + * extension. Otherwise it has a contradictory state of + * B_CACHE | B_DELWRI but with invalid pages, and cannot be + * neither written out nor validated. + * + * Fix it by proactively clearing extended pages. + */ + error = bread(vp, de_cluster(pmp, dep->de_FileSize), pmp->pm_bpcluster, + NOCRED, &bp); + if (error != 0) + goto rewind; + vfs_bio_clrbuf(bp); + if (!DOINGASYNC(vp)) + (void)bwrite(bp); + else if (vm_page_count_severe() || buf_dirty_count_severe()) + bawrite(bp); + else + bdwrite(bp); + vnode_pager_setsize(vp, length); dep->de_FileSize = length; dep->de_flag |= DE_UPDATE | DE_MODIFIED; return (deupdat(dep, !DOINGASYNC(vp))); + +rewind: + /* truncate the added clusters away again */ + (void)detrunc(dep, dep->de_FileSize, 0, cred); + return (error); } /* From nobody Mon Feb 13 23:08:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG0QJ24hFz3qZxm; Mon, 13 Feb 2023 23:08: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 4PG0QJ1pH6z3MWD; Mon, 13 Feb 2023 23:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676329736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9aDQOwzopxhUx/62WlXytG1q8F7kJu3xI28rxZzSggk=; b=sNT14nYl2+JoVzscOZlbuqesmdFvls8ZL01MuZj6UP89SKqdk9/ugFqDLWKhLA9WUejryr b0pXBX5vjuIdR5jFTGBpzKfc6899HQ554I+Pr9y9AB9pDe5Kyudde7ZTdRFANOvPxx8Q5I AS2eaFngnfCqTsQHu4K8kzK8iZwy6cSG3PbPePxVSM0iDk3t2Or1CpLXYQz1pORtw+poXA UY/SCUJ6nD+eKX88y5qhcJgvM7kNwsfVf4kxVY+hepZc9Otkz1Gsf2ZDqm8XTF+6ELeggp 52B0odi0/IeXVWXv4JQ/R1Ym+0EIbQmaigpCDIBNLJJdymbu31YaCjdwoYA33A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676329736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9aDQOwzopxhUx/62WlXytG1q8F7kJu3xI28rxZzSggk=; b=xp3ow6MDXWUyCo1X1dI8HtaC5nnoLs22PZ8iUq4RqXiDsnrQo56EH4hD9UAlp2TSR/ECwV fdpOaW22AroqgK7iXZyQRi52bhobqk0afX/hh3tANY2u+qry9Hm6jWyPt84J8LVuBOefv5 mWn2ibH7W2Iup6nocxwEC2Jyf3nRikJFYrlYfjUCaU+SJ3YX+GcNn0+klAoXnJZpymEN6p 6pe4XefD4p/9gvMnR7Qv0MeJUMBdTr0fp9WjlkWeEgXR9jm0RU3fGwJAoBuVX0XLhWQtPn zV0Sh/LxnXqK6DyOHgOU505nphXIEyQWkCl692ObmaIwy31540W+kKhVXNE4JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676329736; a=rsa-sha256; cv=none; b=wD9U5QxwGTe9X+1TVMpoXC0ET1nzpgL1aD7zPVfuf1cOiTcGN1z5y0v4STDqZ46W+sYblI eyK5rskt064zG7E0vACxXOhlX2zvS5N8Jppbacx4HFsKiCjffP+LvGWkXfCZ8OuUC/OdSD /sCjbCGztw+A5dNwkIECYCdZnV1fSuACe1GuAyJ7K9IBG4uunJrFBQeOCcjSXkGvCchngm RP6uGhITom/Jw97AoHVdxZqCOwOjIy/kAPne/YRVIdzm8Pv+2flotH3skO9NiEbLRV36fU 2IVWCxM+Co7lAiP0hREHdPo6x6vWifc05Mx5N3g/lufBtTyvNiunbdMT09cCzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PG0QJ0gWQzbpJ; Mon, 13 Feb 2023 23:08: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 31DN8upS029739; Mon, 13 Feb 2023 23:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DN8tMp029738; Mon, 13 Feb 2023 23:08:55 GMT (envelope-from git) Date: Mon, 13 Feb 2023 23:08:55 GMT Message-Id: <202302132308.31DN8tMp029738@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: 9d329bbc9aea - main - nfsd: Continue adding macros so nfsd can run in a vnet prison List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d329bbc9aea6b8f47df251072bc65403ac3e43e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9d329bbc9aea6b8f47df251072bc65403ac3e43e commit 9d329bbc9aea6b8f47df251072bc65403ac3e43e Author: Rick Macklem AuthorDate: 2023-02-13 23:07:17 +0000 Commit: Rick Macklem CommitDate: 2023-02-13 23:07:17 +0000 nfsd: Continue adding macros so nfsd can run in a vnet prison Commit 7344856e3a6d added a lot of macros that will front end vnet macros so that nfsd(8) can run in vnet prison. This patch adds some more of them and also a lot of uses of nfsstatsv1_p instead of nfsstatsv1. nfsstatsv1_p points to nfsstatsv1 for prison0, but will point to a malloc'd structure for other prisons. It also puts nfsstatsv1_p in nfscommon.ko instead of nfsd.ko. MFC after: 3 months --- sys/fs/nfs/nfs_commonkrpc.c | 15 +- sys/fs/nfs/nfs_commonport.c | 305 ++++++++++++++++++++++------------------ sys/fs/nfsserver/nfs_nfsdport.c | 12 +- 3 files changed, 177 insertions(+), 155 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 9badd8be47d4..bf0a9e6e53ef 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -92,7 +92,6 @@ NFSSTATESPINLOCK; NFSREQSPINLOCK; NFSDLOCKMUTEX; NFSCLSTATEMUTEX; -extern struct nfsstatsv1 nfsstatsv1; extern struct nfsreqhead nfsd_reqq; extern int nfscl_ticks; extern void (*ncl_call_invalcaches)(struct vnode *); @@ -100,6 +99,8 @@ extern int nfs_numnfscbd; extern int nfscl_debuglevel; extern int nfsrv_lease; +NFSD_VNET_DECLARE(struct nfsstatsv1 *, nfsstatsv1_p); + SVCPOOL *nfscbd_pool; int nfs_bufpackets = 4; static int nfsrv_gsscallbackson = 0; @@ -782,7 +783,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, procnum = NFSV4PROC_COMPOUND; if (nmp != NULL) { - NFSINCRGLOBAL(nfsstatsv1.rpcrequests); + NFSINCRGLOBAL(nfsstatsv1_p->rpcrequests); /* Map the procnum to the old NFSv2 one, as required. */ if ((nd->nd_flag & ND_NFSV2) != 0) { @@ -917,13 +918,13 @@ tryagain: if (stat == RPC_SUCCESS) { error = 0; } else if (stat == RPC_TIMEDOUT) { - NFSINCRGLOBAL(nfsstatsv1.rpctimeouts); + NFSINCRGLOBAL(nfsstatsv1_p->rpctimeouts); error = ETIMEDOUT; } else if (stat == RPC_VERSMISMATCH) { - NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); + NFSINCRGLOBAL(nfsstatsv1_p->rpcinvalid); error = EOPNOTSUPP; } else if (stat == RPC_PROGVERSMISMATCH) { - NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); + NFSINCRGLOBAL(nfsstatsv1_p->rpcinvalid); error = EPROTONOSUPPORT; } else if (stat == RPC_CANTSEND || stat == RPC_CANTRECV || stat == RPC_SYSTEMERROR || stat == RPC_INTR) { @@ -957,11 +958,11 @@ tryagain: if (stat == RPC_INTR) error = EINTR; else { - NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); + NFSINCRGLOBAL(nfsstatsv1_p->rpcinvalid); error = ENXIO; } } else { - NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); + NFSINCRGLOBAL(nfsstatsv1_p->rpcinvalid); error = EACCES; } if (error) { diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index cb47922a34e0..e45f26d53799 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -61,7 +61,6 @@ extern struct nfssockreq nfsrv_nfsuserdsock; extern void (*nfsd_call_recall)(struct vnode *, int, struct ucred *, struct thread *); extern int nfsrv_useacl; -struct mount nfsv4root_mnt; int newnfs_numnfsd = 0; struct nfsstatsv1 nfsstatsv1; int nfs_numnfscbd = 0; @@ -76,6 +75,8 @@ vop_advlock_t *nfs_advlock_p = NULL; vop_reclaim_t *nfs_reclaim_p = NULL; uint32_t nfs_srvmaxio = NFS_SRVMAXIO; +NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); + int nfs_pnfsio(task_fn_t *, void *); static int nfs_realign_test; @@ -149,6 +150,7 @@ struct mtx nfs_clstate_mutex; /* local functions */ static int nfssvc_call(struct thread *, struct nfssvc_args *, struct ucred *); +static void nfs_clean(struct prison *); #ifdef __NO_STRICT_ALIGNMENT /* @@ -433,7 +435,9 @@ nfssvc_nfscommon(struct thread *td, struct nfssvc_args *uap) { int error; + NFSD_CURVNET_SET(NFSD_TD_TO_VNET(td)); error = nfssvc_call(td, uap, td->td_ucred); + NFSD_CURVNET_RESTORE(); NFSEXITCODE(error); return (error); } @@ -473,87 +477,87 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred) if ((uap->flag & NFSSVC_NEWSTRUCT) == 0) { /* Copy fields to the old ext_nfsstat structure. */ oldnfsstats.attrcache_hits = - nfsstatsv1.attrcache_hits; + nfsstatsv1_p->attrcache_hits; oldnfsstats.attrcache_misses = - nfsstatsv1.attrcache_misses; + nfsstatsv1_p->attrcache_misses; oldnfsstats.lookupcache_hits = - nfsstatsv1.lookupcache_hits; + nfsstatsv1_p->lookupcache_hits; oldnfsstats.lookupcache_misses = - nfsstatsv1.lookupcache_misses; + nfsstatsv1_p->lookupcache_misses; oldnfsstats.direofcache_hits = - nfsstatsv1.direofcache_hits; + nfsstatsv1_p->direofcache_hits; oldnfsstats.direofcache_misses = - nfsstatsv1.direofcache_misses; + nfsstatsv1_p->direofcache_misses; oldnfsstats.accesscache_hits = - nfsstatsv1.accesscache_hits; + nfsstatsv1_p->accesscache_hits; oldnfsstats.accesscache_misses = - nfsstatsv1.accesscache_misses; + nfsstatsv1_p->accesscache_misses; oldnfsstats.biocache_reads = - nfsstatsv1.biocache_reads; + nfsstatsv1_p->biocache_reads; oldnfsstats.read_bios = - nfsstatsv1.read_bios; + nfsstatsv1_p->read_bios; oldnfsstats.read_physios = - nfsstatsv1.read_physios; + nfsstatsv1_p->read_physios; oldnfsstats.biocache_writes = - nfsstatsv1.biocache_writes; + nfsstatsv1_p->biocache_writes; oldnfsstats.write_bios = - nfsstatsv1.write_bios; + nfsstatsv1_p->write_bios; oldnfsstats.write_physios = - nfsstatsv1.write_physios; + nfsstatsv1_p->write_physios; oldnfsstats.biocache_readlinks = - nfsstatsv1.biocache_readlinks; + nfsstatsv1_p->biocache_readlinks; oldnfsstats.readlink_bios = - nfsstatsv1.readlink_bios; + nfsstatsv1_p->readlink_bios; oldnfsstats.biocache_readdirs = - nfsstatsv1.biocache_readdirs; + nfsstatsv1_p->biocache_readdirs; oldnfsstats.readdir_bios = - nfsstatsv1.readdir_bios; + nfsstatsv1_p->readdir_bios; for (i = 0; i < NFSV4_NPROCS; i++) - oldnfsstats.rpccnt[i] = nfsstatsv1.rpccnt[i]; - oldnfsstats.rpcretries = nfsstatsv1.rpcretries; + oldnfsstats.rpccnt[i] = nfsstatsv1_p->rpccnt[i]; + oldnfsstats.rpcretries = nfsstatsv1_p->rpcretries; for (i = 0; i < NFSV4OP_NOPS; i++) oldnfsstats.srvrpccnt[i] = - nfsstatsv1.srvrpccnt[i]; + nfsstatsv1_p->srvrpccnt[i]; for (i = NFSV42_NOPS, j = NFSV4OP_NOPS; i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++) oldnfsstats.srvrpccnt[j] = - nfsstatsv1.srvrpccnt[i]; + nfsstatsv1_p->srvrpccnt[i]; oldnfsstats.reserved_0 = 0; oldnfsstats.reserved_1 = 0; - oldnfsstats.rpcrequests = nfsstatsv1.rpcrequests; - oldnfsstats.rpctimeouts = nfsstatsv1.rpctimeouts; - oldnfsstats.rpcunexpected = nfsstatsv1.rpcunexpected; - oldnfsstats.rpcinvalid = nfsstatsv1.rpcinvalid; + oldnfsstats.rpcrequests = nfsstatsv1_p->rpcrequests; + oldnfsstats.rpctimeouts = nfsstatsv1_p->rpctimeouts; + oldnfsstats.rpcunexpected = nfsstatsv1_p->rpcunexpected; + oldnfsstats.rpcinvalid = nfsstatsv1_p->rpcinvalid; oldnfsstats.srvcache_inproghits = - nfsstatsv1.srvcache_inproghits; + nfsstatsv1_p->srvcache_inproghits; oldnfsstats.reserved_2 = 0; oldnfsstats.srvcache_nonidemdonehits = - nfsstatsv1.srvcache_nonidemdonehits; + nfsstatsv1_p->srvcache_nonidemdonehits; oldnfsstats.srvcache_misses = - nfsstatsv1.srvcache_misses; + nfsstatsv1_p->srvcache_misses; oldnfsstats.srvcache_tcppeak = - nfsstatsv1.srvcache_tcppeak; - oldnfsstats.srvcache_size = nfsstatsv1.srvcache_size; - oldnfsstats.srvclients = nfsstatsv1.srvclients; - oldnfsstats.srvopenowners = nfsstatsv1.srvopenowners; - oldnfsstats.srvopens = nfsstatsv1.srvopens; - oldnfsstats.srvlockowners = nfsstatsv1.srvlockowners; - oldnfsstats.srvlocks = nfsstatsv1.srvlocks; - oldnfsstats.srvdelegates = nfsstatsv1.srvdelegates; + nfsstatsv1_p->srvcache_tcppeak; + oldnfsstats.srvcache_size = nfsstatsv1_p->srvcache_size; + oldnfsstats.srvclients = nfsstatsv1_p->srvclients; + oldnfsstats.srvopenowners = nfsstatsv1_p->srvopenowners; + oldnfsstats.srvopens = nfsstatsv1_p->srvopens; + oldnfsstats.srvlockowners = nfsstatsv1_p->srvlockowners; + oldnfsstats.srvlocks = nfsstatsv1_p->srvlocks; + oldnfsstats.srvdelegates = nfsstatsv1_p->srvdelegates; for (i = 0; i < NFSV4OP_CBNOPS; i++) oldnfsstats.cbrpccnt[i] = - nfsstatsv1.cbrpccnt[i]; - oldnfsstats.clopenowners = nfsstatsv1.clopenowners; - oldnfsstats.clopens = nfsstatsv1.clopens; - oldnfsstats.cllockowners = nfsstatsv1.cllockowners; - oldnfsstats.cllocks = nfsstatsv1.cllocks; - oldnfsstats.cldelegates = nfsstatsv1.cldelegates; + nfsstatsv1_p->cbrpccnt[i]; + oldnfsstats.clopenowners = nfsstatsv1_p->clopenowners; + oldnfsstats.clopens = nfsstatsv1_p->clopens; + oldnfsstats.cllockowners = nfsstatsv1_p->cllockowners; + oldnfsstats.cllocks = nfsstatsv1_p->cllocks; + oldnfsstats.cldelegates = nfsstatsv1_p->cldelegates; oldnfsstats.cllocalopenowners = - nfsstatsv1.cllocalopenowners; - oldnfsstats.cllocalopens = nfsstatsv1.cllocalopens; + nfsstatsv1_p->cllocalopenowners; + oldnfsstats.cllocalopens = nfsstatsv1_p->cllocalopens; oldnfsstats.cllocallockowners = - nfsstatsv1.cllocallockowners; - oldnfsstats.cllocallocks = nfsstatsv1.cllocallocks; + nfsstatsv1_p->cllocallockowners; + oldnfsstats.cllocallocks = nfsstatsv1_p->cllocallocks; error = copyout(&oldnfsstats, uap->argp, sizeof (oldnfsstats)); } else { @@ -563,128 +567,128 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred) if (nfsstatver.vers == NFSSTATS_OV1) { /* Copy nfsstatsv1 to nfsstatsov1. */ nfsstatsov1.attrcache_hits = - nfsstatsv1.attrcache_hits; + nfsstatsv1_p->attrcache_hits; nfsstatsov1.attrcache_misses = - nfsstatsv1.attrcache_misses; + nfsstatsv1_p->attrcache_misses; nfsstatsov1.lookupcache_hits = - nfsstatsv1.lookupcache_hits; + nfsstatsv1_p->lookupcache_hits; nfsstatsov1.lookupcache_misses = - nfsstatsv1.lookupcache_misses; + nfsstatsv1_p->lookupcache_misses; nfsstatsov1.direofcache_hits = - nfsstatsv1.direofcache_hits; + nfsstatsv1_p->direofcache_hits; nfsstatsov1.direofcache_misses = - nfsstatsv1.direofcache_misses; + nfsstatsv1_p->direofcache_misses; nfsstatsov1.accesscache_hits = - nfsstatsv1.accesscache_hits; + nfsstatsv1_p->accesscache_hits; nfsstatsov1.accesscache_misses = - nfsstatsv1.accesscache_misses; + nfsstatsv1_p->accesscache_misses; nfsstatsov1.biocache_reads = - nfsstatsv1.biocache_reads; + nfsstatsv1_p->biocache_reads; nfsstatsov1.read_bios = - nfsstatsv1.read_bios; + nfsstatsv1_p->read_bios; nfsstatsov1.read_physios = - nfsstatsv1.read_physios; + nfsstatsv1_p->read_physios; nfsstatsov1.biocache_writes = - nfsstatsv1.biocache_writes; + nfsstatsv1_p->biocache_writes; nfsstatsov1.write_bios = - nfsstatsv1.write_bios; + nfsstatsv1_p->write_bios; nfsstatsov1.write_physios = - nfsstatsv1.write_physios; + nfsstatsv1_p->write_physios; nfsstatsov1.biocache_readlinks = - nfsstatsv1.biocache_readlinks; + nfsstatsv1_p->biocache_readlinks; nfsstatsov1.readlink_bios = - nfsstatsv1.readlink_bios; + nfsstatsv1_p->readlink_bios; nfsstatsov1.biocache_readdirs = - nfsstatsv1.biocache_readdirs; + nfsstatsv1_p->biocache_readdirs; nfsstatsov1.readdir_bios = - nfsstatsv1.readdir_bios; + nfsstatsv1_p->readdir_bios; for (i = 0; i < NFSV42_OLDNPROCS; i++) nfsstatsov1.rpccnt[i] = - nfsstatsv1.rpccnt[i]; + nfsstatsv1_p->rpccnt[i]; nfsstatsov1.rpcretries = - nfsstatsv1.rpcretries; + nfsstatsv1_p->rpcretries; for (i = 0; i < NFSV42_PURENOPS; i++) nfsstatsov1.srvrpccnt[i] = - nfsstatsv1.srvrpccnt[i]; + nfsstatsv1_p->srvrpccnt[i]; for (i = NFSV42_NOPS, j = NFSV42_PURENOPS; i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++) nfsstatsov1.srvrpccnt[j] = - nfsstatsv1.srvrpccnt[i]; + nfsstatsv1_p->srvrpccnt[i]; nfsstatsov1.reserved_0 = 0; nfsstatsov1.reserved_1 = 0; nfsstatsov1.rpcrequests = - nfsstatsv1.rpcrequests; + nfsstatsv1_p->rpcrequests; nfsstatsov1.rpctimeouts = - nfsstatsv1.rpctimeouts; + nfsstatsv1_p->rpctimeouts; nfsstatsov1.rpcunexpected = - nfsstatsv1.rpcunexpected; + nfsstatsv1_p->rpcunexpected; nfsstatsov1.rpcinvalid = - nfsstatsv1.rpcinvalid; + nfsstatsv1_p->rpcinvalid; nfsstatsov1.srvcache_inproghits = - nfsstatsv1.srvcache_inproghits; + nfsstatsv1_p->srvcache_inproghits; nfsstatsov1.reserved_2 = 0; nfsstatsov1.srvcache_nonidemdonehits = - nfsstatsv1.srvcache_nonidemdonehits; + nfsstatsv1_p->srvcache_nonidemdonehits; nfsstatsov1.srvcache_misses = - nfsstatsv1.srvcache_misses; + nfsstatsv1_p->srvcache_misses; nfsstatsov1.srvcache_tcppeak = - nfsstatsv1.srvcache_tcppeak; + nfsstatsv1_p->srvcache_tcppeak; nfsstatsov1.srvcache_size = - nfsstatsv1.srvcache_size; + nfsstatsv1_p->srvcache_size; nfsstatsov1.srvclients = - nfsstatsv1.srvclients; + nfsstatsv1_p->srvclients; nfsstatsov1.srvopenowners = - nfsstatsv1.srvopenowners; + nfsstatsv1_p->srvopenowners; nfsstatsov1.srvopens = - nfsstatsv1.srvopens; + nfsstatsv1_p->srvopens; nfsstatsov1.srvlockowners = - nfsstatsv1.srvlockowners; + nfsstatsv1_p->srvlockowners; nfsstatsov1.srvlocks = - nfsstatsv1.srvlocks; + nfsstatsv1_p->srvlocks; nfsstatsov1.srvdelegates = - nfsstatsv1.srvdelegates; + nfsstatsv1_p->srvdelegates; for (i = 0; i < NFSV42_CBNOPS; i++) nfsstatsov1.cbrpccnt[i] = - nfsstatsv1.cbrpccnt[i]; + nfsstatsv1_p->cbrpccnt[i]; nfsstatsov1.clopenowners = - nfsstatsv1.clopenowners; + nfsstatsv1_p->clopenowners; nfsstatsov1.clopens = - nfsstatsv1.clopens; + nfsstatsv1_p->clopens; nfsstatsov1.cllockowners = - nfsstatsv1.cllockowners; + nfsstatsv1_p->cllockowners; nfsstatsov1.cllocks = - nfsstatsv1.cllocks; + nfsstatsv1_p->cllocks; nfsstatsov1.cldelegates = - nfsstatsv1.cldelegates; + nfsstatsv1_p->cldelegates; nfsstatsov1.cllocalopenowners = - nfsstatsv1.cllocalopenowners; + nfsstatsv1_p->cllocalopenowners; nfsstatsov1.cllocalopens = - nfsstatsv1.cllocalopens; + nfsstatsv1_p->cllocalopens; nfsstatsov1.cllocallockowners = - nfsstatsv1.cllocallockowners; + nfsstatsv1_p->cllocallockowners; nfsstatsov1.cllocallocks = - nfsstatsv1.cllocallocks; + nfsstatsv1_p->cllocallocks; nfsstatsov1.srvstartcnt = - nfsstatsv1.srvstartcnt; + nfsstatsv1_p->srvstartcnt; nfsstatsov1.srvdonecnt = - nfsstatsv1.srvdonecnt; + nfsstatsv1_p->srvdonecnt; for (i = NFSV42_NOPS, j = NFSV42_PURENOPS; i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++) { nfsstatsov1.srvbytes[j] = - nfsstatsv1.srvbytes[i]; + nfsstatsv1_p->srvbytes[i]; nfsstatsov1.srvops[j] = - nfsstatsv1.srvops[i]; + nfsstatsv1_p->srvops[i]; nfsstatsov1.srvduration[j] = - nfsstatsv1.srvduration[i]; + nfsstatsv1_p->srvduration[i]; } nfsstatsov1.busyfrom = - nfsstatsv1.busyfrom; + nfsstatsv1_p->busyfrom; nfsstatsov1.busyfrom = - nfsstatsv1.busyfrom; + nfsstatsv1_p->busyfrom; error = copyout(&nfsstatsov1, uap->argp, sizeof(nfsstatsov1)); } else if (nfsstatver.vers != NFSSTATS_V1) @@ -696,41 +700,41 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred) } if (error == 0) { if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) { - nfsstatsv1.attrcache_hits = 0; - nfsstatsv1.attrcache_misses = 0; - nfsstatsv1.lookupcache_hits = 0; - nfsstatsv1.lookupcache_misses = 0; - nfsstatsv1.direofcache_hits = 0; - nfsstatsv1.direofcache_misses = 0; - nfsstatsv1.accesscache_hits = 0; - nfsstatsv1.accesscache_misses = 0; - nfsstatsv1.biocache_reads = 0; - nfsstatsv1.read_bios = 0; - nfsstatsv1.read_physios = 0; - nfsstatsv1.biocache_writes = 0; - nfsstatsv1.write_bios = 0; - nfsstatsv1.write_physios = 0; - nfsstatsv1.biocache_readlinks = 0; - nfsstatsv1.readlink_bios = 0; - nfsstatsv1.biocache_readdirs = 0; - nfsstatsv1.readdir_bios = 0; - nfsstatsv1.rpcretries = 0; - nfsstatsv1.rpcrequests = 0; - nfsstatsv1.rpctimeouts = 0; - nfsstatsv1.rpcunexpected = 0; - nfsstatsv1.rpcinvalid = 0; - bzero(nfsstatsv1.rpccnt, - sizeof(nfsstatsv1.rpccnt)); + nfsstatsv1_p->attrcache_hits = 0; + nfsstatsv1_p->attrcache_misses = 0; + nfsstatsv1_p->lookupcache_hits = 0; + nfsstatsv1_p->lookupcache_misses = 0; + nfsstatsv1_p->direofcache_hits = 0; + nfsstatsv1_p->direofcache_misses = 0; + nfsstatsv1_p->accesscache_hits = 0; + nfsstatsv1_p->accesscache_misses = 0; + nfsstatsv1_p->biocache_reads = 0; + nfsstatsv1_p->read_bios = 0; + nfsstatsv1_p->read_physios = 0; + nfsstatsv1_p->biocache_writes = 0; + nfsstatsv1_p->write_bios = 0; + nfsstatsv1_p->write_physios = 0; + nfsstatsv1_p->biocache_readlinks = 0; + nfsstatsv1_p->readlink_bios = 0; + nfsstatsv1_p->biocache_readdirs = 0; + nfsstatsv1_p->readdir_bios = 0; + nfsstatsv1_p->rpcretries = 0; + nfsstatsv1_p->rpcrequests = 0; + nfsstatsv1_p->rpctimeouts = 0; + nfsstatsv1_p->rpcunexpected = 0; + nfsstatsv1_p->rpcinvalid = 0; + bzero(nfsstatsv1_p->rpccnt, + sizeof(nfsstatsv1_p->rpccnt)); } if ((uap->flag & NFSSVC_ZEROSRVSTATS) != 0) { - nfsstatsv1.srvcache_inproghits = 0; - nfsstatsv1.srvcache_nonidemdonehits = 0; - nfsstatsv1.srvcache_misses = 0; - nfsstatsv1.srvcache_tcppeak = 0; - bzero(nfsstatsv1.srvrpccnt, - sizeof(nfsstatsv1.srvrpccnt)); - bzero(nfsstatsv1.cbrpccnt, - sizeof(nfsstatsv1.cbrpccnt)); + nfsstatsv1_p->srvcache_inproghits = 0; + nfsstatsv1_p->srvcache_nonidemdonehits = 0; + nfsstatsv1_p->srvcache_misses = 0; + nfsstatsv1_p->srvcache_tcppeak = 0; + bzero(nfsstatsv1_p->srvrpccnt, + sizeof(nfsstatsv1_p->srvrpccnt)); + bzero(nfsstatsv1_p->cbrpccnt, + sizeof(nfsstatsv1_p->cbrpccnt)); } } goto out; @@ -848,6 +852,34 @@ nfs_pnfsio(task_fn_t *func, void *context) return (ret); } +static void +nfs_clean(struct prison *pr) +{ + + NFSD_CURVNET_SET(pr->pr_vnet); + if (pr != &prison0) + free(NFSD_VNET(nfsstatsv1_p), M_TEMP); + /* Clean out the name<-->id cache. */ + nfsrv_cleanusergroup(); + NFSD_CURVNET_RESTORE(); +} + +/* + * Initialize everything that needs to be initialized for a vnet. + */ +static void +nfs_vnetinit(const void *unused __unused) +{ + + if (curthread->td_ucred->cr_prison == &prison0) + NFSD_VNET(nfsstatsv1_p) = &nfsstatsv1; + else + NFSD_VNET(nfsstatsv1_p) = malloc(sizeof(struct nfsstatsv1), + M_TEMP, M_WAITOK | M_ZERO); +} +SYSINIT(nfs_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, + nfs_vnetinit, NULL); + extern int (*nfsd_call_nfscommon)(struct thread *, struct nfssvc_args *); /* @@ -885,8 +917,7 @@ nfscommon_modevent(module_t mod, int type, void *data) } nfsd_call_nfscommon = NULL; - /* Clean out the name<-->id cache. */ - nfsrv_cleanusergroup(); + nfs_clean(&prison0); /* and get rid of the mutexes */ mtx_destroy(&nfs_nameid_mutex); mtx_destroy(&newnfsd_mtx); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index bcc49f8bcac3..633d31ea6511 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -61,7 +61,6 @@ extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1; extern int nfsrv_useacl; extern int newnfs_numnfsd; extern int nfsrv_sessionhashsize; -extern struct nfsstatsv1 nfsstatsv1; extern struct nfslayouthash *nfslayouthash; extern int nfsrv_layouthashsize; extern struct mtx nfsrv_dslock_mtx; @@ -79,6 +78,7 @@ NFSD_VNET_DECLARE(struct nfsclienthashhead *, nfsclienthash); NFSD_VNET_DECLARE(struct nfslockhashhead *, nfslockhash); NFSD_VNET_DECLARE(struct nfssessionhash *, nfssessionhash); NFSD_VNET_DECLARE(struct nfsv4lock, nfsd_suspend_lock); +NFSD_VNET_DECLARE(struct nfsstatsv1 *, nfsstatsv1_p); NFSDLOCKMUTEX; NFSSTATESPINLOCK; @@ -102,7 +102,6 @@ NFSD_VNET_DEFINE(struct nfsrchash_bucket *, nfsrcahash_table); NFSD_VNET_DEFINE(struct nfsrvfh, nfs_rootfh); NFSD_VNET_DEFINE(int, nfs_rootfhset) = 0; NFSD_VNET_DEFINE(struct callout, nfsd_callout); -NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); NFSD_VNET_DEFINE_STATIC(struct mount *, nfsv4root_mnt); NFSD_VNET_DEFINE_STATIC(struct vfsoptlist, nfsv4root_opt); NFSD_VNET_DEFINE_STATIC(struct vfsoptlist, nfsv4root_newopt); @@ -3535,13 +3534,6 @@ nfsd_mntinit(void) nfsrvd_init(0); NFSD_UNLOCK(); - if (curthread->td_ucred->cr_prison == &prison0) - NFSD_VNET(nfsstatsv1_p) = &nfsstatsv1; - else - NFSD_VNET(nfsstatsv1_p) = malloc(sizeof(struct nfsstatsv1), - M_TEMP, M_WAITOK | M_ZERO); - nfsstatsv1_p->srvcache_tcppeak = 0; - nfsstatsv1_p->srvcache_size = 0; NFSD_VNET(nfsv4root_mnt) = malloc(sizeof(struct mount), M_TEMP, M_WAITOK | M_ZERO); NFSD_VNET(nfsv4root_mnt)->mnt_flag = (MNT_RDONLY | MNT_EXPORTED); @@ -7167,8 +7159,6 @@ nfsrv_cleanup(struct prison *pr) free(NFSD_VNET(nfssessionhash), M_NFSDSESSION); free(NFSD_VNET(nfsv4root_mnt), M_TEMP); NFSD_VNET(nfsv4root_mnt) = NULL; - if (pr != &prison0) - free(NFSD_VNET(nfsstatsv1_p), M_TEMP); NFSD_CURVNET_RESTORE(); } From nobody Mon Feb 13 23:16:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG0bL27cWz3qc0s; Mon, 13 Feb 2023 23:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PG0bL1dNhz3NfF; Mon, 13 Feb 2023 23:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676330206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=djBRDtvGi3aFzzIVqrA4pb3qh7862twW+41qc9KrDms=; b=STwJAFO9vRTlfmNLwJZYjYJimpnuGWptP8NbKfK8v5G8jPq7gWOXcfdgwOSpPxoKhbBYO5 l0WR7qRj5qUXHe4SqvjzSrwnP+GVpMIOb6zmPMI0PZYzT3BytUzE1TB6X0/6FgoxQIoJ/m VCT0grSQ6Lzc2sjj8p9kCK4EoUD+1GlST+U5hYxB/RByJuyYB1QJIQX7PsaqhJgNs5iQU0 /DjiVS6Ag0hS9/Z451A8C4ZVq770dgViF4RwXzZSiPHXuNgo/9+G1pj2A8SO1T/ceexBTu QB8qrPg6UvoN4QZkG3eoCjT5qDw/Dlpu2KDHhxoY1kCZEEFyWqAj2O0DkrcwnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676330206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=djBRDtvGi3aFzzIVqrA4pb3qh7862twW+41qc9KrDms=; b=sgtNYqfMlQnhLnfVzY6Q/u2GLeJ9M+bp3T8h6JmAXMV15F0LMB55jEXtZvqttmNSa1aE99 wfZy5MJH0YkcgLYp1KAZgTem0ztVP9a/zqZOOjrQW+XZ4HJG0NEK43QkoBTbIeTiQGjR4D yk+TatUUrKugT3R0lxd0h+xOWC3hGCe1t0FwqslqC8EcXVafwTSk31X4rs4cF95lKFAuzo ddhr0mqKqa934E/CXm3lMsIARHa+Fd766VINqM5cQ2g5D0lDUa0KNc2r2aRF+WVc1jRlhu KzuipqUOmn781Fw6ui6uVhou0lOn/RiuVWgYjDnoW8rWvV8LdBL0Scn26PGwTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676330206; a=rsa-sha256; cv=none; b=IS+zajM0QU1TcH90s8VPHo/JDDRSK1Fbf05NK24DKFSCYTmuL8uGBl8RjMra6IVvM+PH7u GIY+JrBkWfTuMfVWzfIP7Vi5QZQHUNAloazv9KVaqJfH33AIpkrovxK5fZUwnA2pDptr6Q JLOVPg/hu+7dP0TH+V26eFyMkiVg8tgElIYgeINagq0vmekFi/TSFgQawIbpQZClTqzUAc PLZIQILjV2D6h5GPJRQ5pWjU915nLAmDedWC0AZuL31siUXmu3dCbFycUq1tvXg2AkUHDh SwVbXt/qkjhpQr84qZ3npz1+RdsuI55SepbXYpl+Lq6M7F/oB4adQ+bki8XDWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PG0bL0h1CzcZ5; Mon, 13 Feb 2023 23:16: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 31DNGjWv044321; Mon, 13 Feb 2023 23:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DNGjis044320; Mon, 13 Feb 2023 23:16:45 GMT (envelope-from git) Date: Mon, 13 Feb 2023 23:16:45 GMT Message-Id: <202302132316.31DNGjis044320@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: 889f07460151 - main - tmpfs_access(): style fixes and remove redundand assertions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 889f07460151ad20d3171cb37c608aaee112e408 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=889f07460151ad20d3171cb37c608aaee112e408 commit 889f07460151ad20d3171cb37c608aaee112e408 Author: Konstantin Belousov AuthorDate: 2023-02-12 22:15:00 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-13 23:16:38 +0000 tmpfs_access(): style fixes and remove redundand assertions Note that MPASS(VOP_ISLOCKED(vp)) is simply broken. Reviewed by: markj, mjg Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38557 --- sys/fs/tmpfs/tmpfs_vnops.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 28de8c989487..c7371de28896 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -379,20 +379,17 @@ int tmpfs_access(struct vop_access_args *v) { struct vnode *vp = v->a_vp; - accmode_t accmode = v->a_accmode; struct ucred *cred = v->a_cred; + struct tmpfs_node *node = VP_TO_TMPFS_NODE(vp); mode_t all_x = S_IXUSR | S_IXGRP | S_IXOTH; + accmode_t accmode = v->a_accmode; int error; - struct tmpfs_node *node; - - MPASS(VOP_ISLOCKED(vp)); - - node = VP_TO_TMPFS_NODE(vp); /* * Common case path lookup. */ - if (__predict_true(accmode == VEXEC && (node->tn_mode & all_x) == all_x)) + if (__predict_true(accmode == VEXEC && + (node->tn_mode & all_x) == all_x)) return (0); switch (vp->v_type) { @@ -401,7 +398,8 @@ tmpfs_access(struct vop_access_args *v) case VLNK: /* FALLTHROUGH */ case VREG: - if (accmode & VWRITE && vp->v_mount->mnt_flag & MNT_RDONLY) { + if ((accmode & VWRITE) != 0 && + (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) { error = EROFS; goto out; } @@ -421,7 +419,7 @@ tmpfs_access(struct vop_access_args *v) goto out; } - if (accmode & VWRITE && node->tn_flags & IMMUTABLE) { + if ((accmode & VWRITE) != 0 && (node->tn_flags & IMMUTABLE) != 0) { error = EPERM; goto out; } @@ -430,8 +428,6 @@ tmpfs_access(struct vop_access_args *v) accmode, cred); out: - MPASS(VOP_ISLOCKED(vp)); - return (error); } @@ -1157,7 +1153,7 @@ tmpfs_rename(struct vop_rename_args *v) TMPFS_UNLOCK(tmp); error = EINVAL; if (newname != NULL) - free(newname, M_TMPFSNAME); + free(newname, M_TMPFSNAME); goto out_locked; } parent = n->tn_dir.tn_parent; From nobody Mon Feb 13 23:16:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG0bM335Kz3qc2y; Mon, 13 Feb 2023 23: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 4PG0bM2Yggz3NLB; Mon, 13 Feb 2023 23: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=1676330207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ft0PIZgDcluwyvuDk2FzTIcALGKw3YpnMXKH9x9hkY=; b=KpdpxabK5LYqg//O4cmsMyhs7b/nYpmdo8NyEYLRHQ2mSTBHkKQgg8WyCbtrq+3Dr3dUx6 hfymwQBJFsZiDrOtiV6sokydYe57c16Y7sjvrcOmHB68l0PGNzI0tvXNC8TIQqqYrUUWoO 0CNbnpUogTFQyrKJWOwfRGehfoFtasWApmTAaNNtyluFgvotHqbo0gmL/4X3JXw8OSJH1N g2VogIWoYCC1MKHdFketTYB6wLkDdNMLryJi+uygNa5yGSa/Y0QQA5qwIhlqfP//i00vra f+y5+EvlUvCTWPQV+5RWN2W5s+v5ThivDFNHe93PGKxtrDs1HPJCpuheH01AkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676330207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ft0PIZgDcluwyvuDk2FzTIcALGKw3YpnMXKH9x9hkY=; b=sqiH3QyX3rNabDqL/GcGwmeb5GcgKt2G0MWZIemJFSiXbVpvoDYr40rX7BqFCq3Mr47ckJ KfmEkxrxRaXUzbxF/OMu390FYT0wWj7FuYTa6ekN0PWk1LBzfzbCd4cIG6wUhEN456TjW8 y6aDuJGUg+Dlr1weMS+eFk7nhDipb3mFkfKAKscpwHuHLzEYgRfhRWcWxh2ay/0Cr7xT6U l0SSBh7zIhrxLfP2etWiAp+XP8Qqtbyf9qGknIWr1eEeYzCfO0I/7z9yVtXl4b8qv7K6VF 4vYiSW18pGyjzm+R7ifMkdnlcGrTYnnlYWXpKUe0QATFRBnuxxO+QH4WX1iekQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676330207; a=rsa-sha256; cv=none; b=WHjtbhPMfnjz4mmh6W0YP/FltXddVpLWaXDBUyTATnUGulAyrBmPzF1apbUE2hDBkMHhgV kPLGQUf4vyiBy3zT8BhQPvL3Pb3Dxqw8OWQiSyA1fvByEhOuikJPo6rjidV4tmf5MJoBfP gDs9o6aYmAJoczrDS7x7bwbRt5BY9znYtxNWCmN0fM8W+ts51oTnoyrLtbG7WEmEU9ytvD +2lK0hPIM2riiIlnToCVn7iN7o1d7/ZzKx8CZSAzP+zuNdeAngaOw7plSNKFSfEghBHDOK +bNtriQVKyQlKv6jkC82NUOzQ8ujVLG9YEWK3KXwPZor9sOsERAwoHMhphFpzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PG0bM1NQLzcRF; Mon, 13 Feb 2023 23: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 31DNGlZe044347; Mon, 13 Feb 2023 23: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 31DNGlMm044346; Mon, 13 Feb 2023 23:16:47 GMT (envelope-from git) Date: Mon, 13 Feb 2023 23:16:47 GMT Message-Id: <202302132316.31DNGlMm044346@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: adc3506d56d7 - main - Extract tmpfs-specific part of tmpfs_access() into a helper List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adc3506d56d76981a0e251080b186c26edb843b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=adc3506d56d76981a0e251080b186c26edb843b4 commit adc3506d56d76981a0e251080b186c26edb843b4 Author: Konstantin Belousov AuthorDate: 2023-02-12 22:25:25 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-13 23:16:38 +0000 Extract tmpfs-specific part of tmpfs_access() into a helper The helper tmpfs_access_locked() requires either the vnode or node locked for consistency of the access check, unlike the pure vnode op. Reviewed by: markj, mjg Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38557 --- sys/fs/tmpfs/tmpfs_vnops.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index c7371de28896..cd460636b647 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -375,6 +375,23 @@ tmpfs_fplookup_vexec(struct vop_fplookup_vexec_args *v) return (vaccess_vexec_smr(mode, node->tn_uid, node->tn_gid, cred)); } +static int +tmpfs_access_locked(struct vnode *vp, struct tmpfs_node *node, + accmode_t accmode, struct ucred *cred) +{ +#ifdef DEBUG_VFS_LOCKS + if (!mtx_owned(TMPFS_NODE_MTX(node))) { + ASSERT_VOP_LOCKED(vp, + "tmpfs_access_locked needs locked vnode or node"); + } +#endif + + if ((accmode & VWRITE) != 0 && (node->tn_flags & IMMUTABLE) != 0) + return (EPERM); + return (vaccess(vp->v_type, node->tn_mode, node->tn_uid, node->tn_gid, + accmode, cred)); +} + int tmpfs_access(struct vop_access_args *v) { @@ -383,7 +400,6 @@ tmpfs_access(struct vop_access_args *v) struct tmpfs_node *node = VP_TO_TMPFS_NODE(vp); mode_t all_x = S_IXUSR | S_IXGRP | S_IXOTH; accmode_t accmode = v->a_accmode; - int error; /* * Common case path lookup. @@ -399,10 +415,8 @@ tmpfs_access(struct vop_access_args *v) /* FALLTHROUGH */ case VREG: if ((accmode & VWRITE) != 0 && - (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) { - error = EROFS; - goto out; - } + (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) + return (EROFS); break; case VBLK: @@ -415,20 +429,10 @@ tmpfs_access(struct vop_access_args *v) break; default: - error = EINVAL; - goto out; - } - - if ((accmode & VWRITE) != 0 && (node->tn_flags & IMMUTABLE) != 0) { - error = EPERM; - goto out; + return (EINVAL); } - error = vaccess(vp->v_type, node->tn_mode, node->tn_uid, node->tn_gid, - accmode, cred); - -out: - return (error); + return (tmpfs_access_locked(vp, node, accmode, cred)); } int From nobody Mon Feb 13 23:16:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG0bN5mLwz3qbx3; Mon, 13 Feb 2023 23: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 4PG0bN39w4z3NLZ; Mon, 13 Feb 2023 23: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=1676330208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TDCone7YiXp56d9Y4k+rF4wpqJtgY/eBS3bkHmewim4=; b=wZda15rk23n2e5LtrZn1c3iZKgQ0I0nVGKiXFktuiLDhNQUnLOlG+BjWjx1AJbvdEMYMjO Wpec3gI9h5Yu8vfeFNkUJ4SdrHOQTEjxX+1SmyN7qCeiiFqN+Pa7n+/uNixMBDvXrKbl2k crGUIqQ2hKiOPjHvrzDWvFdu4LwP3XKMBfdbCoYQPLlYoCammUDeXcALTzGSS3SYhFCOvi gtAPQC0IpAKkJnoLEHlpvqSBcXTjx5CbCOCB4eYuuB7uZ1JGgUlmcVLCtq7nXgF/JPqmeg FUJUPXD7CDFRBLrUz9WUWK3jOwHJjooqIQmDJqI86p5xj7ybZG34FkjCQYrdag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676330208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TDCone7YiXp56d9Y4k+rF4wpqJtgY/eBS3bkHmewim4=; b=Sr7jDLmjrqmoNJ9tm4wYdw2KsKYHHsEN9k5YMApJAVfMltPOSN8XeZlY04UiAw3grcVVeb JkBzBx6SSU/ywV/ehtCyeoEZmJy4JwggFxIdEt7Tg9Jw4oourXkIViARiX/sJjTW3UJg3l YQ18Pnk/P8CM1gD1f4akxI0vLerMwzpJgdItmnB3zSGZCtaSILKMMula1d25AWoZUqCt6e tTkq6qF3yQxsGD+zIyLqk216mS3LYkOBRtqjCaupVpDSF1+Q6ko+66F7TZgYnUlEb2Za8c f0DLVoo0fi3yZr2QgV7w+yR/G1iLffGZX+Isr62hFmd1h8C6njEVMGD2efLDpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676330208; a=rsa-sha256; cv=none; b=RqkTCcE06LPf/DfTdN+tTWXfdtOTpf7NJwFd9RC81b4iBLDyYky67nMYP3LPIgn/GpVSWU vyj4LboWn3qivQkRjGxltTtNHHOfMQYijkAY1xh5u1dFkboM1qUDRQ5loJdLowKLRuGm80 AKWwwyZhZzpodq2cFcKZMcuPbY0brHN8veyyt9vN/cnJZBoTkFO8QrJDTkTnpmBz6aF4sC TDu7Zy3z4b7TpvixWtPPYQtHTyWEejEzmw/WUYGfJeQo21Q5a2EifM6ccMpyQxZz7DQU1t nYXMR9PL6+OLyf4+wNzmfi6a3dMFX9cFuTYg7e9lxdREtruwyqFv3XcQE8CVcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PG0bN25dVzbpl; Mon, 13 Feb 2023 23: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 31DNGms3044372; Mon, 13 Feb 2023 23: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 31DNGmZw044371; Mon, 13 Feb 2023 23:16:48 GMT (envelope-from git) Date: Mon, 13 Feb 2023 23:16:48 GMT Message-Id: <202302132316.31DNGmZw044371@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: 3a3450eda6d4 - main - tmpfs_rename(): use tmpfs_access_locked instead of VOP_ACCESS() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a3450eda6d4616df51a30f84a872d9d43669d78 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3a3450eda6d4616df51a30f84a872d9d43669d78 commit 3a3450eda6d4616df51a30f84a872d9d43669d78 Author: Konstantin Belousov AuthorDate: 2023-02-12 23:20:25 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-13 23:16:38 +0000 tmpfs_rename(): use tmpfs_access_locked instead of VOP_ACCESS() Protect the call with the node lock. We cannot lock the fvp vnode sleepable there, because we already own other participating vnode's locks. Taking it without sleeping require unwinding the whole locking state in one more place. Note that the liveness of the node is guaranteed by the lock on the parent directory vnode. Reported and tested by: pho Fixes: cbac1f3464956185cf95955344b6009e2cc3ae40ESC Reviewed by: markj, mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38557 --- sys/fs/tmpfs/tmpfs_vnops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index cd460636b647..b1d6bce6754f 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1129,7 +1129,10 @@ tmpfs_rename(struct vop_rename_args *v) if (de->td_node->tn_type == VDIR) { struct tmpfs_node *n; - error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); + TMPFS_NODE_LOCK(fnode); + error = tmpfs_access_locked(fvp, fnode, VWRITE, + tcnp->cn_cred); + TMPFS_NODE_UNLOCK(fnode); if (error) { if (newname != NULL) free(newname, M_TMPFSNAME); From nobody Mon Feb 13 23:53:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG1Pr3N0jz3r9s5; Mon, 13 Feb 2023 23:53:36 +0000 (UTC) (envelope-from jbeich@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 4PG1Pr2t8Jz3jBs; Mon, 13 Feb 2023 23:53:36 +0000 (UTC) (envelope-from jbeich@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676332416; 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=bYOgdFgZ1rNRyHxK4d512wex7KzTk1rFYdOHGwwnlMg=; b=BCGD3iF5jROlsxD6RwcaxfKce72klx8O2ec2cVJ47swoHZrYHEKuojI/zacUQNBNTM8A/V A3FRZjLx3Y1vcswkGa/oe3eQsq3/HwnfPKmFALmucEPYJm4K7NaU1OFvpMlT/+3m5llPov IH27XZ10W9hcT4K9avOCOUVhZqugO7Aq1YobE2lPyZpY2ivHQPFsmq/ZnocdypJSRi5jCF WRMj7+C5a6TbJM0snz3JqTT0D4+AbBDuEUgTgw0sfR0vstOwnEsWcb9E058UIM7MaYHtRc OqBKmTSL0OLxLugu0NEXUIyH001lIhL4Rl5j/zbMjTRhhTzIAYrj3xlvYuDdPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676332416; 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=bYOgdFgZ1rNRyHxK4d512wex7KzTk1rFYdOHGwwnlMg=; b=ku6QMzgKcKWFIxM5A98u+bxLhI3fILMH/UIiODwb4O3febhN/onTWh+lYwDtOzTtH3IF8a NEVxxlI5oXpc8UV7t/IvL84o85wLKC7tZcbiaktnkmQiYMoF7AR9+WiXD19Sh9srE/EZZm Stx54p1EPOE82QNqvsnyaEfktNDp+GJFU359YWFUxaSaYeVmo1dKz20Q2/6fUuiBMSuSeG ctpuAQibQ1yJ5eiMxnpC0wlCdkVz5gEFw8h7peyHc6vlmPMFYX1Og4WpxQQf7bFlnAjUiG 5S5TqHtG7jlf9YJmLBhucKA4xz8j6tdr7fPewf5CgQuLr7O0cjsQKTwsWXF5OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676332416; a=rsa-sha256; cv=none; b=iD2YBtdiCoI0xVHP8QUyVad8U+8ZRaBlY/6kn0Gb53H0JAzq1qSlbEf4jlG5LANvujHT4g laEsznruNUSvm0yRU+rgwldn2DJUO8jOLtMEK3Npv2f6EJw4i4hZzwG9CxAuFCFho3RCNd QLo9TQkXXOztqQirOou8C7iYXcFHh4HIUqAMJmwDK2EEHG5lvMCPt3y1pZFbBjRsMoNYAa smRpEuPmgw3+FW/RjbCiU3dRnl/uXJFPgstOjs8hUFx6bI7HTNEYaiYPFbzdiVQgsmcn6R FiO57RRKU5JaxMYDLKtVLmQ3GyYgRvAZ3E4+jVIE2Soju8XoZ+5nNndQoapuog== Received: by freefall.freebsd.org (Postfix, from userid 1354) id 4380B1A273; Mon, 13 Feb 2023 23:53:36 +0000 (UTC) From: Jan Beich To: Mateusz Guzik Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 48bfd3597654 - main - Add nproc(1) In-Reply-To: <20230208202736.L7hpB%steffen__28609.3347867549$1675888077$gmane$org@sdaoden.eu> (Steffen Nurpmeso's message of "Wed, 08 Feb 2023 21:27:36 +0100") References: <202302081947.318Jlbt6052826@gitrepo.freebsd.org> <20230208202736.L7hpB%steffen__28609.3347867549$1675888077$gmane$org@sdaoden.eu> Date: Tue, 14 Feb 2023 00:53:31 +0100 Message-ID: <1qmt-6s1w-wny@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-ThisMailContainsUnwantedMimeParts: N Steffen Nurpmeso writes: > |+ if (all_flag) { > |+ cpus = sysconf(_SC_NPROCESSORS_ONLN); > > is not compatible -- note i like the FreeBSD way better, and maybe > someone should make a bug report even. > > #?0|kent:$ getconf -a|grep NPROC > _NPROCESSORS_CONF 8 > _NPROCESSORS_ONLN 4 See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230330 $ cpuset -l 2-5 -- getconf -a | fgrep _NPROC _NPROCESSORS_CONF: 8 _NPROCESSORS_ONLN: 4 From nobody Mon Feb 13 23:58:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG1Wl3N25z3rB7F; Mon, 13 Feb 2023 23:58:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) (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 4PG1Wl0r15z3jWX; Mon, 13 Feb 2023 23:58:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-16aa71c1600so17112536fac.11; Mon, 13 Feb 2023 15:58:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tGUtzbNp9abcw3jzaGGBd0xO8nj7aYkX6iviXMVvqeE=; b=leQBOzx5GcYd8dvEvG3V2TVGS+YV1S3Q0+jI8NOA+P9GGPoWtLuIe1FOPUaoR5ZUx8 S/5OKtOaQHguG6WTVbOyV/gBdyGS/r/sj7DP1HmuOjfU1PmyDq5Hp1jd0neEFjOs1iH1 sT7VF+aiMobwQ869l5AxUo4BIterjZBF8+rkNxIZW5IVmfcLX73FKqvEXITRkZBBlwFZ M2PrTMYy+MAMvK7EmBKYNeyeFrAqrOu/VcNfTDxcsNwyI2Kh6Wv/VelpLsbyZjsNBQYl xd/4sqwuryIrWzIGmt0TOi2278Dzd4qNVup58ffNAAw1BXXnsVB8D3taYXYcpKG3YqUF DCBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tGUtzbNp9abcw3jzaGGBd0xO8nj7aYkX6iviXMVvqeE=; b=gUh8E4KUfnXI+Bnjfw9tT8n/HdHhRH1h0rnrArCd4VouhYgFzXlSZUHWUAvEUNcXse rfhclNAgVAO7cnXbCoTvm1bGqUcy5BRTMgyt9OQgRd19MVGDi8s/InNEp6LZsBRRKgoT p0REiPanHDl4tEYLwmV+mDaFvc5zqffjflLB4hbAkXMen669LUR9KmJLFpvKyh38O2Sq 2VlWnZwoA7ZLdoLAJYgGYtCPdvLTdTGDJhvLcXSOFAM0lCKG6xccgzxzOFC5Hh8WhUV/ pJzJwNDbNJppiJ9snhbcBIEVNzXftX11B0xtofzxGvatZ6IRC5HOudQmC6PG7E2XDU57 +O3g== X-Gm-Message-State: AO0yUKWnzrCOKAEnXyS3PmFq6R9XXr4WmCcY75golB2os3cJzoVSnz9/ 13ybbbERJoQjs4aTwPbFSOUcgimIsF8BgyZ0bt1ueiN8 X-Google-Smtp-Source: AK7set8VxrAhCaL+2EYd7OUkq7XpDAj3dXFVvnlBMDc2IKWHjSKkrb0J4Scpe8C47Gr5SzmEfV2asW54KF1HZbpKNXY= X-Received: by 2002:a05:6870:cf05:b0:16e:25e:f294 with SMTP id xf5-20020a056870cf0500b0016e025ef294mr390500oab.81.1676332721876; Mon, 13 Feb 2023 15:58:41 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:4381:0:b0:4b9:9c2d:ce62 with HTTP; Mon, 13 Feb 2023 15:58:41 -0800 (PST) In-Reply-To: <1qmt-6s1w-wny@FreeBSD.org> References: <202302081947.318Jlbt6052826@gitrepo.freebsd.org> <20230208202736.L7hpB%steffen__28609.3347867549$1675888077$gmane$org@sdaoden.eu> <1qmt-6s1w-wny@FreeBSD.org> From: Mateusz Guzik Date: Tue, 14 Feb 2023 00:58:41 +0100 Message-ID: Subject: Re: git: 48bfd3597654 - main - Add nproc(1) To: Jan Beich 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-Rspamd-Queue-Id: 4PG1Wl0r15z3jWX X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 2/14/23, Jan Beich wrote: > Steffen Nurpmeso writes: > >> |+ if (all_flag) { >> |+ cpus = sysconf(_SC_NPROCESSORS_ONLN); >> >> is not compatible -- note i like the FreeBSD way better, and maybe >> someone should make a bug report even. >> >> #?0|kent:$ getconf -a|grep NPROC >> _NPROCESSORS_CONF 8 >> _NPROCESSORS_ONLN 4 > > See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230330 > > $ cpuset -l 2-5 -- getconf -a | fgrep _NPROC > _NPROCESSORS_CONF: 8 > _NPROCESSORS_ONLN: 4 > As I mentioned previously in the thread, on linux these *don't* react to cpusets (or tasksets in linux parlance): $ getconf -a | grep _NPROC _NPROCESSORS_CONF 4 _NPROCESSORS_ONLN 4 $ taskset --cpu-list 0 getconf -a | grep _NPROC _NPROCESSORS_CONF 4 _NPROCESSORS_ONLN 4 consequently the patch proposed in the bz would introduce an incompatibility with linux -- Mateusz Guzik From nobody Tue Feb 14 00:21:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG2292cnfz3rD7J; Tue, 14 Feb 2023 00:21:37 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 4PG2292BSwz3lPH; Tue, 14 Feb 2023 00:21:37 +0000 (UTC) (envelope-from jbeich@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676334097; 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=+x2UoDMvxSytTGfuvG6T5gVskPy7OJkjCAEldmPzyVg=; b=wmhKvfeEjOt5stPu3GNIkOTsuE3TlHLmrQ3Z3xMYa4e+DDfpb5RefFBQNhOrc+6d8JVWR8 M/WaMAb0f2WmTdyv1QeqbRzfyANHloGustVYIX0fJT6CuBBQZa2BiiRIT1iaQC6laenUIq Qp9k8hKBr4rT5sMGMiWGqcSK+hDb6QeFbfhI+sp67+PN6kz5E2W46VGFGmg1Zdo+lGI/Yd /nAiOrTmK3Ih7+BQKTgezchOqKY8bv1DDMRBvVHlFpTEbi3+Nq4NSR8VcWQtag2yml6s1S lik63akn1AE688zZPrDEVMqD2kovIzf5g1F+tXgEACGVhJFFKHzXqV3+gYdSpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676334097; 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=+x2UoDMvxSytTGfuvG6T5gVskPy7OJkjCAEldmPzyVg=; b=oqQT3QGENCFoekyTnFiwkffIKUVgi+zIcJzvFOL0Z8Tb0S8lJEZYM/rB/w3qoj3daBX0sn WTq752OJVlCbkrMTB0vqL/bYAl6tdLzOxjS5Gd6EQV9QVAJRL0UWiSacO4ti4OYKJlS9SK pUc2C4jpd9mfxfebl4ZvVDdq5HXNW6qoWwiN4YkcnpsC24wE5DpnhxG3fvc7eonKy5V9XS O5zt5oZ0bs3OKx934L2wOA8lucMUia2TJILgl0EAkYsWPAs5cG9AjMwU5zYBcIsTEFwAxJ H89sNDnPQWCiy3RUcYbOO1rdPoORDkHwA+SAiXBp3NJ2JcI+m7vRMZU/WayVrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676334097; a=rsa-sha256; cv=none; b=dzxvKWy1cWIpP0gm2RJpIo+MDo5TmcugbYx6F8biWvhNWBhTLB+RRTY3iqba+sPOnI14we ipV5L8LEZiIwUBwCyLqKgwaL8L2YnVf+0zkem53Hhy2j1tyEkb0c05gttIN4cSXimTqWag 7SVW2xd2Y+i912EFKkBfpY2ubWJmH8Xtn1gV/99BmEuP9OWwxx7UYGrSUmS2TVcrHr3eWv nrIPcuTcHdj/Ik8bCoyst8xI4gddZRMRJeVo7S+ny3LgPqOhpEIX7gtIVRrmNDGHmtaE5N /BYinrdMjGHZqiMJHbHO40TsSJux3jSsgvKYWDgTmgdL/WJKIQBZg2N3LpqvfA== Received: by freefall.freebsd.org (Postfix, from userid 1354) id 2E1FC1A527; Tue, 14 Feb 2023 00:21:37 +0000 (UTC) From: Jan Beich To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 48bfd3597654 - main - Add nproc(1) In-Reply-To: (Mateusz Guzik's message of "Tue, 14 Feb 2023 00:58:41 +0100") References: <202302081947.318Jlbt6052826@gitrepo.freebsd.org> <20230208202736.L7hpB%steffen__28609.3347867549$1675888077$gmane$org@sdaoden.eu> <1qmt-6s1w-wny@FreeBSD.org> Date: Tue, 14 Feb 2023 01:21:29 +0100 Message-ID: List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-ThisMailContainsUnwantedMimeParts: N Mateusz Guzik writes: > On 2/14/23, Jan Beich wrote: > >> Steffen Nurpmeso writes: >> >>> |+ if (all_flag) { >>> |+ cpus = sysconf(_SC_NPROCESSORS_ONLN); >>> >>> is not compatible -- note i like the FreeBSD way better, and maybe >>> someone should make a bug report even. >>> >>> #?0|kent:$ getconf -a|grep NPROC >>> _NPROCESSORS_CONF 8 >>> _NPROCESSORS_ONLN 4 >> >> See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230330 >> >> $ cpuset -l 2-5 -- getconf -a | fgrep _NPROC >> _NPROCESSORS_CONF: 8 >> _NPROCESSORS_ONLN: 4 >> > > As I mentioned previously in the thread, on linux these *don't* react > to cpusets (or tasksets in linux parlance): > > $ getconf -a | grep _NPROC > _NPROCESSORS_CONF 4 > _NPROCESSORS_ONLN 4 > $ taskset --cpu-list 0 getconf -a | grep _NPROC > _NPROCESSORS_CONF 4 > _NPROCESSORS_ONLN 4 > > consequently the patch proposed in the bz would introduce an > incompatibility with linux I've used kern.smp.cpus in old patches but found musl more practical. _SC_NPROCESSORS_ONLN is often used as a default number of jobs. glibc: - /sys/devices/system/cpu/online - /proc/stat - sched_getaffinity musl: - sched_getaffinity bionic: - /sys/devices/system/cpu/online - /proc/stat (Android < 7) From nobody Tue Feb 14 00:47:04 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG2bw4d6mz3rHFR for ; Tue, 14 Feb 2023 00:47:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic309-22.consmr.mail.gq1.yahoo.com (sonic309-22.consmr.mail.gq1.yahoo.com [98.137.65.148]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PG2bt6nzHz3nLm for ; Tue, 14 Feb 2023 00:47:22 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b="Jrk/t7aV"; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.148 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676335641; bh=W1fwrTxRife4aCnH1xtND3vqL2/Tdkdb/79dAB2/FrA=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=Jrk/t7aV5s8/jOPaPW76iSvLKl0KNERyW/VyNo0/9jGA55ZH6LFdgqdqjY8NGgku60vk+oRBXceRdyYXypK2drIDnej7gtHFzKUD3lQjpICAZbB62tSHdCrXySAdYWNxdZWILr4HqLY+89R601heBnS6E9WqRAz19NMckpNHAl3Z/bmUnaEPe6OKJygDilr3NE7HykF5UDLAct5GflfOv1dk50CAC3GIkpG8fYR8MNophvNq+m0vQ6aqqxwM3BuKK8v6kY08RC+ESIQlDG6OBtItkXOb9/LCvwmSQUQvII/EdVGbvK6jLgZH6HX/aLHDGdaO0t8rs0lHrfQIdimEkQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676335641; bh=Pm8JAUjHitHSNmoWlFdlkBioKakEfs/S3P4Mzoayg86=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=rpXirIKoYdCEi+wx8/E1ItX/fsc3J1NW3173xFcezn0JPnImwYkkxWIIgoBiFQiCwjjwUggIH3sAx6XYxV1TucFcvPp2M/mH2Lh/1op2vdZE9+2Y5gprofby2vo6pIbF9h0f7ap5in6CPjBMghHpAVqte4voYEQlUVYcZ8lVitBXNmxtERXPc3KWOunW9n5clbQlqfKviW19nUMeFQL9TUqrI+WNE9NmmXWBGLpWTMZW5hiWLm4a75gZsFuKZp0dQgGcZ0/xVZzKvHuXALpBdcxiEjU+cbZtYKz1kex+Pz9IbTkiBgEjZXuGhg8c8QzGp6V9Lph5P8ImGIrEq206xw== X-YMail-OSG: RWIjuMQVM1l7y6iLlUlprrmoRxjHODpFlD5ALLs_iTRmoQWu6y748erjsXL305Z 2La.ymKwlLIpuQVHTJoxQ4HbMSL2hAGeTbuyKoDxDM4h0kLWcEdrCkHDKri1GGGk2Ss9W_CZ2aaC V8AkEbEs_RJNq2N1TN2KBs6da2j3dmwzvcY2rfEg8qUfacImmPpcFaXLoj6FpLWyAQV_dwEcs2uo pqm8EnxmP1obPRHzpbDxQ1spNoqwa4vq8piAAeyqgwGSz9dcRJsFrmlWGe1cFqK5euynrZfJz9dK t6CST6N28BWmmt.e8OhDpGsvNL5C0eppiS8vodChs7HGbr7ECES_GsKzqspAtVn6.8FtKEjapOHZ 5KVmq8k7ktVxe5AjZQ02hG3lKwnZtNTg9GbMjTFBozX6XDBJBlCsWD40DexHzOXzSMV0Ij7SmEcU ihIBL_TDf6yPsmUk1U8QW7cDzFgCz_DcY231xhKH5SuvhKyx81Wc9flOXCUaekHbujHvoPwawMD1 C8TuRiVqWlJzVGwHAKn9QEe02kn6E8JduCEFnvvrxSg81JBGaXT0YkT_lRUjOHWIfLNVRkzrgQdp hP403QCV86qpUhLGrknqswmtsPK5ictiGrUk4jyGxj.s9Vv2a7qUdSMS_aYahcnzLvbrN3j0qVcK TYBrLeQ1V1tH8DuU9qFJJz7hHpngXT545u8FUZxT2G_Ey8a.k.oFPq.Uzz.OgP6WzHaaQChgvyCd XaRNZbd2oFW27SlTGbZr07bg0_jdt3_dlitH0tQb2B.zcXNwVe6y5geB92898tw43oOLL7yX1DPm Yuki0LGHQ9i43bd6RchI7dhHV2FHozVMSSheDuQWabqcl4jIwByoOmdMdV0XsGerYM1NUfHSoOmj _YJ.JVusv4jLMlx_NBLoe_sDSNXQeZunWSbWjmMQeO4MjEFHA7.Vi8_TXw23CgeOpChKER30QWg. OcX1CGWVJDwvJL48QMNwpoP3EvtSRrgP8sbtNqQPtI.D_EVnk93yv3bkHp8.OYCfCZNj6ZN7VARl WilGrwHWY0oJ8418oUeoEz178GgLyCG5PwqQKDrZkN_30Gwv.0_Z_ZhxkRAdRhvitUuWK2foxsPQ SrpQ6vuAMKJKW6B_swNksTYe345NDaTeNRXK7Hz1FFfHs8DoiCfpCJJLTyI2t1FSHHaV5nAM_PHo B4ysS.sp1.Mbla7sMC0QA4tMPg2l7KdQT6tbGjsBAhdC9X3JQjCdxAi0ESdxQIjotsPFeMsDCwcp bGm3GIQUtL80agK9Rlx4gGYPF5u_DeLjW.SJBCQ9AShoP34WcGe4BmK3_xVenQGcuji_qXY4ctKh SW4rcboZXgF6D9rVYPqyfGZF7kMqIrEgwLoRgg3VRrwEWOkTt4aFn7A.1rHCM.nvWdcjn7C1l4Di CSu2dqoYi88sPH66HeZdqdJARPepT2mEz2bDiyhVb3jqV1zmd2vl8syom9HS1d37VHYdsw3d5JUA bjGDxxoW8Yf.vewBkBXdu1LAJljewuPLn3P_TFDpw1i0qwil6wn4MALvJcJftQc_xbx6E6R9w84l A9JCf1NRVmWYoqmsLGrbaEbyIGJC5.9rQPhuis403uUfW5VZD8J4.d1FXV8sgricBwdbtd9xHWPi vZcZ5tPN6BEpMSzw2hxO8EEvClahdTih_GnnWkf3F12m31.Smmcm3__sGTEov4SUXhWMjqrit3Zs txzCPhOuukms_1ZE3.Pkq.DLqPkoZP4jKDe4a6.jn0q8Wvsmosnu7solx4HVZefktbYcF.LszwkR QAXSmgxVxi_wFBBMYcNudbegx.3Cn81SfwXV9gBrPwRrJB2L53abt6kcpdkxbChMUe5zy.0LczYm cSnLr5KhY5Gu3R3rJm2Yjfvx_sUCBvRl73xEW0RYa7ymavi4ppz1KNIhRT64KjvPnLgVHQVyAxLU P_eNfWinhYDGxZx4.0TfxkXnCp8zE1n4guc_JJXEqQ90WlTwSSHosN6jXFzfGMBWOhmgdy.1gWPK bvEf3xdn39oV2zOImhM0Qr6jt41Q0DEelgj4RVMKkU0DfNWntV3clnLyajuGkSoFe.ItqBi8LrNo MjM9oVxcT7leFoNO8MFaKRL0YalqjBtog.z0S7Rx120ctRoULl.v7KjrMORdedGAkqcUjBAdXomi pWc9nB224GWWyq70jwOK2PqAFquRWFtFlODtJTPWjxzeyWvB.jMh.nC8Ycu0LhIog5ZFQrHsiMp7 JnBNRjKCrnF7ealqzf_lKjwwl7Bix8utv7RyOXun66dGj7ilmx1eJeh5v9YbLm5XcKAfS_A_fH5o F X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Tue, 14 Feb 2023 00:47:21 +0000 Received: by hermes--production-bf1-57c96c66f6-7qgxj (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 04a4d598a9637ac3f10a4747d5fbfa5c; Tue, 14 Feb 2023 00:47:17 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. (Just a fixed TO: address.) Date: Mon, 13 Feb 2023 16:47:04 -0800 References: <18263DB1-D79D-420A-9F24-EE8C8E071C15@yahoo.com> To: dchagin@heemeyer.club, antoine@freebsd.org, dev-commits-src-main@freebsd.org In-Reply-To: <18263DB1-D79D-420A-9F24-EE8C8E071C15@yahoo.com> Message-Id: X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spamd-Result: default: False [-3.49 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.993]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.148:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.148:from] X-Rspamd-Queue-Id: 4PG2bt6nzHz3nLm X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On Feb 12, 2023, at 22:05, Mark Millard wrote: > [Just a fixed TO: address.] >=20 >>> On Sun, Feb 12, 2023 at 07:58:07PM +0000, Antoine Brodin wrote: >>>> On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin = wrote: >>>>>=20 >>>>> On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: >>>>>> On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: >>>>>>> On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin = wrote: >>>>>>>>=20 >>>>>>>> The branch main has been updated by dchagin: >>>>>>>>=20 >>>>>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc21b080f3dc2f5e91ada608d4385b7ed= 6538ba9b >>>>>>>>=20 >>>>>>>> commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b >>>>>>>> Author: Dmitry Chagin >>>>>>>> AuthorDate: 2023-01-29 13:17:33 +0000 >>>>>>>> Commit: Dmitry Chagin >>>>>>>> CommitDate: 2023-01-29 13:17:33 +0000 >>>>>>>>=20 >>>>>>>> cpuset: Fix sched_[g|s]etaffinity() for better compatibility = with Linux. >>>>>>>>=20 >>>>>>>> Under Linux to sched_[g|s]etaffinity() functions the value = returned from a call >>>>>>>> to gettid(2) (thread id) can be passed in the argument pid. = Specifying pid as 0 >>>>>>>> will set the attribute for the calling thread, and passing the = value returned >>>>>>>> from a call to getpid(2) (process id) will set the attribute = for the main thread >>>>>>>> of the thread group. >>>>>>>>=20 >>>>>>>> Native cpuset(2) family of system calls has "which" argument to = determine how >>>>>>>> the value of id argument is interpreted, i.e., CPU_WHICH_TID is = used to pass >>>>>>>> a thread id and CPU_WHICH_PID - to pass a process id. >>>>>>>>=20 >>>>>>>> For now native sched_[g|s]etaffinity() implementation is wrong = as uses "which" >>>>>>>> CPU_WHICH_PID to pass both (process and thread id) to the = kernel. To fix this >>>>>>>> adding a new "which" CPU_WHICH_TIDPID intended to handle both = id's. >>>>>>>>=20 >>>>>>>> Reviewed by: kib >>>>>>>> Differential Revision: https://reviews.freebsd.org/D38209 >>>>>>>> MFC after: 1 week >>>>>>>> --- >>>>>>>> lib/libc/gen/sched_getaffinity.c | 2 +- >>>>>>>> lib/libc/gen/sched_setaffinity.c | 2 +- >>>>>>>> lib/libc/sys/cpuset.2 | 4 +++- >>>>>>>> sys/kern/kern_cpuset.c | 42 = +++++++++++++++++++++++++++++++++++++++- >>>>>>>> sys/sys/cpuset.h | 1 + >>>>>>>> 5 files changed, 47 insertions(+), 4 deletions(-) >>>>>>>=20 >>>>>>>=20 >>>>>>> Hello, >>>>>>>=20 >>>>>>> This broke math/py-numpy on main and stable/13 >>>>>>>=20 >>>>>>> = https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p5= 2768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log >=20 > Well, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running a > 1400079 [2023-02-08..2023-02-10] jail that is using new KBI > material not in the older kernel (CPU_WHICH_TIDPID) have problems? : >=20 > =3D>> Building math/py-numpy > build started at Fri Feb 10 11:40:51 UTC 2023 > port directory: /usr/ports/math/py-numpy > package name: py39-numpy-1.24.1,1 > building for: FreeBSD main-amd64-default-baseline-job-04 14.0-CURRENT = FreeBSD 14.0-CURRENT 1400079 amd64 > maintained by: python@FreeBSD.org > Makefile ident:=20 > Poudriere version: 3.2.8-23-ga7f8d188 > Host OSVERSION: 1400073 > Jail OSVERSION: 1400079 > Job Id: 04 >=20 > !!! Jail is newer than host. (Jail: 1400079, Host: 1400073) !!! > !!! This is not supported. !!! > !!! Host kernel must be same or newer than jail. !!! > !!! Expect build failures. !!! >=20 >=20 >>>>>>> = https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-basel= ine/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log >=20 > Similarly, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running = a > 13.2-PRERELEASE 1301511 [2023-01-10..2023-02-10] jail that is using = new > KBI material not in the older kernel (CPU_WHICH_TIDPID) have problems? = : >=20 > =3D>> Building math/py-numpy > build started at Fri Feb 10 10:36:27 UTC 2023 > port directory: /usr/ports/math/py-numpy > package name: py39-numpy-1.23.5_1,1 > building for: FreeBSD 13stable-amd64-quarterly-baseline-job-01 = 13.2-PRERELEASE FreeBSD 13.2-PRERELEASE 1301511 amd64 > maintained by: python@FreeBSD.org > Makefile ident:=20 > Poudriere version: 3.2.8-23-ga7f8d188 > Host OSVERSION: 1400073 > Jail OSVERSION: 1301511 >=20 >=20 >=20 > (Looks to me like CPU_WHICH_TIDPID use for 13.* has to > require 13.2+ .) (I should have used "some CPU_WHICH_TIDPID use" and the like in various places.) I got my environment to be 140079 (everywhere) with ports updated to be have py39-numpy be at 1.24.1,1 . My poudriere-devel build result was: [00:25:52] [01] [00:00:00] Building math/py-numpy@py39 | = py39-numpy-1.24.1,1 [00:28:39] [01] [00:02:47] Finished math/py-numpy@py39 | = py39-numpy-1.24.1,1: Success (It built 47 other ports first to get ready for that.) FYI: # uname -apKU FreeBSD amd64_ZFS 14.0-CURRENT FreeBSD 14.0-CURRENT #60 = main-n260797-dc1b8c9a846e-dirty: Thu Feb 9 22:17:26 PST 2023 = root@amd64_ZFS:/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.a= md64/sys/GENERIC-NODBG amd64 amd64 1400079 1400079 Looks to me like, if the ABI incompatibilities are to stay as they are, then the FreeBSD build servers need an update for HOST OSVERSION to be more modern in order to avoid having odd problems with building some ports. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Tue Feb 14 01:37:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG3jM67M0z3pttk; Tue, 14 Feb 2023 01:37: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 4PG3jM5jqgz3tXH; Tue, 14 Feb 2023 01:37:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676338631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LH3xPldjB4Dk6pqVqZfBcCuOPhfYbsbMUk2FjcO2mys=; b=qQD3ruNvIw8sNfynlVPxGscVeJ+EPSgFPZs/k+wgGPDakA/1QCeeg0KSoYnc6JKi4WHdPn wYBoxkf6F5JTCZ6JIM2oMHKZaXLqdIHcdj6fsAIeuh5+xNsvKteorWSWGUKlfJiafNTksk snAkQOO8nnJnQYWSO3imEPTmR417fZySFn23nu436q9ffM8wK7pkbi3X10unEG/XzdLIe3 ryq8H+EyLZPEKiu+mvZCEwG5jo2gBhIQue04UokBpVgFXOZ63qGREnxKyaOIzUs8J7B4aj dOa+MY8quU/A8QVKTuLMSUIHsF1HVgMyAHnIBSAEOcCrtHNDP8xd72XtVV4VQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676338631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LH3xPldjB4Dk6pqVqZfBcCuOPhfYbsbMUk2FjcO2mys=; b=mPqNFq3eXvpBOf6ZpeoEyKl8A2aPfJol5a46KCngxHs8tUI4U701MIVXyGbjuFEvrYXP5D YIRkb3gza9jsmN84qwa8OE49VQGbvYz5VPCaj0mQ9ea6615EzUWS4EDx6ffynvCEvElBDw TBlfAe8VkA5kCkRkxq24Vfe8n4eypv55GbLaqFw0ZHoROk7Qc8/f+M7+zGtILDWCWNxIqt AtBqSbanFPPd5S0VRXrRV2Hr3naQpB2BIkosDwxLil/7IT0xA6kT9CCdaZQ2dOlI/Nqbc5 IAdDp5zoNAcrleqV26aIYe6Z7IQlgVAN6H40mv4/diRk+r3fJ0wr9qENp64KWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676338631; a=rsa-sha256; cv=none; b=mIYBLReWYX7xNoACn67Mf6sDTQTo4Wov8NXQcxHxPxluLQDk3A/N52aSWtwuGocIw4G+zT JYFdtDpp1Q6lDdusZ2ka4tsmdRPJJ7b1TLs3wwpfHTloVSR6Wc3xkI5HMpM9iFpbK7L37h jNFrizId6QfCf3S/wg5VmbLKlTGhwsgjq1NXMniPcw77YiqSD+7JR5LulgtNAo4HlcxqSE MCuNS9B4I48geDPZumwAE90/SO8v/CjIb40d/dQizXM/IFgjdjTCgRtY4ss7xDjJIMu+Ax ix4k3HaQR4FtgaVPc6z//zIYd2rrz6e9ifKi1To3BUI6D6J2nz80LgiCxiCsrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PG3jM4mBLzgt0; Tue, 14 Feb 2023 01:37: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 31E1bB7b043659; Tue, 14 Feb 2023 01:37:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E1bBaD043658; Tue, 14 Feb 2023 01:37:11 GMT (envelope-from git) Date: Tue, 14 Feb 2023 01:37:11 GMT Message-Id: <202302140137.31E1bBaD043658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 8923de590543 - main - ice(4): Update to 1.37.7-k List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8923de59054358980102ea5acda6c6dd58273957 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=8923de59054358980102ea5acda6c6dd58273957 commit 8923de59054358980102ea5acda6c6dd58273957 Author: Piotr Kubaj AuthorDate: 2023-02-14 01:29:44 +0000 Commit: Eric Joyner CommitDate: 2023-02-14 01:29:44 +0000 ice(4): Update to 1.37.7-k Notable changes include: - DSCP QoS Support (leveraging support added in rG9c950139051298831ce19d01ea5fb33ec6ea7f89) - Improved PFC handling and TC queue assignments (now all remaining queues are assigned to TC 0 when more than one TC is enabled and the number of available queues does not evenly divide between them) - Support for dumping the internal FW state for additional debugging by Intel support - Support for allowing "No FEC" to be a valid state for the LESM to negotiate when using non-standard compliant modules Also includes various bug fixes and smaller enhancements, too. Signed-off-by: Eric Joyner Reviewed by: erj@ Tested by: Jeff Pieper MFC after: 3 days Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38109 --- sys/conf/files.amd64 | 2 + sys/conf/files.arm64 | 2 + sys/conf/files.powerpc | 44 +- sys/dev/ice/ice_adminq_cmd.h | 142 +- sys/dev/ice/ice_alloc.h | 2 +- sys/dev/ice/ice_bitops.h | 14 +- sys/dev/ice/ice_common.c | 453 ++++-- sys/dev/ice/ice_common.h | 7 +- sys/dev/ice/ice_common_sysctls.h | 17 +- sys/dev/ice/ice_common_txrx.h | 2 +- sys/dev/ice/ice_controlq.c | 31 +- sys/dev/ice/ice_controlq.h | 2 +- sys/dev/ice/ice_dcb.c | 52 +- sys/dev/ice/ice_dcb.h | 4 +- sys/dev/ice/ice_ddp_common.c | 2532 +++++++++++++++++++++++++++++++++ sys/dev/ice/ice_ddp_common.h | 478 +++++++ sys/dev/ice/ice_defs.h | 71 + sys/dev/ice/ice_devids.h | 9 +- sys/dev/ice/ice_drv_info.h | 15 +- sys/dev/ice/ice_features.h | 4 +- sys/dev/ice/ice_flex_pipe.c | 2474 +++++--------------------------- sys/dev/ice/ice_flex_pipe.h | 44 +- sys/dev/ice/ice_flex_type.h | 291 +--- sys/dev/ice/ice_flow.c | 18 +- sys/dev/ice/ice_flow.h | 2 +- sys/dev/ice/ice_fw_logging.c | 2 +- sys/dev/ice/ice_fwlog.c | 2 +- sys/dev/ice/ice_fwlog.h | 4 +- sys/dev/ice/ice_hw_autogen.h | 2 +- sys/dev/ice/ice_iflib.h | 12 +- sys/dev/ice/ice_iflib_recovery_txrx.c | 2 +- sys/dev/ice/ice_iflib_sysctls.h | 2 +- sys/dev/ice/ice_iflib_txrx.c | 27 +- sys/dev/ice/ice_lan_tx_rx.h | 10 +- sys/dev/ice/ice_lib.c | 1489 ++++++++++++++++--- sys/dev/ice/ice_lib.h | 43 +- sys/dev/ice/ice_nvm.c | 37 +- sys/dev/ice/ice_nvm.h | 5 +- sys/dev/ice/ice_opts.h | 2 +- sys/dev/ice/ice_osdep.c | 2 +- sys/dev/ice/ice_osdep.h | 2 +- sys/dev/ice/ice_protocol_type.h | 25 +- sys/dev/ice/ice_rdma.c | 15 +- sys/dev/ice/ice_rdma.h | 2 +- sys/dev/ice/ice_resmgr.c | 2 +- sys/dev/ice/ice_resmgr.h | 2 +- sys/dev/ice/ice_rss.h | 2 +- sys/dev/ice/ice_sbq_cmd.h | 2 +- sys/dev/ice/ice_sched.c | 94 +- sys/dev/ice/ice_sched.h | 13 +- sys/dev/ice/ice_status.h | 2 +- sys/dev/ice/ice_strings.c | 8 +- sys/dev/ice/ice_switch.c | 257 ++-- sys/dev/ice/ice_switch.h | 54 +- sys/dev/ice/ice_type.h | 112 +- sys/dev/ice/ice_vlan_mode.c | 3 +- sys/dev/ice/ice_vlan_mode.h | 2 +- sys/dev/ice/if_ice_iflib.c | 66 +- sys/dev/ice/irdma_di_if.m | 2 +- sys/dev/ice/irdma_if.m | 2 +- sys/dev/ice/virtchnl.h | 186 ++- sys/dev/ice/virtchnl_inline_ipsec.h | 11 +- sys/dev/ice/virtchnl_lan_desc.h | 550 ------- sys/modules/ice/Makefile | 2 +- 64 files changed, 5963 insertions(+), 3806 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index d8541b9de67a..ff5138104bf4 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -187,6 +187,8 @@ dev/ice/irdma_if.m optional ice pci \ compile-with "${NORMAL_M} -I$S/dev/ice" dev/ice/irdma_di_if.m optional ice pci \ compile-with "${NORMAL_M} -I$S/dev/ice" +dev/ice/ice_ddp_common.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031e00 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 058f4bfc2c21..02447db830dc 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -294,6 +294,8 @@ dev/ice/irdma_if.m optional ice pci \ compile-with "${NORMAL_M} -I$S/dev/ice" dev/ice/irdma_di_if.m optional ice pci \ compile-with "${NORMAL_M} -I$S/dev/ice" +dev/ice/ice_ddp_common.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031e00 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 70f4abed8122..444611c6cb58 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -42,48 +42,50 @@ dev/iicbus/ofw_iicbus.c optional iicbus aim dev/iicbus/ofw_iicbus_if.m optional iicbus aim dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_opal.c optional powernv ipmi -dev/ice/if_ice_iflib.c optional ice pci powerpc64 \ +dev/ice/if_ice_iflib.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_lib.c optional ice pci powerpc64 \ +dev/ice/ice_lib.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_osdep.c optional ice pci powerpc64 \ +dev/ice/ice_osdep.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_resmgr.c optional ice pci powerpc64 \ +dev/ice/ice_resmgr.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_strings.c optional ice pci powerpc64 \ +dev/ice/ice_strings.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_iflib_recovery_txrx.c optional ice pci powerpc64 \ +dev/ice/ice_iflib_recovery_txrx.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_iflib_txrx.c optional ice pci powerpc64 \ +dev/ice/ice_iflib_txrx.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_common.c optional ice pci powerpc64 \ +dev/ice/ice_common.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_controlq.c optional ice pci powerpc64 \ +dev/ice/ice_controlq.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_dcb.c optional ice pci powerpc64 \ +dev/ice/ice_dcb.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_flex_pipe.c optional ice pci powerpc64 \ +dev/ice/ice_flex_pipe.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_flow.c optional ice pci powerpc64 \ +dev/ice/ice_flow.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_nvm.c optional ice pci powerpc64 \ +dev/ice/ice_nvm.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_sched.c optional ice pci powerpc64 \ +dev/ice/ice_sched.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_switch.c optional ice pci powerpc64 \ +dev/ice/ice_switch.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_vlan_mode.c optional ice pci powerpc64 \ +dev/ice/ice_vlan_mode.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_fw_logging.c optional ice pci powerpc64 \ +dev/ice/ice_fw_logging.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_fwlog.c optional ice pci powerpc64 \ +dev/ice/ice_fwlog.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/ice_rdma.c optional ice pci powerpc64 \ +dev/ice/ice_rdma.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" -dev/ice/irdma_if.m optional ice pci powerpc64 \ +dev/ice/irdma_if.m optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_M} -I$S/dev/ice" -dev/ice/irdma_di_if.m optional ice pci powerpc64 \ +dev/ice/irdma_di_if.m optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_M} -I$S/dev/ice" +dev/ice/ice_ddp_common.c optional ice pci powerpc64 | ice pci powerpc64le \ + compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp powerpc64 | ice pci powerpc64le \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031e00 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ diff --git a/sys/dev/ice/ice_adminq_cmd.h b/sys/dev/ice/ice_adminq_cmd.h index a07ca6780a3c..92ad8055b666 100644 --- a/sys/dev/ice/ice_adminq_cmd.h +++ b/sys/dev/ice/ice_adminq_cmd.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2022, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,19 @@ * descriptor format. It is shared between Firmware and Software. */ +#include "ice_osdep.h" +#include "ice_defs.h" +#include "ice_bitops.h" + #define ICE_MAX_VSI 768 #define ICE_AQC_TOPO_MAX_LEVEL_NUM 0x9 #define ICE_AQ_SET_MAC_FRAME_SIZE_MAX 9728 +enum ice_aq_res_access_type { + ICE_RES_READ = 1, + ICE_RES_WRITE +}; + struct ice_aqc_generic { __le32 param0; __le32 param1; @@ -155,9 +164,6 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_TXQS 0x0042 #define ICE_AQC_CAPS_MSIX 0x0043 #define ICE_AQC_CAPS_MAX_MTU 0x0047 -#define ICE_AQC_CAPS_NVM_VER 0x0048 -#define ICE_AQC_CAPS_OROM_VER 0x004A -#define ICE_AQC_CAPS_NET_VER 0x004C #define ICE_AQC_CAPS_CEM 0x00F2 #define ICE_AQC_CAPS_IWARP 0x0051 #define ICE_AQC_CAPS_LED 0x0061 @@ -173,6 +179,10 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG1 0x0082 #define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG2 0x0083 #define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG3 0x0084 +#define ICE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE 0x0085 +#define ICE_AQC_CAPS_NAC_TOPOLOGY 0x0087 +#define ICE_AQC_CAPS_DYN_FLATTENING 0x0090 +#define ICE_AQC_CAPS_ROCEV2_LAG 0x0092 u8 major_ver; u8 minor_ver; @@ -526,6 +536,7 @@ struct ice_aqc_vsi_props { #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S 0 #define ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_M (0xF << ICE_AQ_VSI_SW_FLAG_RX_PRUNE_EN_S) #define ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA BIT(0) +#define ICE_AQ_VSI_SW_FLAG_RX_PASS_PRUNE_ENA BIT(3) #define ICE_AQ_VSI_SW_FLAG_LAN_ENA BIT(4) u8 veb_stat_id; #define ICE_AQ_VSI_SW_VEB_STAT_ID_S 0 @@ -836,6 +847,8 @@ struct ice_sw_rule_lkup_rx_tx { #define ICE_SINGLE_ACT_PTR 0x2 #define ICE_SINGLE_ACT_PTR_VAL_S 4 #define ICE_SINGLE_ACT_PTR_VAL_M (0x1FFF << ICE_SINGLE_ACT_PTR_VAL_S) + /* Bit 17 should be set if pointed action includes a FWD cmd */ +#define ICE_SINGLE_ACT_PTR_HAS_FWD BIT(17) /* Bit 18 should be set to 1 */ #define ICE_SINGLE_ACT_PTR_BIT BIT(18) @@ -1017,6 +1030,24 @@ struct ice_aqc_get_topo { __le32 addr_low; }; +/* Get/Set Tx Topology (indirect 0x0418/0x0417) */ +struct ice_aqc_get_set_tx_topo { + u8 set_flags; +#define ICE_AQC_TX_TOPO_FLAGS_CORRER BIT(0) +#define ICE_AQC_TX_TOPO_FLAGS_SRC_RAM BIT(1) +#define ICE_AQC_TX_TOPO_FLAGS_SET_PSM BIT(2) +#define ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW BIT(4) +#define ICE_AQC_TX_TOPO_FLAGS_ISSUED BIT(5) + u8 get_flags; +#define ICE_AQC_TX_TOPO_GET_NO_UPDATE 0 +#define ICE_AQC_TX_TOPO_GET_PSM 1 +#define ICE_AQC_TX_TOPO_GET_RAM 2 + __le16 reserved1; + __le32 reserved2; + __le32 addr_high; + __le32 addr_low; +}; + /* Update TSE (indirect 0x0403) * Get TSE (indirect 0x0404) * Add TSE (indirect 0x0401) @@ -1170,6 +1201,22 @@ struct ice_aqc_rl_profile_elem { __le16 rl_encode; }; +/* Config Node Attributes (indirect 0x0419) + * Query Node Attributes (indirect 0x041A) + */ +struct ice_aqc_node_attr { + __le16 num_entries; /* Number of attributes structures in the buffer */ + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +struct ice_aqc_node_attr_elem { + __le32 node_teid; + __le16 max_children; + __le16 children_level; +}; + /* Configure L2 Node CGD (indirect 0x0414) * This indirect command allows configuring a congestion domain for given L2 * node TEIDs in the scheduler topology. @@ -1335,7 +1382,7 @@ struct ice_aqc_get_phy_caps { #define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2) #define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3) #define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4) -#define ICE_PHY_TYPE_HIGH_MAX_INDEX 5 +#define ICE_PHY_TYPE_HIGH_MAX_INDEX 4 struct ice_aqc_get_phy_caps_data { __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ @@ -1376,6 +1423,7 @@ struct ice_aqc_get_phy_caps_data { #define ICE_AQC_PHY_FEC_25G_RS_528_REQ BIT(2) #define ICE_AQC_PHY_FEC_25G_KR_REQ BIT(3) #define ICE_AQC_PHY_FEC_25G_RS_544_REQ BIT(4) +#define ICE_AQC_PHY_FEC_DIS BIT(5) #define ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN BIT(6) #define ICE_AQC_PHY_FEC_25G_KR_CLAUSE74_EN BIT(7) #define ICE_AQC_PHY_FEC_MASK MAKEMASK(0xdf, 0) @@ -1484,6 +1532,12 @@ struct ice_aqc_get_link_status { __le32 addr_low; }; +enum ice_get_link_status_data_version { + ICE_GET_LINK_STATUS_DATA_V1 = 1, +}; + +#define ICE_GET_LINK_STATUS_DATALEN_V1 32 + /* Get link status response data structure, also used for Link Status Event */ struct ice_aqc_get_link_status_data { u8 topo_media_conflict; @@ -2078,6 +2132,12 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_PERST_FLAG 1 #define ICE_AQC_NVM_EMPR_FLAG 2 #define ICE_AQC_NVM_EMPR_ENA BIT(0) /* Write Activate reply only */ + /* For Write Activate, several flags are sent as part of a separate + * flags2 field using a separate byte. For simplicity of the software + * interface, we pass the flags as a 16 bit value so these flags are + * all offset by 8 bits + */ +#define ICE_AQC_NVM_ACTIV_REQ_EMPR BIT(8) /* NVM Write Activate only */ __le16 module_typeid; __le16 length; #define ICE_AQC_NVM_ERASE_LEN 0xFFFF @@ -2108,6 +2168,7 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_LLDP_STATUS_RD_LEN 4 /* In Bytes */ #define ICE_AQC_NVM_MINSREV_MOD_ID 0x130 +#define ICE_AQC_NVM_TX_TOPO_MOD_ID 0x14B /* Used for reading and writing MinSRev using 0x0701 and 0x0703. Note that the * type field is excluded from the section when reading and writing from @@ -2124,6 +2185,13 @@ struct ice_aqc_nvm_minsrev { __le16 orom_minsrev_h; }; +struct ice_aqc_nvm_tx_topo_user_sel { + __le16 length; + u8 data; +#define ICE_AQC_NVM_TX_TOPO_USER_SEL BIT(4) + u8 reserved; +}; + /* Used for 0x0704 as well as for 0x0705 commands */ struct ice_aqc_nvm_cfg { u8 cmd_flags; @@ -2218,14 +2286,25 @@ struct ice_aqc_lldp_get_mib { #define ICE_AQ_LLDP_TX_ACTIVE 0 #define ICE_AQ_LLDP_TX_SUSPENDED 1 #define ICE_AQ_LLDP_TX_FLUSHED 3 +/* DCBX mode */ +#define ICE_AQ_LLDP_DCBX_S 6 +#define ICE_AQ_LLDP_DCBX_M (0x3 << ICE_AQ_LLDP_DCBX_S) +#define ICE_AQ_LLDP_DCBX_NA 0 +#define ICE_AQ_LLDP_DCBX_CEE 1 +#define ICE_AQ_LLDP_DCBX_IEEE 2 /* The following bytes are reserved for the Get LLDP MIB command (0x0A00) * and in the LLDP MIB Change Event (0x0A01). They are valid for the * Get LLDP MIB (0x0A00) response only. */ - u8 reserved1; + u8 state; +#define ICE_AQ_LLDP_MIB_CHANGE_STATE_S 0 +#define ICE_AQ_LLDP_MIB_CHANGE_STATE_M \ + (0x1 << ICE_AQ_LLDP_MIB_CHANGE_STATE_S) +#define ICE_AQ_LLDP_MIB_CHANGE_EXECUTED 0 +#define ICE_AQ_LLDP_MIB_CHANGE_PENDING 1 __le16 local_len; __le16 remote_len; - u8 reserved2[2]; + u8 reserved[2]; __le32 addr_high; __le32 addr_low; }; @@ -2236,6 +2315,11 @@ struct ice_aqc_lldp_set_mib_change { u8 command; #define ICE_AQ_LLDP_MIB_UPDATE_ENABLE 0x0 #define ICE_AQ_LLDP_MIB_UPDATE_DIS 0x1 +#define ICE_AQ_LLDP_MIB_PENDING_S 1 +#define ICE_AQ_LLDP_MIB_PENDING_M \ + (0x1 << ICE_AQ_LLDP_MIB_PENDING_S) +#define ICE_AQ_LLDP_MIB_PENDING_DISABLE 0 +#define ICE_AQ_LLDP_MIB_PENDING_ENABLE 1 u8 reserved[15]; }; @@ -2580,6 +2664,9 @@ struct ice_aqc_add_rdma_qset_data { /* Move RDMA Queue Set (indirect 0x0C34) */ struct ice_aqc_move_rdma_qset_cmd { u8 num_rdma_qset; /* Used by commands and response */ +#define ICE_AQC_PF_MODE_SAME_PF 0x0 +#define ICE_AQC_PF_MODE_GIVE_OWNERSHIP 0x1 +#define ICE_AQC_PF_MODE_KEEP_OWNERSHIP 0x2 u8 flags; u8 reserved[6]; __le32 addr_high; @@ -2656,8 +2743,8 @@ struct ice_aqc_get_pkg_info_resp { struct ice_aqc_driver_shared_params { u8 set_or_get_op; #define ICE_AQC_DRIVER_PARAM_OP_MASK BIT(0) -#define ICE_AQC_DRIVER_PARAM_SET 0 -#define ICE_AQC_DRIVER_PARAM_GET 1 +#define ICE_AQC_DRIVER_PARAM_SET ((u8)0) +#define ICE_AQC_DRIVER_PARAM_GET ((u8)1) u8 param_indx; #define ICE_AQC_DRIVER_PARAM_MAX_IDX 15 u8 rsvd[2]; @@ -2676,16 +2763,18 @@ struct ice_aqc_event_lan_overflow { /* Debug Dump Internal Data (indirect 0xFF08) */ struct ice_aqc_debug_dump_internals { u8 cluster_id; -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW 0 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED 2 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES 3 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW 0 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED 2 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES 3 /* EMP_DRAM only dumpable in device debug mode */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_EMP_DRAM 4 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK 5 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_EMP_DRAM 4 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_LINK 5 /* AUX_REGS only dumpable in device debug mode */ -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_AUX_REGS 6 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB 7 -#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P 8 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_AUX_REGS 6 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_DCB 7 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P 8 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG 9 +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE 21 u8 reserved; __le16 table_id; /* Used only for non-memory clusters */ __le32 idx; /* In table entries for tables, in bytes for memory */ @@ -2729,7 +2818,6 @@ enum ice_aqc_fw_logging_mod { ICE_AQC_FW_LOG_ID_MAX, }; - /* Set Health Status (direct 0xFF20) */ struct ice_aqc_set_health_status_config { u8 event_source; @@ -2747,6 +2835,7 @@ struct ice_aqc_set_health_status_config { #define ICE_AQC_HEALTH_STATUS_ERR_MOD_NOT_PRESENT 0x106 #define ICE_AQC_HEALTH_STATUS_INFO_MOD_UNDERUTILIZED 0x107 #define ICE_AQC_HEALTH_STATUS_ERR_UNKNOWN_MOD_LENIENT 0x108 +#define ICE_AQC_HEALTH_STATUS_ERR_MOD_DIAGNOSTIC_FEATURE 0x109 #define ICE_AQC_HEALTH_STATUS_ERR_INVALID_LINK_CFG 0x10B #define ICE_AQC_HEALTH_STATUS_ERR_PORT_ACCESS 0x10C #define ICE_AQC_HEALTH_STATUS_ERR_PORT_UNREACHABLE 0x10D @@ -2768,7 +2857,16 @@ struct ice_aqc_set_health_status_config { #define ICE_AQC_HEALTH_STATUS_ERR_DDP_AUTH 0x504 #define ICE_AQC_HEALTH_STATUS_ERR_NVM_COMPAT 0x505 #define ICE_AQC_HEALTH_STATUS_ERR_OROM_COMPAT 0x506 +#define ICE_AQC_HEALTH_STATUS_ERR_NVM_SEC_VIOLATION 0x507 +#define ICE_AQC_HEALTH_STATUS_ERR_OROM_SEC_VIOLATION 0x508 #define ICE_AQC_HEALTH_STATUS_ERR_DCB_MIB 0x509 +#define ICE_AQC_HEALTH_STATUS_ERR_MNG_TIMEOUT 0x50A +#define ICE_AQC_HEALTH_STATUS_ERR_BMC_RESET 0x50B +#define ICE_AQC_HEALTH_STATUS_ERR_LAST_MNG_FAIL 0x50C +#define ICE_AQC_HEALTH_STATUS_ERR_RESOURCE_ALLOC_FAIL 0x50D +#define ICE_AQC_HEALTH_STATUS_ERR_FW_LOOP 0x1000 +#define ICE_AQC_HEALTH_STATUS_ERR_FW_PFR_FAIL 0x1001 +#define ICE_AQC_HEALTH_STATUS_ERR_LAST_FAIL_AQ 0x1002 /* Get Health Status codes (indirect 0xFF21) */ struct ice_aqc_get_supported_health_status_codes { @@ -2923,6 +3021,7 @@ struct ice_aq_desc { struct ice_aqc_cfg_l2_node_cgd cfg_l2_node_cgd; struct ice_aqc_query_port_ets port_ets; struct ice_aqc_rl_profile rl_profile; + struct ice_aqc_node_attr node_attr; struct ice_aqc_nvm nvm; struct ice_aqc_nvm_cfg nvm_cfg; struct ice_aqc_nvm_checksum nvm_checksum; @@ -2949,6 +3048,7 @@ struct ice_aq_desc { struct ice_aqc_dis_txqs dis_txqs; struct ice_aqc_move_txqs move_txqs; struct ice_aqc_add_rdma_qset add_rdma_qset; + struct ice_aqc_move_rdma_qset_cmd move_rdma_qset; struct ice_aqc_txqs_cleanup txqs_cleanup; struct ice_aqc_add_get_update_free_vsi vsi_cmd; struct ice_aqc_add_update_free_vsi_resp add_update_free_vsi_res; @@ -2975,6 +3075,7 @@ struct ice_aq_desc { struct ice_aqc_clear_health_status clear_health_status; struct ice_aqc_prog_topo_dev_nvm prog_topo_dev_nvm; struct ice_aqc_read_topo_dev_nvm read_topo_dev_nvm; + struct ice_aqc_get_set_tx_topo get_set_tx_topo; } params; }; @@ -3125,6 +3226,10 @@ enum ice_adminq_opc { ice_aqc_opc_query_node_to_root = 0x0413, ice_aqc_opc_cfg_l2_node_cgd = 0x0414, ice_aqc_opc_remove_rl_profiles = 0x0415, + ice_aqc_opc_set_tx_topo = 0x0417, + ice_aqc_opc_get_tx_topo = 0x0418, + ice_aqc_opc_cfg_node_attr = 0x0419, + ice_aqc_opc_query_node_attr = 0x041A, /* PHY commands */ ice_aqc_opc_get_phy_caps = 0x0600, @@ -3196,6 +3301,7 @@ enum ice_adminq_opc { ice_aqc_opc_lldp_set_local_mib = 0x0A08, ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09, ice_aqc_opc_lldp_filter_ctrl = 0x0A0A, + ice_execute_pending_lldp_mib = 0x0A0B, /* RSS commands */ ice_aqc_opc_set_rss_key = 0x0B02, diff --git a/sys/dev/ice/ice_alloc.h b/sys/dev/ice/ice_alloc.h index b281958be793..bfcb376d45b2 100644 --- a/sys/dev/ice/ice_alloc.h +++ b/sys/dev/ice/ice_alloc.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2022, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_bitops.h b/sys/dev/ice/ice_bitops.h index 0e04cab87be9..c29963d0a318 100644 --- a/sys/dev/ice/ice_bitops.h +++ b/sys/dev/ice/ice_bitops.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2022, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,15 +33,25 @@ #ifndef _ICE_BITOPS_H_ #define _ICE_BITOPS_H_ +#include "ice_defs.h" +#include "ice_osdep.h" + /* Define the size of the bitmap chunk */ typedef u32 ice_bitmap_t; +/* NOTE! + * Do not use any of the functions declared in this file + * on memory that was not declared with ice_declare_bitmap. + * Not following this rule might cause issues like split + * locks. + */ + /* Number of bits per bitmap chunk */ #define BITS_PER_CHUNK (BITS_PER_BYTE * sizeof(ice_bitmap_t)) /* Determine which chunk a bit belongs in */ #define BIT_CHUNK(nr) ((nr) / BITS_PER_CHUNK) /* How many chunks are required to store this many bits */ -#define BITS_TO_CHUNKS(sz) DIVIDE_AND_ROUND_UP((sz), BITS_PER_CHUNK) +#define BITS_TO_CHUNKS(sz) (((sz) + BITS_PER_CHUNK - 1) / BITS_PER_CHUNK) /* Which bit inside a chunk this bit corresponds to */ #define BIT_IN_CHUNK(nr) ((nr) % BITS_PER_CHUNK) /* How many bits are valid in the last chunk, assumes nr > 0 */ diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index 3ae266b72d1f..c2efddeb4f7c 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2022, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,118 +39,110 @@ #define ICE_PF_RESET_WAIT_COUNT 300 -/** - * dump_phy_type - helper function that prints PHY type strings - * @hw: pointer to the HW structure - * @phy: 64 bit PHY type to decipher - * @i: bit index within phy - * @phy_string: string corresponding to bit i in phy - * @prefix: prefix string to differentiate multiple dumps - */ -static void -dump_phy_type(struct ice_hw *hw, u64 phy, u8 i, const char *phy_string, - const char *prefix) -{ - if (phy & BIT_ULL(i)) - ice_debug(hw, ICE_DBG_PHY, "%s: bit(%d): %s\n", prefix, i, - phy_string); -} +static const char * const ice_link_mode_str_low[] = { + [0] = "100BASE_TX", + [1] = "100M_SGMII", + [2] = "1000BASE_T", + [3] = "1000BASE_SX", + [4] = "1000BASE_LX", + [5] = "1000BASE_KX", + [6] = "1G_SGMII", + [7] = "2500BASE_T", + [8] = "2500BASE_X", + [9] = "2500BASE_KX", + [10] = "5GBASE_T", + [11] = "5GBASE_KR", + [12] = "10GBASE_T", + [13] = "10G_SFI_DA", + [14] = "10GBASE_SR", + [15] = "10GBASE_LR", + [16] = "10GBASE_KR_CR1", + [17] = "10G_SFI_AOC_ACC", + [18] = "10G_SFI_C2C", + [19] = "25GBASE_T", + [20] = "25GBASE_CR", + [21] = "25GBASE_CR_S", + [22] = "25GBASE_CR1", + [23] = "25GBASE_SR", + [24] = "25GBASE_LR", + [25] = "25GBASE_KR", + [26] = "25GBASE_KR_S", + [27] = "25GBASE_KR1", + [28] = "25G_AUI_AOC_ACC", + [29] = "25G_AUI_C2C", + [30] = "40GBASE_CR4", + [31] = "40GBASE_SR4", + [32] = "40GBASE_LR4", + [33] = "40GBASE_KR4", + [34] = "40G_XLAUI_AOC_ACC", + [35] = "40G_XLAUI", + [36] = "50GBASE_CR2", + [37] = "50GBASE_SR2", + [38] = "50GBASE_LR2", + [39] = "50GBASE_KR2", + [40] = "50G_LAUI2_AOC_ACC", + [41] = "50G_LAUI2", + [42] = "50G_AUI2_AOC_ACC", + [43] = "50G_AUI2", + [44] = "50GBASE_CP", + [45] = "50GBASE_SR", + [46] = "50GBASE_FR", + [47] = "50GBASE_LR", + [48] = "50GBASE_KR_PAM4", + [49] = "50G_AUI1_AOC_ACC", + [50] = "50G_AUI1", + [51] = "100GBASE_CR4", + [52] = "100GBASE_SR4", + [53] = "100GBASE_LR4", + [54] = "100GBASE_KR4", + [55] = "100G_CAUI4_AOC_ACC", + [56] = "100G_CAUI4", + [57] = "100G_AUI4_AOC_ACC", + [58] = "100G_AUI4", + [59] = "100GBASE_CR_PAM4", + [60] = "100GBASE_KR_PAM4", + [61] = "100GBASE_CP2", + [62] = "100GBASE_SR2", + [63] = "100GBASE_DR", +}; + +static const char * const ice_link_mode_str_high[] = { + [0] = "100GBASE_KR2_PAM4", + [1] = "100G_CAUI2_AOC_ACC", + [2] = "100G_CAUI2", + [3] = "100G_AUI2_AOC_ACC", + [4] = "100G_AUI2", +}; /** - * ice_dump_phy_type_low - helper function to dump phy_type_low + * ice_dump_phy_type - helper function to dump phy_type * @hw: pointer to the HW structure * @low: 64 bit value for phy_type_low + * @high: 64 bit value for phy_type_high * @prefix: prefix string to differentiate multiple dumps */ static void -ice_dump_phy_type_low(struct ice_hw *hw, u64 low, const char *prefix) +ice_dump_phy_type(struct ice_hw *hw, u64 low, u64 high, const char *prefix) { + u32 i; + ice_debug(hw, ICE_DBG_PHY, "%s: phy_type_low: 0x%016llx\n", prefix, (unsigned long long)low); - dump_phy_type(hw, low, 0, "100BASE_TX", prefix); - dump_phy_type(hw, low, 1, "100M_SGMII", prefix); - dump_phy_type(hw, low, 2, "1000BASE_T", prefix); - dump_phy_type(hw, low, 3, "1000BASE_SX", prefix); - dump_phy_type(hw, low, 4, "1000BASE_LX", prefix); - dump_phy_type(hw, low, 5, "1000BASE_KX", prefix); - dump_phy_type(hw, low, 6, "1G_SGMII", prefix); - dump_phy_type(hw, low, 7, "2500BASE_T", prefix); - dump_phy_type(hw, low, 8, "2500BASE_X", prefix); - dump_phy_type(hw, low, 9, "2500BASE_KX", prefix); - dump_phy_type(hw, low, 10, "5GBASE_T", prefix); - dump_phy_type(hw, low, 11, "5GBASE_KR", prefix); - dump_phy_type(hw, low, 12, "10GBASE_T", prefix); - dump_phy_type(hw, low, 13, "10G_SFI_DA", prefix); - dump_phy_type(hw, low, 14, "10GBASE_SR", prefix); - dump_phy_type(hw, low, 15, "10GBASE_LR", prefix); - dump_phy_type(hw, low, 16, "10GBASE_KR_CR1", prefix); - dump_phy_type(hw, low, 17, "10G_SFI_AOC_ACC", prefix); - dump_phy_type(hw, low, 18, "10G_SFI_C2C", prefix); - dump_phy_type(hw, low, 19, "25GBASE_T", prefix); - dump_phy_type(hw, low, 20, "25GBASE_CR", prefix); - dump_phy_type(hw, low, 21, "25GBASE_CR_S", prefix); - dump_phy_type(hw, low, 22, "25GBASE_CR1", prefix); - dump_phy_type(hw, low, 23, "25GBASE_SR", prefix); - dump_phy_type(hw, low, 24, "25GBASE_LR", prefix); - dump_phy_type(hw, low, 25, "25GBASE_KR", prefix); - dump_phy_type(hw, low, 26, "25GBASE_KR_S", prefix); - dump_phy_type(hw, low, 27, "25GBASE_KR1", prefix); - dump_phy_type(hw, low, 28, "25G_AUI_AOC_ACC", prefix); - dump_phy_type(hw, low, 29, "25G_AUI_C2C", prefix); - dump_phy_type(hw, low, 30, "40GBASE_CR4", prefix); - dump_phy_type(hw, low, 31, "40GBASE_SR4", prefix); - dump_phy_type(hw, low, 32, "40GBASE_LR4", prefix); - dump_phy_type(hw, low, 33, "40GBASE_KR4", prefix); - dump_phy_type(hw, low, 34, "40G_XLAUI_AOC_ACC", prefix); - dump_phy_type(hw, low, 35, "40G_XLAUI", prefix); - dump_phy_type(hw, low, 36, "50GBASE_CR2", prefix); - dump_phy_type(hw, low, 37, "50GBASE_SR2", prefix); - dump_phy_type(hw, low, 38, "50GBASE_LR2", prefix); - dump_phy_type(hw, low, 39, "50GBASE_KR2", prefix); - dump_phy_type(hw, low, 40, "50G_LAUI2_AOC_ACC", prefix); - dump_phy_type(hw, low, 41, "50G_LAUI2", prefix); - dump_phy_type(hw, low, 42, "50G_AUI2_AOC_ACC", prefix); - dump_phy_type(hw, low, 43, "50G_AUI2", prefix); - dump_phy_type(hw, low, 44, "50GBASE_CP", prefix); - dump_phy_type(hw, low, 45, "50GBASE_SR", prefix); - dump_phy_type(hw, low, 46, "50GBASE_FR", prefix); - dump_phy_type(hw, low, 47, "50GBASE_LR", prefix); - dump_phy_type(hw, low, 48, "50GBASE_KR_PAM4", prefix); - dump_phy_type(hw, low, 49, "50G_AUI1_AOC_ACC", prefix); - dump_phy_type(hw, low, 50, "50G_AUI1", prefix); - dump_phy_type(hw, low, 51, "100GBASE_CR4", prefix); - dump_phy_type(hw, low, 52, "100GBASE_SR4", prefix); - dump_phy_type(hw, low, 53, "100GBASE_LR4", prefix); - dump_phy_type(hw, low, 54, "100GBASE_KR4", prefix); - dump_phy_type(hw, low, 55, "100G_CAUI4_AOC_ACC", prefix); - dump_phy_type(hw, low, 56, "100G_CAUI4", prefix); - dump_phy_type(hw, low, 57, "100G_AUI4_AOC_ACC", prefix); - dump_phy_type(hw, low, 58, "100G_AUI4", prefix); - dump_phy_type(hw, low, 59, "100GBASE_CR_PAM4", prefix); - dump_phy_type(hw, low, 60, "100GBASE_KR_PAM4", prefix); - dump_phy_type(hw, low, 61, "100GBASE_CP2", prefix); - dump_phy_type(hw, low, 62, "100GBASE_SR2", prefix); - dump_phy_type(hw, low, 63, "100GBASE_DR", prefix); -} - -/** - * ice_dump_phy_type_high - helper function to dump phy_type_high - * @hw: pointer to the HW structure - * @high: 64 bit value for phy_type_high - * @prefix: prefix string to differentiate multiple dumps - */ -static void -ice_dump_phy_type_high(struct ice_hw *hw, u64 high, const char *prefix) -{ + for (i = 0; i < ARRAY_SIZE(ice_link_mode_str_low); i++) { + if (low & BIT_ULL(i)) + ice_debug(hw, ICE_DBG_PHY, "%s: bit(%d): %s\n", + prefix, i, ice_link_mode_str_low[i]); + } + ice_debug(hw, ICE_DBG_PHY, "%s: phy_type_high: 0x%016llx\n", prefix, (unsigned long long)high); - dump_phy_type(hw, high, 0, "100GBASE_KR2_PAM4", prefix); - dump_phy_type(hw, high, 1, "100G_CAUI2_AOC_ACC", prefix); - dump_phy_type(hw, high, 2, "100G_CAUI2", prefix); - dump_phy_type(hw, high, 3, "100G_AUI2_AOC_ACC", prefix); - dump_phy_type(hw, high, 4, "100G_AUI2", prefix); + for (i = 0; i < ARRAY_SIZE(ice_link_mode_str_high); i++) { + if (high & BIT_ULL(i)) + ice_debug(hw, ICE_DBG_PHY, "%s: bit(%d): %s\n", + prefix, i, ice_link_mode_str_high[i]); + } } /** @@ -227,13 +219,23 @@ bool ice_is_e810t(struct ice_hw *hw) { switch (hw->device_id) { case ICE_DEV_ID_E810C_SFP: - if (hw->subsystem_device_id == ICE_SUBDEV_ID_E810T || - hw->subsystem_device_id == ICE_SUBDEV_ID_E810T2) + switch (hw->subsystem_device_id) { + case ICE_SUBDEV_ID_E810T: + case ICE_SUBDEV_ID_E810T2: + case ICE_SUBDEV_ID_E810T3: + case ICE_SUBDEV_ID_E810T4: + case ICE_SUBDEV_ID_E810T5: + case ICE_SUBDEV_ID_E810T7: return true; + } break; case ICE_DEV_ID_E810C_QSFP: - if (hw->subsystem_device_id == ICE_SUBDEV_ID_E810T2) + switch (hw->subsystem_device_id) { + case ICE_SUBDEV_ID_E810T2: + case ICE_SUBDEV_ID_E810T5: + case ICE_SUBDEV_ID_E810T6: return true; + } break; default: break; @@ -242,6 +244,31 @@ bool ice_is_e810t(struct ice_hw *hw) return false; } +/** + * ice_is_e823 + * @hw: pointer to the hardware structure + * + * returns true if the device is E823-L or E823-C based, false if not. + */ +bool ice_is_e823(struct ice_hw *hw) +{ + switch (hw->device_id) { + case ICE_DEV_ID_E823L_BACKPLANE: + case ICE_DEV_ID_E823L_SFP: + case ICE_DEV_ID_E823L_10G_BASE_T: + case ICE_DEV_ID_E823L_1GBE: + case ICE_DEV_ID_E823L_QSFP: + case ICE_DEV_ID_E823C_BACKPLANE: + case ICE_DEV_ID_E823C_QSFP: + case ICE_DEV_ID_E823C_SFP: + case ICE_DEV_ID_E823C_10G_BASE_T: + case ICE_DEV_ID_E823C_SGMII: + return true; + default: + return false; + } +} + /** * ice_clear_pf_cfg - Clear PF configuration * @hw: pointer to the hardware structure @@ -308,10 +335,10 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, if (resp[i].addr_type == ICE_AQC_MAN_MAC_ADDR_TYPE_LAN) { ice_memcpy(hw->port_info->mac.lan_addr, resp[i].mac_addr, ETH_ALEN, - ICE_DMA_TO_NONDMA); + ICE_NONDMA_TO_NONDMA); ice_memcpy(hw->port_info->mac.perm_addr, resp[i].mac_addr, - ETH_ALEN, ICE_DMA_TO_NONDMA); + ETH_ALEN, ICE_NONDMA_TO_NONDMA); break; } return ICE_SUCCESS; @@ -355,23 +382,30 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, cmd->param0 |= CPU_TO_LE16(ICE_AQC_GET_PHY_RQM); cmd->param0 |= CPU_TO_LE16(report_mode); + status = ice_aq_send_cmd(hw, &desc, pcaps, pcaps_size, cd); ice_debug(hw, ICE_DBG_LINK, "get phy caps dump\n"); - if (report_mode == ICE_AQC_REPORT_TOPO_CAP_MEDIA) + switch (report_mode) { + case ICE_AQC_REPORT_TOPO_CAP_MEDIA: prefix = "phy_caps_media"; - else if (report_mode == ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA) + break; + case ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA: prefix = "phy_caps_no_media"; - else if (report_mode == ICE_AQC_REPORT_ACTIVE_CFG) + break; + case ICE_AQC_REPORT_ACTIVE_CFG: prefix = "phy_caps_active"; - else if (report_mode == ICE_AQC_REPORT_DFLT_CFG) + break; + case ICE_AQC_REPORT_DFLT_CFG: prefix = "phy_caps_default"; - else + break; + default: prefix = "phy_caps_invalid"; + } - ice_dump_phy_type_low(hw, LE64_TO_CPU(pcaps->phy_type_low), prefix); - ice_dump_phy_type_high(hw, LE64_TO_CPU(pcaps->phy_type_high), prefix); + ice_dump_phy_type(hw, LE64_TO_CPU(pcaps->phy_type_low), + LE64_TO_CPU(pcaps->phy_type_high), prefix); ice_debug(hw, ICE_DBG_LINK, "%s: report_mode = 0x%x\n", prefix, report_mode); @@ -444,7 +478,7 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd, * * Find and return the node handle for a given node type and part number in the * netlist. When found ICE_SUCCESS is returned, ICE_ERR_DOES_NOT_EXIST - * otherwise. If @node_handle provided, it would be set to found node handle. + * otherwise. If node_handle provided, it would be set to found node handle. */ enum ice_status ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number, @@ -452,11 +486,12 @@ ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number, { struct ice_aqc_get_link_topo cmd; u8 rec_node_part_number; - enum ice_status status; u16 rec_node_handle; u8 idx; for (idx = 0; idx < MAX_NETLIST_SIZE; idx++) { + enum ice_status status; + memset(&cmd, 0, sizeof(cmd)); cmd.addr.topo_params.node_type_ctx = @@ -545,7 +580,6 @@ static enum ice_media_type ice_get_media_type(struct ice_port_info *pi) case ICE_PHY_TYPE_LOW_1000BASE_LX: case ICE_PHY_TYPE_LOW_10GBASE_SR: case ICE_PHY_TYPE_LOW_10GBASE_LR: - case ICE_PHY_TYPE_LOW_10G_SFI_C2C: case ICE_PHY_TYPE_LOW_25GBASE_SR: case ICE_PHY_TYPE_LOW_25GBASE_LR: case ICE_PHY_TYPE_LOW_40GBASE_SR4: @@ -602,6 +636,7 @@ static enum ice_media_type ice_get_media_type(struct ice_port_info *pi) case ICE_PHY_TYPE_LOW_2500BASE_X: case ICE_PHY_TYPE_LOW_5GBASE_KR: case ICE_PHY_TYPE_LOW_10GBASE_KR_CR1: + case ICE_PHY_TYPE_LOW_10G_SFI_C2C: case ICE_PHY_TYPE_LOW_25GBASE_KR: case ICE_PHY_TYPE_LOW_25GBASE_KR1: case ICE_PHY_TYPE_LOW_25GBASE_KR_S: @@ -629,6 +664,8 @@ static enum ice_media_type ice_get_media_type(struct ice_port_info *pi) return ICE_MEDIA_UNKNOWN; } +#define ice_get_link_status_datalen(hw) ICE_GET_LINK_STATUS_DATALEN_V1 + /** * ice_aq_get_link_info * @pi: port information structure @@ -668,8 +705,8 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, resp->cmd_flags = CPU_TO_LE16(cmd_flags); resp->lport_num = pi->lport; - status = ice_aq_send_cmd(hw, &desc, &link_data, sizeof(link_data), cd); - + status = ice_aq_send_cmd(hw, &desc, &link_data, + ice_get_link_status_datalen(hw), cd); if (status != ICE_SUCCESS) return status; *** 12047 LINES SKIPPED *** From nobody Tue Feb 14 02:19:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG4g05FWFz3q0FS for ; Tue, 14 Feb 2023 02:20:12 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic305-21.consmr.mail.gq1.yahoo.com (sonic305-21.consmr.mail.gq1.yahoo.com [98.137.64.84]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PG4fz14XCz3x4G for ; Tue, 14 Feb 2023 02:20:10 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=UTQdFxdh; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.84 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676341209; bh=FOmeaqiF3+fBBvwIpFCljN83K1Hr1mVyyPSGj7TiMec=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=UTQdFxdh+Umirc4+EyeRt+M5iSQrL129cdA2ZFZdnu1x3OCSiBGPrWFHDEIOMKlTHJohoSlsO3TPKhyhf2m3LldSIhWxxKoiIWqwnw95gUMuMwhjpSZXraB/M17WFmAZVxKHKM/ATBNjWHiHvgwaYitmv/Z+nqjEHjMXMMoE/3WpkY4GZgKJsTitjNJxz7bUd4z1FIqSeLv4QNrGDzQo/U5gpfJN93Sx8wtrDFO94wK07CZdHPQCVxVkMqBZHAohcGYRuVJxZjmIPfhgYIb8B3oh8lcenF/QG7SdsHZLfDsh9Bb4f3DmxvJtuYkpVfVLRmKbSFib89fQGLN1zn4YFw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676341209; bh=rstVHNcu80PKuSqTAWzhrVPDCFm+8+rH+WCLSgBdr6H=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=H9t/M5XelXHgfOdd3ix1JgTtzGPvkGRoXNT9OrJT3Q55s8OOVgR/20eMRB6MVp6cSQA4yXSthqYBeN0+9M+x+wYPuiv7nPYLyvdUQOzDHn4cwYyKnW+9MEbSL72Om1V7ugW+1ZRaS8+8xhFd2c6wsmZ8EBiCVOtmbQ5EnKDLKJG7qyBtZfjM/ejAhNHy+cHi8jwj8TgCcUgLlC82Pv/QjC1MomiAh48scAovldo4gFj7wJoJVex8W/cpc68HeD3NOnG7tySZtwjgBgz5CP3TWoJYTuXcAm/EmpTPUXTYmDMV5clJsBYnNZcZcpJ4KRG6XxaLzIFt7WbGD/mYV3pTvg== X-YMail-OSG: tonbZ0QVM1nfV9nQ2FCkBk31uG0bqhWl4CSrj.EdDF1eXCLmNK8DDg6EuggxLNV OYHiJTawNDPISKOw4bVQF8kYQ0Q3DPbDmeMdGsLXfPH32p4zKXJonUSRUF66gRT5.JkG_KuMhC1B maXaMlbmZlZxsMuVkBeAE3rax5YEUVekMCNPnNJEuk0RFWtyGdH80nZPdycj0n9NC2ncN5wMH4MQ IYyx.UpWsqzR3V8BrsjtTwszxKnPfKV4ameWN0RdEydvRsdFxSFaquoUrITyUKW5nRD0HMhn_Scx R1gRRw03vQSdjF8jBFK6H0LzQ4XH1CikEwuOljfjwsc6uvfA1s7YzbVlAlZM2HsJFbdyFmAHOeHt d9q_HCqAhp9uOm84tjwRzzAJI22T7LVbnuXfVj7AeKuJOz0vOsB5tsb2oi02PFsZ1ceWIUfXbneB 2trYpryBflk3p8CmbvvSjiqdB9QKC3qEOYFRLHkoYQDXseLFeep0YYkwf7xkxStCTFlTX0zquCmt 6qTK04OEClskWX0zF7EQTOwHqetlXk0eNnzSzY80T5qOCdG.LOrsyDTHyZUaqaFFX9JHeB3MVK8r UNGBb87vb0Zr7jkijF0EwBvj4gIi978Kx741X9qBBmX3luyb8WX7xgMd3NUk63E_HZIwTEMH1xLX Ol6HsBD2lTKFeEB9MyBgLC5uaHJPxHveR1nI9LF2v2XdnuB4.HfvUT10ixEr2LZuEAM1oZOO2cX7 WX93o6ffhlIkwhkpdkgBQWtYnRijC5uE_RH.dkK_jDL6VHt012HzeK4j4XbMYxuxRwkFEdCRJWQ5 AYYF6I3acHM9kNTEE2FnmQLZ4tDgqhcmMpARd5.WvB8y_hnBxd5ckGiXeJykEI_gbPZYwLkwX1wq .vAIwQXezNPPjn6hM6Oyd4x_qBzMybnt_N5iuW4VKxmacw1Ta.oUV_BYWnL4479IOyRr5KLahmEo 24k8bMOZo2L.q2FRqUT1FG8ZF0G47nHtB5f3zMMeqoO2hM9JgUUvCxy2dfNXxgrHqeJNCGT7gCLh .usWHUeI9A_A97gk4VccwzTSUCdh0Cg6uOBGSpQ4MyD8MlLYywBreB8ETw7A1nbV4UMsNntZMRW7 ynAysHY3uAj4zali1fKLb6V5YumiBWgJHvUfcNKjh7C.R3QD8y2zLFODv6q6pinVppXeOXdu_Bmn K1948ODsfU6.4KB4MU39ZFm4K3bPWoDhT2dASPAhfVgIhRcodEJRevVQibFg0vUoLzb_2gu1LnD6 lOiRj_7rtLc3.nPOcNlWUbiBpTb72k0_hx8JZXOCMxGXHkWFVTin5hIHEW8p1E2S1VjVBE9oFw4t ocmPh_ej12a3R0Prli5BQiQWP7YR6nn0fTP7FvC.wxybrU3iHVg1eqRs0F_3Gqze3LmTpMvLZMh2 MY_SLUJ4oaq1fO32j9pYZZc.n5NQYNz8AWYenE3lWW1O4kPGWBo1FRz_SyqBmoxTwhtRQBZ3ScEr 0kNzDYNI8aQZoysbShHhrugh5fvrqI3NRTMmxmm2lG20cAguwjdPMT9JCIDcE26zR3OGFLhqi21q 7iduBXGIYeGue0bUyZ0KvQkdtl4tCMKf0Dn.87OhFca_NTfAGMn.0PuS05lOkl2Me5v9_9JHK3jy QyVFL_M3zS4Xrm8lZReZrcSuKk570ElL5EkpEyCoiePn4Q.iAQ0rMJqrBZH39i9_zOakFAcKZ5X1 wBuTU4Z4sc1vsdms0ALwEleXoQTSMIAszaL_twbiPL4Ovl_MbD0St9qWiNXH..PiGLgFXP8mjHSV DgQlYlOQz4A0jLx2i68DRvwx5AsqyD17.naQrv72apkQ9v04dwLinYQvSMmEuXLWW0.DZ3nDd0Eb xJ5MDD_BsKqH8sBLGbvQCXorjb3ktydjH5QPFUKUhjyDhXUSGT8CVAuVlkGql5Ypxvc5mtwy6WAE DL21gs3NiAUQPssJdwi62x.NlX_mv9PZC8LIv4mT4JF2V6Qwoip7M4gFyGgS2lJ7YZTUqOd0I91C oGpuDc83azbXKLvOa02WIgnuk1UXF6jgzpvj3_lVhal1pRKM4P6_GS_TrO7kqDVjNufGjyFfb7vD x_A2W4j50sqdoXyMRq4pEtQhi0rqqceB4d_.pEtf4jecNi95aUZN9Izg3R2eqDyu2mMKn8l_sOmB HOm.JqTi8PhAYdtZRxV748SSLLc2xJHkY.fD4bDQAF_QFSmWFJywRuvYi8nffSxVVB3TJQ3iDYIi eq3okZZNf4UJSxIryyHDZvCJfHjloPY4pg20FxsdAEvQH1dF6xaD2ZTTQpDiAOUlE2mwD51ZqZdJ 1V34- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.gq1.yahoo.com with HTTP; Tue, 14 Feb 2023 02:20:09 +0000 Received: by hermes--production-bf1-57c96c66f6-p9vmd (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b2c29120db591e967c83ddb6fa0273a7; Tue, 14 Feb 2023 02:20:07 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. (Just a fixed TO: address.) Date: Mon, 13 Feb 2023 18:19:54 -0800 References: <18263DB1-D79D-420A-9F24-EE8C8E071C15@yahoo.com> To: dchagin@heemeyer.club, antoine@freebsd.org, dev-commits-src-main@freebsd.org In-Reply-To: Message-Id: <7CF460A7-C6BD-4494-8C11-0542D61F8F72@yahoo.com> X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spamd-Result: default: False [-1.88 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_SPAM_SHORT(0.62)[0.616]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.84:from]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org] X-Rspamd-Queue-Id: 4PG4fz14XCz3x4G X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N On Feb 13, 2023, at 16:47, Mark Millard wrote: > On Feb 12, 2023, at 22:05, Mark Millard wrote: >=20 >> [Just a fixed TO: address.] >>=20 >>>> On Sun, Feb 12, 2023 at 07:58:07PM +0000, Antoine Brodin wrote: >>>>> On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin = wrote: >>>>>>=20 >>>>>> On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: >>>>>>> On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: >>>>>>>> On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin = wrote: >>>>>>>>>=20 >>>>>>>>> The branch main has been updated by dchagin: >>>>>>>>>=20 >>>>>>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc21b080f3dc2f5e91ada608d4385b7ed= 6538ba9b >>>>>>>>>=20 >>>>>>>>> commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b >>>>>>>>> Author: Dmitry Chagin >>>>>>>>> AuthorDate: 2023-01-29 13:17:33 +0000 >>>>>>>>> Commit: Dmitry Chagin >>>>>>>>> CommitDate: 2023-01-29 13:17:33 +0000 >>>>>>>>>=20 >>>>>>>>> cpuset: Fix sched_[g|s]etaffinity() for better compatibility = with Linux. >>>>>>>>>=20 >>>>>>>>> Under Linux to sched_[g|s]etaffinity() functions the value = returned from a call >>>>>>>>> to gettid(2) (thread id) can be passed in the argument pid. = Specifying pid as 0 >>>>>>>>> will set the attribute for the calling thread, and passing the = value returned >>>>>>>>> from a call to getpid(2) (process id) will set the attribute = for the main thread >>>>>>>>> of the thread group. >>>>>>>>>=20 >>>>>>>>> Native cpuset(2) family of system calls has "which" argument = to determine how >>>>>>>>> the value of id argument is interpreted, i.e., CPU_WHICH_TID = is used to pass >>>>>>>>> a thread id and CPU_WHICH_PID - to pass a process id. >>>>>>>>>=20 >>>>>>>>> For now native sched_[g|s]etaffinity() implementation is wrong = as uses "which" >>>>>>>>> CPU_WHICH_PID to pass both (process and thread id) to the = kernel. To fix this >>>>>>>>> adding a new "which" CPU_WHICH_TIDPID intended to handle both = id's. >>>>>>>>>=20 >>>>>>>>> Reviewed by: kib >>>>>>>>> Differential Revision: https://reviews.freebsd.org/D38209 >>>>>>>>> MFC after: 1 week >>>>>>>>> --- >>>>>>>>> lib/libc/gen/sched_getaffinity.c | 2 +- >>>>>>>>> lib/libc/gen/sched_setaffinity.c | 2 +- >>>>>>>>> lib/libc/sys/cpuset.2 | 4 +++- >>>>>>>>> sys/kern/kern_cpuset.c | 42 = +++++++++++++++++++++++++++++++++++++++- >>>>>>>>> sys/sys/cpuset.h | 1 + >>>>>>>>> 5 files changed, 47 insertions(+), 4 deletions(-) >>>>>>>>=20 >>>>>>>>=20 >>>>>>>> Hello, >>>>>>>>=20 >>>>>>>> This broke math/py-numpy on main and stable/13 >>>>>>>>=20 >>>>>>>> = https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p5= 2768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log >>=20 >> Well, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running a >> 1400079 [2023-02-08..2023-02-10] jail that is using new KBI >> material not in the older kernel (CPU_WHICH_TIDPID) have problems? : >>=20 >> =3D>> Building math/py-numpy >> build started at Fri Feb 10 11:40:51 UTC 2023 >> port directory: /usr/ports/math/py-numpy >> package name: py39-numpy-1.24.1,1 >> building for: FreeBSD main-amd64-default-baseline-job-04 14.0-CURRENT = FreeBSD 14.0-CURRENT 1400079 amd64 >> maintained by: python@FreeBSD.org >> Makefile ident:=20 >> Poudriere version: 3.2.8-23-ga7f8d188 >> Host OSVERSION: 1400073 >> Jail OSVERSION: 1400079 >> Job Id: 04 >>=20 >> !!! Jail is newer than host. (Jail: 1400079, Host: 1400073) !!! >> !!! This is not supported. !!! >> !!! Host kernel must be same or newer than jail. !!! >> !!! Expect build failures. !!! >>=20 >>=20 >>>>>>>> = https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-basel= ine/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log >>=20 >> Similarly, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running = a >> 13.2-PRERELEASE 1301511 [2023-01-10..2023-02-10] jail that is using = new >> KBI material not in the older kernel (CPU_WHICH_TIDPID) have = problems? : >>=20 >> =3D>> Building math/py-numpy >> build started at Fri Feb 10 10:36:27 UTC 2023 >> port directory: /usr/ports/math/py-numpy >> package name: py39-numpy-1.23.5_1,1 >> building for: FreeBSD 13stable-amd64-quarterly-baseline-job-01 = 13.2-PRERELEASE FreeBSD 13.2-PRERELEASE 1301511 amd64 >> maintained by: python@FreeBSD.org >> Makefile ident:=20 >> Poudriere version: 3.2.8-23-ga7f8d188 >> Host OSVERSION: 1400073 >> Jail OSVERSION: 1301511 >>=20 >>=20 >>=20 >> (Looks to me like CPU_WHICH_TIDPID use for 13.* has to >> require 13.2+ .) >=20 > (I should have used "some CPU_WHICH_TIDPID use" and the > like in various places.) >=20 > I got my environment to be 140079 (everywhere) with ports > updated to be have py39-numpy be at 1.24.1,1 . My > poudriere-devel build result was: >=20 > [00:25:52] [01] [00:00:00] Building math/py-numpy@py39 | = py39-numpy-1.24.1,1 > [00:28:39] [01] [00:02:47] Finished math/py-numpy@py39 | = py39-numpy-1.24.1,1: Success >=20 > (It built 47 other ports first to get ready for that.) >=20 > FYI: >=20 > # uname -apKU > FreeBSD amd64_ZFS 14.0-CURRENT FreeBSD 14.0-CURRENT #60 = main-n260797-dc1b8c9a846e-dirty: Thu Feb 9 22:17:26 PST 2023 = root@amd64_ZFS:/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.a= md64/sys/GENERIC-NODBG amd64 amd64 1400079 1400079 >=20 > Looks to me like, if the ABI incompatibilities are to > stay as they are, then the FreeBSD build servers need an > update for HOST OSVERSION to be more modern in order to > avoid having odd problems with building some ports. >=20 Now I question what happens for going the other way, imagine: HOST OSVERSION: 1400079 Jail OSVERSION: 1301000 for 13.1-RELEASE-p6 Might this change the behavior of 13.1-RELEASE-p6 port build activity based on the live kernel using the new CPU_WHICH_TIDPID related behavior? Is something translating things to get the old behavior for such a combination? =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Tue Feb 14 02:57:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG5VX4c3rz3q4TX for ; Tue, 14 Feb 2023 02:57:56 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 4PG5VW6tdwz41h5 for ; Tue, 14 Feb 2023 02:57:55 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none Received: by mail-wm1-f41.google.com with SMTP id hg24-20020a05600c539800b003e1f5f2a29cso237676wmb.4 for ; Mon, 13 Feb 2023 18:57:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=M0ruyAMmLT2KInPireE0924m0m4Edb3qBuuo/t/xaIU=; b=G2q/FAG5gZIPyuVIAr1ZT3sVbUTCPblUxmzFVJvICLP1mqUT5Pq3evTXeA+eR5XHMu lWI7n50UICqLJ8bx+6g5MFEttTmbF3EM3nAzbIMh5zWwmh6rJ/APkgK+jOj+l9gi7ynF e7vFQWk9BqN3PUf23eWMd/DIJtLVO1Dw9slhQ8NVoz/GnRrsr9OtMQRgdpT9Z/8jIz+4 bZss5fbqSWe9qTcPoNX0aLXov3M1y24ato8fuw2vkEPEgVylZheiILZ1ZngQBZ1mNi0F 648PjwbkQwJWjQIGKdJVTS4Rj+VVvIOperHgB3hxBw8ON3b9tv5+JF0HaTDarUswjMca B+dg== X-Gm-Message-State: AO0yUKUAjDQFp2fy4SS+yKJhWuA73wAIKx5biU0AK2MSDvz5QyARQkbp 7ooxKxFDiVmEOL874PUDAvrlrA== X-Google-Smtp-Source: AK7set8xgnC5CjcCcj2+QrSa1zNn2YeP2zDnJ9pzqH/8xrN2VjNgjzEKxwSuW45b8X4B/QNXl9P0Qg== X-Received: by 2002:a05:600c:c0b:b0:3df:e1cc:94ff with SMTP id fm11-20020a05600c0c0b00b003dfe1cc94ffmr712120wmb.28.1676343474182; Mon, 13 Feb 2023 18:57:54 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id w19-20020a05600c475300b003e11f280b8bsm13646098wmo.44.2023.02.13.18.57.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2023 18:57:53 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: f29942229d24 - main - Read the arm64 far early in el0 exceptions From: Jessica Clarke In-Reply-To: <0E3AAA1E-0B3E-4C4F-A425-CEE13BAE8723@freebsd.org> Date: Tue, 14 Feb 2023 02:57:53 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <1F46E64A-2261-47B1-BA73-3649DB1E08CE@freebsd.org> References: <202302021648.312GmSXI049747@gitrepo.freebsd.org> <0E3AAA1E-0B3E-4C4F-A425-CEE13BAE8723@freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spamd-Result: default: False [-2.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_THREE(0.00)[4]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.41:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.41:from] X-Rspamd-Queue-Id: 4PG5VW6tdwz41h5 X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On 2 Feb 2023, at 21:00, Jessica Clarke wrote: >=20 > On 2 Feb 2023, at 16:48, Andrew Turner wrote: >>=20 >> The branch main has been updated by andrew: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Df29942229d24ebb8b98f8c5d02f3c863= 2648007e >>=20 >> commit f29942229d24ebb8b98f8c5d02f3c8632648007e >> Author: Andrew Turner >> AuthorDate: 2023-01-25 17:47:39 +0000 >> Commit: Andrew Turner >> CommitDate: 2023-02-02 16:43:15 +0000 >>=20 >> Read the arm64 far early in el0 exceptions >>=20 >> When handling userspace exceptions on arm64 we need to dereference = the >> current thread pointer. If this is being promoted/demoted there is = a >> small window where it will cause another exception to be hit. As = this >> second exception will set the fault address register we will read = the >> incorrect value in the userspace exception handler. >>=20 >> Fix this be always reading the fault address before dereferencing = the >> current thread pointer. >>=20 >> Reported by: olivier@ >> Reviewed by: markj >> Sponsored by: Arm Ltd >> Differential Revision: https://reviews.freebsd.org/D38196 >> --- >> sys/arm64/arm64/exception.S | 15 +++++++++++++++ >> sys/arm64/arm64/trap.c | 26 +++++++------------------- >> 2 files changed, 22 insertions(+), 19 deletions(-) >>=20 >> diff --git a/sys/arm64/arm64/exception.S = b/sys/arm64/arm64/exception.S >> index 4a74358afeb9..55bac5e5228a 100644 >> --- a/sys/arm64/arm64/exception.S >> +++ b/sys/arm64/arm64/exception.S >> @@ -212,10 +212,25 @@ ENTRY(handle_el1h_irq) >> END(handle_el1h_irq) >>=20 >> ENTRY(handle_el0_sync) >> + /* >> + * Read the fault address early. The current thread structure = may >> + * be transiently unmapped if it is part of a memory range being >> + * promoted or demoted to/from a superpage. As this involves a >> + * break-before-make sequence there is a short period of time = where >> + * an access will raise an exception. If this happens the fault >> + * address will be changed to the kernel address so a later read = of >> + * far_el1 will give the wrong value. >> + * >> + * The earliest memory access that could trigger a fault is in a >> + * function called by the save_registers macro so this is the = latest >> + * we can read the userspace value. >> + */ >> + mrs x19, far_el1 >> save_registers 0 >> ldr x0, [x18, #PC_CURTHREAD] >> mov x1, sp >> str x1, [x0, #TD_FRAME] >> + mov x2, x19 >> bl do_el0_sync >> do_ast >> restore_registers 0 >> diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c >> index 4e54a06548cc..1b33d7aa60c4 100644 >> --- a/sys/arm64/arm64/trap.c >> +++ b/sys/arm64/arm64/trap.c >> @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); >>=20 >> /* Called from exception.S */ >> void do_el1h_sync(struct thread *, struct trapframe *); >=20 > This did not address my feedback regarding EL1 debug exceptions also > clobbering FAR. Ping, now after this has been MFC=E2=80=99ed without so much as a reply = to my feedback here nor on the Phabricator review. Jess >> -void do_el0_sync(struct thread *, struct trapframe *); >> +void do_el0_sync(struct thread *, struct trapframe *, uint64_t far); >> void do_el0_error(struct trapframe *); >> void do_serror(struct trapframe *); >> void unhandled_exception(struct trapframe *); >> @@ -559,11 +559,11 @@ do_el1h_sync(struct thread *td, struct = trapframe *frame) >> } >>=20 >> void >> -do_el0_sync(struct thread *td, struct trapframe *frame) >> +do_el0_sync(struct thread *td, struct trapframe *frame, uint64_t = far) >> { >> pcpu_bp_harden bp_harden; >> uint32_t exception; >> - uint64_t esr, far; >> + uint64_t esr; >> int dfsc; >>=20 >> /* Check we have a sane environment when entering from userland = */ >> @@ -573,27 +573,15 @@ do_el0_sync(struct thread *td, struct trapframe = *frame) >>=20 >> esr =3D frame->tf_esr; >> exception =3D ESR_ELx_EXCEPTION(esr); >> - switch (exception) { >> - case EXCP_INSN_ABORT_L: >> - far =3D READ_SPECIALREG(far_el1); >> - >> + if (exception =3D=3D EXCP_INSN_ABORT_L && far > = VM_MAXUSER_ADDRESS) { >> /* >> * Userspace may be trying to train the branch predictor = to >> * attack the kernel. If we are on a CPU affected by = this >> * call the handler to clear the branch predictor state. >> */ >> - if (far > VM_MAXUSER_ADDRESS) { >> - bp_harden =3D PCPU_GET(bp_harden); >> - if (bp_harden !=3D NULL) >> - bp_harden(); >> - } >> - break; >> - case EXCP_UNKNOWN: >> - case EXCP_DATA_ABORT_L: >> - case EXCP_DATA_ABORT: >> - case EXCP_WATCHPT_EL0: >> - far =3D READ_SPECIALREG(far_el1); >> - break; >> + bp_harden =3D PCPU_GET(bp_harden); >> + if (bp_harden !=3D NULL) >> + bp_harden(); >> } >> intr_enable(); From nobody Tue Feb 14 03:18:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG5y85rzQz3q6YB; Tue, 14 Feb 2023 03:18:24 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (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 4PG5y82Rx9z438t; Tue, 14 Feb 2023 03:18:24 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-15ff0a1f735so17588558fac.5; Mon, 13 Feb 2023 19:18:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yjQRWCYAjbGrggh+wPiUwt+LWiuDYBWSsKPLjgQTk/I=; b=GxfDHZvNJBBVbskLfU7JybTZhL5UKmGudJRGUkkcwZW2zhLL5BtSCuAcqTRaJVgW7H BrN4Y04vZl8R00kbM4YUYhDwkab+L/3oWp46qZR2S+BJL+Y3nBeIREbtoR2GNKezSEiy TC1qP6S0vyUTaF9nL9gtmLElti3DgwVDBSEvAOq1NeGNPT9WUsHnKSZg7aNhE6yqyw+U QBbtHgEkUbifYcI99qkk0YY1ENI3n/LHBv+OSIlvb0PnilTWvMYWRkcHLjyki5zsFEde /YNNIN+F5xs9OLNopRvGZWmya690c4jhvx7bB64PAA42SqHhpPuNHnrySxW7dewJmbPa gimw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yjQRWCYAjbGrggh+wPiUwt+LWiuDYBWSsKPLjgQTk/I=; b=Mz7Iqs4Mn+dYpj0tUs4jpHE0q8Jvasznk+kylSZx8dUyqkm+unDLJHDRSrkBODTbZI dYACKsDzdguAko3W7tW3jf5wV013DOTUiN9pyucuPejLRII6CrFB/xT3g6IC7RBdxkEW S0NFNT85WdtkSayVhaVNV+41+cGwstzknxdAOJqrafK8yR7Mv6d/PZTSxN2mqvlN9qiS +SnqTd1LrfZh3KXc0TCL7NMWaUOmXaK8gKACuJeEEWYYPOKoT6eOOcl8r8OVRKHBbAQy OuJTMJ4egSu9v7d8B17GYX3ygIRnjoifmqZ47ybMRTGLEQUCRyNbL0dBbZJHZLN0EQRQ 9yZg== X-Gm-Message-State: AO0yUKVvgia1xSgeBlq8VkjtbifTsFUd4XmPZN0JTAQiZjJxhCz2far2 xSEJvXpjxiG7T/QX0ZmGs4wc4Y+NV4Ev1dV387t/W05F X-Google-Smtp-Source: AK7set99I8Yk6TpUelIQJi3hxgyCauBMmtTMdtTbfzbuMVLCjZpm9XnuBZSczbGtEuhWmyVZS7x56bl+TJCegAUMR58= X-Received: by 2002:a05:6870:13d0:b0:16e:25e:f294 with SMTP id 16-20020a05687013d000b0016e025ef294mr29914oat.81.1676344702099; Mon, 13 Feb 2023 19:18:22 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:4381:0:b0:4b9:9c2d:ce62 with HTTP; Mon, 13 Feb 2023 19:18:21 -0800 (PST) In-Reply-To: References: <202302081947.318Jlbt6052826@gitrepo.freebsd.org> <20230208202736.L7hpB%steffen__28609.3347867549$1675888077$gmane$org@sdaoden.eu> <1qmt-6s1w-wny@FreeBSD.org> From: Mateusz Guzik Date: Tue, 14 Feb 2023 04:18:21 +0100 Message-ID: Subject: Re: git: 48bfd3597654 - main - Add nproc(1) To: Jan Beich 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-Rspamd-Queue-Id: 4PG5y82Rx9z438t X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 2/14/23, Jan Beich wrote: > Mateusz Guzik writes: > >> On 2/14/23, Jan Beich wrote: >> >>> Steffen Nurpmeso writes: >>> >>>> |+ if (all_flag) { >>>> |+ cpus = sysconf(_SC_NPROCESSORS_ONLN); >>>> >>>> is not compatible -- note i like the FreeBSD way better, and maybe >>>> someone should make a bug report even. >>>> >>>> #?0|kent:$ getconf -a|grep NPROC >>>> _NPROCESSORS_CONF 8 >>>> _NPROCESSORS_ONLN 4 >>> >>> See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230330 >>> >>> $ cpuset -l 2-5 -- getconf -a | fgrep _NPROC >>> _NPROCESSORS_CONF: 8 >>> _NPROCESSORS_ONLN: 4 >>> >> >> As I mentioned previously in the thread, on linux these *don't* react >> to cpusets (or tasksets in linux parlance): >> >> $ getconf -a | grep _NPROC >> _NPROCESSORS_CONF 4 >> _NPROCESSORS_ONLN 4 >> $ taskset --cpu-list 0 getconf -a | grep _NPROC >> _NPROCESSORS_CONF 4 >> _NPROCESSORS_ONLN 4 >> >> consequently the patch proposed in the bz would introduce an >> incompatibility with linux > > I've used kern.smp.cpus in old patches but found musl more practical. > _SC_NPROCESSORS_ONLN is often used as a default number of jobs. > _SC_NPROCESSORS_ONLN is expected by real consumers to *not* be affected by cpuset et al. See below for musl. > glibc: > - /sys/devices/system/cpu/online > - /proc/stat Neither of these are affected by taskset/cpuset. > - sched_getaffinity where is this used? > > musl: > - sched_getaffinity > >From the commit I don't think the choice was thought out whatsoever. https://git.musl-libc.org/cgit/musl/commit/?id=9a7fac7934975338449b63eb4d0409b472251dfa the code went from returning -1 to glibc-incompatible taskset-affected count, and there are people complaining it breaks compat: https://marc.info/?l=musl&w=2&r=1&s=_SC_NPROCESSORS_ONLN&q=b > bionic: > - /sys/devices/system/cpu/online > - /proc/stat (Android < 7) > Neither of these are affected by taskset/cpuset. All in all, the *current* state is broadly linux+glibc-compatible. The one incompatibility concerns disabled HT, which on linux still reports those cpu threads, while they are completely absent from the count on freebsd. This is not taskset/cpuset-related. -- Mateusz Guzik From nobody Tue Feb 14 04:40:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PG7mx6lMMz3qWlX for ; Tue, 14 Feb 2023 04:40:33 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-20.consmr.mail.gq1.yahoo.com (sonic301-20.consmr.mail.gq1.yahoo.com [98.137.64.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PG7mw4ptXz49Zd for ; Tue, 14 Feb 2023 04:40:32 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=HytXdK+E; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.146 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676349629; bh=nq5bZtBHvXD2s+6rCK/G7ZWjHKZYqsSYb5hGYv09dsU=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=HytXdK+EEP2AFq7SpSsGPYOrlcrmhDlfchOlL7T1Z2cOvYIR2XXULkmK/Hx/14Xtsd5HsamtiLXGiKFDzbWQX2bOs8SG/Xk6ZDWkiHqF7Vlgc6jas6GJAwogdxncGg6p1go9OzQ31YVxeLicl8yAhAkV52z5/GovGrUjuE+uViC8ynSyyrWeIdOVs2p/Fhv1SvF3+fENtzi0ByZNJRLORmH64PvXB5WqVo7/l7bNFD5cFhlZ46MdKB9OPZU05vuew+IZDMzavMi0g95TR/fTy8I8TeEPSWLjF0QvWdCJacFK32QYVyrwbYBC1jcbenmbIUiOaEnl5xVrBqj2X9PJ+g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676349629; bh=RhkqDmV3e1HaaIeK0USYFHlNQjCMGLREcY57p15ahrF=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=fxvZVUtJjk91I+noJtacslodpWf4GqVdpTkQscoq20RBGu0Auzd9bhTFKQaZqR49FxOd9+NU0/u2W0c6U5kU89FFwqO93SzKpVh5sx3J/R6qk7rSx1gguP3BH3UAs6v+A/FZtfnqAkD7ODRhYF1x5sTVIrVOdO60pji7WYXvyScmmL0BJiCgxytGqleI0rPuUmAWDoJyZQojQwL+F1Tx/73+x7WcYRxqPn+yHffry7W0c+TIFpKcZD/AwWUkZSMWAHLZob5LquLGeF25zyxRs4sPAxZ6buJbKMXnZD8y0DR9ft8hVnqKcB8cE8dIL98JTB8eYbfSWem1/K+pJEUeVw== X-YMail-OSG: ofOeQLoVM1lI31qmCRLxYZInyzcbC09WPYQ4Wpsp6uOTgAc4glE.QAMpp5X7qgx 0w_jMNlBZJIDlrWUftTEBZrT08WuMQJfyIMC8LBAFqlvxsaR_O6lZSr.Da_LyIgS8RXWsn03NDZI 2cFtdk13rMhwwQesYyvJsLaxAcU17e7jEmRbE33b8lSn2.ms4D9mvkjZA0aE0nngc98NYumJ4eeS KoOkI4Cc1ejY8UB6p1Ihk8J3uwrgnhiFSb5Ivv84xPTNaisuTMRA_6wTjduPfoE_AfTMFAUCPpwx 7.3h6N1hvWFGyBT8bBcUilwXElo3hNyLVLhwdjjo9cPkbFOGiyp8F0jQa9sA0SWBUAsVOOQ2UTdc 86r8Dt4pWoB1_wSEPtAbW_h241dMiR616gzJgJl5lMfwip1IIqLJkG4WnpasvJrOvFJVByC7eX9x k2SktXdQkdE33zxiT5DZw8MJfG34nke3ZfUYgtFEwOC9pn_xS70Gxh6VeCHsSD4ZWv0uvuyquIdM 3kEoKCWvJP7GDTCTdI.Lw0qDDntooYPH6YCDczHh_98eXUlzNhmwD6KKZtm9QDkCnlnw3xGvj2H8 BNN7j9evuyleBt5xUSqiZ8t7MAYpxh3MH3IBzQqtjNxo8lP0qCZ9uJEqObXGu3mdUSQJQN2tgxaN goueioCVUp9Cf2FY9RJxyKrUyhtRwTwhGpTUGwWzGgT7kvkRGlhJ3ONCN_m4AwyK_.q50knXh.4X bNE9ZYoa4Tbb.Pk0NquQOSB9Y3C9FKM.ArhTdtq1barSfNABbY6Oh1.lco0BVgbJkOSug286h91p 2W8Xl.zsGCZIhEdw3kmjRTOlELzERPprrwVFUKnb9ETiWeAtxdcjLiVfm5BvhGAuBdYHh1nGYew0 T.qN3fuJmVB3e..HlJAdAJFmxPtgZ8vyPCKnkJ4OaTIeoh87DfZQJq8oW6XD6XxUsUnNXB6gMKGq _fWBD24DTp6Tdk4dRMmWt1NjDwRSWvFo_9ozY.piYRjZ5Fhx7a9kpNHC6H1ISR4RrIjHSpB3rCQp TggNfrtIDBW7z0YCzKkAW_4OiZr.XNCBf94grA4G7BplJlv.xbU2fAx2gBiRMZVtLW7Ton11QmtE 6kJA.GPMMo8IXF9M1zW_N7pxFPXhgymlfjEVSeXXatsFf43ualCMaAid61c1BMZx1GpMH06iQ9X_ MJ5PNueqmwlgQn0IE_DMmNCDNiDqdIm57UuU.ZWclYBBUDsRs5DYGSoiqvp76WW3D8PBp7kYVSKt O_F6w7O5iYdM6REy72RBsXfj.XaT3SQpiC200ur7Hhm8B46hc4IvhjW.xcnLvHc3zAlvKwYRL69Y c_9OESkK59brM4Huc2Qtv7An5x3xnPJA0VeIgye.WZzyImiLkBP.1rv9zcmk3i2WOGwBudw0Xozi nLUDt3SpcvoZp61zwWI8PeEdKmmmyUlY3FUVmkbY4GABWroHo7d.YPwsmQoAvhelrzONRZ5UF_Cc FIlHRNse3jfJJ2K4QQqka0kbT7OcoBUdUEOE2rJY4s4oyuYunOhsqvuFtOdYXolaUdtB3ik9_2Hz XDUUNevf_GlHhQaI6NK2kSy7i2yapNgZjpa4PNlWkTyB89ClUryjyjjZ5irTJLV0glBiYf8NGs0Y InxWwarCsPSkoURRX8nOJ1vH7spDfiejn5nSw_DN.MZLLVher57lxyHr.Yj3nYQ9o5dXEWSU8rZX q0PyF22D.lXPpV3S5PIZnGsUMH_b8WEOmDeW7nN.VVKritKmAfTWLIWBUhDBKu0qvSH_SHksenTJ BjXVAvoY8Y6TkMDoWANWJklO0N.ek2NAp2N5jqPq3BpA2HT.QcFyKNGmshJNc1KWJDULHvuFR.TO z.JEjflh311uFGeCUY5xpmsmO8NRm1X7wmWxBQULHDtrK_dye0ARJ5aycEHacekKgzWKXLw2WYis FK1_Qtbnn9JG6A1xeE2U1EYzGE8HsBG1_gflAZu4jdRE4u8DxR5MqnWdlPqrDedQ0wt6Jnwkxd3Q ybZ9yhF3luswDxHrvxxQFRaQaUAdvlnCbNotb_awxVw0vsUYaaZmWEWNVa8vaaDjMz.XGsaAFtYu YvCSYhNCgspYPiaC0fuoLzrN9USBP4aWO1JbyDf4d6x4SNQdM7sX1XgIolVuoS69M.YrdfyEq2Ek CmQG.aPnJKWq5uRpwlq331ILtPENNOhprGG9Vltr1ucb9dCw.cKQnTFV6nOyFYilmOJTMw3wKgz2 jvliPux76GWFmbDm8WWTotwFubPzQmKM6KbU96sgBTDgDsiPwOc8FlLuvt25y3BNcazadQbB.qDH 5 X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Tue, 14 Feb 2023 04:40:29 +0000 Received: by hermes--production-ne1-746bc6c6c4-kcw5g (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 32c1d067dc6c9c293b33b31df90229d5; Tue, 14 Feb 2023 04:40:24 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: 48bfd3597654 - main - Add nproc(1) Message-Id: <6A17ABC7-9C91-4B9D-93C3-146307FB9390@yahoo.com> Date: Mon, 13 Feb 2023 20:40:12 -0800 To: dev-commits-src-main@freebsd.org, mjguzik@gmail.com, jbeich@freebsd.org X-Mailer: Apple Mail (2.3731.300.101.1.3) References: <6A17ABC7-9C91-4B9D-93C3-146307FB9390.ref@yahoo.com> X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCPT_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.146:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[freebsd.org,gmail.com]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.146:from] X-Rspamd-Queue-Id: 4PG7mw4ptXz49Zd X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N As far as I can tell, it is unlikely that any choice is going to be universal for a sysconf(...) context. Part of that is that POSIX does not have the _SC_* names involved for "nproc". But there is a broader issue as well: POSIX.1-2017, for example, says of long sysconf(int name): (I ignore here material about returing -1/errno handling.) QUOTE The value shall not change during the lifetime of the calling process END QUOTE A XSI note adds that QUOTE except that sysconf(_SC_OPEN_MAX) may return different values before and = after a call to setrlimit() which changes the RLIMIT_NOFILE soft limit END QUOTE (So, one XSI exception noted.) The rationale section has some more related words: QUOTE This runtime facility is not meant to provide ever-changing values that = applications have to check multiple times. The values are seen as = changing no more frequently than once per system initialization, such as = by a system administrator or operator with an automatic configuration = program. This volume of POSIX.1-2017 specifies that they shall not = change within the lifetime of the process. END QUOTE It looks to me like, in this "nproc" area, sysconf(name) is being abused related to its POSIX intended range of functionality. Not a good context for getting stable definitions across systems/libraries or over time. That said, ignoring cpuset/taskset would be appropriate to the POSIX.1-2017 wording for anything sysconf(name) is to return and using cpuset/taskset looks to be inappropriate. (I did not review the POSIX history prior to the 2017 context.) If some forms of sysconf(name) use are to not fit with the POSIX property indicated, it likely needs to be well documented for that and whatever other criteria were used instead also needs to be well documented for the names that do not get the property. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Tue Feb 14 07:29:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGCWR6BVyz3rKw3; Tue, 14 Feb 2023 07:29: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 4PGCWR5ZGsz4Nn5; Tue, 14 Feb 2023 07:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5RAa1FQLLHSBkmZU9LwKFewX6VLz8/SH3oxDymoGJvA=; b=duCNgI78vKsBloZGc8Tv+WCmcdrkpcAnzzzOz5O/yBO+dA0GNIW52jI76tKW+JFfnCAWpf XiVWunzF5wkHcG04oh82BsYrjq+mD3ZHOS8cB5yr2dbMTUAOGnc87x7dCyjU2NOyNElubu +6hhshdtc91Rl73unissSMNxLsn8YGW/lE9dPWcG4DF2mzcnzoqCrGIbCyeFoAfwp7l7eF fpc95t0Uov9Y5nWRDBAeGrS7FWd7n+8bG7PHDK4NK98NChQ8XGqsGEJjfmIKsaOupgA2W3 1/QVslHoIi+XExqfbdG13LqRG124H6rkS0aczal4lYlnpo7Km9t/z5Qzq2ziHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5RAa1FQLLHSBkmZU9LwKFewX6VLz8/SH3oxDymoGJvA=; b=s6t6ft6iM+xEJoYw8Fjqe9Y+/LON/3hJpnAzJ7++wy86Szd3zAKNQCwjUevYPJEEo8Tqff DW/SshknKx9CgjAbhLln3pKXJCHA/HvGTRxeRCKSA7QORFMn2pDCOCd7anDpgYoXJGOfnp f/Mip4eOqBrXg5TAMbblH+T3SfCQ3tqbBBPc7akzPTYDhJ8CgRpsYAQ75A2cI8593MV0DF knPyKerT99uMVtlW8Ji36mERSzLJVXn8OAGJpKCJ+qUYD8Bp6OcHTz5a7/qKrGuv7h+A36 WiviWpPhwFzMJ0k3UNC05ANuR7/xdj5x/MzKNN2psDi1zu44HKISR+qd3kaHLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676359747; a=rsa-sha256; cv=none; b=VV9X3hhFRu8cM+HzH8yV8NNwFFilVNQOhi1yLC2WKS3At8j/z8LsGd4iAcDcW2gt7ehTg8 RuNZKbwa1izkAegzzxZUNdn6/hmVUJIlktkbVz2CvmpV2u7SobYeNUMJ58eNGANJqr17Bz K+B+E2bDhILpm9jpdwQZqA1s/mOIu9rF0eSdU0cl9ZHhHEykqQWTGBl3PLdbEdkUKEUIi/ e8UdWRhExq4NXCvxzo/4tXS8I2xdE2/owwwxP7Tjb3mJwr9TBeaU+vfojp/tNI/aaTIkom fFk2mA/OGN4+0RV7VVftZMXGyvCuZMzXi86jgN7iDSPaos5eopp0PCDXUmBiJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGCWR4dTpzqlM; Tue, 14 Feb 2023 07:29: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 31E7T7XZ043940; Tue, 14 Feb 2023 07:29:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E7T7HB043939; Tue, 14 Feb 2023 07:29:07 GMT (envelope-from git) Date: Tue, 14 Feb 2023 07:29:07 GMT Message-Id: <202302140729.31E7T7HB043939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 1231f047c3ed - main - bhyve: add helper struct for acpi device handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1231f047c3ed46ca6041df62f2b71f6e879bbb40 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=1231f047c3ed46ca6041df62f2b71f6e879bbb40 commit 1231f047c3ed46ca6041df62f2b71f6e879bbb40 Author: Corvin Köhne AuthorDate: 2021-10-07 13:54:46 +0000 Commit: Corvin Köhne CommitDate: 2023-02-14 07:28:17 +0000 bhyve: add helper struct for acpi device handling To simplify the handling of different acpi devices like qemu fwcfg or a tpm, add a helper struct. It will handle the reporting of acpi resources. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38327 --- usr.sbin/bhyve/Makefile | 1 + usr.sbin/bhyve/acpi_device.c | 92 ++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/acpi_device.h | 31 +++++++++++++++ 3 files changed, 124 insertions(+) diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile index a456d507a071..bf0a17edc59e 100644 --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -15,6 +15,7 @@ MAN= bhyve.8 bhyve_config.5 BHYVE_SYSDIR?=${SRCTOP} SRCS= \ + acpi_device.c \ atkbdc.c \ acpi.c \ audio.c \ diff --git a/usr.sbin/bhyve/acpi_device.c b/usr.sbin/bhyve/acpi_device.c new file mode 100644 index 000000000000..66d50de814fd --- /dev/null +++ b/usr.sbin/bhyve/acpi_device.c @@ -0,0 +1,92 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG + * Author: Corvin Köhne + */ + +#include +#include + +#include + +#include +#include +#include + +#include "acpi.h" +#include "acpi_device.h" + +/** + * List entry to enumerate all resources used by an ACPI device. + * + * @param chain Used to chain multiple elements together. + * @param type Type of the ACPI resource. + * @param data Data of the ACPI resource. + */ +struct acpi_resource_list_entry { + SLIST_ENTRY(acpi_resource_list_entry) chain; + UINT32 type; + ACPI_RESOURCE_DATA data; +}; + +/** + * Holds information about an ACPI device. + * + * @param vm_ctx VM context the ACPI device was created in. + * @param name Name of the ACPI device. + * @param hid Hardware ID of the ACPI device. + * @param crs Current resources used by the ACPI device. + */ +struct acpi_device { + struct vmctx *vm_ctx; + const char *name; + const char *hid; + SLIST_HEAD(acpi_resource_list, acpi_resource_list_entry) crs; +}; + +int +acpi_device_create(struct acpi_device **const new_dev, + struct vmctx *const vm_ctx, const char *const name, const char *const hid) +{ + if (new_dev == NULL || vm_ctx == NULL || name == NULL || hid == NULL) { + return (EINVAL); + } + + struct acpi_device *const dev = calloc(1, sizeof(*dev)); + if (dev == NULL) { + return (ENOMEM); + } + + dev->vm_ctx = vm_ctx; + dev->name = strdup(name); + dev->hid = strdup(hid); + SLIST_INIT(&dev->crs); + if (dev->name == NULL || dev->hid == NULL) { + acpi_device_destroy(dev); + return (ENOMEM); + } + + *new_dev = dev; + + return (0); +} + +void +acpi_device_destroy(struct acpi_device *const dev) +{ + if (dev == NULL) { + return; + } + + struct acpi_resource_list_entry *res; + while (!SLIST_EMPTY(&dev->crs)) { + res = SLIST_FIRST(&dev->crs); + SLIST_REMOVE_HEAD(&dev->crs, chain); + free(res); + } + + free(__DECONST(void *, dev->hid)); + free(__DECONST(void *, dev->name)); + free(dev); +} diff --git a/usr.sbin/bhyve/acpi_device.h b/usr.sbin/bhyve/acpi_device.h new file mode 100644 index 000000000000..1728acd4cdcd --- /dev/null +++ b/usr.sbin/bhyve/acpi_device.h @@ -0,0 +1,31 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG + * Author: Corvin Köhne + */ + +#pragma once + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#include +#pragma GCC diagnostic pop + +struct vmctx; + +struct acpi_device; + +/** + * Creates an ACPI device. + * + * @param[out] new_dev Returns the newly create ACPI device. + * @param[in] vm_ctx VM context the ACPI device is created in. + * @param[in] name Name of the ACPI device. Should always be a NULL + * terminated string. + * @param[in] hid Hardware ID of the ACPI device. Should always be a NULL + * terminated string. + */ +int acpi_device_create(struct acpi_device **const new_dev, + struct vmctx *const vm_ctx, const char *const name, const char *const hid); +void acpi_device_destroy(struct acpi_device *const dev); From nobody Tue Feb 14 07:29:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGCWT11Q1z3rLC4; Tue, 14 Feb 2023 07:29: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 4PGCWS6q2vz4NWM; Tue, 14 Feb 2023 07:29:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xobRijXbgXnAlxqj3wYckmTL4lS1veJs5u7w1eZkxZI=; b=AyqRuAJx0Vsy98pP0XP/zQDD9kYBc9mBW+ta2sfOLPyjSzIui4qvODV3NjsbQl2SkYA5fy PSZkahWJrpmi+RVs38ohb437ljQsrrjnRJSU5GP3obnojJSXocO4apx73PYLdxEGy20zx1 B8aUO6Omx1V7kIT6cu2SzoFKuuAyYyWF3ggkQI7SDcIPxlYxVDqJ6skWaEQ0CmEWLT84sm oIlhcYGXXmGyySTgBOwCCokRTXmn+yYNUOVopwJbVROsHCyJY7IP+1xnZ14+KdkGrFeTJG imYcRxW4nXoGDhdFLmRqttFlupZzZwa8HLe8NzIGet5mw7W8cUbMvG42g9tNoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xobRijXbgXnAlxqj3wYckmTL4lS1veJs5u7w1eZkxZI=; b=LDYNCob8ojxsI6k2dQi3D8MIrU5LnPDndiy/pb/qxrLw9q/EwuhMXmHkdghXJw8LM/ZMwq hfRMqlo/LB07ZphS3UZk3a6pPwFiWgj9qOLS0WBF95yLITiGoE4VlDfeGpYJTi1gXls1FT XRfHrflLHMnXKaGVrv2uVWl7TIXzsGvojY88/6dA5bkwB3PTLZH27K9+ige+6N06UIkwZl mH6MtU2bAyosZVzae5Z8biAOuYQ0HcU76rzfSSz31o1fam7fNRMZRXBSOi2NKJVh9qwqn4 60T7zX6EwSjYY5HgXxNTylejm/1EEXY+jzaNZxNpVyg47HaYknfNBjSdp673TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676359749; a=rsa-sha256; cv=none; b=XKvndGRnXYDvbuAdE379dqfKiiTlgkGsABUdUlxCjiWB1kZJMBctMS7y8BHnfBDWbbOTCN 1hivf+PKMDKzp0nR91CNfVKySr5l7MMUXrMq3A6WFm9GGQB2IU6zXps4NtFbS8aYXmmHW3 OmcNJ/gMo+CdiTIsTO23hWthYSCTZTgxN5v+I0TeyS0jSbAjsyH1DOHosLR+LOKK0JJpNF oNA97sCSzpBUvdx8oQMvth75sQN3dlhPyeP+n9QVuUW1x6aMdA9bZaDjgLkRGvwMCfTsDT /KS6SM0f1poZDe5dGVLjVltLwSwJljWYHD+eHW6cwnbVDCOBGiy2L81P8jLN9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGCWS5RmFzqql; Tue, 14 Feb 2023 07:29: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 31E7T8L1043976; Tue, 14 Feb 2023 07:29:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E7T8wM043975; Tue, 14 Feb 2023 07:29:08 GMT (envelope-from git) Date: Tue, 14 Feb 2023 07:29:08 GMT Message-Id: <202302140729.31E7T8wM043975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 13a1df5b85e9 - main - bhyve: add helper func to add acpi resources List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13a1df5b85e992570f45248bfe9d581dc182b755 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=13a1df5b85e992570f45248bfe9d581dc182b755 commit 13a1df5b85e992570f45248bfe9d581dc182b755 Author: Corvin Köhne AuthorDate: 2021-10-07 13:57:01 +0000 Commit: Corvin Köhne CommitDate: 2023-02-14 07:28:21 +0000 bhyve: add helper func to add acpi resources These helper function can be used to assign acpi resources to an acpi_device. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38328 --- usr.sbin/bhyve/acpi_device.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/acpi_device.h | 5 +++++ 2 files changed, 50 insertions(+) diff --git a/usr.sbin/bhyve/acpi_device.c b/usr.sbin/bhyve/acpi_device.c index 66d50de814fd..402e32faa93a 100644 --- a/usr.sbin/bhyve/acpi_device.c +++ b/usr.sbin/bhyve/acpi_device.c @@ -90,3 +90,48 @@ acpi_device_destroy(struct acpi_device *const dev) free(__DECONST(void *, dev->name)); free(dev); } + +int +acpi_device_add_res_fixed_ioport(struct acpi_device *const dev, + const UINT16 port, const UINT8 length) +{ + if (dev == NULL) { + return (EINVAL); + } + + struct acpi_resource_list_entry *const res = calloc(1, sizeof(*res)); + if (res == NULL) { + return (ENOMEM); + } + + res->type = ACPI_RESOURCE_TYPE_FIXED_IO; + res->data.FixedIo.Address = port; + res->data.FixedIo.AddressLength = length; + + SLIST_INSERT_HEAD(&dev->crs, res, chain); + + return (0); +} + +int +acpi_device_add_res_fixed_memory32(struct acpi_device *const dev, + const UINT8 write_protected, const UINT32 address, const UINT32 length) +{ + if (dev == NULL) { + return (EINVAL); + } + + struct acpi_resource_list_entry *const res = calloc(1, sizeof(*res)); + if (res == NULL) { + return (ENOMEM); + } + + res->type = ACPI_RESOURCE_TYPE_FIXED_MEMORY32; + res->data.FixedMemory32.WriteProtect = write_protected; + res->data.FixedMemory32.Address = address; + res->data.FixedMemory32.AddressLength = length; + + SLIST_INSERT_HEAD(&dev->crs, res, chain); + + return (0); +} diff --git a/usr.sbin/bhyve/acpi_device.h b/usr.sbin/bhyve/acpi_device.h index 1728acd4cdcd..d9618d7e0a43 100644 --- a/usr.sbin/bhyve/acpi_device.h +++ b/usr.sbin/bhyve/acpi_device.h @@ -29,3 +29,8 @@ struct acpi_device; int acpi_device_create(struct acpi_device **const new_dev, struct vmctx *const vm_ctx, const char *const name, const char *const hid); void acpi_device_destroy(struct acpi_device *const dev); + +int acpi_device_add_res_fixed_ioport(struct acpi_device *const dev, + const UINT16 port, UINT8 length); +int acpi_device_add_res_fixed_memory32(struct acpi_device *const dev, + const UINT8 write_protected, const UINT32 address, const UINT32 length); From nobody Tue Feb 14 07:29:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGCWV0zbyz3rL98; Tue, 14 Feb 2023 07:29: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 4PGCWV0Vjlz4Nsp; Tue, 14 Feb 2023 07:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcTw/GNEQ9aKIV2764G3P9CBnRfaEb7QG6RHQh6dkvg=; b=eM3T3uSCSgdyfBZlrV1Dv14BBgXUNlW7gkakHNi0Aj/pSckFPSqwUnyc/b4Vz6eXFFlQIt hVjVYPYMdgT43rp2uA7nA94c3RB+Ek96R48kNTwXXOceC1US0muy2yqjzis73pDFP3+Lhj Zj8G+jQjzoBi/DHGuwnlURf9GFuX2ECBkLyHSR27A5RMou0n95Hn+gZm6MwKfGDRc/gZyD bspT9fT5597hn5jeifrsRGDYt0JVqziCGqejXCCGbw6//08Q9TVf4WoBFc1WwNwOxuS5Bl Ag5n+CCt7AEm49jodZd2AB/ux+iFv9oABN9UvL8Fabs42Uhxes7rtEEGO9LDgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GcTw/GNEQ9aKIV2764G3P9CBnRfaEb7QG6RHQh6dkvg=; b=andpN7ttDdgsroGjqRAbR4vSr8wQM9ew0s+jEg/2wwutFyZlp5FZwoFukHquTXAWDIKJN2 4ke3t/WXtAYM8RtT5Bn92ZPyqBmY5bFoC1TA1sj4Y66mpKRT/34S5g61hMIsKCJ2HC+6y1 ub8vHXPhAFZw5a4oBjcOjKU8Jt4zIvsFTAmcQjaknyPNKw6BYLGVS6y67aG/Dq8363MYsU jLUJIlDxTUkMa2R285fbuz0Gt/S09qgqyuNBEy8GnuUgNvkRwBTDm8BatxjxkgpAHk5wzt DHe9YLSVacTPKT33Y8SK+ii32i0kzZcQqoBVTJBUi9wkAlMZnQxWyKTfQZQPMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676359750; a=rsa-sha256; cv=none; b=H4nqFZ5EW2ebaVT6QVkOxnEje/+AY7lSH+wrDqI8MRPOrs3fWyP374pkRQJg949tKH6Iet rZDAdcpxzycW4mezQL2tnU2PdgEXHdLz4nk2X87ejmmFVCBHaF0/eBLbmOkeILhec4FOrU FIw0RUoqezGjfk+X214hE77RNTe0e4uuD2qdg/KM4anZnPfWe2ReWmE45yoD373zDgaccx zfN5wCeGFU3QmLWJYYb7RP2HU5ZfEnpU3S8H9YahLJlK0bU15VHUQeEqhhDM+Shk1SFV54 GeH5RYzMF/Nx5LICyDH94Lbr69h1/UeCWb+3a+HE5UhfVmSg/S/Zn8Dk9o5VZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGCWT6Qjmzr2M; Tue, 14 Feb 2023 07:29: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 31E7T9Gn044008; Tue, 14 Feb 2023 07:29:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E7T9Z5044007; Tue, 14 Feb 2023 07:29:09 GMT (envelope-from git) Date: Tue, 14 Feb 2023 07:29:09 GMT Message-Id: <202302140729.31E7T9Z5044007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 682a522d6122 - main - bhyve: add helper func to write a dsdt entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 682a522d61223920f23a202aa57901f38bdfd8dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=682a522d61223920f23a202aa57901f38bdfd8dd commit 682a522d61223920f23a202aa57901f38bdfd8dd Author: Corvin Köhne AuthorDate: 2021-10-07 13:58:27 +0000 Commit: Corvin Köhne CommitDate: 2023-02-14 07:28:27 +0000 bhyve: add helper func to write a dsdt entry The guest will check the dsdt to detect acpi devices. Therefore, add a helper function to create such a dsdt entry for an acpi device. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38329 --- usr.sbin/bhyve/acpi_device.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/acpi_device.h | 2 ++ 2 files changed, 48 insertions(+) diff --git a/usr.sbin/bhyve/acpi_device.c b/usr.sbin/bhyve/acpi_device.c index 402e32faa93a..10259006c619 100644 --- a/usr.sbin/bhyve/acpi_device.c +++ b/usr.sbin/bhyve/acpi_device.c @@ -10,6 +10,7 @@ #include +#include #include #include #include @@ -135,3 +136,48 @@ acpi_device_add_res_fixed_memory32(struct acpi_device *const dev, return (0); } + +static void +acpi_device_write_dsdt_crs(const struct acpi_device *const dev) +{ + const struct acpi_resource_list_entry *res; + SLIST_FOREACH(res, &dev->crs, chain) { + switch (res->type) { + case ACPI_RESOURCE_TYPE_FIXED_IO: + dsdt_fixed_ioport(res->data.FixedIo.Address, + res->data.FixedIo.AddressLength); + break; + case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: + dsdt_fixed_mem32(res->data.FixedMemory32.Address, + res->data.FixedMemory32.AddressLength); + break; + default: + assert(0); + break; + } + } +} + +void +acpi_device_write_dsdt(const struct acpi_device *const dev) +{ + if (dev == NULL) { + return; + } + + dsdt_line(""); + dsdt_line(" Scope (\\_SB)"); + dsdt_line(" {"); + dsdt_line(" Device (%s)", dev->name); + dsdt_line(" {"); + dsdt_line(" Name (_HID, \"%s\")", dev->hid); + dsdt_line(" Name (_STA, 0x0F)"); + dsdt_line(" Name (_CRS, ResourceTemplate ()"); + dsdt_line(" {"); + dsdt_indent(4); + acpi_device_write_dsdt_crs(dev); + dsdt_unindent(4); + dsdt_line(" })"); + dsdt_line(" }"); + dsdt_line(" }"); +} diff --git a/usr.sbin/bhyve/acpi_device.h b/usr.sbin/bhyve/acpi_device.h index d9618d7e0a43..5fb3ea18e481 100644 --- a/usr.sbin/bhyve/acpi_device.h +++ b/usr.sbin/bhyve/acpi_device.h @@ -34,3 +34,5 @@ int acpi_device_add_res_fixed_ioport(struct acpi_device *const dev, const UINT16 port, UINT8 length); int acpi_device_add_res_fixed_memory32(struct acpi_device *const dev, const UINT8 write_protected, const UINT32 address, const UINT32 length); + +void acpi_device_write_dsdt(const struct acpi_device *const dev); From nobody Tue Feb 14 07:29:10 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGCWW1xqmz3rLGT; Tue, 14 Feb 2023 07:29: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 4PGCWW1Wcdz4P2K; Tue, 14 Feb 2023 07:29:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X76R6DzsUWcTUm5nSr10CPAtMzGmKxBod6vxTHkxC1M=; b=IS0ubexkMazLsqTnOOiVbnL1it1d1rwPCbaElMurRBW52mWf084C2pJBXeLs9g4W89Ac9o jPwFheQTXaB8bXLP+eRmnjWekpx+e6YrGmCz+KAoHpbl4wpy8Ur3ACDNdcXM/LNXTYgHz2 pWo4Ata2FBpKQWPjpB5j0NqstSDq7PuG0xNnocLiqpmmvq3JJvNHSo6zwyNbjh5vhxHTuS 911AQ9sMIMRxX50uFquc1O2Aw1qwzxLbdyTxMyiy/5wb30k9lZSN7p4Bexx6Z99o1ciAv7 ozWuo/qIRDwM/3JqMDcx3sJRDt7j62MDXY5fkR0MWVH1Nq7BpA9edSsMiMh6RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X76R6DzsUWcTUm5nSr10CPAtMzGmKxBod6vxTHkxC1M=; b=yRYDrVPDPe/VabaTuImCHI7wLBYcB4vqakkuNEgB6utk0reDb9pLLeDp4RGmlefwHMHv1k JFfE6efXAwjtvQi3pODhOvDZEQHaiZnj9evsaQIEEePVeAJZ2BJ7bfB3WDP122LUIHaeRV 6qg2v2g0ZWG6ZvORKbAMDhI3ma1RANsA/Gadw4KiuFaKlwj1FRv30YYZZMQQ3QnVq2n0o+ DtKgTUDTpdU4r64cvYl6PPZ9/8u/IjhRYxYHGRNzHYlvl/bg1ASA9vLUpCsbxmUk2IRiYt bNVxneZKCrrHfME8EdJIjWLrlGpKd7n0N9M4XptRhS/FL+YW6YT7bZJQZCF18A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676359751; a=rsa-sha256; cv=none; b=fPcNCSdM6br7JUKIDYx/fd7BanXO+EKJDReLft07Qm3e4q+N6vlwXG6LGGXMxkRWdapC4y U1tOuLrTWLYJWblVxeACTyGkKZi7WU76x3z0sbP/Al1R2yJT1xudZqxQJYoeqmNg6ZTZ1F bPLX1zhnc9qQC6wkaxCpFdMFwO5QC1VlmpX5DcD+aiw4G5hlfWixTiophRE4kUvE6dkqxM uX6uKTcQbtu7nxEGMQDhjx5tEKxWiJyj7MFSF89z9pI+/6k1iGyYMGp8cHvpsWzXmPTyaR 85kABasMFSzpalkd5LsaAwjTHhCNRtyxISYFtmPx4JwAxyGxJuf7IZeLFkzM5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGCWW0Fv0zqnW; Tue, 14 Feb 2023 07:29: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 31E7TAbK044037; Tue, 14 Feb 2023 07:29:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E7TAJj044036; Tue, 14 Feb 2023 07:29:10 GMT (envelope-from git) Date: Tue, 14 Feb 2023 07:29:10 GMT Message-Id: <202302140729.31E7TAJj044036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: fbd045021d9f - main - bhyve: maintain a list of acpi devices List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fbd045021d9ffdae5e5bb20e1d1890fd4b46498e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=fbd045021d9ffdae5e5bb20e1d1890fd4b46498e commit fbd045021d9ffdae5e5bb20e1d1890fd4b46498e Author: Corvin Köhne AuthorDate: 2021-10-07 14:14:31 +0000 Commit: Corvin Köhne CommitDate: 2023-02-14 07:28:31 +0000 bhyve: maintain a list of acpi devices The list is used to generate the dsdt entry for every acpi device. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D3830 --- usr.sbin/bhyve/acpi.c | 29 +++++++++++++++++++++++++++++ usr.sbin/bhyve/acpi.h | 3 +++ usr.sbin/bhyve/acpi_device.c | 6 ++++++ 3 files changed, 38 insertions(+) diff --git a/usr.sbin/bhyve/acpi.c b/usr.sbin/bhyve/acpi.c index bdb0e97076ad..84a54cc485c5 100644 --- a/usr.sbin/bhyve/acpi.c +++ b/usr.sbin/bhyve/acpi.c @@ -106,6 +106,30 @@ struct basl_fio { #define EFFLUSH(x) \ if (fflush(x) != 0) goto err_exit; +/* + * A list for additional ACPI devices like a TPM. + */ +struct acpi_device_list_entry { + SLIST_ENTRY(acpi_device_list_entry) chain; + const struct acpi_device *dev; +}; +static SLIST_HEAD(acpi_device_list, + acpi_device_list_entry) acpi_devices = SLIST_HEAD_INITIALIZER(acpi_devices); + +int +acpi_tables_add_device(const struct acpi_device *const dev) +{ + struct acpi_device_list_entry *const entry = calloc(1, sizeof(*entry)); + if (entry == NULL) { + return (ENOMEM); + } + + entry->dev = dev; + SLIST_INSERT_HEAD(&acpi_devices, entry, chain); + + return (0); +} + /* * Helper routines for writing to the DSDT from other modules. */ @@ -219,6 +243,11 @@ basl_fwrite_dsdt(FILE *fp) vmgenc_write_dsdt(); + const struct acpi_device_list_entry *entry; + SLIST_FOREACH(entry, &acpi_devices, chain) { + acpi_device_write_dsdt(entry->dev); + } + dsdt_line("}"); if (dsdt_error != 0) diff --git a/usr.sbin/bhyve/acpi.h b/usr.sbin/bhyve/acpi.h index 50e5337f332a..98479913732c 100644 --- a/usr.sbin/bhyve/acpi.h +++ b/usr.sbin/bhyve/acpi.h @@ -31,6 +31,8 @@ #ifndef _ACPI_H_ #define _ACPI_H_ +#include "acpi_device.h" + #define SCI_INT 9 #define SMI_CMD 0xb2 @@ -55,6 +57,7 @@ struct vmctx; int acpi_build(struct vmctx *ctx, int ncpu); void acpi_raise_gpe(struct vmctx *ctx, unsigned bit); +int acpi_tables_add_device(const struct acpi_device *const dev); void dsdt_line(const char *fmt, ...); void dsdt_fixed_ioport(uint16_t iobase, uint16_t length); void dsdt_fixed_irq(uint8_t irq); diff --git a/usr.sbin/bhyve/acpi_device.c b/usr.sbin/bhyve/acpi_device.c index 10259006c619..047d411deec2 100644 --- a/usr.sbin/bhyve/acpi_device.c +++ b/usr.sbin/bhyve/acpi_device.c @@ -68,6 +68,12 @@ acpi_device_create(struct acpi_device **const new_dev, return (ENOMEM); } + const int error = acpi_tables_add_device(dev); + if (error) { + acpi_device_destroy(dev); + return (error); + } + *new_dev = dev; return (0); From nobody Tue Feb 14 07:29:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGCWX4XhNz3rLB6; Tue, 14 Feb 2023 07:29: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 4PGCWX2F5Wz4P2Y; Tue, 14 Feb 2023 07:29:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UpkmOcBFHwXrtAI2yCvsSW9fh6G6yytzHM/jvb/0zT0=; b=eaviiDCdQu33dBHAG/I3RopGN5wEzNpRFBwHT0Mt9DXxOHkHpxR23MbjFAaww9LhEHEL5y QZNOmwUKLPZDel91aBoqIHl/SfEOMxTwoy0FQmg5iBpCPBZ+h9Nqfb7vRFQ9CAA+NO3zod mDw1R/xqMX6Ssp18ntVd7yu+f/LjK80Bn8xdWWsmzookz9bL+YeHYL/vaFl4DCztrFMCJo PYXq9yWkJnMdxh9bNa2l2zq3TfjPvSeC0d9r8tWhxecoixATHc1CCDywhLlW7u+yoy+qEL ebcJGVReNNDHem4H3mIgwoxPEsQeB2sFWnrgYIn5iofWdmLizbTGWTt0gCXzXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UpkmOcBFHwXrtAI2yCvsSW9fh6G6yytzHM/jvb/0zT0=; b=h9GuA+6n6SeyfA/sMtQe6Z3EDWDSbVJ7SYl68YjPZe/qFaGw81S4vjt8mB1DJGViH7dH6E wY4sPMZsg2RM8M906TidrtONAhIDCnLEpFBR8uutjiJIuweGitHp9HS209FP6Ov6ah4EY3 WzAU9doXIB40uksv/GZXjeSbkPynf1e0SCjE4tE7ZNGPJzUoSuViYJBE5kdHe6dYT6otzY V65PaUusl5rkXrebB+RiCttWJKcz9sGjXI5VzBTj4RDYDEtT12nhVm2Icz000sb/W0/6Q9 ZBcE6LQt+amMNyFyQTQ9xc1gSuMkb8s7XZT+qJzjzqId2L8MwoyasTCy1HO2QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676359752; a=rsa-sha256; cv=none; b=ImkrTiSVXtKGtV4iiE6CE0q79akhIn3xzOm50nPGCYV5bPJHAqShyZBXGm51zJCHXmQu/7 Ppanyu32wmdYa9eljT4CdzvpAXrqElEN/xa/Q0JGJBJVkZlizn4z6PK59Z/BiANbYaoChy UTUqC/PUVQi71G9kRN19awCTO17Y07cCCgOlwAY2F6fv5Eg3m9Z2XlHchJeY60URaMqMmn tI1qCnLFaoLIRoEBIoqJ+5HEK8zPS1cy2iS3e0lC8JUqkM//FSpqtSha8/PjEnl50jHp3D kBR4ff1Qn8wuSiXI/ZZBHind30lE1S2zj2AJi4phYK8fyXL6oK4gH1DtPgGI9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGCWX1D6PzqSP; Tue, 14 Feb 2023 07:29: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 31E7TCVG044068; Tue, 14 Feb 2023 07:29:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E7TCwW044067; Tue, 14 Feb 2023 07:29:12 GMT (envelope-from git) Date: Tue, 14 Feb 2023 07:29:12 GMT Message-Id: <202302140729.31E7TCwW044067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 9b99de77f160 - main - bhyve: add basic qemu fwcfg implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b99de77f16029dd55326e0210072b14ec1ad960 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=9b99de77f16029dd55326e0210072b14ec1ad960 commit 9b99de77f16029dd55326e0210072b14ec1ad960 Author: Corvin Köhne AuthorDate: 2021-08-11 07:58:15 +0000 Commit: Corvin Köhne CommitDate: 2023-02-14 07:28:37 +0000 bhyve: add basic qemu fwcfg implementation qemu's fwcfg and bhyve's fwctl are both used to configure ovmf. qemu's fwcfg is much more powerfull than bhyve's fwctl. For that reason, add support for qemu's fwcfg. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38331 --- usr.sbin/bhyve/qemu_fwcfg.c | 114 ++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/qemu_fwcfg.h | 12 +++++ 2 files changed, 126 insertions(+) diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c new file mode 100644 index 000000000000..5d3070abf285 --- /dev/null +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -0,0 +1,114 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG + * Author: Corvin Köhne + */ + +#include + +#include + +#include +#include +#include +#include + +#include "acpi_device.h" +#include "inout.h" +#include "qemu_fwcfg.h" + +#define QEMU_FWCFG_ACPI_DEVICE_NAME "FWCF" +#define QEMU_FWCFG_ACPI_HARDWARE_ID "QEMU0002" + +#define QEMU_FWCFG_SELECTOR_PORT_NUMBER 0x510 +#define QEMU_FWCFG_SELECTOR_PORT_SIZE 1 +#define QEMU_FWCFG_SELECTOR_PORT_FLAGS IOPORT_F_INOUT +#define QEMU_FWCFG_DATA_PORT_NUMBER 0x511 +#define QEMU_FWCFG_DATA_PORT_SIZE 1 +#define QEMU_FWCFG_DATA_PORT_FLAGS \ + IOPORT_F_INOUT /* QEMU v2.4+ ignores writes */ + +struct qemu_fwcfg_softc { + struct acpi_device *acpi_dev; +}; + +static struct qemu_fwcfg_softc fwcfg_sc; + +static int +qemu_fwcfg_selector_port_handler(struct vmctx *const ctx __unused, const int in, + const int port __unused, const int bytes, uint32_t *const eax, + void *const arg __unused) +{ + return (0); +} + +static int +qemu_fwcfg_data_port_handler(struct vmctx *const ctx __unused, const int in, + const int port __unused, const int bytes, uint32_t *const eax, + void *const arg __unused) +{ + return (0); +} + +static int +qemu_fwcfg_register_port(const char *const name, const int port, const int size, + const int flags, const inout_func_t handler) +{ + struct inout_port iop; + + bzero(&iop, sizeof(iop)); + iop.name = name; + iop.port = port; + iop.size = size; + iop.flags = flags; + iop.handler = handler; + + return (register_inout(&iop)); +} + +int +qemu_fwcfg_init(struct vmctx *const ctx) +{ + int error; + + error = acpi_device_create(&fwcfg_sc.acpi_dev, ctx, + QEMU_FWCFG_ACPI_DEVICE_NAME, QEMU_FWCFG_ACPI_HARDWARE_ID); + if (error) { + warnx("%s: failed to create ACPI device for QEMU FwCfg", + __func__); + goto done; + } + + error = acpi_device_add_res_fixed_ioport(fwcfg_sc.acpi_dev, + QEMU_FWCFG_SELECTOR_PORT_NUMBER, 2); + if (error) { + warnx("%s: failed to add fixed IO port for QEMU FwCfg", + __func__); + goto done; + } + + /* add handlers for fwcfg ports */ + if ((error = qemu_fwcfg_register_port("qemu_fwcfg_selector", + QEMU_FWCFG_SELECTOR_PORT_NUMBER, QEMU_FWCFG_SELECTOR_PORT_SIZE, + QEMU_FWCFG_SELECTOR_PORT_FLAGS, + qemu_fwcfg_selector_port_handler)) != 0) { + warnx("%s: Unable to register qemu fwcfg selector port 0x%x", + __func__, QEMU_FWCFG_SELECTOR_PORT_NUMBER); + goto done; + } + if ((error = qemu_fwcfg_register_port("qemu_fwcfg_data", + QEMU_FWCFG_DATA_PORT_NUMBER, QEMU_FWCFG_DATA_PORT_SIZE, + QEMU_FWCFG_DATA_PORT_FLAGS, qemu_fwcfg_data_port_handler)) != 0) { + warnx("%s: Unable to register qemu fwcfg data port 0x%x", + __func__, QEMU_FWCFG_DATA_PORT_NUMBER); + goto done; + } + +done: + if (error) { + acpi_device_destroy(fwcfg_sc.acpi_dev); + } + + return (error); +} diff --git a/usr.sbin/bhyve/qemu_fwcfg.h b/usr.sbin/bhyve/qemu_fwcfg.h new file mode 100644 index 000000000000..26c4db0ff71e --- /dev/null +++ b/usr.sbin/bhyve/qemu_fwcfg.h @@ -0,0 +1,12 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG + * Author: Corvin Köhne + */ + +#pragma once + +#include + +int qemu_fwcfg_init(struct vmctx *const ctx); From nobody Tue Feb 14 07:29:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGCWY40Lkz3rLK4; Tue, 14 Feb 2023 07:29: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 4PGCWY36yBz4P0d; Tue, 14 Feb 2023 07:29:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mAmb7RUF3PhoaaNF6H33XfxjjbRB9gBlTaKZ6asf4UU=; b=W61Np3WMqxaLztf/ElH2/cTz+eD21tfClSZQ4GihYuZQuZKQ077TBmsT/Bh2smFm/hHuw3 /6XQE8Qk2iMH5MpXYkSjxd+yNManUcW3+z/zRG8PpEPb1NDFH/GBHF0HsJCbDOnb73Pyv0 SbOXweWYD81dOpPZAF1S8oPznZvs29bgfIXrDRmuTZDBvcTVUgCyx72MDeBURn4txBUgFM 6WA3PTeRgY03xWcozP8R8kNH9plUBmp+jhGbC67upjhYVzH0AgYRmvz0sCEcToSv4c7wcd GezdE5MEpc6ijSMvDzoXq26Z3OpCpcViSTh3Mbnq0j30sfAK4QZgCvt9cU+RMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mAmb7RUF3PhoaaNF6H33XfxjjbRB9gBlTaKZ6asf4UU=; b=JZWzWUO/cCiKAcwCYeoCFxwu5gpHN4SdHV3tEbtfJ7HGoIyIj0qbkkFEsGfUN96cwyKOzQ 3l5O8Fseud72nSsqaWGZRBR1PWSMbr3z5cSxSWym8zIfGCE/Wt8oer1FxBQLXcQAmSIJBJ VIKcTKjT5tRTdFcqo9vIgC9kvb10moZ2s9+SwRHkWtBKfSxmwj50oK1PTp8ZvZ5giDinmB wL6+04Jx9bPxbW8A+qv/rDtBPv2dem6d82BVs/Lc2RC0QrsDHB9Mj5gDI5zGkTO25EVXtd dauB/SA8aW+Zhsc+MDfrlTgOIZG0OzPGt4nwyEb+mSRp7euKZ1ScgYNZDycDEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676359753; a=rsa-sha256; cv=none; b=gQM/632o6Y7a8WRM5Yk7E81EGrlhhKyk7HK11CI41/SlvBVDGW1awsPJ9XVQg4hlbV69+2 7fib/LEdy4CwLIpBuVBLbblLn2WqhLGofnS1Ykt16xfEpeixjFoS0PhiOQtwoe2Aoye/h3 MKkykgPBUsD8oDVmbzQCzP/a5cCuGaGPajrDd+enJWGWJbxLI8ShOHI7C0+zZBBz3mYg6F TnsHHCU46zmy2CGy1bzbML4kiMe5veCRR4Q2Ed0K1dFFv2I+GqJAHvlLXYoU8xm+j+vTj+ KM75vC8/3quI6S9MQZSVtSjY3qz8LhktWMhUR9Da8u2Ld/RiEIfyh4Mc4+Zmhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGCWY299czqnX; Tue, 14 Feb 2023 07:29:13 +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 31E7TDDB044097; Tue, 14 Feb 2023 07:29:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E7TDtA044096; Tue, 14 Feb 2023 07:29:13 GMT (envelope-from git) Date: Tue, 14 Feb 2023 07:29:13 GMT Message-Id: <202302140729.31E7TDtA044096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 151d8131a817 - main - bhyve: add emulation for the qemu fwcfg selector port List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 151d8131a817e7a6a629e9bb7fde4d7a158e5211 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=151d8131a817e7a6a629e9bb7fde4d7a158e5211 commit 151d8131a817e7a6a629e9bb7fde4d7a158e5211 Author: Corvin Köhne AuthorDate: 2021-08-11 07:59:16 +0000 Commit: Corvin Köhne CommitDate: 2023-02-14 07:28:43 +0000 bhyve: add emulation for the qemu fwcfg selector port The selector port is used to select the desired fwcfg item. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38332 --- usr.sbin/bhyve/qemu_fwcfg.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c index 5d3070abf285..dec3fa83c493 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.c +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -29,8 +29,33 @@ #define QEMU_FWCFG_DATA_PORT_FLAGS \ IOPORT_F_INOUT /* QEMU v2.4+ ignores writes */ +#define QEMU_FWCFG_ARCHITECTURE_MASK 0x0001 +#define QEMU_FWCFG_INDEX_MASK 0x3FFF + +#define QEMU_FWCFG_SELECT_READ 0 +#define QEMU_FWCFG_SELECT_WRITE 1 + +#define QEMU_FWCFG_ARCHITECTURE_GENERIC 0 +#define QEMU_FWCFG_ARCHITECTURE_SPECIFIC 1 + +#pragma pack(1) + +union qemu_fwcfg_selector { + struct { + uint16_t index : 14; + uint16_t writeable : 1; + uint16_t architecture : 1; + }; + uint16_t bits; +}; + +#pragma pack() + struct qemu_fwcfg_softc { struct acpi_device *acpi_dev; + + uint32_t data_offset; + union qemu_fwcfg_selector selector; }; static struct qemu_fwcfg_softc fwcfg_sc; @@ -40,6 +65,20 @@ qemu_fwcfg_selector_port_handler(struct vmctx *const ctx __unused, const int in, const int port __unused, const int bytes, uint32_t *const eax, void *const arg __unused) { + if (bytes != sizeof(uint16_t)) { + warnx("%s: invalid size (%d) of IO port access", __func__, + bytes); + return (-1); + } + + if (in) { + *eax = htole16(fwcfg_sc.selector.bits); + return (0); + } + + fwcfg_sc.data_offset = 0; + fwcfg_sc.selector.bits = le16toh(*eax); + return (0); } From nobody Tue Feb 14 07:29:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGCWZ4slmz3rL8D; Tue, 14 Feb 2023 07:29: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 4PGCWZ45JPz4PBJ; Tue, 14 Feb 2023 07:29:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=majAo9FNHCGpUDPQgNCAgQVWKqHm+VxY+YOIXayr+h4=; b=i+m1QiTtJP3nnNVX1YAgxQSMg1fNS5aWY7LFRvcTkD03YqQJuo2hp0AL7j+F7GT3rzmswz 1lhtb/pIwZi/mMZTN+H/zrpE9pmsXU3WFalCHvcQULsNQJWyWOeVjtHBYiCTSFEj7Y5NPG l9umYwhNvmESIyi57b+2oGd435aRb4DMllKW6jgQI6kBqAGE6bCObRt4/clN0bXq/x/U2R 5bUGpYlm8uQHezZJUGZOewq5JxCbvuqYyeKSmTOOIJHn4QTiS4jtEZQAJuBebJHGzBJxxP szfqBHyMwBiHXrX9eqKOo04QAxb7ZGw2p8DGxDAZqdMAUFc8tGyheRuYbidQNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676359754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=majAo9FNHCGpUDPQgNCAgQVWKqHm+VxY+YOIXayr+h4=; b=hewU5TXREVloGdSSDKsE+xFSh3auggZmnriQ9G1B+tu1+vfomsJ1mM+5vJ++rnxgcQkdjO 8mM96cn0siItjYkbwyhKB6XWC8CN2lIxAQX+5KTKLQbRqKZWzI8d7EhDz58D1JycmPdSYN +OcFW1irqUk1EbmWANrvcv75bC5hwTpw50pkTN2/0yNYsx/j/P+6SZi2Jb83/lHv7XR+Hr BuiLHUSxzdTcc9lAggdkmTHMt7cXoBMwD5T/3S6rvoyPFkgaSw8DFH2trw9WNiVJfVV0Tm lJhSG/uYTF/eIaXbVMHLIY1L1bLlkTo/s0vxp1n9vGdi+1wlWIgwV3nXZCrliQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676359754; a=rsa-sha256; cv=none; b=soaHdX0qMy+a89E4rWAYmfsZ9oLb5/Lz01M3eOf/2mgd7/8s4rMJrGtIjLds7LvAHX+fqU 8/jNlUKn+gz3kSFG7yFW+XSdr3SDSoE3C4mvjo1iUl+u3A9c8eRQv63musqVzWvOmDL+Td MpyoHyzUPO+tcbpTsNLNtNA0Z7DkTZZCnIon5k8Q4rIkrTHuYsajkKJO+tG7zftZyvzY7A vn9p8m233tTZ2gPAi8lLw2nmNSdtiGLoV8QRcy3G94Q1pZYWxk1hYqTG1XZ1In1h+sOvJT 5y//nGG5k+fBe01cfEiwsqosZPNQOEGKrInrKIKr42YD2bBgcOQBE02268vvYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGCWZ38XwzqnY; Tue, 14 Feb 2023 07:29: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 31E7TE3N044135; Tue, 14 Feb 2023 07:29:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E7TEUv044134; Tue, 14 Feb 2023 07:29:14 GMT (envelope-from git) Date: Tue, 14 Feb 2023 07:29:14 GMT Message-Id: <202302140729.31E7TEUv044134@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: b11081dca76b - main - bhyve: add emulation for qemu's fwcfg data port List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b11081dca76b8e283495632b86b41539ee013857 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=b11081dca76b8e283495632b86b41539ee013857 commit b11081dca76b8e283495632b86b41539ee013857 Author: Corvin Köhne AuthorDate: 2021-08-11 08:00:34 +0000 Commit: Corvin Köhne CommitDate: 2023-02-14 07:28:49 +0000 bhyve: add emulation for qemu's fwcfg data port The data port returns the data of the fwcfg item. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38333 --- usr.sbin/bhyve/qemu_fwcfg.c | 40 ++++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/qemu_fwcfg.h | 8 ++++++++ 2 files changed, 48 insertions(+) diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c index dec3fa83c493..13e21daca7ff 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.c +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -56,6 +56,8 @@ struct qemu_fwcfg_softc { uint32_t data_offset; union qemu_fwcfg_selector selector; + struct qemu_fwcfg_item items[QEMU_FWCFG_MAX_ARCHS] + [QEMU_FWCFG_MAX_ENTRIES]; }; static struct qemu_fwcfg_softc fwcfg_sc; @@ -87,6 +89,44 @@ qemu_fwcfg_data_port_handler(struct vmctx *const ctx __unused, const int in, const int port __unused, const int bytes, uint32_t *const eax, void *const arg __unused) { + if (bytes != sizeof(uint8_t)) { + warnx("%s: invalid size (%d) of IO port access", __func__, + bytes); + return (-1); + } + + if (!in) { + warnx("%s: Writes to qemu fwcfg data port aren't allowed", + __func__); + return (-1); + } + + /* get fwcfg item */ + struct qemu_fwcfg_item *const item = + &fwcfg_sc.items[fwcfg_sc.selector.architecture] + [fwcfg_sc.selector.index]; + if (item->data == NULL) { + warnx( + "%s: qemu fwcfg item doesn't exist (architecture %s index 0x%x)", + __func__, + fwcfg_sc.selector.architecture ? "specific" : "generic", + fwcfg_sc.selector.index); + *eax = 0x00; + return (0); + } else if (fwcfg_sc.data_offset >= item->size) { + warnx( + "%s: qemu fwcfg item read exceeds size (architecture %s index 0x%x size 0x%x offset 0x%x)", + __func__, + fwcfg_sc.selector.architecture ? "specific" : "generic", + fwcfg_sc.selector.index, item->size, fwcfg_sc.data_offset); + *eax = 0x00; + return (0); + } + + /* return item data */ + *eax = item->data[fwcfg_sc.data_offset]; + fwcfg_sc.data_offset++; + return (0); } diff --git a/usr.sbin/bhyve/qemu_fwcfg.h b/usr.sbin/bhyve/qemu_fwcfg.h index 26c4db0ff71e..58ef5ed3c6bf 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.h +++ b/usr.sbin/bhyve/qemu_fwcfg.h @@ -9,4 +9,12 @@ #include +#define QEMU_FWCFG_MAX_ARCHS 0x2 +#define QEMU_FWCFG_MAX_ENTRIES 0x4000 + +struct qemu_fwcfg_item { + uint32_t size; + uint8_t *data; +}; + int qemu_fwcfg_init(struct vmctx *const ctx); From nobody Tue Feb 14 08:45:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGFCX6k3nz3rQk6; Tue, 14 Feb 2023 08:45:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGFCX6DQVz3K7m; Tue, 14 Feb 2023 08:45:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676364328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7DvzWf02z2h1sCQ9goDklyMfoucqG/Xvg2r45IVmbTs=; b=jqaFrkKA5jlgjWjRNqY+Rx3u6rwZa4kDr82ic20X7r7xDdkktt9UuwZrGP1x8rhdGZ90Sd Diwy0+JPh/C7r/qa0CId95/1oAc22B+lgCGEFMRKyV/OAAvEg0hrBuFOQJg0RajOCMPQiR 6Dy4xlNiPZqh8BYRsM/c9LlCNIcx3VXyOnQPrl+050NUD52/U5rw4n5hxANV7DpmnhbY6Q 8KB6rAL2lDalEu/bxtEGduBAxlg7fUPG6DhZKGtcl3RwvxmO+2q/TAkB3bV2yG7XV60MsG A69vmn04Vgh6nCO9Sd0++wSg71Eoq3pXHxbfmO1AAYf6tMnGsbeM1DjiLQkNsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676364328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7DvzWf02z2h1sCQ9goDklyMfoucqG/Xvg2r45IVmbTs=; b=N19z+SLNIfjIT0rlxoNFElCG0IpvrNsTQZ6oi1W42ApnQ0DxGUtmV7grVcIBmGSd6P6hhZ +0T7OWuNkcQtxDkgMREnjWNoJrE0W5lTOopjqsbkUzAYD4WBV3ztfYNgALZ0hwZjWkRVG5 g64NXU24OmPrAumQEUd+bH6eEPwMhUhX6mF0TlizD7XpR1F3JqkqOPMZH7evj5GsLahKaT r77JQEov2/P2t9SbxyNZQBNQOK+2ZFzE5s2cQHFzxE4MWFGEeR6Lw9ffEssvzGIUz792mS U+XUL1pT0tW8Nx9jjTGfQzIdfv4bwSL1ahpbYXQcBenVB0KtPWGlXm83kZKIow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676364328; a=rsa-sha256; cv=none; b=yGzabuAPJkF7LDbDxkHYdUrrHXVYos8EyHMvtvW0NaWN8QKJ4oSMB+QT1Hx4SDtXvkJgB7 mVZCG0lbGRso3paphjAex7GXMwO5ycVCrsCCef+Y0YP3VEirhqJL9FB8mWX9jEUyCHzuZ8 ZzWKvDB+aB8Z0vsZXvqNTCU/IKcVWddDFJNkj1m38T2OHkDVEWrxhMT8HX7fYlqrFPsIp0 s31fWkrtvZVvpL+ZXMuH09T66UcjDolMdRn7BI8CCpfNqv8cun0G5qPbo0H7rV8CwX9eIZ 6WZOsEQCatWE3yP3chPwvrdC66Hmwshp95F1U9gfslFNA+D6ePK3XzpLSofLRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGFCX5Gfgzsc6; Tue, 14 Feb 2023 08:45: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 31E8jSSL057363; Tue, 14 Feb 2023 08:45:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31E8jSsw057362; Tue, 14 Feb 2023 08:45:28 GMT (envelope-from git) Date: Tue, 14 Feb 2023 08:45:28 GMT Message-Id: <202302140845.31E8jSsw057362@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: 3f1f48f1d95a - main - stress2: Add a regression test for D38549 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 3f1f48f1d95a4923a557e34acc047a3ef8630532 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=3f1f48f1d95a4923a557e34acc047a3ef8630532 commit 3f1f48f1d95a4923a557e34acc047a3ef8630532 Author: Peter Holm AuthorDate: 2023-02-14 08:44:58 +0000 Commit: Peter Holm CommitDate: 2023-02-14 08:44:58 +0000 stress2: Add a regression test for D38549 --- tools/test/stress2/misc/msdos18.sh | 250 +++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) diff --git a/tools/test/stress2/misc/msdos18.sh b/tools/test/stress2/misc/msdos18.sh new file mode 100755 index 000000000000..faeed9dca944 --- /dev/null +++ b/tools/test/stress2/misc/msdos18.sh @@ -0,0 +1,250 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 Peter Holm +# +# 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. +# + +# D38549: msdosfs deextend: validate pages of the partial buffer + +# https://people.freebsd.org/~pho/stress/log/log0420.txt + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +set -eu +prog=$(basename "$0" .sh) +mkdir -p $mntpoint +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 1g -u $mdstart +newfs_msdos /dev/md$mdstart > /dev/null 2>&1 +mount -t msdosfs /dev/md$mdstart $mntpoint +mount | grep $mntpoint +set +e + +odir=`pwd` + +cd /tmp +sed '1,/^EOF/d' < $odir/$0 > $prog.c +cc -o $prog -Wall -O0 $prog.c -pthread || exit 1 +rm -f $prog.c +cd $mntpoint + +in=inputFile +out=outputFile + +/tmp/$prog $in $out 12345 +ls -al + +cd $odir +umount $mntpoint +mdconfig -d -u $mdstart +rm -f /tmp/$prog +exit +EOF +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int fd, port; +volatile int go; +char *inputFile; +char *outputFile; + +#define FSIZE 936374 +char buf[FSIZE]; + +static void +reader(void) { + struct sockaddr_in inetaddr, inetpeer; + socklen_t len; + int on, n, tcpsock, msgsock; + + on = 1; + if ((tcpsock = socket(AF_INET, SOCK_STREAM, 0)) < 0) + err(1, "socket(), %s:%d", __FILE__, __LINE__); + + if (setsockopt(tcpsock, + SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) < 0) + err(1, "setsockopt(), %s:%d", __FILE__, __LINE__); + + inetaddr.sin_family = AF_INET; + inetaddr.sin_addr.s_addr = INADDR_ANY; + inetaddr.sin_port = htons(port); + inetaddr.sin_len = sizeof(inetaddr); + + if (bind(tcpsock, + (struct sockaddr *)&inetaddr, sizeof (inetaddr)) < 0) + err(1, "bind(), %s:%d", __FILE__, __LINE__); + + if (listen(tcpsock, 5) < 0) + err(1, "listen(), %s:%d", __FILE__, __LINE__); + + len = sizeof(inetpeer); + if ((msgsock = accept(tcpsock, + (struct sockaddr *)&inetpeer, &len)) < 0) + err(1, "accept(), %s:%d", __FILE__, __LINE__); + + if ((fd = open(outputFile, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1) + err(1, "open(%s)", outputFile); + + usleep(arc4random() % 1000); + for (;;) { + if ((n = read(msgsock, buf, FSIZE)) < 0) + err(1, "read(), %s:%d", __FILE__, __LINE__); + if (n == 0) + break; + + } + close(msgsock); + close(tcpsock); + close(fd); + return; +} + +static void * +thr(void *data __unused) +{ + pthread_set_name_np(pthread_self(), __func__); + go = 1; + while (go == 1) { + ftruncate(fd, FSIZE / 2); + ftruncate(fd, FSIZE); + } + + return (NULL); +} + +static void +writer(void) { + struct hostent *hostent; + struct sockaddr_in inetaddr; + pthread_t tid; + off_t off = 0; + size_t size; + int i, on, r, tcpsock; + + on = 1; + for (i = 1; i < 5; i++) { + if ((tcpsock = socket(AF_INET, SOCK_STREAM, 0)) < 0) + err(1, "socket(), %s:%d", __FILE__, __LINE__); + + if (setsockopt(tcpsock, + SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) < 0) + err(1, "setsockopt(), %s:%d", __FILE__, __LINE__); + + size = getpagesize(); + if (setsockopt(tcpsock, SOL_SOCKET, SO_SNDBUF, (void *)&size, + sizeof(size)) < 0) + err(1, "setsockopt(SO_SNDBUF), %s:%d", + __FILE__, __LINE__); + + hostent = gethostbyname ("localhost"); + memcpy (&inetaddr.sin_addr.s_addr, hostent->h_addr, + sizeof (struct in_addr)); + + inetaddr.sin_family = AF_INET; + inetaddr.sin_port = htons(port); + inetaddr.sin_len = sizeof(inetaddr); + + r = connect(tcpsock, (struct sockaddr *) &inetaddr, + sizeof(inetaddr)); + if (r == 0) + break; + sleep(1); + close(tcpsock); + } + if (r < 0) + err(1, "connect(), %s:%d", __FILE__, __LINE__); + + if ((fd = open(inputFile, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1) + err(1, "open(%s)", inputFile); + + if (write(fd, buf, sizeof(buf)) != sizeof(buf)) + err(1, "write()"); + + r = pthread_create(&tid, NULL, thr, NULL); + if (r) + errc(1, r, "pthread_create"); + + usleep(5000); + if (sendfile(fd, tcpsock, 0, FSIZE, NULL, &off, 0) == -1) + err(1, "sendfile"); + + usleep(arc4random() % 20000); + go = 0; + if ((r = pthread_join(tid, NULL)) != 0) + errc(1, r, "pthread_join"); + + _exit(0); +} + +int +main(int argc, char **argv) +{ + pid_t pid; + time_t start; + + if (argc != 4) { + fprintf(stderr, "Usage: %s 0) { + reader(); + kill(pid, SIGINT); + if (waitpid(pid, NULL, 0) != pid) + err(1, "waitpid()"); + } else + err(1, "fork(), %s:%d", __FILE__, __LINE__); + } + + return (0); +} From nobody Tue Feb 14 10:48:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGHxx4DHyz3rXW6; Tue, 14 Feb 2023 10:48: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 4PGHxx3N3Bz3m8T; Tue, 14 Feb 2023 10:48:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676371733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B4zuM5bVKwR0j1nv7LXdmRc4Fl1r+qmtGgmYQyx2xBA=; b=pLHSySifKEm19i4wOnnWH0pgZp4pTv4Asnuej2tcMUgonIK/e35KwuCgrba9/kHYp1wtWX F36Bko5rGQW8t0WJ15c+NouSu/8NBdqWe9jZlXww+q6Gos8k8NSC0TYalC9qy1OjxzIaR/ 2ThiKEwNtslIh1ITKChukVqv+6YFAEo+Bezc89XjVi24Kb0DOGl/2IioxOITd9oimCo+Fp S25J4IltpfwpmoV0nA50rhBVuvp1RBV1mPFcxOOCxRmDWCt6JeTGLlTtx8KciZyYAJqy0h PTXgFXRqEGYMditJqmnHti3exyt35Mz6Vjyvm/jdQlE2VVPzvJ9+Q+WTc381iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676371733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B4zuM5bVKwR0j1nv7LXdmRc4Fl1r+qmtGgmYQyx2xBA=; b=Vt9COqgoy0wn0NULliGnrZhvIbl8HWGZ6hWMnfMzXZt45+3i85QOi+kHWZlEP1wf3ZmMSk aRZqqtt8v1Wnyot39Qq06TxaeLxNrJtUtsAxxg5dKHsC4BecfiKlh7DfJ85HDJxlhbMdYj wGY8NISj0SlII4tzbs0Fb20GNYvJUk554voIYypn/hkHXk074UHN8QRQlwnoUoSMlEjYSL GoqdPFrw9cUb+18AIIwIVCBDCC5EkK5n00X9ZqhRhpfWtWhXJD675u/aAW92oA9L800gdu ZxR1zHYVZBR1KlTl6jp6+XQR8zTBfVWaj++kUnfbCeNLyZ7roP5MaGye5Wnbsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676371733; a=rsa-sha256; cv=none; b=IGzzZPTD0mjjCnszbL1WkaBxcuTuuSpGsB8armA+J6JM+pT0mmgoP331Cn8NIOkLGQGJSU V07cj8iqivFBKXuv9vvpXpEaymfym3Npa9RZcQ88fXoXDeutxOrxC41EWB3OoGtoHlAD7u dcpZRBGCnsMOOxqhdnfYCKPe6etuTDDN80A+8lg/xwGHLR5Ts/X7z+Xw4n4qUe+EeBnxrB xpGUhyP0aTlNOEaiVK3RpNtMVA6aA0QAWyLikkLbuKOW1W811vVmAGiJk5xnG4VndxxxrI B8zmBMZ3CZ6/9CzjFW2IUGH45QGpZ1G9l+qgNgXlAoGCtkK2kCK+3NN8N1TfUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGHxx2G84zwQT; Tue, 14 Feb 2023 10:48: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 31EAmr4F028791; Tue, 14 Feb 2023 10:48:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EAmr1L028790; Tue, 14 Feb 2023 10:48:53 GMT (envelope-from git) Date: Tue, 14 Feb 2023 10:48:53 GMT Message-Id: <202302141048.31EAmr1L028790@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: 31a252876889 - main - stress2: Add UFS+SU test scenario List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 31a2528768894c46751974b7efbbfb3db0f01c5e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=31a2528768894c46751974b7efbbfb3db0f01c5e commit 31a2528768894c46751974b7efbbfb3db0f01c5e Author: Peter Holm AuthorDate: 2023-02-14 10:48:18 +0000 Commit: Peter Holm CommitDate: 2023-02-14 10:48:18 +0000 stress2: Add UFS+SU test scenario --- tools/test/stress2/misc/creat.sh | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/tools/test/stress2/misc/creat.sh b/tools/test/stress2/misc/creat.sh new file mode 100755 index 000000000000..45f6b0f87301 --- /dev/null +++ b/tools/test/stress2/misc/creat.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 Peter Holm +# +# 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. +# + +# Demonstrate incorrect "out of inodes" message with SU enabled. +# No issue seen with SU+J + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +set -eu +prog=$(basename "$0" .sh) +log=/tmp/$prog.log +s=0 +mount | grep -q "on $mntpoint " && umount $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 100m -u $mdstart +[ $# -eq 1 ] && flags="$@" || flags="-Un" +echo "newfs $flags /dev/md$mdstart" +newfs $flags /dev/md$mdstart > /dev/null +mount /dev/md$mdstart $mntpoint +set +e + +ifree1=`df -i $mntpoint | tail -1 | awk '{print $7}'` +before=`df -i $mntpoint` +n=$(((ifree1 - 5) / 10)) +jot 10 | xargs -I% mkdir $mntpoint/% +start=`date +%s` +while [ $((`date +%s` - start)) -lt 60 ]; do + for j in `jot 10`; do + ( + jot $n | xargs -P0 -I% touch $mntpoint/$j/% + jot $n | xargs -P0 -I% rm $mntpoint/$j/% + ) & + done + wait +done 2>&1 | tee $log | head -5 +[ -s $log ] && s=3 +jot 10 | xargs -I% rmdir $mntpoint/% +umount $mntpoint; mount /dev/md$mdstart $mntpoint + +ifree2=`df -i $mntpoint | tail -1 | awk '{print $7}'` +after=`df -i $mntpoint | tail -1` +if [ $ifree1 -ne $ifree2 ]; then + echo "$before" + echo "$after" + s=1 + ls -alsrt $mntpoint | head -20 +fi + +umount $mntpoint +fsck -fy /dev/md$mdstart > $log 2>&1 +grep -Eq "WAS MODIFIED" $log && { s=2; cat $log; } + +mdconfig -d -u $mdstart +rm -f $log +exit $s From nobody Tue Feb 14 13:15:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGMCb3rMVz3rxFJ; Tue, 14 Feb 2023 13:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGMCb3LkWz3yDq; Tue, 14 Feb 2023 13:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676380555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RAa4I7a3tcfBbaVqKeQCO9E3+Kd/1eEPcYeqvsIcqa0=; b=tXFzSVDPcjfT7h2cJIgRzKTpksRBGkZbsLeh2Sel2zlOOtEQI2mQwjWXqaXblbhL8hz4H7 0ZZeJDELp/6LCMXmS2nYMl43Faxj14SMR+JxIhBTQhxYjzrLrfkR4qZmf8dDIMcKGHDNLv KG2bgMe6MqpTVzFEWqgJt4OvMRnFBLlBAXmPvPjcNLktzq0NZsCDKrX2zVlNk+SfNULFKd 50hy2KWRsur9hv2IOMKvaB7GwdqOmZpHh8M1S9FO6x8cD6AQ94aOY1DEQCVF0WfbFSZaTj edsOCT1P8TeExcHVxzieHu/3BRf/iCRyqRpfT2UuSRZgyRklEvUKTbaxJbQ0Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676380555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RAa4I7a3tcfBbaVqKeQCO9E3+Kd/1eEPcYeqvsIcqa0=; b=TyZs2xZydEqIhEgVeSxEQx9L3b+DHLYme7Ti19dyD9fTjICynwKuOmqwMcqudTucWHZtYq VocM36UqntwSnRWMqMbYBMpBArpuD8D7RsrmZlbBYStw8qey9/dU0TfsKMxwqTsUzbCTrA xlmImJbrvI5gzOFaoaRWZKnTrdb/L1fw9jN+NBhAI8FLRHehgnBIExwMm8PEpi6jwjuu7H sgPk34o/8PFQQaim0gfyzjmS4KG/Vnt3qjCOu04Gn0WXFF7af1XaMbNJzf1frV12GM+1Jz JlA72HBbfkrBCuPlJtjn9lleGAIYqVAgXUGCBA1ugo/ckr7VT/tk1MCXcVE3KQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676380555; a=rsa-sha256; cv=none; b=yEx1JP/xIrsAHqqLtQgvb9u0UkkYbqyRjgNdv6B++U8/09lBREtOy3Y0FX6mygPT9Z/CmB cApmsgLA1+pImERmObGgg5wETuZxYNxL0LMl4oOYg+Xif+9XUPmkTFyZh5FwDSyBPBGaJc jixUw8H5IHh8RUDQ4SMzHLilcaVW6heNZ8DN+eDNM2lo0NaP+QxhAzpeVrjpTh+LrqTKRU 2QvJl+V2p3qzb3UUpeELfVo5byBPMenUZZpFE0MAdZhBsBOG5U7NkIaibv7sd5MN2bafXA 9233FzrXSpopUJZ7ssx2UjhfdEapP4BAELeN+fGYekJzIUx9WHk+B5bKsP017g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGMCb2NpFz10G3; Tue, 14 Feb 2023 13:15:55 +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 31EDFtZI044356; Tue, 14 Feb 2023 13:15:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EDFtSA044355; Tue, 14 Feb 2023 13:15:55 GMT (envelope-from git) Date: Tue, 14 Feb 2023 13:15:55 GMT Message-Id: <202302141315.31EDFtSA044355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: b4eab621f246 - main - kbdcontrol.c: make pre-Unicode compatibility conditional List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4eab621f2462574d1836c199dc84c5bdb4f60f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=b4eab621f2462574d1836c199dc84c5bdb4f60f7 commit b4eab621f2462574d1836c199dc84c5bdb4f60f7 Author: Stefan EĂźer AuthorDate: 2023-02-14 12:27:27 +0000 Commit: Stefan EĂźer CommitDate: 2023-02-14 12:27:27 +0000 kbdcontrol.c: make pre-Unicode compatibility conditional Support for the full range of Unicode character codes has been added to the main keymap back in 2009, with compatibility shims added in 2011 (to support an older kbdcontrol command on a new kernel during an upgrade from FreeBSD-8 to FreeBSD-9). Unicode support for accented characters that are reached via dead key combinations has been added just recently, again with compatibility shims to allow all combinations of old/new kernel and old/new kbdcontrol command to load and display the keymaps including the dead key table. (But full Unicode in the dead key table requires both a new kernel and kbdcontrol command.) This commit makes the compatibility shims depend on the respective compatibility ioctls (OGIO_KEYMAP, OPIO_KEYMAP, OGIO_DEADKEYMAP, and OPIO_DEADKEYMAP) being defined in sys/kbio.h. This is true for all of them in 13-STABLE, none in 12-STABLE (as of now), and will become optional due to a follow-up commit to sys/kbio.h in -CURRENT. This commit is the only part of review D38465 that should be merged back to 12-STABLE and 13-STABLE. MFC after: 1 month --- usr.sbin/kbdcontrol/kbdcontrol.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index 725d62a7bfe6..44f34f9a4f3a 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -818,6 +818,7 @@ add_keymap_path(const char *path) STAILQ_INSERT_TAIL(&pathlist, pe, next); } +#ifdef OPIO_DEADKEYMAP static void to_old_accentmap(accentmap_t *from, oaccentmap_t *to) { @@ -832,13 +833,16 @@ to_old_accentmap(accentmap_t *from, oaccentmap_t *to) } } } +#endif /* OPIO_DEADKEYMAP */ static void load_keymap(char *opt, int dumponly) { keymap_t keymap; accentmap_t accentmap; +#ifdef OPIO_DEADKEYMAP oaccentmap_t oaccentmap; +#endif /* OPIO_DEADKEYMAP */ struct pathent *pe; FILE *file; int j; @@ -898,8 +902,11 @@ load_keymap(char *opt, int dumponly) } if ((accentmap.n_accs > 0) && (ioctl(0, PIO_DEADKEYMAP, &accentmap) < 0)) { +#ifdef OPIO_DEADKEYMAP to_old_accentmap(&accentmap, &oaccentmap); - if (ioctl(0, OPIO_DEADKEYMAP, &oaccentmap) < 0) { + if (ioctl(0, OPIO_DEADKEYMAP, &oaccentmap) < 0) +#endif /* OGIO_DEADKEYMAP */ + { warn("setting accentmap"); fclose(file); return; @@ -907,6 +914,7 @@ load_keymap(char *opt, int dumponly) } } +#ifdef OPIO_DEADKEYMAP static void to_new_accentmap(oaccentmap_t *from, accentmap_t *to) { @@ -921,21 +929,26 @@ to_new_accentmap(oaccentmap_t *from, accentmap_t *to) } } } +#endif /* OPIO_DEADKEYMAP */ static void print_keymap(void) { keymap_t keymap; accentmap_t accentmap; +#ifdef OGIO_DEADKEYMAP oaccentmap_t oaccentmap; +#endif /* OPIO_DEADKEYMAP */ int i; if (ioctl(0, GIO_KEYMAP, &keymap) < 0) err(1, "getting keymap"); if (ioctl(0, GIO_DEADKEYMAP, &accentmap) < 0) { +#ifdef OGIO_DEADKEYMAP if (ioctl(0, OGIO_DEADKEYMAP, &oaccentmap) == 0) to_new_accentmap(&oaccentmap, &accentmap); else +#endif /* OGIO_DEADKEYMAP */ memset(&accentmap, 0, sizeof(accentmap)); } printf( From nobody Tue Feb 14 13:15:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGMCc4ryfz3rxHd; Tue, 14 Feb 2023 13:15: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 4PGMCc499Wz3xvN; Tue, 14 Feb 2023 13:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676380556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7zRGlGVf83PPQf6lwDP1uDAIVKzkW6B7wrxHqNfV7g=; b=Yd4zRh7Tqw//sgOFsoKI7a02cPCQEyuvUAzMV7twaAvqmDHJNp++u6FcVaaLFps04GGd82 Z8UlgzigMhhsPceqU3Gq5t/uML/CNfhhsgtBLaiQ1MBlTNzviRAZfPYRMWxoORQSb+K34t sA3QoROfhfS4BHQEKsYV31SarMkJAllg7Gibn4tV7U/Q7bmazvLOcCkI/4Q7cfZd6LwRgy R0y+6Aj3dP4dxKRtg1JD3U9LZVSe5RdXF3PoKGN+6sf3jnA45DSi43ZegvyrvfT780dafR W2w/UW0ilynnUKSKC+xqcncb+W+G8zarzm/jwnyrszjV4TYe/FmJtTUhww1Hnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676380556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7zRGlGVf83PPQf6lwDP1uDAIVKzkW6B7wrxHqNfV7g=; b=IJ5jNmFGnEdTimaJ00CVVZ+H+NPvfJYy0H6RLfEtpLJNYdsfPHaoz4HeJYxVqAQDmZhxAt pj52a/Q2pmIEdRlMu9mcCUcxUiD1nb0zrPN472VNI9PXvSRjCUPnjNwmr7/3GEH4wdmGnz Jp4VHoXx95EIdClMURX76hjQ18Hp3X6A/aHwz6NqpRHWBOWM8vM18/Sy4KgS6z8OpEK4Af TlzXLYDyTZMaPNWhVesGfueTPkRJKoayWDPBo6y5CWf40nk9MntoSkqbyLCsGcFtBPfAAj upf+FeSeX5RxkzEMvLzyTpRz90NNoQ9fAyqzArjk6Q5D1pgwZTr1vne5jsvkDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676380556; a=rsa-sha256; cv=none; b=XHZRgKywZc0zPRcTVckmuY2BDIuR4MUBByrHyNN9XGgnaKLayq938yTGEECSrF/GnMmx/j mekwfWCCtwt+4K3gyLLIKDJWDNAa+TERl9Pt7qUgBcaTJgAxnVj8nnUUIkq3jT4OnzllaS VC/dNEVLnlYYkAdRnievmI01pMZ5KtOdwr5vRTdMOACWyFp/SovuZfxkeHK4s3v/7prrep Q9JeQMKGQw84ibasS9NXlHBOuL6S6mwWYVpP1Hg65OtRKSMbk3H2r9mEecLjrcXm0drppS FPVqMdx9ehL2pCZed4jhsT9HnpQKN0xrfkP8Sd3YmLoJCZXz2jp5eTIwgiec/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 4PGMCc3368z10Tn; Tue, 14 Feb 2023 13:15: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 31EDFux4044385; Tue, 14 Feb 2023 13:15:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EDFu9Q044384; Tue, 14 Feb 2023 13:15:56 GMT (envelope-from git) Date: Tue, 14 Feb 2023 13:15:56 GMT Message-Id: <202302141315.31EDFu9Q044384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: c2bb66023fe3 - main - kbdcontrol: enable pre-Unicode dead key table compatibility List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2bb66023fe3e3617f56302b6960f59545a5535c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=c2bb66023fe3e3617f56302b6960f59545a5535c commit c2bb66023fe3e3617f56302b6960f59545a5535c Author: Stefan EĂźer AuthorDate: 2023-02-14 12:49:06 +0000 Commit: Stefan EĂźer CommitDate: 2023-02-14 12:49:06 +0000 kbdcontrol: enable pre-Unicode dead key table compatibility The definition of pre-Unicode keymap ioctls will be made optional and dependent on COMPAT_FREEBSD13 in a follow-up commit to 14-CURRENT. While we generally provide ABI compatibility for older binaries on a new kernel, but not functionally extended userland programs on an old kernel, it has been specifically requested to preserve ABI compatibility for the kbdcontrol program for both these cases. Passing the kernel configuration option COMPAT_FREEBSD13 to the build of kbdcontrol will make ioctls visible to the build that are normally hidden, but required to implement compatibility with kernels that only support 8 bit characters in dead key maps. This commit is not to be merged to any previous FreeBSD version and it shall be reverted as soon as this type of ABI compatibility is no longer deemed necessary (probably before 14-STABLE is branched). This commit is a part of review D38465 and split off to allow it to be reverted using the commit ID. --- usr.sbin/kbdcontrol/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/kbdcontrol/Makefile b/usr.sbin/kbdcontrol/Makefile index 960671a40fe7..d2107fb86290 100644 --- a/usr.sbin/kbdcontrol/Makefile +++ b/usr.sbin/kbdcontrol/Makefile @@ -9,4 +9,7 @@ SRCS= kbdcontrol.c lex.l WARNS?= 4 CFLAGS+= -I${.CURDIR} +# temporarily added for pre-Unicode accent key API/ABI compatibility +CFLAGS+= -DCOMPAT_FREEBSD13 + .include From nobody Tue Feb 14 13:15:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGMCd56tfz3rwwQ; Tue, 14 Feb 2023 13:15: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 4PGMCd4sQYz3xvy; Tue, 14 Feb 2023 13:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676380557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3aCZMU9T+BYhzDVSuY/MjCXrpBbOfiQwpnubJDC0gK8=; b=tqPitdBbknykG8uuwsNaNfdqZ11ZY5URicApG+vecn5i0okknbqb1/CyKrTVgpmdPQceRh b6VXVKtzS8Ygk/OD3abmoyxW+LmvFUYgpZ9AI/Q43/pd6SVr4F02+TIla22gQQAPhVYP9v cQYMF/LucQMJN7UhtVxBip1FjqH4jdBD2MkHyVNkW7IaA1Rr2P89Br/63LA3lpBFSsaTOa qXC1X7Tsft9R5/kiq1YvM/E3nLdyOEb4OYaY1/8UIEieiXqzj/lYO3oVe1eUudU1/sIh/Y DGdVQSNoeySWYYemxYyVBcnLUOAqaUvzFdkvpSvT44eJMPqZycH0CdebGbDd8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676380557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3aCZMU9T+BYhzDVSuY/MjCXrpBbOfiQwpnubJDC0gK8=; b=xxoyxC9dheGkyxn9npRYodoTkXIpWwtHqHPmgxovvIueWkPp4GeXZaQyWlaeTb2z2GnNWd Kt/H2Kv9bgWNJVkCeNRUb/4hrDLrURDGVnfAd8kYglzegHB/rDLFt//VdHhE+CsuLXlu21 kaUAmf9eGB4qX1CAjoD1gnGTxAwWwNo9cs0ktR9Jb9Y1XCmjYE/N+rjezA+zygtRKfd3dw PBoSgL7xkiD3ZhmP1Bviu7Y+wbF5Oor8os7mRpD1KUlSHVHCNhY6rsUw/8Bbq1XFA71TVC tFzFo31OXTbk12TjJqBfK71E5ATAz0tf4f0C0a/5sFyAXLscK5BXVVwpu/1xfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676380557; a=rsa-sha256; cv=none; b=aNAD4DuoW08HtGP1HYyw8fhKa7WPzjx0YlXBqDEjoUoDcgXWjI6a41ABTZxzUEzUGbZiFy /nRr6dAWJtkd4z77Gp0dQUWxMN5Q98Z83RwaWdWmFbHLB29fk9ADBd5iZtoTXXIxpYkdxz 5Xa0Oznidisl4KRjg7LJI/JOfjeVhtZwsw+8b3EJQ5a9IUlmfAXV8Za168pvqf+z720hi7 ylG2too0UAEJAOiLB6Jyq8lnTtl7A7Guj6k7WKkny1QWQOIdN8UVGcy8ZwPXafubaGIgz3 W84oLbrgB9wu/OAgUzKQObKfIY21o5CdsEa1dMTekxc/7Ep3Mp18YrFPMFQXPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGMCd3vhjz10rJ; Tue, 14 Feb 2023 13:15: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 31EDFvHW044414; Tue, 14 Feb 2023 13:15:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EDFvN2044413; Tue, 14 Feb 2023 13:15:57 GMT (envelope-from git) Date: Tue, 14 Feb 2023 13:15:57 GMT Message-Id: <202302141315.31EDFvN2044413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: f20058955c9d - main - sys/kbio.h: make pre-unicode keymap support optional List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f20058955c9d1041a5a09cd02a27babda7e34dc8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=f20058955c9d1041a5a09cd02a27babda7e34dc8 commit f20058955c9d1041a5a09cd02a27babda7e34dc8 Author: Stefan EĂźer AuthorDate: 2023-02-14 13:03:28 +0000 Commit: Stefan EĂźer CommitDate: 2023-02-14 13:03:28 +0000 sys/kbio.h: make pre-unicode keymap support optional FreeBSD-9 had introduced support for the full set of Unicode characters to the parsing and processing of keymap character tables. This support has been extended to cover the table for accented characters that are reached via dead key combinations in FreeBSD-13.2. New ioctls have been introduced to support both the pre-Unicode and the Unicode formats and keyboard drivers have been extended to support those ioctls. This commit makes the ABI compatibility functions in the kernel optional and dependent on COMPAT_FREEBSD13 in -CURRENT. The kbdcontrol command in -CURRENT and 13-STABLE (before 13.2) has been made ABI compatible with old kernels to allow a new world to be run on an old kernel (that does not have full Unicode support for keymaps). This commit is not to merged back to 12-STABLE or 13-STABLE. It is part of review D38465, which has been split into 3 separate commits due to different MFC and life-time requirements of either commit. Approved by: imp Differential Revision: https://reviews.freebsd.org/D38465 --- sys/dev/adb/adb_kbd.c | 4 +++- sys/dev/atkbdc/atkbd.c | 4 +++- sys/dev/gpio/gpiokeys.c | 9 ++++++--- sys/dev/hid/hkbd.c | 9 ++++++--- sys/dev/hyperv/input/hv_kbd.c | 4 +++- sys/dev/kbd/kbd.c | 27 ++++++++++++++++++++++----- sys/dev/kbdmux/kbdmux.c | 6 ++++-- sys/dev/syscons/syscons.c | 6 ++++-- sys/dev/usb/input/ukbd.c | 9 ++++++--- sys/dev/vkbd/vkbd.c | 4 +++- sys/dev/vt/vt_core.c | 4 +++- sys/sys/kbio.h | 16 ++++++++-------- 12 files changed, 71 insertions(+), 31 deletions(-) diff --git a/sys/dev/adb/adb_kbd.c b/sys/dev/adb/adb_kbd.c index 86d3865473bb..614d89c30447 100644 --- a/sys/dev/adb/adb_kbd.c +++ b/sys/dev/adb/adb_kbd.c @@ -795,10 +795,12 @@ static int akbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t data) break; case PIO_KEYMAP: - case OPIO_KEYMAP: case PIO_KEYMAPENT: case PIO_DEADKEYMAP: +#ifdef COMPAT_FREEBSD13 + case OPIO_KEYMAP: case OPIO_DEADKEYMAP: +#endif /* COMPAT_FREEBSD13 */ default: return (genkbd_commonioctl(kbd, cmd, data)); } diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c index 08266cf4bf51..0c6dadca43aa 100644 --- a/sys/dev/atkbdc/atkbd.c +++ b/sys/dev/atkbdc/atkbd.c @@ -1088,10 +1088,12 @@ atkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) return error; case PIO_KEYMAP: /* set keyboard translation table */ - case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ +äifdef COMPAT_FREEBSD13 + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ +#endif /* COMPAT_FREEBSD13 */ state->ks_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/gpio/gpiokeys.c b/sys/dev/gpio/gpiokeys.c index 655fd2f4e154..86f684535be9 100644 --- a/sys/dev/gpio/gpiokeys.c +++ b/sys/dev/gpio/gpiokeys.c @@ -894,12 +894,15 @@ gpiokeys_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) return (gpiokeys_set_typematic(kbd, *(int *)arg)); case PIO_KEYMAP: /* set keyboard translation table */ - case OPIO_KEYMAP: /* set keyboard translation table - * (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table * entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ - case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ +#ifdef COMPAT_FREEBSD13 + case OPIO_KEYMAP: /* set keyboard translation table + * (compat) */ + case OPIO_DEADKEYMAP: /* set accent key translation table + * (compat) */ +#endif /* COMPAT_FREEBSD13 */ sc->sc_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index a938ae70787b..e233ccd5b6dd 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -1635,12 +1635,15 @@ hkbd_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) return (hkbd_set_typematic(kbd, *(int *)arg)); case PIO_KEYMAP: /* set keyboard translation table */ - case OPIO_KEYMAP: /* set keyboard translation table - * (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table * entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ - case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ +#ifdef COMPAT_FREEBSD13 + case OPIO_KEYMAP: /* set keyboard translation table + * (compat) */ + case OPIO_DEADKEYMAP: /* set accent key translation table + * (compat) */ +#endif /* COMPAT_FREEBSD13 */ sc->sc_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/hyperv/input/hv_kbd.c b/sys/dev/hyperv/input/hv_kbd.c index 2e313b06ca7e..721178a9f3f2 100644 --- a/sys/dev/hyperv/input/hv_kbd.c +++ b/sys/dev/hyperv/input/hv_kbd.c @@ -663,10 +663,12 @@ hvkbd_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) KBD_LED_VAL(kbd) = *(int *)arg; break; case PIO_KEYMAP: /* set keyboard translation table */ - case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ +#ifdef COMPAT_FREEBSD13 + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ +#endif /* COMPAT_FREEBSD13 */ sc->sc_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c index 41d6fd5666d8..205d76639e0f 100644 --- a/sys/dev/kbd/kbd.c +++ b/sys/dev/kbd/kbd.c @@ -789,13 +789,16 @@ int genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) { keymap_t *mapp; - okeymap_t *omapp; accentmap_t *accentmapp; - oaccentmap_t *oaccentmapp; keyarg_t *keyp; fkeyarg_t *fkeyp; - int i, j; int error; + int i; +#ifdef COMPAT_FREEBSD13 + int j; + okeymap_t *omapp; + oaccentmap_t *oaccentmapp; +#endif /* COMPAT_FREEBSD13 */ GIANT_REQUIRED; switch (cmd) { @@ -824,6 +827,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) error = copyout(kbd->kb_keymap, *(void **)arg, sizeof(keymap_t)); return (error); +#ifdef COMPAT_FREEBSD13 case OGIO_KEYMAP: /* get keyboard translation table (compat) */ mapp = kbd->kb_keymap; omapp = (okeymap_t *)arg; @@ -836,10 +840,14 @@ genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) omapp->key[i].flgs = mapp->key[i].flgs; } break; +#endif /* COMPAT_FREEBSD13 */ case PIO_KEYMAP: /* set keyboard translation table */ +#ifdef COMPAT_FREEBSD13 case OPIO_KEYMAP: /* set keyboard translation table (compat) */ +#endif /* COMPAT_FREEBSD13 */ #ifndef KBD_DISABLE_KEYMAP_LOAD mapp = malloc(sizeof *mapp, M_TEMP, M_WAITOK); +#ifdef COMPAT_FREEBSD13 if (cmd == OPIO_KEYMAP) { omapp = (okeymap_t *)arg; mapp->n_keys = omapp->n_keys; @@ -850,7 +858,9 @@ genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) mapp->key[i].spcl = omapp->key[i].spcl; mapp->key[i].flgs = omapp->key[i].flgs; } - } else { + } else +#endif /* COMPAT_FREEBSD13 */ + { error = copyin(*(void **)arg, mapp, sizeof *mapp); if (error != 0) { free(mapp, M_TEMP); @@ -904,6 +914,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) sizeof(accentmap_t)); return (error); break; +#ifdef COMPAT_FREEBSD13 case OGIO_DEADKEYMAP: /* get accent key translation table (compat) */ accentmapp = kbd->kb_accentmap; oaccentmapp = (oaccentmap_t *)arg; @@ -919,11 +930,15 @@ genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) } } break; +#endif /* COMPAT_FREEBSD13 */ case PIO_DEADKEYMAP: /* set accent key translation table */ +#ifdef COMPAT_FREEBSD13 case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ +#endif /* COMPAT_FREEBSD13 */ #ifndef KBD_DISABLE_KEYMAP_LOAD accentmapp = malloc(sizeof(*accentmapp), M_TEMP, M_WAITOK); +#ifdef COMPAT_FREEBSD13 if (cmd == OPIO_DEADKEYMAP) { oaccentmapp = (oaccentmap_t *)arg; accentmapp->n_accs = oaccentmapp->n_accs; @@ -937,7 +952,9 @@ genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) oaccentmapp->acc[i].accchar; } } - } else { + } else +#endif /* COMPAT_FREEBSD13 */ + { error = copyin(*(void **)arg, accentmapp, sizeof(*accentmapp)); if (error != 0) { free(accentmapp, M_TEMP); diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index 1545022bec2a..2590eb5e69c1 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -1240,12 +1240,14 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) break; case PIO_KEYMAP: /* set keyboard translation table */ - case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ +#ifdef COMPAT_FREEBSD13 + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ KBDMUX_LOCK(state); - state->ks_accents = 0; + state->ks_accents = 0; +#endif /* COMPAT_FREEBSD13 */ /* perform command on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index c456be43d8a4..defd0b8380bb 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -1594,12 +1594,14 @@ sctty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) case GIO_KEYMAP: /* get keyboard translation table */ case PIO_KEYMAP: /* set keyboard translation table */ - case OGIO_KEYMAP: /* get keyboard translation table (compat) */ - case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case GIO_DEADKEYMAP: /* get accent key translation table */ case PIO_DEADKEYMAP: /* set accent key translation table */ +#ifdef COMPAT_FREEBSD13 + case OGIO_KEYMAP: /* get keyboard translation table (compat) */ + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case OGIO_DEADKEYMAP: /* get accent key translation table (compat) */ case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ +#endif /* COMPAT_FREEBSD13 */ case GETFKEY: /* get function key string */ case SETFKEY: /* set function key string */ error = kbdd_ioctl(sc->kbd, cmd, data); diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index e4ee63f59720..97d649ca13ac 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -1857,12 +1857,15 @@ ukbd_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) return (ukbd_set_typematic(kbd, *(int *)arg)); case PIO_KEYMAP: /* set keyboard translation table */ - case OPIO_KEYMAP: /* set keyboard translation table - * (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table * entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ - case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ +#ifdef COMPAT_FREEBSD13 + case OPIO_KEYMAP: /* set keyboard translation table + * (compat) */ + case OPIO_DEADKEYMAP: /* set accent key translation table + * (compat) */ +#endif /* COMPAT_FREEBSD13 */ sc->sc_accents = 0; /* FALLTHROUGH */ default: diff --git a/sys/dev/vkbd/vkbd.c b/sys/dev/vkbd/vkbd.c index 27cf4549f3db..19f52a591126 100644 --- a/sys/dev/vkbd/vkbd.c +++ b/sys/dev/vkbd/vkbd.c @@ -1204,10 +1204,12 @@ vkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) break; case PIO_KEYMAP: /* set keyboard translation table */ - case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ +#ifdef COMPAT_FREEBSD13 + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ +#endif /* COMPAT_FREEBSD13 */ state->ks_accents = 0; /* FALLTHROUGH */ diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index a47343340b0a..267dd7bf2489 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -2403,9 +2403,11 @@ skip_thunk: case GIO_KEYMAP: case PIO_KEYMAP: case GIO_DEADKEYMAP: - case OGIO_DEADKEYMAP: case PIO_DEADKEYMAP: +#ifdef COMPAT_FREEBSD13 + case OGIO_DEADKEYMAP: case OPIO_DEADKEYMAP: +#endif /* COMPAT_FREEBSD13 */ case GETFKEY: case SETFKEY: case KDGKBINFO: diff --git a/sys/sys/kbio.h b/sys/sys/kbio.h index a129556d1ada..80a58bf8e51e 100644 --- a/sys/sys/kbio.h +++ b/sys/sys/kbio.h @@ -120,7 +120,7 @@ struct keymap { }; typedef struct keymap keymap_t; -#ifdef _KERNEL +#ifdef COMPAT_FREEBSD13 struct okeyent_t { u_char map[NUM_STATES]; u_char spcl; @@ -132,7 +132,7 @@ struct okeymap { struct okeyent_t key[NUM_KEYS]; }; typedef struct okeymap okeymap_t; -#endif /* _KERNEL */ +#endif /* COMPAT_FREEBSD13 */ #endif /* !_KEYMAP_DECLARED */ @@ -209,7 +209,7 @@ struct accentmap { }; typedef struct accentmap accentmap_t; -//#ifdef _KERNEL +#ifdef COMPAT_FREEBSD13 struct oacc_t { u_char accchar; u_char map[NUM_ACCENTCHARS][2]; @@ -220,7 +220,7 @@ struct oaccentmap { struct oacc_t acc[NUM_DEADKEYS]; }; typedef struct oaccentmap oaccentmap_t; -//#endif /* _KERNEL */ +#endif /* COMPAT_FREEBSD13 */ struct keyarg { u_short keynum; @@ -250,17 +250,17 @@ typedef struct fkeyarg fkeyarg_t; /* XXX: Should have keymap_t as an argument, but that's too big for ioctl()! */ #define GIO_KEYMAP _IO('k', 6) #define PIO_KEYMAP _IO('k', 7) -#ifdef _KERNEL +#ifdef COMPAT_FREEBSD13 #define OGIO_KEYMAP _IOR('k', 6, okeymap_t) #define OPIO_KEYMAP _IOW('k', 7, okeymap_t) -#endif /* _KERNEL */ +#endif /* COMPAT_FREEBSD13 */ /* XXX: Should have accentmap_t as an argument, but that's too big for ioctl()! */ #define GIO_DEADKEYMAP _IO('k', 8) #define PIO_DEADKEYMAP _IO('k', 9) -//#ifdef _KERNEL +#ifdef COMPAT_FREEBSD13 #define OGIO_DEADKEYMAP _IOR('k', 8, oaccentmap_t) #define OPIO_DEADKEYMAP _IOW('k', 9, oaccentmap_t) -//#endif /* _KERNEL */ +#endif /* COMPAT_FREEBSD13 */ #define GIO_KEYMAPENT _IOWR('k', 10, keyarg_t) #define PIO_KEYMAPENT _IOW('k', 11, keyarg_t) From nobody Tue Feb 14 14:05:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGNK24Dljz3s0hZ for ; Tue, 14 Feb 2023 14:05:42 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGNK21xqGz43gB for ; Tue, 14 Feb 2023 14:05:42 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f49.google.com with SMTP id j29-20020a05600c1c1d00b003dc52fed235so11694849wms.1 for ; Tue, 14 Feb 2023 06:05:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JuRBBPorVxzfcN7bRZgwpy2670Opi3SdqqDa/qyboXM=; b=gdg+JbTqTeA5Xmk60qDh6A+y26Iu5TC+5RyCLWF0RepCeIM7J8jpPKdRt8W4Lc5Kgt hgm3B3KZVHrTeLDZo22G3PtBhObd20RO8W7CUdMwr8Lo1yEEWq/bkB5BjGZc3Iv71ry9 lvUQmkT+eaaRuGLt5rlVfmol3xLizfqHPfhaXQEeBBhDjCkw7hjfSqfsRqRq+2FRJQG+ UQd7EOCzucItuhKfhRLkN5PJL2F+cOr73L6KkWZ2kFfthQWMUdkSN+29Fjm0EPUp7Miz vwCNMGwOWVNibGHfxmB8RATSUUFq1QvMjxnynwc83JpMSoJzud3qMWFgQMqYs8G7LrWP ym9w== X-Gm-Message-State: AO0yUKVCjBkOj3HA4pDZZ8lQkCHrZOnq7bM5x3eIj7CDq1ksFN8X3iG3 Mwrk8LXNiQDNWfKZiIxQiB2Kug== X-Google-Smtp-Source: AK7set8p5CKX8CxOAycDdDKRpO1ubebyldjO6jFfMWJPgIKyOiGD0o9hOBofad1+vRtRTzyz33Otcw== X-Received: by 2002:a05:600c:13c3:b0:3dc:557f:6126 with SMTP id e3-20020a05600c13c300b003dc557f6126mr2079360wmg.4.1676383529518; Tue, 14 Feb 2023 06:05:29 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id c129-20020a1c3587000000b003dc1a525f22sm18118756wma.25.2023.02.14.06.05.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Feb 2023 06:05:29 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: c2bb66023fe3 - main - kbdcontrol: enable pre-Unicode dead key table compatibility From: Jessica Clarke In-Reply-To: <202302141315.31EDFu9Q044384@gitrepo.freebsd.org> Date: Tue, 14 Feb 2023 14:05:28 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202302141315.31EDFu9Q044384@gitrepo.freebsd.org> To: =?utf-8?Q?Stefan_E=C3=9Fer?= X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PGNK21xqGz43gB 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 14 Feb 2023, at 13:15, Stefan E=C3=9Fer wrote: >=20 > The branch main has been updated by se: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc2bb66023fe3e3617f56302b6960f595= 45a5535c >=20 > commit c2bb66023fe3e3617f56302b6960f59545a5535c > Author: Stefan E=C3=9Fer > AuthorDate: 2023-02-14 12:49:06 +0000 > Commit: Stefan E=C3=9Fer > CommitDate: 2023-02-14 12:49:06 +0000 >=20 > kbdcontrol: enable pre-Unicode dead key table compatibility >=20 > The definition of pre-Unicode keymap ioctls will be made optional = and > dependent on COMPAT_FREEBSD13 in a follow-up commit to 14-CURRENT. >=20 > While we generally provide ABI compatibility for older binaries on > a new kernel, but not functionally extended userland programs on an > old kernel, it has been specifically requested to preserve ABI > compatibility for the kbdcontrol program for both these cases. >=20 > Passing the kernel configuration option COMPAT_FREEBSD13 to the = build > of kbdcontrol will make ioctls visible to the build that are = normally > hidden, but required to implement compatibility with kernels that = only > support 8 bit characters in dead key maps. >=20 > This commit is not to be merged to any previous FreeBSD version and > it shall be reverted as soon as this type of ABI compatibility is = no > longer deemed necessary (probably before 14-STABLE is branched). >=20 > This commit is a part of review D38465 and split off to allow it to = be > reverted using the commit ID. > --- > usr.sbin/kbdcontrol/Makefile | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/usr.sbin/kbdcontrol/Makefile = b/usr.sbin/kbdcontrol/Makefile > index 960671a40fe7..d2107fb86290 100644 > --- a/usr.sbin/kbdcontrol/Makefile > +++ b/usr.sbin/kbdcontrol/Makefile > @@ -9,4 +9,7 @@ SRCS=3D kbdcontrol.c lex.l > WARNS?=3D 4 > CFLAGS+=3D -I${.CURDIR} >=20 > +# temporarily added for pre-Unicode accent key API/ABI compatibility > +CFLAGS+=3D -DCOMPAT_FREEBSD13 This doesn=E2=80=99t seem right... COMPAT_FREEBSD* is for kernel not = userspace. Normally this would be a _WANT_FOO. Jess > + > .include From nobody Tue Feb 14 14:47:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPDv4LJ2z3s2h9; Tue, 14 Feb 2023 14:47: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 4PGPDv3t8Mz46WF; Tue, 14 Feb 2023 14:47:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YwqDDWv34hj2gn7UahkSHVp8UBy8Nnp3TboNIx71PaU=; b=SRmXTyfpBHRx2orYbiuPUeYn23DiHXHckkyC2r6QgyEA0qG+c3d6xbtmwMMZYI7ntEwXCb F0mGnMUqFxn5KdfaDNI95ZRwYR1z2ejy9YXjgzc+9WV217XFMngJXpgHeT2jZfepK8+WOT X/5sxXQkR8NvsVOnDPfiSEanVfoToLakZq9llngWZpNt6Mi0ECnyTwCMPI3frQthxw75pS 4gG1hNHfgYd4+6QUr+axz4kyJY05q1nIzOrdVfLZr+2Ui/uTdi3syVhN1Y5sZHbw1ECnIV 2xieD6EldzyZTySMcU+RoDtlpj3UZZQXwmpCh/NNEACHQC+uKz2ERIIUsrklPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YwqDDWv34hj2gn7UahkSHVp8UBy8Nnp3TboNIx71PaU=; b=CN+qXIbCcth5r4oZ5ntgsUV9iVUQ8CxdRsUDttnlCL19iDFL4trfOQfzo+hLfJxlb4386U phW1BssV0oE2rXoACrFxd709ipgRNTT79D+UKgI0cS3omL+gNeRPd1UDu5ycIOHaGKadOU aVTgJIc/F642r2nGpCZ7LgYf0FnPpTRDWkik5P6c1fCG8Y5NC3U0SnhewcI3V/JAXomw+f opcA2VncPoDtn/wJ2YYVS7rHWssycAG0QBQckQWdvwqtpztXBbK7LLuJYaHMxe/xWxOrhL n8CWN20PsMsRR6Aciuoz9J94g1fl1TgqUarQT4fyOb8cfsdKpl7HwWiPhqZn6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386031; a=rsa-sha256; cv=none; b=XemhqcpyoS63carxXLqQGLGmWzcD+Yb9TNBKTOqauRwNMffzbS/wxrApcRZY5r5kihqH0y K+qcOGkeQWScFxriysIv1943uUOm2u/T6+TiCGngTvXisKD2ElwTGfaKgtQkaJAzI8hUwZ +xu34o7wozL6Oj2JUyuKqNosZc3KFQjO8EUC/RXc1Tl09VQBl77TJZYlsobd31+e1pj6vs 2SsQ27vgCEXngYKz4CH/8M4gMLGgpR9JsRJ+PqFFM3edEZDBQkeG+cZq/YE202YV6Ns1Jp 93Ai4eWVo6jLhzuFSxO50sw54VOjSBo3Nm0ppqrgCDXIzkV7RZ7TuYrpHyHCIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPDv2x8zz12j2; Tue, 14 Feb 2023 14:47: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 31EElBKE072246; Tue, 14 Feb 2023 14:47:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElB3t072245; Tue, 14 Feb 2023 14:47:11 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:11 GMT Message-Id: <202302141447.31EElB3t072245@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: 81e7a8005521 - main - linux(4): Cleanup unneeded includes from linux_util.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 81e7a800552196a65c9c8b3fef82c2ef6c8058ff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=81e7a800552196a65c9c8b3fef82c2ef6c8058ff commit 81e7a800552196a65c9c8b3fef82c2ef6c8058ff Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:30 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:30 +0000 linux(4): Cleanup unneeded includes from linux_util.h MFC after: 2 weeks --- sys/compat/linux/linux_util.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index 6f7b55be8123..b12b3034ab49 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -38,11 +38,7 @@ #include #include -#include -#include #include -#include -#include #include MALLOC_DECLARE(M_LINUX); From nobody Tue Feb 14 14:47:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPDx21dBz3s2f7; Tue, 14 Feb 2023 14:47: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 4PGPDw4pm0z466p; Tue, 14 Feb 2023 14:47:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wfFVJihFgCgxPVpncexryzxCldGjQ8ePpfOpNRaGd/0=; b=aF2xXWkdMcduDVNGvQi8WcRX6GiAHissJiT5A2Z0tfN3vERIBVDBKrybe66mS8mviQAzVf lkeIABK2ByZ80YXY3ZRbosW30mPTlAigxByDqQ+qYtusFLLMI2/ZKLa8b3O57oh8aVMFH4 zo2II/o6MRsFH5zuQfmQv5khYK6waJKgqr/5imjElM0XgvS5HVTL3548FwWvMpWPMn59uC 3WiptsdArBkJpCVAF8mgC8E1Yen5WA0VJMxazzniWAB0lAWxSbIcwf5mpACAFBG7SbjW4n YXugxDJkTNB4spLl4xY9RYesrHZ1BPh+PcnXzYBhOJ96t0/Rt+Wqd+/pFX1ZDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wfFVJihFgCgxPVpncexryzxCldGjQ8ePpfOpNRaGd/0=; b=W9UUk8soHyJmKeETzOHZZZcEZEHylEgJgQhpnGXNp51kZCqVGTU7yM63gI7ZdO0zIjTYdD JlTMh1vkuuvXyiT+4nbN7v/favzsIQ2RSsEhPvBVaP9UedTu/EKi2b2YPYxIVxbFJnRqce r7RtE4RWRJ5jSYcQAvmhcB5zoZg+3acAxq7zewe7v5XNC4Z9KOOGfCvHqjSmvUlikm35GA EbsGYrFzS9k2o9rAFSAjtbYCF5PMR2yJQOlv082a39SAl1kdOkSXi5tCPMbh3JlzIsDDWa 5tUfLWupylfkiuoFoaSeQnEFPBdnNj3p1ZUdc3ONiLEk1Y/og7IT/njSUjmtCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386032; a=rsa-sha256; cv=none; b=k1O4DO0Ko8IoS9EEIajhQjQMPXjBsh4gUb7ro0sRe+lZDGcVy14OOPTFQgkWxzpkzhT+T+ 87cRFGS4Bs5ho1DLSa25GAS9qlLSEV2V23cwfZpd5zSfLZuwE2jWCswMYMbf6ODptMfS7F OQ/LBMpzb/lgcjCTz7S6JObo5SaYNoIBS/LP62Jz4HbBZuwjpCNkMWCgEGxJATqg24AkD6 sU0Rpq93G0HfK9/+rUV21lWKOWBasKmWF6L/RhO+z2vflTv8PCckoLfYVsCltgImV0DLtk SX2YHpmLQSyV7i0kQcfwrn65enJwnt7fKOsVhA/Xn0bo997ypEcomrD/V1LFSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPDw3s0hz12j3; Tue, 14 Feb 2023 14:47: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 31EElCmY072277; Tue, 14 Feb 2023 14:47:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElCof072276; Tue, 14 Feb 2023 14:47:12 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:12 GMT Message-Id: <202302141447.31EElCof072276@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: 31e938c531dc - main - linux(4): Cleanup vm includes from linux_util.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 31e938c531dcbb708dbcd0e1d0a4ea80dcc82300 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=31e938c531dcbb708dbcd0e1d0a4ea80dcc82300 commit 31e938c531dcbb708dbcd0e1d0a4ea80dcc82300 Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:30 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:30 +0000 linux(4): Cleanup vm includes from linux_util.h Include vm headers directly where they needed. The linux_util.h included in a most source files of the Linuxulator, avoid collecting a rarely used includes here. MFC after: 2 weeks --- sys/amd64/linux/linux_machdep.c | 1 + sys/arm64/linux/linux_machdep.c | 2 ++ sys/compat/linux/linux_misc.c | 1 + sys/compat/linux/linux_util.h | 2 -- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index 1c042424f3ea..ed905518fdf4 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index 0bfe51f7da1e..4b12476f7865 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 98bbe4b4cbb9..96670ef9ca39 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index b12b3034ab49..b89fd61de19a 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -36,8 +36,6 @@ #ifndef _LINUX_UTIL_H_ #define _LINUX_UTIL_H_ -#include -#include #include #include From nobody Tue Feb 14 14:47:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPDy1Sp2z3s2lx; Tue, 14 Feb 2023 14:47: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 4PGPDx5prBz469B; Tue, 14 Feb 2023 14:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cJJqSexu1nqVhrt+NCLXRPo856RuEikbNrKym9881I=; b=i71CpxBAO8gCZvcNHpf4Pf4FsX8TRbXqUsH45npUEXqeiV8RPfBLMTNlDXMpfO+TO+s0hr fPd/6FKaY+ZDOtY8vpVMdRoF46nlC6dpSNAQzfoFDWEQC9c4K/wfVTlrvb3H7Sr6iCYThz lyBZrFYsu3idP9U6rgYf/+qNSCoz9zdrM/2O1QigBl3dECzbkPy8B8ODLat+bKqltPckma m2lNpsRysi+NHyZ7jR9ZUiPs7ot0QYChs62dlf/dNknKQt9ScdnNcSp6/juy/D2uI4kn0W t/+n+1I62bdN1hNUYT4VTQzAw68PxzhBfPaicKVRPk4rl7m/Mm/8VC6IJ8vn/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cJJqSexu1nqVhrt+NCLXRPo856RuEikbNrKym9881I=; b=dts0ad3SQe497kVk4crDtP5rCcWJygRRKolwYolm2yG3763uRPlLSjELVieSt0JUWPIH96 O2kSqXJjAGP1zefCjYdpoGUiqIMN8VbQFXauHuk0YEAdq94YKfluwVtDiMXuG/XGD0Oivg uMdG1iFMx3UD2YhARhzfXlgqy4UG5bCuMHtwVKgntm+d4RW65PfQsLCnJXtXbqoF5fuDVR 6p2S/dxiv5tYHklA4f05nh26rgcSe+msvyjsvE0CR2kHz7e05obPnYtlXlYR9GIwoUPqi1 KgPsCCGGytOGnjZ1i23c0ZGonf5fp4y5vPD3BvHq9DEc3SwaOJeI+TEGQJ2kpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386033; a=rsa-sha256; cv=none; b=nnRSCpzmzgJ+QO6VWda8t6foZG0UYVZf/by+zqBjHU2WQswwJwaWOV6KNJ6nFjtkcdQBtA 3O1zXWMqUJACGJuGiEabac9kTJRTQnq6k4e6lvA44gvCH/zP+fVBmkGRR0jqynjLq43uHm XlbqS7Gj9blv2/LVZQxjAPUORt945Uva+zuxhIz2mr8e5HTW5XybkT4139lMnunejSibEz urO1awB7ObSyva16VO9MJE/+ox90XtuDY5l1xd2SvfOvQPQpMvYjbywFG7h1dQTyJT19CP nPBxiNxn3x6nzLGZbF5IsWDyR8l/BlvMoDDicPRd8TlmuHGsGNUr9jHIHsKBmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPDx4jkBz12mf; Tue, 14 Feb 2023 14:47:13 +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 31EElDl5072301; Tue, 14 Feb 2023 14:47:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElDGU072300; Tue, 14 Feb 2023 14:47:13 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:13 GMT Message-Id: <202302141447.31EElDGU072300@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: 513eb69edf38 - main - linux(4): Cleanup sys/sysent.h from linux_util List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 513eb69edf382923bff1b09edda64010d89f74bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=513eb69edf382923bff1b09edda64010d89f74bd commit 513eb69edf382923bff1b09edda64010d89f74bd Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:31 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:31 +0000 linux(4): Cleanup sys/sysent.h from linux_util Include sys/sysent.h directly where it needed. The linux_util.h included in a most source files of the Linuxulator, avoid collecting a rarely used includes here. MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 1 + sys/compat/linux/linux_ipc.c | 1 + sys/compat/linux/linux_misc.c | 1 + sys/compat/linux/linux_util.h | 1 - 4 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 7d75889d2dce..aed6bbf94cee 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef COMPAT_LINUX32 diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 5f0c22b49e58..a72b0a9709b5 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef COMPAT_LINUX32 #include diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 96670ef9ca39..b20a1b3597e5 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index b89fd61de19a..b00a9036d367 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -36,7 +36,6 @@ #ifndef _LINUX_UTIL_H_ #define _LINUX_UTIL_H_ -#include #include MALLOC_DECLARE(M_LINUX); From nobody Tue Feb 14 14:47:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPDz6tw0z3s2fD; Tue, 14 Feb 2023 14:47: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 4PGPDy6bLMz46Wf; Tue, 14 Feb 2023 14:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=714ZdwtQw10an8zJ4d+FFomhHbButLd2Hwtemd/AxTI=; b=TpsFELdPoVaCyrV8XVxRdLfEbAly+rdEguNgKTa4YwUEnF0PBoDvazYUW65HglLMvc/c+p tplRxVZTnj47y/VPvJ1xVbOXCZMrWMn9byW5pKogDiyHzoHvwo6P1JAWGThmEumCaaoeju w5AL0VlLBaiG1QcJFfd4azczQQMAHhFuGyKBlNakgEwLf4seBa19/umIFtiJ7c/1+WmJzk ykfTLKMxLD5vErlIlEK0hVGFpQd/Qwlr1KQAhOTVP0BHciqZYs7DK+a2K/XvujHdXtzSKJ 9RAxm8hseBa7xV3/fbOR9pbYqsZcDT7sJFEOODXkcYsN5GkUzYHOkdTW3QKXug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=714ZdwtQw10an8zJ4d+FFomhHbButLd2Hwtemd/AxTI=; b=dDcDWr7+F4v0SigTWi9AClnWc9GeIGAaG7yKThpbCBEqFF5uQBqrDJmECux0294rNYvl+w 10J739xJrvOHJSv2lxSpHoZLKkivTQsmnbDbHwIIIaJMyQXa78DumilWXtaTLR//MSAPhL uaGcrnrmveqhIAQ2PuZzha+NyQeP7f6bDbt3KM/MiHtDnAv6qoFHUKy7qSekcMZYVxJ8Nx vNi8TV/eYH/CoDhAld3coE6I3GItuzQ/l96VQ4VOfTFiVblQDcPmxY2dRKfxMB2TQgKR2Q idG0xx1h8CJ8PPgEbgb6fbq3PCMi31sfaGXMyqgtvki3EeGh1bgSKFEMoEMo6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386034; a=rsa-sha256; cv=none; b=xgP4BrlasPUhUYZ7RqtHrkCPy2UlxaVuFwcpjU2Ra2/bpSVKmxYyGvvLg8TZdnSvGdu2J8 5GGnkMb5FTZXwrclk0w6ty2k7lHHecaaEA9ceAdtb3lRnnq12SiFWzEYhXmQhn0n74uf5u PZJ//hAWJpZ9hjEXOPTaxmeVOTaNPPxPFjX+Aka1CpvgM1SXVXGzEj4bsvw8gghwVoaapa GACqCuFHb/R6dbIGWMLgqmgEYKHRhYv5/kjoerA2mnsK0U1VtnPLHIG+0P6BCyvo3N7/R9 WYucNQgUVdnX4N5Qv+bfczgRCO5D5QX1ATYcOCUCa0TxVv0BsKoGNT5i4Vh1lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPDy5fwnz12mg; Tue, 14 Feb 2023 14:47: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 31EElEfI072332; Tue, 14 Feb 2023 14:47:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElEQI072331; Tue, 14 Feb 2023 14:47:14 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:14 GMT Message-Id: <202302141447.31EElEQI072331@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: 007986714c78 - main - linux(4): Cleanup sys/queue.h from linux.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 007986714c78c8e087038fb05442f17da1171bfa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=007986714c78c8e087038fb05442f17da1171bfa commit 007986714c78c8e087038fb05442f17da1171bfa Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:31 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:31 +0000 linux(4): Cleanup sys/queue.h from linux.h Leftover after converting futexes to the umtx API. NFC after: 2 weeks --- sys/compat/linux/linux.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index 40e563014fde..cd7e8cd6b3e0 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -28,8 +28,6 @@ #ifndef _LINUX_MI_H_ #define _LINUX_MI_H_ -#include - /* * Private Brandinfo flags */ From nobody Tue Feb 14 14:47:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPF03tXwz3s2SQ; Tue, 14 Feb 2023 14:47: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 4PGPF003FNz46M3; Tue, 14 Feb 2023 14:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsIdZUdq7hFWUytKAdeMWGy4JYJaIGDD0jUQ7Le8jjc=; b=L8dGXpzC/Y0Qki/kTXyF9To3G3Rx8x+NSQU+6ggHNxZGL5i/AQL8ODG0DooKUX8vQmyEQY 2j8TRcPpVsDXdkTNWFlruo8Olu+Fk/9JDVH3YMlmOhTsxVtTIy1G1Zsrzl39OYdfcVUMs2 kiiuJbAlt5L8rzt8ruAneUmXeqt+MujNMm4nEQe1UcIXlL/rHLCoJ0yeqm8v7SQrLzY/kG jF2VkOGCGVnAsCSs8At8M9hw1EwyMH1eCTqNxEdhUW8MSaKqZsRkrpfXgAHqkx6MRG4CjN jMBRmqKQwmfECRucPCVIdr4u4vixhLssv24CebNkxA/bgrVPuk6nSatAwBV5Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsIdZUdq7hFWUytKAdeMWGy4JYJaIGDD0jUQ7Le8jjc=; b=ESzcoA1RM55A9RqWF1zvKmUR95ujh+OB2qR58RkaWXsfHV2Jtgua0brCqCc5pIXA6CfTC4 18iY2Uz9pv+eGpjqGDV4srcS6eRyWMPFW1aNoTXgNZKI5Cx9mDb8rYXsPlJexVPhl9achi u7+AvoKodS6Y2IlefJTfpLQszX63H4n9HNNS/p+5y8e4DdxKog7Ytc/qqIynZRkW/MZ5L/ VKMhxAh300wlrXdl3nS0J26tPkAcCUAA89L6Kl17DrraKUGtXpyFBei+mausWXEUrf+5Ra xLETMdi0j+J8b420mO6o8j7rjHmWKdJNG2K+Ybd9jatIpDviXoQAuOccFNSc4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386036; a=rsa-sha256; cv=none; b=xs66v0ymiuKne5pFBt9JV2oXTED5GrmpNtN2+s1VI6crMPibG3xY7XGgvyVrszrVzAjSjK VxoYEV9CN80A8SOP4LSHNdHNnZFGLY6bEvCyguJGPI9Tcc2AXmbVzN0sDIXSrCaRJKpLa9 Ky6FXwDcLdptrRA0xiM0Vkl5v/5EKmPUDP1xbjtPIBtD/L99FDQu5yflAZN/ZkGT2KQ6gv 5+0dgESNWb6qlnHMFOqiGr31TkIsKkER7Jg6YA9plShGZVqadhUqKNqkPL+m3KaHhVYAIW jipOfzQ+D0cDJc/ezn0h0KQXClUh1jRYll3aAKkESo+5PICHXmAXHWuXr/MvuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPDz6Gkwz12kR; Tue, 14 Feb 2023 14:47: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 31EElFvO072357; Tue, 14 Feb 2023 14:47:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElFOE072356; Tue, 14 Feb 2023 14:47:15 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:15 GMT Message-Id: <202302141447.31EElFOE072356@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: 86f9efef2c44 - main - linux(4): Cleanup abi_compat.h include from linux_timer.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 86f9efef2c44f6be007cbc9ab383ee6a277d5880 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=86f9efef2c44f6be007cbc9ab383ee6a277d5880 commit 86f9efef2c44f6be007cbc9ab383ee6a277d5880 Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:31 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:31 +0000 linux(4): Cleanup abi_compat.h include from linux_timer.h Leftover after timespec copyin/copyout routines was implemented. MFC after: 2 weeks --- sys/compat/linux/linux_timer.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/compat/linux/linux_timer.h b/sys/compat/linux/linux_timer.h index b9f877cc83a4..a01411cec847 100644 --- a/sys/compat/linux/linux_timer.h +++ b/sys/compat/linux/linux_timer.h @@ -33,8 +33,6 @@ #ifndef _LINUX_TIMER_H #define _LINUX_TIMER_H -#include - #ifndef __LINUX_ARCH_SIGEV_PREAMBLE_SIZE #define __LINUX_ARCH_SIGEV_PREAMBLE_SIZE \ (sizeof(l_int) * 2 + sizeof(l_sigval_t)) From nobody Tue Feb 14 14:47:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPF13fD4z3s2fL; Tue, 14 Feb 2023 14:47: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 4PGPF10kfNz46cH; Tue, 14 Feb 2023 14:47:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NjMq309bp9NpfOw0oSm/rHlF2rPDGkeZqjb1/NeH6H0=; b=CosEZjtdX9R0RkAwSRP+dDYTx4ZfoMr7i4POC9MCx+Uo1cE7tDSw4W+dCZ1kECrvZC6BSc cS6G5fOzHcDJR08M2MRLZJlNf+rKRYRjaeU2MWy2ABd1M/R5LFkvOgIaR4prMrpaDb4GD3 I8diibX6Yv4w+ni61D1MYBEdkvFD9as+lT9yxh0TJNo7TozskBvaTuC4aPjK/nIHDxSAnI Ohiqy5SlUKy1fGo1rdAocXyWLmoP5znljrKCR5oh2w7XbEFevjMOWuw8KlzkX1W6uWwON1 EEtryVtTCGNcGj4afPnZzoFwTig+l57DZV2T+zdYZNpTniPcpTGN0cWSfSIQ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NjMq309bp9NpfOw0oSm/rHlF2rPDGkeZqjb1/NeH6H0=; b=adQZPSRANvNi05Ey+xsG3Qoy3sOmkq7nSSB8NyTbkIz5qTWrqsp23YuBhtStZr2bfqPxv2 jV3e3z9QP2I7ARWwjtybWPyUhYh2mtzV4/mKIbUTFvg3KBpIcatb3EoqG6JxTggEzeptUs v8tsAk6aMAiCqs2rCVd2J1X2RA7TIIvR70+i9R3sI5PQwTZNQ8AYdntQIKRUgk9nj7KlAu 10jugXYf1G6zXtqv1C/2TJItfNY9GIE8wcb1LOWDE7R9fm5YfqV08lH0nz7V/4bR8TwX7a JZdC16SfjyuHfwWWzLssHXuwxNNk66if0ZCwkwQqKuzLESe4Q1z2gyttwJsnrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386037; a=rsa-sha256; cv=none; b=PQmTdedT5Zj3GUEgEe9CtNx6VTIH3zZdRIcQ3LiTaR7cp2jm22wmDtlMEKiqgdPO+LWfs7 drm0wRsBN2+wIpIQFU7b9WatXUPbtApzNzqkSx898JH3IG6bIqqgWa0fX0MKrZKtz/YIfm zmnEdn7kl4EfpIDhldWNjzCNf7PrI0QxKnVAfvRrY+zLSq9yOIOE0TLwWLyNDw2vOx7b1l zVzl6yj4kIKkjBm5EXVItple8JMNlXtyOZvnpvbE/huccXA5uxJ/QlvvtuqTDGscfHaIjY nqvyoMSvws0RtnwHEOKeYIzxhATH1/9l7Z+gg/JM9VR4NycrPL287svtGOOb/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 4PGPF06xnzz12kS; Tue, 14 Feb 2023 14:47: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 31EElGpT072381; Tue, 14 Feb 2023 14:47:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElGMl072380; Tue, 14 Feb 2023 14:47:16 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:16 GMT Message-Id: <202302141447.31EElGMl072380@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: 50c85a32d9c6 - main - linux(4): Move uselib() to i386 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 50c85a32d9c667779494850b6238b8d7ec13da75 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=50c85a32d9c667779494850b6238b8d7ec13da75 commit 50c85a32d9c667779494850b6238b8d7ec13da75 Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:31 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:31 +0000 linux(4): Move uselib() to i386 This obsolete system call is not supported by glibc. In ancient libc versions (before glibc 2.0), uselib() was used to load the shared libraries with names found in an array of names in the binary. On Linux, since 3.15, this system call is available only when the kernel is configured with the CONFIG_USELIB option. It doesn't look like anyone needs this syscall for others Linuxulators, so move it to the corresponding MD Linuxulator. MFC after: 2 weeks --- sys/compat/linux/linux_misc.c | 264 ----------------------------------------- sys/i386/linux/linux_machdep.c | 260 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 260 insertions(+), 264 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index b20a1b3597e5..4dba124a918f 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -35,9 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__i386__) -#include -#endif #include #include #include @@ -48,13 +45,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -77,12 +72,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include #include -#include -#include #include #ifdef COMPAT_LINUX32 @@ -251,261 +242,6 @@ linux_brk(struct thread *td, struct linux_brk_args *args) return (0); } -#if defined(__i386__) -/* XXX: what about amd64/linux32? */ - -int -linux_uselib(struct thread *td, struct linux_uselib_args *args) -{ - struct nameidata ni; - struct vnode *vp; - struct exec *a_out; - vm_map_t map; - vm_map_entry_t entry; - struct vattr attr; - vm_offset_t vmaddr; - unsigned long file_offset; - unsigned long bss_size; - char *library; - ssize_t aresid; - int error; - bool locked, opened, textset; - - a_out = NULL; - vp = NULL; - locked = false; - textset = false; - opened = false; - - if (!LUSECONVPATH(td)) { - NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_USERSPACE, args->library); - error = namei(&ni); - } else { - LCONVPATHEXIST(args->library, &library); - NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_SYSSPACE, library); - error = namei(&ni); - LFREEPATH(library); - } - if (error) - goto cleanup; - - vp = ni.ni_vp; - NDFREE_PNBUF(&ni); - - /* - * From here on down, we have a locked vnode that must be unlocked. - * XXX: The code below largely duplicates exec_check_permissions(). - */ - locked = true; - - /* Executable? */ - error = VOP_GETATTR(vp, &attr, td->td_ucred); - if (error) - goto cleanup; - - if ((vp->v_mount->mnt_flag & MNT_NOEXEC) || - ((attr.va_mode & 0111) == 0) || (attr.va_type != VREG)) { - /* EACCESS is what exec(2) returns. */ - error = ENOEXEC; - goto cleanup; - } - - /* Sensible size? */ - if (attr.va_size == 0) { - error = ENOEXEC; - goto cleanup; - } - - /* Can we access it? */ - error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td); - if (error) - goto cleanup; - - /* - * XXX: This should use vn_open() so that it is properly authorized, - * and to reduce code redundancy all over the place here. - * XXX: Not really, it duplicates far more of exec_check_permissions() - * than vn_open(). - */ -#ifdef MAC - error = mac_vnode_check_open(td->td_ucred, vp, VREAD); - if (error) - goto cleanup; -#endif - error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL); - if (error) - goto cleanup; - opened = true; - - /* Pull in executable header into exec_map */ - error = vm_mmap(exec_map, (vm_offset_t *)&a_out, PAGE_SIZE, - VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp, 0); - if (error) - goto cleanup; - - /* Is it a Linux binary ? */ - if (((a_out->a_magic >> 16) & 0xff) != 0x64) { - error = ENOEXEC; - goto cleanup; - } - - /* - * While we are here, we should REALLY do some more checks - */ - - /* Set file/virtual offset based on a.out variant. */ - switch ((int)(a_out->a_magic & 0xffff)) { - case 0413: /* ZMAGIC */ - file_offset = 1024; - break; - case 0314: /* QMAGIC */ - file_offset = 0; - break; - default: - error = ENOEXEC; - goto cleanup; - } - - bss_size = round_page(a_out->a_bss); - - /* Check various fields in header for validity/bounds. */ - if (a_out->a_text & PAGE_MASK || a_out->a_data & PAGE_MASK) { - error = ENOEXEC; - goto cleanup; - } - - /* text + data can't exceed file size */ - if (a_out->a_data + a_out->a_text > attr.va_size) { - error = EFAULT; - goto cleanup; - } - - /* - * text/data/bss must not exceed limits - * XXX - this is not complete. it should check current usage PLUS - * the resources needed by this library. - */ - PROC_LOCK(td->td_proc); - if (a_out->a_text > maxtsiz || - a_out->a_data + bss_size > lim_cur_proc(td->td_proc, RLIMIT_DATA) || - racct_set(td->td_proc, RACCT_DATA, a_out->a_data + - bss_size) != 0) { - PROC_UNLOCK(td->td_proc); - error = ENOMEM; - goto cleanup; - } - PROC_UNLOCK(td->td_proc); - - /* - * Prevent more writers. - */ - error = VOP_SET_TEXT(vp); - if (error != 0) - goto cleanup; - textset = true; - - /* - * Lock no longer needed - */ - locked = false; - VOP_UNLOCK(vp); - - /* - * Check if file_offset page aligned. Currently we cannot handle - * misalinged file offsets, and so we read in the entire image - * (what a waste). - */ - if (file_offset & PAGE_MASK) { - /* Map text+data read/write/execute */ - - /* a_entry is the load address and is page aligned */ - vmaddr = trunc_page(a_out->a_entry); - - /* get anon user mapping, read+write+execute */ - error = vm_map_find(&td->td_proc->p_vmspace->vm_map, NULL, 0, - &vmaddr, a_out->a_text + a_out->a_data, 0, VMFS_NO_SPACE, - VM_PROT_ALL, VM_PROT_ALL, 0); - if (error) - goto cleanup; - - error = vn_rdwr(UIO_READ, vp, (void *)vmaddr, file_offset, - a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, - td->td_ucred, NOCRED, &aresid, td); - if (error != 0) - goto cleanup; - if (aresid != 0) { - error = ENOEXEC; - goto cleanup; - } - } else { - /* - * for QMAGIC, a_entry is 20 bytes beyond the load address - * to skip the executable header - */ - vmaddr = trunc_page(a_out->a_entry); - - /* - * Map it all into the process's space as a single - * copy-on-write "data" segment. - */ - map = &td->td_proc->p_vmspace->vm_map; - error = vm_mmap(map, &vmaddr, - a_out->a_text + a_out->a_data, VM_PROT_ALL, VM_PROT_ALL, - MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, vp, file_offset); - if (error) - goto cleanup; - vm_map_lock(map); - if (!vm_map_lookup_entry(map, vmaddr, &entry)) { - vm_map_unlock(map); - error = EDOOFUS; - goto cleanup; - } - entry->eflags |= MAP_ENTRY_VN_EXEC; - vm_map_unlock(map); - textset = false; - } - - if (bss_size != 0) { - /* Calculate BSS start address */ - vmaddr = trunc_page(a_out->a_entry) + a_out->a_text + - a_out->a_data; - - /* allocate some 'anon' space */ - error = vm_map_find(&td->td_proc->p_vmspace->vm_map, NULL, 0, - &vmaddr, bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, - VM_PROT_ALL, 0); - if (error) - goto cleanup; - } - -cleanup: - if (opened) { - if (locked) - VOP_UNLOCK(vp); - locked = false; - VOP_CLOSE(vp, FREAD, td->td_ucred, td); - } - if (textset) { - if (!locked) { - locked = true; - VOP_LOCK(vp, LK_SHARED | LK_RETRY); - } - VOP_UNSET_TEXT_CHECKED(vp); - } - if (locked) - VOP_UNLOCK(vp); - - /* Release the temporary mapping. */ - if (a_out) - kmap_free_wakeup(exec_map, (vm_offset_t)a_out, PAGE_SIZE); - - return (error); -} - -#endif /* __i386__ */ - #ifdef LINUX_LEGACY_SYSCALLS int linux_select(struct thread *td, struct linux_select_args *args) diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index fb42c3e9df84..148258ac049c 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -31,15 +31,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include +#include #include #include #include +#include #include #include #include @@ -49,8 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include + #include #include #include @@ -58,7 +65,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include +#include #include @@ -701,3 +711,253 @@ bsd_to_linux_regset(const struct reg *b_reg, l_regset->esp = b_reg->r_esp; l_regset->ss = b_reg->r_ss; } + +int +linux_uselib(struct thread *td, struct linux_uselib_args *args) +{ + struct nameidata ni; + struct vnode *vp; + struct exec *a_out; + vm_map_t map; + vm_map_entry_t entry; + struct vattr attr; + vm_offset_t vmaddr; + unsigned long file_offset; + unsigned long bss_size; + char *library; + ssize_t aresid; + int error; + bool locked, opened, textset; + + a_out = NULL; + vp = NULL; + locked = false; + textset = false; + opened = false; + + if (!LUSECONVPATH(td)) { + NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1, + UIO_USERSPACE, args->library); + error = namei(&ni); + } else { + LCONVPATHEXIST(args->library, &library); + NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1, + UIO_SYSSPACE, library); + error = namei(&ni); + LFREEPATH(library); + } + if (error) + goto cleanup; + + vp = ni.ni_vp; + NDFREE_PNBUF(&ni); + + /* + * From here on down, we have a locked vnode that must be unlocked. + * XXX: The code below largely duplicates exec_check_permissions(). + */ + locked = true; + + /* Executable? */ + error = VOP_GETATTR(vp, &attr, td->td_ucred); + if (error) + goto cleanup; + + if ((vp->v_mount->mnt_flag & MNT_NOEXEC) || + ((attr.va_mode & 0111) == 0) || (attr.va_type != VREG)) { + /* EACCESS is what exec(2) returns. */ + error = ENOEXEC; + goto cleanup; + } + + /* Sensible size? */ + if (attr.va_size == 0) { + error = ENOEXEC; + goto cleanup; + } + + /* Can we access it? */ + error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td); + if (error) + goto cleanup; + + /* + * XXX: This should use vn_open() so that it is properly authorized, + * and to reduce code redundancy all over the place here. + * XXX: Not really, it duplicates far more of exec_check_permissions() + * than vn_open(). + */ +#ifdef MAC + error = mac_vnode_check_open(td->td_ucred, vp, VREAD); + if (error) + goto cleanup; +#endif + error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL); + if (error) + goto cleanup; + opened = true; + + /* Pull in executable header into exec_map */ + error = vm_mmap(exec_map, (vm_offset_t *)&a_out, PAGE_SIZE, + VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp, 0); + if (error) + goto cleanup; + + /* Is it a Linux binary ? */ + if (((a_out->a_magic >> 16) & 0xff) != 0x64) { + error = ENOEXEC; + goto cleanup; + } + + /* + * While we are here, we should REALLY do some more checks + */ + + /* Set file/virtual offset based on a.out variant. */ + switch ((int)(a_out->a_magic & 0xffff)) { + case 0413: /* ZMAGIC */ + file_offset = 1024; + break; + case 0314: /* QMAGIC */ + file_offset = 0; + break; + default: + error = ENOEXEC; + goto cleanup; + } + + bss_size = round_page(a_out->a_bss); + + /* Check various fields in header for validity/bounds. */ + if (a_out->a_text & PAGE_MASK || a_out->a_data & PAGE_MASK) { + error = ENOEXEC; + goto cleanup; + } + + /* text + data can't exceed file size */ + if (a_out->a_data + a_out->a_text > attr.va_size) { + error = EFAULT; + goto cleanup; + } + + /* + * text/data/bss must not exceed limits + * XXX - this is not complete. it should check current usage PLUS + * the resources needed by this library. + */ + PROC_LOCK(td->td_proc); + if (a_out->a_text > maxtsiz || + a_out->a_data + bss_size > lim_cur_proc(td->td_proc, RLIMIT_DATA) || + racct_set(td->td_proc, RACCT_DATA, a_out->a_data + + bss_size) != 0) { + PROC_UNLOCK(td->td_proc); + error = ENOMEM; + goto cleanup; + } + PROC_UNLOCK(td->td_proc); + + /* + * Prevent more writers. + */ + error = VOP_SET_TEXT(vp); + if (error != 0) + goto cleanup; + textset = true; + + /* + * Lock no longer needed + */ + locked = false; + VOP_UNLOCK(vp); + + /* + * Check if file_offset page aligned. Currently we cannot handle + * misalinged file offsets, and so we read in the entire image + * (what a waste). + */ + if (file_offset & PAGE_MASK) { + /* Map text+data read/write/execute */ + + /* a_entry is the load address and is page aligned */ + vmaddr = trunc_page(a_out->a_entry); + + /* get anon user mapping, read+write+execute */ + error = vm_map_find(&td->td_proc->p_vmspace->vm_map, NULL, 0, + &vmaddr, a_out->a_text + a_out->a_data, 0, VMFS_NO_SPACE, + VM_PROT_ALL, VM_PROT_ALL, 0); + if (error) + goto cleanup; + + error = vn_rdwr(UIO_READ, vp, (void *)vmaddr, file_offset, + a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, + td->td_ucred, NOCRED, &aresid, td); + if (error != 0) + goto cleanup; + if (aresid != 0) { + error = ENOEXEC; + goto cleanup; + } + } else { + /* + * for QMAGIC, a_entry is 20 bytes beyond the load address + * to skip the executable header + */ + vmaddr = trunc_page(a_out->a_entry); + + /* + * Map it all into the process's space as a single + * copy-on-write "data" segment. + */ + map = &td->td_proc->p_vmspace->vm_map; + error = vm_mmap(map, &vmaddr, + a_out->a_text + a_out->a_data, VM_PROT_ALL, VM_PROT_ALL, + MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, vp, file_offset); + if (error) + goto cleanup; + vm_map_lock(map); + if (!vm_map_lookup_entry(map, vmaddr, &entry)) { + vm_map_unlock(map); + error = EDOOFUS; + goto cleanup; + } + entry->eflags |= MAP_ENTRY_VN_EXEC; + vm_map_unlock(map); + textset = false; + } + + if (bss_size != 0) { + /* Calculate BSS start address */ + vmaddr = trunc_page(a_out->a_entry) + a_out->a_text + + a_out->a_data; + + /* allocate some 'anon' space */ + error = vm_map_find(&td->td_proc->p_vmspace->vm_map, NULL, 0, + &vmaddr, bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, + VM_PROT_ALL, 0); + if (error) + goto cleanup; + } + +cleanup: + if (opened) { + if (locked) + VOP_UNLOCK(vp); + locked = false; + VOP_CLOSE(vp, FREAD, td->td_ucred, td); + } + if (textset) { + if (!locked) { + locked = true; + VOP_LOCK(vp, LK_SHARED | LK_RETRY); + } + VOP_UNSET_TEXT_CHECKED(vp); + } + if (locked) + VOP_UNLOCK(vp); + + /* Release the temporary mapping. */ + if (a_out) + kmap_free_wakeup(exec_map, (vm_offset_t)a_out, PAGE_SIZE); + + return (error); +} From nobody Tue Feb 14 14:47:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPF24ystz3s2ST; Tue, 14 Feb 2023 14:47: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 4PGPF21T6Vz46fX; Tue, 14 Feb 2023 14:47:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2BPMT8ZtLBqYIrIQcbVN43qnVWEiEA+8V6DkmOTnpFQ=; b=AvBRYJb5e60NOjwrTA28XggCJnRyu7deCVxqktN8sMgI7PGq+T3d3Ch55y4Fpm9kBrFv1S 43zUHiIehVsjj9NQbfgJo0knBxcRt4sukjaxCIDvY3gdP4Z/nrCKnwLhQ57avck7iSG8vX A4wa0RhLthfAXwFrGo1zYCE5O8X7mkroyBbnH+N286Lft20/KNAOsaqySVqF3WV7vz9H7/ ukeYN9gIQ85NSxASWMlRvN7qERpWNDL8DlnA6b15fRkDq99bL15NdZ6wYTFa+BCRcHI6va XB4uP/cNmQG/gZ+4I0URS5t/PMOezpcGFnkoApzLiZwaNbWkxOeK+aCNySGItQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2BPMT8ZtLBqYIrIQcbVN43qnVWEiEA+8V6DkmOTnpFQ=; b=FxTuX2lk+2F85mLU7sgjPKrmYA7nr/5cHnQNCzeD6cKFq+2sEX5JGsMVMkm19LT0JBrlZy kb5FiavGmzXPV9kzbWi2oaXtEMpEN7eZ2YW6YgLah20Mncv6vEcavWJPpmQBH6CwhnGVpw xyKH3PgjML7FBTKLNpQgA60N/qunkeo3sFut1+jWWP/qNpLg2ybtE38o8kXOuL6JFcoTg4 wC7ZPEGinJrKlKKWMTNgQORNf42VHOjqsedRqagS7PnTqKhXP9jBC1xQjwHXHwtZe4mKzZ NeTy6bd6ULDyeFXm7IIZpmEay0rRhW/Ieoeq4J9OBJ77pqcxyq2TjyztqrSRuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386038; a=rsa-sha256; cv=none; b=WmtbfNgQVHfhQRRtPJlREP0HtE7puu7ucYBoNhrF2exNM+6pdR2KrUXBpabCnEicy1us9V cEMNnub11n+9jbQO6QZWgMK/8jWvjfuN54or6WV7PhpA01fiicqo2MUgmR5h3Ou2eA63zV H+WDHb5bYw4hjPNNjTG8kXbyXhLUYc4WYIs6GlHK3uqqSx1EvJTJYVU+Zl7iJZuXzdUbM0 n5oMNPGkxldaIMt7Fl59ElkEZ5j8rrU0pF658OGIwLz7trZF1LbDmBb+EXraewcXjcgjax Y1IU0JQbf2aAKDO6pzn03og7wf2Ver1eMRaYfDPWpUWP/MrK4vAlEyxPVXoNSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPF20b40z12QV; Tue, 14 Feb 2023 14:47: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 31EElHAV072411; Tue, 14 Feb 2023 14:47:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElHUn072410; Tue, 14 Feb 2023 14:47:17 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:17 GMT Message-Id: <202302141447.31EElHUn072410@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: acbbd5c03933 - main - linux(4): Cleanup sys/uio.h where linux_uitl.h is included List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: acbbd5c0393345f13aa4b902e2c1ac83b7e39b59 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=acbbd5c0393345f13aa4b902e2c1ac83b7e39b59 commit acbbd5c0393345f13aa4b902e2c1ac83b7e39b59 Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:31 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:31 +0000 linux(4): Cleanup sys/uio.h where linux_uitl.h is included MFC after: 2 weeks --- sys/compat/linux/linux_ioctl.c | 1 - sys/compat/linux/linux_misc.c | 1 - sys/compat/linux/linux_socket.c | 1 - 3 files changed, 3 deletions(-) diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index a9d39ef18429..18f911de29a4 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 4dba124a918f..562b2f3170a7 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 4bf528943d4f..d0648f88d549 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From nobody Tue Feb 14 14:47:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPF34jppz3s2fS; Tue, 14 Feb 2023 14:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGPF329RXz46VW; Tue, 14 Feb 2023 14:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QzWarjUAqZIr/Hj3LVVbbwbhUB+izzcq4+zbAgYf7eg=; b=GQNFzzNKqcGse137vRe4U6p/kpRPMFniiF7ix1S8N58+fZxTCJarzRqr1wLScR+8LvL97+ Nx/RjmcHnCgStMlPLTN53NP2mehzHEpYT27qZ+b8yzSJRIu5jniFseFGh6Bt/vv0tT2N5R EOIOWgY2gThwDkE0qIDkaY85pfNnV32Ghhqfl5+Xv9aI3HQ3ZHuNIvyfL8GW5AaXyUK3vj ssW7b8Sdh6J0TiG7mEBDII6yX5d62nVru0AQD3ypMlPxyzdoBKPv1iEKxbe9aVxt9Zg2u8 XKztKg2cte1k0p3aGed6+ciSGFp8k95PkkzQ7FmZBOQwMdyolyOaoLjrIZ+bZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QzWarjUAqZIr/Hj3LVVbbwbhUB+izzcq4+zbAgYf7eg=; b=Ck06AJjXCYArilsmwojvnesnQVZgQWeAogWPn9dhfiuVKCoUTkqKqvAauUR5fGZWM04QME +Boqsdr+ieDJaXos9qmzcZEoaeC9d2wpJ+n9V0e9ZI/RNkzet1EgYYBJU3z13xtmWtOLDn KKiyDfASBPJnui5O07Z6Og2ZbltK0b7dvsmf5e8i1iMpYP0o25nx8bFy1hVfgZW5D4jYxL 4gdD0vGusHcYNfjICfQHFfuC2qkawHpqdLd2MkKvrFjnJ4BwJOS9Yp1xIggGbGTJhN2TMm OL2Sq8Kk+Dg8WlsMr6mTv1/Op3fxZACzcLucP8aujISgDc8jdsveEOIdKv2kHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386039; a=rsa-sha256; cv=none; b=IE5DtlyXDm5lkcqmNWj9V7BDIAcWdbHhW8LNFqHhqUl/73Uq3cfOKtuleZSRzsQyt3HbyE tChTe7jW8XYHkVG3n7UgHqYgT7cqt5CAUJ2iHPZoIQkq9QecwT0cLn1fZppmrj7C/7l7oi 0d7IYYVfw2AG8Tg6yXq/+JRXbtycA6XPSq5vdvsFpF2VoWTOVHUi/s/j0q9EO+PmltsbOS 2MXJb1HUPdSDRcbr72e77pbPSzKJZ7ecE+b2R1aubwJSeD5/dDqnZ6pu7NigcY/5VpLPbO /AG0tc2ePFCgWPpwh9a2zGcRrEc2bSEIXkQBsSeRdJ7yt2sQAPQVORV3Lg7y4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPF31Gytz12mh; Tue, 14 Feb 2023 14:47: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 31EElJ52072435; Tue, 14 Feb 2023 14:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElJkP072434; Tue, 14 Feb 2023 14:47:19 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:19 GMT Message-Id: <202302141447.31EElJkP072434@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: 32fdc75fe727 - main - linux(4): Move use_real_names knob to the linux.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 32fdc75fe7276083d446964055b0de0e29970b7c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=32fdc75fe7276083d446964055b0de0e29970b7c commit 32fdc75fe7276083d446964055b0de0e29970b7c Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:32 +0000 linux(4): Move use_real_names knob to the linux.c MI linux.[c|h] are the module independent in terms of the Linux emulation layer (ie, intended for both ISA - 32 & 64 bit), analogue of MD linux.h. There must be a code here that cannot be placed into the corresponding by common sense MI source and header files, i.e., code is machine independent, but ISA dependent. For the use_real_names knob, the code must be placed into the linux_socket.[c|h], however linux_socket is ISA dependent. MFC after: 2 weeks --- sys/compat/linux/linux.c | 12 ++++++++++++ sys/compat/linux/linux.h | 10 ++++++++++ sys/compat/linux/linux_util.c | 15 --------------- sys/compat/linux/linux_util.h | 9 --------- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index 1a0459fd3f7b..2208d6cb1b6d 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -59,6 +59,11 @@ __FBSDID("$FreeBSD$"); CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); +static bool use_real_ifnames = false; +SYSCTL_BOOL(_compat_linux, OID_AUTO, use_real_ifnames, CTLFLAG_RWTUN, + &use_real_ifnames, 0, + "Use FreeBSD interface names instead of generating ethN aliases"); + static int bsd_to_linux_sigtbl[LINUX_SIGTBLSZ] = { LINUX_SIGHUP, /* SIGHUP */ LINUX_SIGINT, /* SIGINT */ @@ -723,3 +728,10 @@ bsd_to_linux_poll_events(short bev, short *lev) *lev = bits; } + +bool +linux_use_real_ifname(const struct ifnet *ifp) +{ + + return (use_real_ifnames || !IFP_IS_ETH(ifp)); +} diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index cd7e8cd6b3e0..055d8e3b9cf6 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -284,6 +284,16 @@ struct l_statx { ktrstruct("l_sigset_t", (s), l) #endif +/* + * Criteria for interface name translation + */ +#define IFP_IS_ETH(ifp) ((ifp)->if_type == IFT_ETHER) +#define IFP_IS_LOOP(ifp) ((ifp)->if_type == IFT_LOOP) + +struct ifnet; + +bool linux_use_real_ifname(const struct ifnet *); + void linux_netlink_register(void); void linux_netlink_deregister(void); diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c index 4fa460078597..2656bab92171 100644 --- a/sys/compat/linux/linux_util.c +++ b/sys/compat/linux/linux_util.c @@ -50,10 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - #include #include @@ -86,11 +82,6 @@ SYSCTL_STRING(_compat_linux, OID_AUTO, emul_path, CTLFLAG_RWTUN, linux_emul_path, sizeof(linux_emul_path), "Linux runtime environment path"); -static bool use_real_ifnames = false; -SYSCTL_BOOL(_compat_linux, OID_AUTO, use_real_ifnames, CTLFLAG_RWTUN, - &use_real_ifnames, 0, - "Use FreeBSD interface names instead of generating ethN aliases"); - /* * Search an alternate path before passing pathname arguments on to * system calls. Useful for keeping a separate 'emulation tree'. @@ -324,9 +315,3 @@ linux_device_unregister_handler(struct linux_device_handler *d) return (EINVAL); } - -bool -linux_use_real_ifname(const struct ifnet *ifp) -{ - return (use_real_ifnames || !IFP_IS_ETH(ifp)); -} diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h index b00a9036d367..37445ad0af27 100644 --- a/sys/compat/linux/linux_util.h +++ b/sys/compat/linux/linux_util.h @@ -113,15 +113,6 @@ int linux_vn_get_major_minor(const struct vnode *vn, int *major, int *minor); char *linux_get_char_devices(void); void linux_free_get_char_devices(char *string); -/* - * Criteria for interface name translation - */ -#define IFP_IS_ETH(ifp) ((ifp)->if_type == IFT_ETHER) -#define IFP_IS_LOOP(ifp) ((ifp)->if_type == IFT_LOOP) - -struct ifnet; -bool linux_use_real_ifname(const struct ifnet *ifp); - #if defined(KTR) #define KTR_LINUX KTR_SUBSYS From nobody Tue Feb 14 14:47:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPF442dlz3s2hK; Tue, 14 Feb 2023 14:47:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGPF437dNz46g3; Tue, 14 Feb 2023 14:47:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4N0Hqd/oPbrzj4YjGamTmty7j+0uza4RbpUaRsnh/fk=; b=bCfuRll3jVLeeKPUgIvyvKPCnSfdpZ1qYXxmHDEfFmW1vE+2Uxz63N+RgFdhkKUk5ckm8l fKcKkOPUNB58SQA5QMeyfCSYYaHwv/2k2im2pxoQ5MReihHJnaK8Hf0smoa9iFHRHVLXxY /0NvNdDNuxnA4+8OJK3c+V9M2HJJVTQd4fmcjy3KbFZg938hzXHkalLQfg745MAmjSl04Z ny2DmMA7FtiPPk7t5Te+qaNHTP+aPVQepddnk5J95h8TQ/qLz2xUH3PEth11vcNhgUIRvA 5tGzIRvBfP8H4bFRa/wf5LFADoHb5SV6EMBRogrIe5dktqRw1mt1u0Gr1yqEFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4N0Hqd/oPbrzj4YjGamTmty7j+0uza4RbpUaRsnh/fk=; b=SaUBbAfuhQdM5+O3PbaXqunlqx7JVANQYsFuvx2Ey67GH8EXqg7BgVSCWuBErvZrBJPVM0 qWNoO88DWaWIXYSwwu5sJ0vrU7kIQmbRk/Qx+AaHYy5fqKapXz+MCiQGKjW+ws3PV+oDXl E81sR9N6FucbW4/4SM6e1F0U0LLoFYtw6bNN/J1TrkUccZwmhUzH/OCWE90G/ZjtAW0vD9 ln9vOLQuVA4msDyg6cj3d3nOmV2LB9POpZ+jozJnrOE3xygpm/lvZ8Hj+kfnTKnvTJdbmv kzWglaBo6oqBcPcoEoN95zjQ/3FjVeL4a6ZuMvzu0CsGgjNQ9m5PFM6Pc/jMNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386040; a=rsa-sha256; cv=none; b=pIoXJp7/GXCQQLKD2qVxb7iIkZv7rVn8I/RrgJDSfK1cZ9wqn+v7xozLtkC9SzRVqGCZr+ dbVH6F8u+wuYpbZFNwr9H1SJY1yr29hxOirt1YbqMu3MFh0AomgC4kkNTlNaTtl2tfL5tF 2bF0aR+C2yifH99hdjkT54G1RCp8CYLCvyCMMhPw2a3a6dKkjCDSaZFeZoHG6MiCExzpEY IgoNhiM9QqjtUb9UfcP4oZYZwThjWMIElf1Epme5t9xHbddtO9UkQnqA+iUohYeE1fS/i6 HMqfaA5HjyaGIGc38WmnzJfLKeaxot+m4hbRbjbOzuuz686Eiwy/Pewbtj8NKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPF42Bzyz12j4; Tue, 14 Feb 2023 14:47: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 31EElKIp072460; Tue, 14 Feb 2023 14:47:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElKTm072459; Tue, 14 Feb 2023 14:47:20 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:20 GMT Message-Id: <202302141447.31EElKTm072459@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: 77f66834b059 - main - linux(4): Fix brackets of local include opt_inet6 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 77f66834b059ae8327b731a19794788eed59178c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=77f66834b059ae8327b731a19794788eed59178c commit 77f66834b059ae8327b731a19794788eed59178c Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:32 +0000 linux(4): Fix brackets of local include opt_inet6 MFC after: 2 weeks --- sys/compat/linux/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index 2208d6cb1b6d..3aa34a21e0c5 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -26,7 +26,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "opt_inet6.h" #include #include From nobody Tue Feb 14 14:47:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPF547Hyz3s2fb; Tue, 14 Feb 2023 14:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGPF53h6Gz46df; Tue, 14 Feb 2023 14:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ieUmYZ5ow8KBlml2NEfiV/+AuNCwZLKc7pG+D3svLAU=; b=OYzIn+4c3sCMwAIRZFC4jVXyGEOS/dLJKuI4uNc7u5OPLeNy7BSogongAgQ1xY6sSNb3uy aDut4ru4oYwq8Y5WlMGJ0lEtMmxt6E7OIaopgPwVII890h0XjetUUolGq/LdwnX0oVqg4H IIdI6hzVGyhOF0stC/YLoXqUoOuHDua4cQ78ThconCa07uBmhaPvkrv06pt3LG/y+rwDtB wcu2JTJ5AQRoFXc9JMrBVCXbwvG8lptoRfPVgbKEkdCMmKftTq17kYsRAWiwHuWjHWL0cW pOSWJCPCa9AL/jWjDZl5CJlwWhFA8MNewzx2+qRXgu6cxgxQIdKc/zes0ZXkwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ieUmYZ5ow8KBlml2NEfiV/+AuNCwZLKc7pG+D3svLAU=; b=X7OsjsfclnUx27aR+6wiSnDtmYVxTwboyfdCLn/WF524WY/6h+TvQmrO7gWxADQSTY46U/ mztR5c645aOE/xGqYQAXRKkUFJcdP9/M31Z1zm5Aw7F5ZzopY5uNkDrOnMcHbDdh7t2/fe UBgJuhq39VNuZuO7AY2IXMahylM2gHPE4yagEtVaYfNUDXfv6huPWG2fNKJBQJjdALGxTF l5S/YQ9ciTeviryFgSr6eLlpXyQSj3VtqTfDrSQy2COZpd3tQpehsfUkv7YORslTGyp2Rj p+7cy+FlNxj3rRWGLwGiF6M0ILZQ2Ns+jFn5Dg+jim7sFU8i5Bcj9UmAnXOxzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386041; a=rsa-sha256; cv=none; b=rMQ3HpwzF4zJNMbNseifnUn1J4Mddi/6aY9uWEKc7cF0m481ebP5cYgaOH6kWfjDJjknEn H3gZpzHIzhJ50UZ2lcwyre95XaRKKEwY8ETS1s2rbHx3DMktm8omJrUElFSdVW45YYHpF+ RScAHR+PvWrrvggczFCRN30WSIBK8aXgxamwI7tFC9QzrNSIE3u1IEBRbL+PorvlhKmbaA x0jXIDP2b9rmJaP/12Onq6GFiZDOMNA7oDAbIcaGb0e9fJBwlN3M2pSW6WOKjjiGEnuls0 FHgHq0xYHwOUP2kEjXzIObFRhxJW06VD5Dih3W2IdD2/wn64OMBvrALPkxiEOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPF52nq7z12yY; Tue, 14 Feb 2023 14:47:21 +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 31EElL6V072485; Tue, 14 Feb 2023 14:47:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElL68072484; Tue, 14 Feb 2023 14:47:21 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:21 GMT Message-Id: <202302141447.31EElL68072484@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: e2028292e54a - main - linux(4): Cleanup sys/sysctl.h from linux_misc.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: e2028292e54a4541d1e80159c78516a0b3332e0c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e2028292e54a4541d1e80159c78516a0b3332e0c commit e2028292e54a4541d1e80159c78516a0b3332e0c Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:32 +0000 linux(4): Cleanup sys/sysctl.h from linux_misc.h Leftover after c5156c77 (r374538). MFC after: 2 weeks --- sys/compat/linux/linux_misc.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index 7a8073539e87..96fcfcbf52b9 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -31,8 +31,6 @@ #ifndef _LINUX_MISC_H_ #define _LINUX_MISC_H_ -#include - #define LINUX_MAX_PID_NS_LEVEL 32 /* bits per mask */ From nobody Tue Feb 14 14:47:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPF65CR8z3s2fg; Tue, 14 Feb 2023 14:47:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGPF64WmBz46sm; Tue, 14 Feb 2023 14:47:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7pwmuKJbkve4mE/P1l4YMpvDMzvlesT969GP8ZwO+Mw=; b=QkkYAtY/uQhK/vqmwh3FPhIaPUpg1fdjPKucC+aguyClqbUNZMiTWRzXnZbzKMkBxc72KG I82duUh7/oVuU2fHgiajHTZ1vkTmfxzoZLJHvFHBN8zDmWLLnqvI13rTPVldeZtqQNskJl kf3PFOkDWtBJYb0URsGDBwq0fR+GEGBxPf21FgohtJV+dPCpAXxaM0maXjd/WoRZDMIjuA 2rMS59o7yDJ24O2MOw+uk9L/5xJ28QhRADmH1JW7pX/aSTbrLbm7o3mab8HTpMZ+GB5DOF RhzS5UidObFeOH6uN4nrW1SsZUyJEzSzdN1UlG54WREomHgEzG60DMS4r7OfMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7pwmuKJbkve4mE/P1l4YMpvDMzvlesT969GP8ZwO+Mw=; b=uFDoU1GAp56r6CdmVqRRFnnesWOrn+qNZlcmPjr2dSnXw5lk2cI6G91lGvccNw/rU5/9Ru 4IMWd1St1xsoVkpKrASfZqtmhvCt7YUee0vH5JSTprD0tuTvCqR6oMEjJ+DO+3Cm22VGKz NCdmbUo4lHUIGUsRUy9aXLNkENrBZVdH6ImyAuv9LLUw08cM0mJbnIwfczDZMHaEZJpXlF fprFQPqg5hI7GcfuriNqoZmxUFvYIST97Wc0e+K7SPzmteRdCU5/PMri2foCTQSUU3ia+7 jSra2igBUCgvFkS4eao4UZu1f+YRvKNkj2tBE5NLyw5kFOHABaoPpFpmYHgy5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386042; a=rsa-sha256; cv=none; b=kEKgilfeNPAE3h+U+MvI8LEnRaAnEUzwksTzIkNR8ZXJDOBplIeqHy1a/iXK6m0xQKSb09 w7JApZ9ga+2I7NoXJsc+tyTxafleuUqLzj7n2JXus8umW2F4KHRbdvF961QKMLrQRq2gIq WUI1O8Np2Ui90BuNEvdFtqSepHimGw+Ui88T3VZ7WhQ/HbmjIpG8CalQCHnf23dCg3JT7A iqgs1jnym2xbbFML70BX5jbft+EctugQXJLmsZjX6lA2WSebUTYEEhIoHzx4dKc8h2SU1k 7F2zBII9TcbTmgudJSsmW+nYhfaaUwRbPwppBGDTGbV4PurWbotZcO0RPyIOsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPF63dZDz12yZ; Tue, 14 Feb 2023 14:47: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 31EElM4o072509; Tue, 14 Feb 2023 14:47:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElMhW072508; Tue, 14 Feb 2023 14:47:22 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:22 GMT Message-Id: <202302141447.31EElMhW072508@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: d8e53d94fae9 - main - linux(4): Cleanup includes under compat/linux List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: d8e53d94fae90cf3c83db5af0eaba0be0f55e00a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=d8e53d94fae90cf3c83db5af0eaba0be0f55e00a commit d8e53d94fae90cf3c83db5af0eaba0be0f55e00a Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:32 +0000 linux(4): Cleanup includes under compat/linux Cleanup unneeded includes, sort the rest according to style(9). No functional changes. MFC after: 2 weeks --- sys/compat/linux/linux.c | 1 - sys/compat/linux/linux_common.c | 4 ---- sys/compat/linux/linux_dummy.c | 3 +-- sys/compat/linux/linux_emul.c | 4 +--- sys/compat/linux/linux_errno.c | 2 +- sys/compat/linux/linux_event.c | 18 +++++++----------- sys/compat/linux/linux_file.c | 7 ------- sys/compat/linux/linux_fork.c | 3 --- sys/compat/linux/linux_futex.c | 3 ++- sys/compat/linux/linux_getcwd.c | 6 ++---- sys/compat/linux/linux_ioctl.c | 22 +++++----------------- sys/compat/linux/linux_ipc.c | 7 +++---- sys/compat/linux/linux_mib.c | 8 ++------ sys/compat/linux/linux_misc.c | 10 ---------- sys/compat/linux/linux_mmap.c | 3 +-- sys/compat/linux/linux_netlink.c | 6 +++++- sys/compat/linux/linux_signal.c | 3 +-- sys/compat/linux/linux_socket.c | 12 ++---------- sys/compat/linux/linux_stats.c | 11 +++-------- sys/compat/linux/linux_sysctl.c | 5 +---- sys/compat/linux/linux_time.c | 12 ++---------- sys/compat/linux/linux_timer.c | 4 +--- sys/compat/linux/linux_uid16.c | 5 +---- sys/compat/linux/linux_util.c | 5 ----- sys/compat/linux/linux_vdso.c | 6 ++---- 25 files changed, 43 insertions(+), 127 deletions(-) diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index 3aa34a21e0c5..4e435081b3b6 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include -#include #include #include #include diff --git a/sys/compat/linux/linux_common.c b/sys/compat/linux/linux_common.c index 9762f16fd747..338b1a0b6989 100644 --- a/sys/compat/linux/linux_common.c +++ b/sys/compat/linux/linux_common.c @@ -28,17 +28,13 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include -#include #include #include #include #include -#include -#include #include #include diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index 6bfeeaf5c298..45b0db6d6dde 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -29,9 +29,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include #include /* diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 08510fc29a3f..afe25f2cf035 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -32,17 +32,15 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include -#include #include #include #include #include -#include #include #include +#include #include #include diff --git a/sys/compat/linux/linux_errno.c b/sys/compat/linux/linux_errno.c index 69880db86319..a8a259fda15a 100644 --- a/sys/compat/linux/linux_errno.c +++ b/sys/compat/linux/linux_errno.c @@ -4,8 +4,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index fc27996580c2..a3b54e6aac60 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -30,21 +30,17 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include -#include #include #include -#include -#include +#include +#include +#include #include #include #include -#include -#include +#include +#include +#include #include #include #include @@ -52,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifdef COMPAT_LINUX32 #include diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 29a0afaeedda..db4b1151bc60 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -31,25 +31,18 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include #include #include -#include #include -#include -#include -#include #include #include #include #include #include #include -#include #include #include #include diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c index 6918868b2c50..7e9aaff7c990 100644 --- a/sys/compat/linux/linux_fork.c +++ b/sys/compat/linux/linux_fork.c @@ -32,8 +32,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include #include #include @@ -45,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index aed6bbf94cee..af16ecfe53fe 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -30,15 +30,16 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include +#include #include #include #include #include #include +#include #include #ifdef COMPAT_LINUX32 diff --git a/sys/compat/linux/linux_getcwd.c b/sys/compat/linux/linux_getcwd.c index 304a72d06588..1c893737f8a6 100644 --- a/sys/compat/linux/linux_getcwd.c +++ b/sys/compat/linux/linux_getcwd.c @@ -39,10 +39,9 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include #include +#include +#include #ifdef COMPAT_LINUX32 #include @@ -52,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#include /* * Find pathname of process's current directory. diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 18f911de29a4..0020149c2c62 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -30,21 +30,12 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#ifdef COMPAT_LINUX32 -#include -#endif #include #include -#include -#include -#include #include -#include +#include +#include #include -#include -#include #include #include #include @@ -53,18 +44,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include #include #include -#include -#include #include +#include +#include #include -#include -#include -#include #include #include diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index a72b0a9709b5..0791e1ad2cbe 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -30,16 +30,15 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include #include #include +#include #include #include #include +#include #include +#include #ifdef COMPAT_LINUX32 #include diff --git a/sys/compat/linux/linux_mib.c b/sys/compat/linux/linux_mib.c index ed1bdc528278..1ff82fc79289 100644 --- a/sys/compat/linux/linux_mib.c +++ b/sys/compat/linux/linux_mib.c @@ -30,15 +30,11 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include +#include #include #include #include -#include +#include #include #include diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 562b2f3170a7..a4aa5903e3b9 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -33,16 +33,11 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include -#include #include #include -#include -#include -#include #include #include #include @@ -53,20 +48,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include #include #include #include -#include #include #include #include -#include -#include #include #include diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c index 4e53f3255b07..07df6f5fd43d 100644 --- a/sys/compat/linux/linux_mmap.c +++ b/sys/compat/linux/linux_mmap.c @@ -34,9 +34,8 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include -#include #include #include #include diff --git a/sys/compat/linux/linux_netlink.c b/sys/compat/linux/linux_netlink.c index 7744fee094e0..8a378d596187 100644 --- a/sys/compat/linux/linux_netlink.c +++ b/sys/compat/linux/linux_netlink.c @@ -27,13 +27,17 @@ #include __FBSDID("$FreeBSD$"); + #include "opt_inet.h" #include "opt_inet6.h" + #include +#include +#include #include #include #include -#include +#include #include #include diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 26da86eba9f7..4bff891d4206 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -32,13 +32,12 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" #include -#include #include #include #include -#include #include #include +#include #include #include #ifdef KTRACE diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index d0648f88d549..ec741abe85de 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -32,23 +32,16 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include -#include -#include -#include #include -#include -#include #include #include -#include #include -#include #include +#include #include #include #include -#include -#include +#include #include #include @@ -57,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #ifdef INET6 diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 1049cb54748b..d00888e77e84 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -32,19 +32,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include +#include #include -#include -#include +#include +#include #include #include -#include #include #include -#include -#include #ifdef COMPAT_LINUX32 #include diff --git a/sys/compat/linux/linux_sysctl.c b/sys/compat/linux/linux_sysctl.c index abf2c898902d..6c4d049821ec 100644 --- a/sys/compat/linux/linux_sysctl.c +++ b/sys/compat/linux/linux_sysctl.c @@ -30,15 +30,12 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include -#include -#include #include -#include #include +#include #ifdef COMPAT_LINUX32 #include diff --git a/sys/compat/linux/linux_time.c b/sys/compat/linux/linux_time.c index c35d257cd78c..102dc4fff4bd 100644 --- a/sys/compat/linux/linux_time.c +++ b/sys/compat/linux/linux_time.c @@ -38,21 +38,13 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/05/14 03:40:54 christos Exp #endif #include -#include -#include -#include #include -#include +#include #include +#include #include -#include -#include -#include #include -#include #include -#include -#include #ifdef COMPAT_LINUX32 #include diff --git a/sys/compat/linux/linux_timer.c b/sys/compat/linux/linux_timer.c index 4b888eac7718..5f0f5b28e624 100644 --- a/sys/compat/linux/linux_timer.c +++ b/sys/compat/linux/linux_timer.c @@ -31,12 +31,10 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include -#include #include -#include #ifdef COMPAT_LINUX32 #include diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c index 149d75459bc8..e6ad3fb967fb 100644 --- a/sys/compat/linux/linux_uid16.c +++ b/sys/compat/linux/linux_uid16.c @@ -29,18 +29,15 @@ #include __FBSDID("$FreeBSD$"); -#include #include -#include +#include #include #include #include #include #include -#include #include #include -#include #ifdef COMPAT_LINUX32 #include diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c index 2656bab92171..6d82f87a3b31 100644 --- a/sys/compat/linux/linux_util.c +++ b/sys/compat/linux/linux_util.c @@ -40,14 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include -#include #include -#include -#include #include #include diff --git a/sys/compat/linux/linux_vdso.c b/sys/compat/linux/linux_vdso.c index b4093e64eb83..af6a199f1181 100644 --- a/sys/compat/linux/linux_vdso.c +++ b/sys/compat/linux/linux_vdso.c @@ -33,22 +33,20 @@ __FBSDID("$FreeBSD$"); #endif #include -#include #include #include -#include +#include #include #include -#include #include -#include #include #include #include #include #include #include +#include #include From nobody Tue Feb 14 14:47:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPF76xlLz3s2vH; Tue, 14 Feb 2023 14:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGPF75YLpz473X; Tue, 14 Feb 2023 14:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PGkrLdHEzhtVBoJUvpLlYhSe0kqGizNHkvqF8UuGchE=; b=woIDgLZNmgBewBw4BjQ9u2oI2IJmyK2RSQLRy+7kd5O6d+6X/VNjQrHNS97DJFou0BXOuI +nb5xqIEHqrfLfBdHzhIysMPlwwEboBbCI4FDd1+KYuMxMRw+KlxYNMTgtQft55P7BgjCB +AQMpVh33KFPK1Oqf+HIrv6mckRoU0axazbURfoXxMaqfMIuIEYYZIP7G91Q9qp1kQ9QQe Y3zWiuQtp9e9quRFcdxHEMvGmGnad1PU6XAjk5YqZeSeZFMKT8e/hO7HrVie1tKaAPiE0O NOhugIY8whDk1mmoiQXXu6/maz73xcPYaKbiU0WzpbYp0ChlgW1Vz816rt1IlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PGkrLdHEzhtVBoJUvpLlYhSe0kqGizNHkvqF8UuGchE=; b=xDsrYfz/U6qGZ9IEr+NoCTxWFKS0fJYKWEBscBfybFXUm2PET/8L5WaU/WYGbtBiwBdBuQ pzPlBR4RMfkM9vPnghdcvZFVLunz9aFor90SYhck5UdabJRVsqVI8T16PBTpBtZeqDMxhC fUteI77iG3zMXVK8uO6xoNT6HKh7cCEcNcSKZYUFgO7zUiVnrNbxxo4Gdv/xTI840YihAt azPPROep+ZxEe4cLZdgPpD3Qu8nkiUueMsOl8Iy6hk4Kq3SM0ItoC1Fg9ISk3HBR+FrG8k FsO+tNL2DmJJchoOLTJOZyUV4/9R4sHWu6r6amOGMZ9uOlmhXpzej1wV/7B57g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386043; a=rsa-sha256; cv=none; b=QKCi6Fg930RKFWiqZo/esu9s+u8RkT9NqHmXW1FESs6wBpFtdjVZa785xVQ7NTM/FKg8Nr YaIthJMuLwh5iQEWhYZhglHhGDoN73KNEeLr+ErBBLoYIhrxz+6Ml4n9fIYBHSv3V/Ppsv QJHucfDZ7pSNwYL3iNr+BYb6wIRSyLDZ5e8C6CFpIp7EPcbrJbRZ+C3OuPG6dE9iOrcXNN weGymGLkPA5c9NSROUVDcP8cg6XBDra0m9CKWFeTqw6VAea4U5jZWLugF0FtNz+1/NlRSo yt39tomgdhqmUSPM7cZ5YXorPpR+Gpste3hCbZexS8UVnitKgm2zClqkM74w/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 4PGPF74gSSz12kT; Tue, 14 Feb 2023 14:47: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 31EElNbV072539; Tue, 14 Feb 2023 14:47:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElNiB072538; Tue, 14 Feb 2023 14:47:23 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:23 GMT Message-Id: <202302141447.31EElNiB072538@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: f4a512a5f187 - main - linux(4): Cleanup includes under i386/linux List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: f4a512a5f187d9139c04111784fe811572bc0ed6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f4a512a5f187d9139c04111784fe811572bc0ed6 commit f4a512a5f187d9139c04111784fe811572bc0ed6 Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:32 +0000 linux(4): Cleanup includes under i386/linux Cleanup unneeded includes, sort the rest according to style(9). No functional changes. MFC after: 2 weeks --- sys/i386/linux/linux_copyout.c | 2 +- sys/i386/linux/linux_dummy_machdep.c | 3 +-- sys/i386/linux/linux_machdep.c | 17 ++++------------- sys/i386/linux/linux_sysvec.c | 10 +++------- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/sys/i386/linux/linux_copyout.c b/sys/i386/linux/linux_copyout.c index 3227d904a235..833d25b911c9 100644 --- a/sys/i386/linux/linux_copyout.c +++ b/sys/i386/linux/linux_copyout.c @@ -32,10 +32,10 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include + #include #include #include diff --git a/sys/i386/linux/linux_dummy_machdep.c b/sys/i386/linux/linux_dummy_machdep.c index 0e41a4b3fc56..7f29d2a6808c 100644 --- a/sys/i386/linux/linux_dummy_machdep.c +++ b/sys/i386/linux/linux_dummy_machdep.c @@ -31,9 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include #include #include diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 148258ac049c..0d06218ddc62 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -29,11 +29,11 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_posix.h" + #include -#include #include #include -#include #include #include #include @@ -41,32 +41,26 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include -#include -#include #include #include -#include -#include -#include #include -#include #include #include #include +#include /* needed for pcb definition in linux_set_thread_area */ #include #include #include #include #include -#include #include +#include #include #include @@ -82,9 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* needed for pcb definition in linux_set_thread_area */ - -#include "opt_posix.h" struct l_descriptor { l_uint entry_number; diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index b16e32ac62f1..f0b979725741 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -32,31 +32,27 @@ __FBSDID("$FreeBSD$"); #define __ELF_WORD_SIZE 32 #include -#include #include #include #include #include #include #include +#include #include #include +#include #include #include -#include #include #include #include #include -#include -#include #include -#include +#include #include -#include #include -#include #include #include From nobody Tue Feb 14 14:47:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPF86z7nz3s2rr; Tue, 14 Feb 2023 14:47: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 4PGPF86Mv0z46tg; Tue, 14 Feb 2023 14:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XXz2kSio7RTrjC/W8+jbkxL/yQHDsX6MWpJhM4AaJJ8=; b=Z0IOUU5l2IpS91uReLUqnrrl1BS1iJgTKsAbm0BOeQsfo3y1Byo0D+IQrvYHSWP4O53RiU PNmLGY+QYpn5CMI1y/gbq3aXHfc9X4XkqQrYYa0llILkJVtBROzg3JmQ3ralPHL38O2KVM urQCuVDExkByD8H0pUe4wamR7k/9KrzhI7O85XHRrJGeuvXd7P5KzKOgX0idBgdgRLlBef 1vgmK+RC8o6hblQ3tqhHLUU4TFYiwpUqQUxUAuaXb2PJ2AmhArew/LglqiuubjXBduCS5P I703qzWdgTHzkFEo4rpZt+SssD/tMkgSwC/DNHqpMFNSZJmNCL8M4wJfUwU1tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XXz2kSio7RTrjC/W8+jbkxL/yQHDsX6MWpJhM4AaJJ8=; b=xCgMyrZ5Dg7KQSwWwfFeEXVnnh66dXcloLbSvQT/2L5lcsDOnhaN8ACVt+hDLvVDISOjbP iyQHbzvIDdT3iLOHkonasSuklg7ItzKkaBR4kr6KfOMG7u6jEvXGdrJE/BVXl9NGeInP5n w0UfmDRCek2elskj26xessFirw5lPPfZrCKXoGjCjR0AAcA+00Hqiz4Q5GEtdl5vTctckk vhEs15KGZS+ihiUbLJylrby51qrDV1ffZzkHZX7N8i79UtQU1Zj+NBsXUocYiUc0zZIOnv bpgd0J+XLJoHF+TVcNW+QLNUUxtz/YOJKcwiLN9chnWbT0sTmEvj3gDzZEEgQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386044; a=rsa-sha256; cv=none; b=KGJjKKqnAnjuA72R13SOm77Q3WOHrTgWeey7MfmPzUFPUOn7gKgyZHHj9qmeMNxaE8EmXP 3199OhkA1RAgcmQikODn0/Fakt2iUDryLK14Kp0OoeHf5303xiDBrjIGrl5eUL1iApl2BW SltWVpQ2pxQOWOReGb939w/vQJowe/Y21aH/IVor2TeGxqZ8a2cy/2EEkIrIbKgiq1MoWh i2I0wrcMTINkcO1iimRuJCbVK45GTk++rdWQFvesohR3OnuqPJ49rELDIzYayNvDf2Pr5y iqnVfK1PuwXy7BaPE06FylGwp7MglMKac+ndmA+oUbTxA2WBAR0MjsGEi2/+gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPF85TK6z12SX; Tue, 14 Feb 2023 14:47: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 31EElOHp072564; Tue, 14 Feb 2023 14:47:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElOSk072563; Tue, 14 Feb 2023 14:47:24 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:24 GMT Message-Id: <202302141447.31EElOSk072563@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: 2456a4592932 - main - linux(4): Cleanup includes under amd64/linux List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 2456a45929328ce73a40ef6577600b0f1e2cced6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=2456a45929328ce73a40ef6577600b0f1e2cced6 commit 2456a45929328ce73a40ef6577600b0f1e2cced6 Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:32 +0000 linux(4): Cleanup includes under amd64/linux Cleanup unneeded includes, sort the rest according to style(9). No functional changes. MFC after: 2 weeks --- sys/amd64/linux/linux_dummy_machdep.c | 3 +-- sys/amd64/linux/linux_genassym.c | 2 +- sys/amd64/linux/linux_machdep.c | 21 +-------------------- sys/amd64/linux/linux_sysvec.c | 12 +----------- sys/amd64/linux32/linux32_dummy_machdep.c | 3 +-- sys/amd64/linux32/linux32_genassym.c | 2 +- sys/amd64/linux32/linux32_machdep.c | 11 ----------- sys/amd64/linux32/linux32_sysvec.c | 11 +---------- 8 files changed, 7 insertions(+), 58 deletions(-) diff --git a/sys/amd64/linux/linux_dummy_machdep.c b/sys/amd64/linux/linux_dummy_machdep.c index 3ce407af291c..ed148a5a6500 100644 --- a/sys/amd64/linux/linux_dummy_machdep.c +++ b/sys/amd64/linux/linux_dummy_machdep.c @@ -30,9 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include #include #include diff --git a/sys/amd64/linux/linux_genassym.c b/sys/amd64/linux/linux_genassym.c index 14880afcc89b..70e1ae91eab9 100644 --- a/sys/amd64/linux/linux_genassym.c +++ b/sys/amd64/linux/linux_genassym.c @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index ed905518fdf4..6c96dd496fdc 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -33,15 +33,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include #include #include #include @@ -49,15 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include #include @@ -85,13 +70,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include -#include #include #include -#include #include #define LINUX_ARCH_AMD64 0xc000003e diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index ed62b2313cba..6d4deb06dc00 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #define __ELF_WORD_SIZE 64 #include -#include #include -#include #include #include #include @@ -49,23 +47,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include -#include -#include -#include -#include #include -#include +#include #include -#include #include -#include #include #include diff --git a/sys/amd64/linux32/linux32_dummy_machdep.c b/sys/amd64/linux32/linux32_dummy_machdep.c index f3bd8717524a..bc7a3c0aa69b 100644 --- a/sys/amd64/linux32/linux32_dummy_machdep.c +++ b/sys/amd64/linux32/linux32_dummy_machdep.c @@ -31,9 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include #include #include diff --git a/sys/amd64/linux32/linux32_genassym.c b/sys/amd64/linux32/linux32_genassym.c index 4a87b5a423bc..323634b3001d 100644 --- a/sys/amd64/linux32/linux32_genassym.c +++ b/sys/amd64/linux32/linux32_genassym.c @@ -2,9 +2,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include #include #include diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 5599cbff2525..0bd398042c3f 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -34,27 +34,16 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include -#include #include -#include #include #include #include -#include #include #include #include #include -#include -#include #include -#include -#include -#include -#include #include #include diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 88720ac7199b..d398a463b8c2 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #define __ELF_WORD_SIZE 32 #include -#include #include #include #include @@ -53,23 +52,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include -#include -#include -#include -#include #include -#include +#include #include -#include #include -#include #include #include From nobody Tue Feb 14 14:47:25 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPFB0h3mz3s2Py; Tue, 14 Feb 2023 14:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGPFB06X4z477L; Tue, 14 Feb 2023 14:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zgvt6nBUNZ/ihtKv6So83YKoNk4D/C2ZR4TtQVPLG6A=; b=ykBok7fg4eUBWN2bLOnRv2JsrVOyhdvwjaKirgepo8EJZTyzVCQ6wSneMna7ko1YluDTL/ sF19fnnbgBNrKYKnmugNK6piC5z8hMI9QLro0BYynMez/nZIA7EsCR1dmBj6uvL7yNhc4u giKlYOHlqW8A1YjjzttsI/lPTBhBy+3yAP4rq0uVuSu/9tp22lbGdjzMMEyAm9JQJfBsr8 fLFZFo/3UorSHi1Q04fOLP1Zljydiqf5R2sST4fokOTpz3sNYxUY1mpzlRNq/IbQDlIv70 UidlPGzoqvtQlBaLrIFrXwMzO+/Ruq0DTZyqGA2BrkaALT2eqyTkfQVE70uq1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zgvt6nBUNZ/ihtKv6So83YKoNk4D/C2ZR4TtQVPLG6A=; b=XlXvSpA6W4/NW5Ic2Y2wX7+cdv5atCnvhs6rq+U1dWsc3OLPDRmqBy18VIkupE/mv89x1J aZxwJSVie86mbVVoXuGq5bhGV0QrBz7GucbhSpxZvJjQ0mwxFkgCIPbTSc1GY8ckYM1gsg TReWiqRe1cWdNPtBThOoTOA8I7iYbE0JY768us2/mGeAXyZrgAt9exe1kHsMEQB7cXpjR0 WWkcwJJDqPbp+hHizadXpcFD5TavRFZ7HFlfL+EMUlCNRoWDITjSC6vamoLsoc5jhAEk14 ZL/mcCaiF03VBzA4MYKkMIGUTk8BeOG1Q55C0P99AQ0knDqH9gSq7fuCTDMyaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386046; a=rsa-sha256; cv=none; b=h3sviU7l+tHSFxzttDD3j86ecl9p1oXT14MYvYDt7F6OZew8DqUaRj1YFR2dNVvwnhvpQD rnHLZcc32bbmvfMRgsPclyuOKqL+aR3F33xYmHISnY8uWzTmEDNRu9ccHUx5quqNoV1xdi Vk7ySUIvktWvcelLY13eWUF5Mfp8KkQUKqG8giXI24IkXg4JX0uxnIBHFzMvToN+VLgyLP N5pzlHuA7qkqxFGeYgyhRP91pHfkmoz7IAK36fhupk+eAUcdxnLtmjopCTb6MWZZY+4EQP vEvjjADddTBGbqqH4k7QGxTjrgc4W5eiOF59OZ1KPKEVblblt/LBK1W6v7q4dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPF96Kp6z12vx; Tue, 14 Feb 2023 14:47: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 31EElP5X072588; Tue, 14 Feb 2023 14:47:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElPg0072587; Tue, 14 Feb 2023 14:47:25 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:25 GMT Message-Id: <202302141447.31EElPg0072587@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: 496a9a4f6071 - main - linux(4): Cleanup includes under x86/linux List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 496a9a4f60716b3ba236c3f20639da03fefe3a3f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=496a9a4f60716b3ba236c3f20639da03fefe3a3f commit 496a9a4f60716b3ba236c3f20639da03fefe3a3f Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:33 +0000 linux(4): Cleanup includes under x86/linux Cleanup unneeded includes, sort the rest according to style(9). No functional changes. MFC after: 2 weeks --- sys/x86/linux/linux_dummy_x86.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/x86/linux/linux_dummy_x86.c b/sys/x86/linux/linux_dummy_x86.c index 54799c1f0df2..92905600742e 100644 --- a/sys/x86/linux/linux_dummy_x86.c +++ b/sys/x86/linux/linux_dummy_x86.c @@ -30,9 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include #ifdef COMPAT_LINUX32 #include From nobody Tue Feb 14 14:47:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPFC5Hh3z3s2MZ; Tue, 14 Feb 2023 14:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGPFC1R15z47G2; Tue, 14 Feb 2023 14:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aYiAlIlJ9c0778SySCyEgth1Zn4va2tM1WhkrpqsCxM=; b=VnFl/dWag6N/IwhEJDsiWsSo3eFkNNSCTscW0TPUbFMRBflaedzKFIDwjqPKk9qbmdlScd mVhmd1EAgzo/amgIHgIfkhKDocu0OMsl13BpQkFfbEbvyqybXQpiT4eTjjbUNmGoFj82yD yG8Ufk3B8aGE047ZbidSfWmHJRjGQLz5dGL15Oz4DOXdIGZrbzsaU/h9vcUQ6LKLw4xv0x hPV7UtXs+GPfoBN9idV+Ra6G1g1Q0jSEj9cFQBbYBNJkqDfRkOY9fevoQHqzbtwqoe0bUB xNw57Liec6XdJIuh+DQ3y1Y9dublj6BoCaBUNIYJYk76OJfSgP1Rqj3XcUo+nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aYiAlIlJ9c0778SySCyEgth1Zn4va2tM1WhkrpqsCxM=; b=UzzuTMelIFBYNtRcHK5n4cLreYM49DKdv9PpPnBHdD0yQwk3rnZYYLdpnBvbGK8wsQP0RH /XXJZblgU1e9PHBVZzQ7Bs2eoLLFVJ9AxmXm2S+izEE+XIXxacq4RwlN7i9XbRdtdVCrfU OShCQEaLgSm6lDdy5FyXFoF7VoM9z3PwevxqUlXxLdscyV8baSmOH7kNVornVbTZLSDfG4 0EwPfX40keMmpV6HE3sCCGn7kGoPFSpyh4g3MOvqy2RhtaafZj7lwqXvZW1ET2bGe9CLGB xGn2UNW3gc2BfwGEZ667l5HoJml/OaStN7FtLi6B4Gso+eio+DvHcVOQzis9xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386047; a=rsa-sha256; cv=none; b=G3FkTwwWq1ObBUE5QGuDUHLOenVvj0wHxmfGpIhbhPXydDAahmCMSEShPYP/9sA0fJxsWm s0c8mCoNxJQOuS4r8bJ1PceCMHKU4W9aLyFyWSgZhnZPdbMfbWvjmTCSOAO3LkOPVxceqO iZ7JS3tMWjFk71qUycJjSGtBoipegFJZtAQehPAx69sFdHawIQOqTXUEpIzji2tc1scN6+ kxI22RbX356uYLTn75/BDJ/LwUu1eqrtpw18JmiSnSami/hHPre/5AKBdaPnWZSqiss4TT fzRdgXiEJi+ExeN2ZIvLtVq++4gzBFQD+VQxZWWtkh0A+ygZI6GeD83BJWijMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPFC0Xvlz12QW; Tue, 14 Feb 2023 14:47: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 31EElQZW072614; Tue, 14 Feb 2023 14:47:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElQ0Y072613; Tue, 14 Feb 2023 14:47:26 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:26 GMT Message-Id: <202302141447.31EElQ0Y072613@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: 55d3e181fc10 - main - linux(4): Cleanup includes under arm64/linux List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 55d3e181fc10edb4810f33009b65342c3e23dd88 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=55d3e181fc10edb4810f33009b65342c3e23dd88 commit 55d3e181fc10edb4810f33009b65342c3e23dd88 Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:33 +0000 linux(4): Cleanup includes under arm64/linux Cleanup unneeded includes, sort the rest according to style(9). No functional changes. MFC after: 2 weeks --- sys/arm64/linux/linux_dummy_machdep.c | 3 +-- sys/arm64/linux/linux_sysvec.c | 8 +------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/arm64/linux/linux_dummy_machdep.c b/sys/arm64/linux/linux_dummy_machdep.c index 40cab9baad10..571b9f0b2a4f 100644 --- a/sys/arm64/linux/linux_dummy_machdep.c +++ b/sys/arm64/linux/linux_dummy_machdep.c @@ -30,9 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include #include #include diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 48b4305c5fe4..19fef57e78e4 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -32,8 +32,6 @@ __FBSDID("$FreeBSD$"); #define __ELF_WORD_SIZE 64 #include -#include -#include #include #include #include @@ -45,18 +43,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include -#include #include +#include #include -#include -#include #include -#include #include #include From nobody Tue Feb 14 14:47:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPFD3YTHz3s2s4; Tue, 14 Feb 2023 14:47: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 4PGPFD2nZhz47DK; Tue, 14 Feb 2023 14:47:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RCBtfTS52gM+Le5cSi6Q8OwWmBXPEQ2O+uk6zkvNbe8=; b=K2hi+/mrVJqeiWCsEwl6f8uAD3EdG23xBq5gSjCkvRTQWsB5/Jb4X+mKtdVbCfWDi6/3O/ Tjrhgd0wNU+dBsJeXi0+Apge66R12BgLcuigUSeI5ncMQOGbKsAS2Wgj43RR9wcR+VqDOE jlFnd3FzM18jUIGWFhbRkMFzZRoZZBpwO4Ztiag+W9rhhSn9Xl97puJ885p3OFljCVxZuD w8WO1gPKjki6UuhxoOntrtpCPF/yS1RTr6VtGwzvQTi7LokcUFKuoyoZC6jX/kcoAZtuwQ 1qxSi5RvFe1tMkjUFjZRuh2gcY8Y6tcjXmWm/tcJnoVOWwTHA9rEhJU7Jolt/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RCBtfTS52gM+Le5cSi6Q8OwWmBXPEQ2O+uk6zkvNbe8=; b=uZ7o24wFgtHeYK5ivqMS/MZX/149J/D4C4VnzD+vCjr8U3qI9DCDl6n/FsYMinHUwZad5K DX7GRMrb/PzLtJhX2oJkMwvTQ3lXmlunaoaMSHGX7rqiFugnFGnUUoZqvH6w4VMCOsYHSQ e1luyMqRt9LreXLGNDAPKVJTcf97WZIUzdSLWCjwKVX53nIuIqbknmhREcCprJ2hFNIW77 My2LsKr+8QizPK3qS50awoa5PDvmQH1njs8zQCQNbrT3d4cbeu/1q3+8QPHzpRaPTfy3Sl X9H0ccaLFAUgLaGly6OwiOlnL2u/WOd3iDPYBTyFY3SattZZThDrcJqxeILFmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386048; a=rsa-sha256; cv=none; b=l2yqtfu5u1w2hTvcDa+Odcaakd/DwvjXub9khTJe5bq1CQUWv0B0CNfYtYcYzDk0Z7rhmv pqm4Dx95jPPYg/G3iVN/IIjKrJiOuR5eW3Uh+SnPUyo1XGWiBRbEDC5y6BDOYLeax8enFt XrEtYtUJmfk1vRu2IN/d32U6hg69IUwMTIetwptTmzf16LPmv3elX0oXQd4KokPjHRbUB7 bhed03lDdlSXcW0jxJjj8Sj8zunriD8LOxNhXDZoGxz4zPXaljU12pEUmkOf5PyD5gpqVx MXMPj7aRE1VlAlJT78QWG7LC8EYPfOgtJlQEV3iSrHLz5GgLDftEBmiLHKLT3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPFD1n8Nz12yb; Tue, 14 Feb 2023 14:47: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 31EElSFN072643; Tue, 14 Feb 2023 14:47:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElS41072642; Tue, 14 Feb 2023 14:47:28 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:28 GMT Message-Id: <202302141447.31EElS41072642@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: c8a79231a5a7 - main - linux(4): Rename linux_timer.h to linux_time.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: c8a79231a5a74fc4263ec3d18c6519a974efb529 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c8a79231a5a74fc4263ec3d18c6519a974efb529 commit c8a79231a5a74fc4263ec3d18c6519a974efb529 Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:33 +0000 linux(4): Rename linux_timer.h to linux_time.h To avoid confusing people, rename linux_timer.h to linux_time.h, as linux_timer.c is the implementation of timer syscalls only, while linux_time.c contains implementation of all stuff declared in linux_time.h. MFC after: 2 weeks --- lib/libsysdecode/linux.c | 2 +- lib/libsysdecode/mklinuxtables | 6 +++--- sys/amd64/linux/linux_vdso_gtod.c | 2 +- sys/amd64/linux32/linux32_vdso_gtod.c | 2 +- sys/arm64/linux/linux_vdso_gtod.c | 2 +- sys/compat/linux/linux_event.c | 2 +- sys/compat/linux/linux_futex.c | 2 +- sys/compat/linux/linux_ioctl.c | 2 +- sys/compat/linux/linux_ipc.c | 2 +- sys/compat/linux/linux_misc.c | 2 +- sys/compat/linux/linux_signal.c | 2 +- sys/compat/linux/linux_socket.c | 2 +- sys/compat/linux/linux_time.c | 2 +- sys/compat/linux/{linux_timer.h => linux_time.h} | 6 +++--- sys/compat/linux/linux_timer.c | 2 +- sys/i386/linux/linux_vdso_gtod.c | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/libsysdecode/linux.c b/lib/libsysdecode/linux.c index 76065ddf404e..4b6aab478a33 100644 --- a/lib/libsysdecode/linux.c +++ b/lib/libsysdecode/linux.c @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #define X(a,b) { a, #b }, #define XEND { 0, NULL } diff --git a/lib/libsysdecode/mklinuxtables b/lib/libsysdecode/mklinuxtables index bcd6ddb5f618..eebdadd03613 100644 --- a/lib/libsysdecode/mklinuxtables +++ b/lib/libsysdecode/mklinuxtables @@ -89,9 +89,9 @@ cat <<_EOF_ _EOF_ gen_table "atflags" "LINUX_AT_[A-Z_]+[[:space:]]+[0-9]+" "compat/linux/linux_file.h" -gen_table "clockids" "LINUX_CLOCK_[A-Z_]+[[:space:]]+[0-9]+" "compat/linux/linux_timer.h" -gen_table "clockflags" "LINUX_TIMER_[A-Z_]+[[:space:]]+0x[0-9]+" "compat/linux/linux_timer.h" -gen_table "clockcpuids" "LINUX_CPUCLOCK_[A-Z_]+[[:space:]]+[0-9]+" "compat/linux/linux_timer.h" "_MASK|_MAX" +gen_table "clockids" "LINUX_CLOCK_[A-Z_]+[[:space:]]+[0-9]+" "compat/linux/linux_time.h" +gen_table "clockflags" "LINUX_TIMER_[A-Z_]+[[:space:]]+0x[0-9]+" "compat/linux/linux_time.h" +gen_table "clockcpuids" "LINUX_CPUCLOCK_[A-Z_]+[[:space:]]+[0-9]+" "compat/linux/linux_time.h" "_MASK|_MAX" gen_table "openflags" "LINUX_O_[A-Z_]+[[:space:]]+[0-9]+" "compat/linux/linux_file.h" "O_RDONLY|O_RDWR|O_WRONLY|O_ACCMODE" gen_table "sigprocmaskhow" "LINUX_SIG_[A-Z]+[[:space:]]+[0-9]+" "compat/linux/linux.h" diff --git a/sys/amd64/linux/linux_vdso_gtod.c b/sys/amd64/linux/linux_vdso_gtod.c index 3d18b551e6fb..95e0ae145fa6 100644 --- a/sys/amd64/linux/linux_vdso_gtod.c +++ b/sys/amd64/linux/linux_vdso_gtod.c @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include /* The kernel fixup this at vDSO install */ uintptr_t *kern_timekeep_base = NULL; diff --git a/sys/amd64/linux32/linux32_vdso_gtod.c b/sys/amd64/linux32/linux32_vdso_gtod.c index 4f9892af3fa5..075b6f3af7f4 100644 --- a/sys/amd64/linux32/linux32_vdso_gtod.c +++ b/sys/amd64/linux32/linux32_vdso_gtod.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include /* The kernel fixup this at vDSO install */ uintptr_t *kern_timekeep_base = NULL; diff --git a/sys/arm64/linux/linux_vdso_gtod.c b/sys/arm64/linux/linux_vdso_gtod.c index 6fdff8335f5d..ff6fe56adbdf 100644 --- a/sys/arm64/linux/linux_vdso_gtod.c +++ b/sys/arm64/linux/linux_vdso_gtod.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include /* The kernel fixup this at vDSO install */ uintptr_t *kern_timekeep_base = NULL; diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index a3b54e6aac60..e3f55f0a5c50 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include typedef uint64_t epoll_udata_t; diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index af16ecfe53fe..74f89e3d49fb 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #define FUTEX_SHARED 0x8 /* shared futex */ diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 0020149c2c62..2cb0e9ead23f 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 0791e1ad2cbe..94c645adc099 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#include +#include #include /* diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index a4aa5903e3b9..bc62c6b24d2c 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 4bff891d4206..5a3cb97c385f 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#include +#include #include #include #include diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index ec741abe85de..a3a8cc6733c1 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #define SECURITY_CONTEXT_STRING "unconfined" diff --git a/sys/compat/linux/linux_time.c b/sys/compat/linux/linux_time.c index 102dc4fff4bd..1a9f6cca22e0 100644 --- a/sys/compat/linux/linux_time.c +++ b/sys/compat/linux/linux_time.c @@ -56,7 +56,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/05/14 03:40:54 christos Exp #include #include -#include +#include #include /* DTrace init */ diff --git a/sys/compat/linux/linux_timer.h b/sys/compat/linux/linux_time.h similarity index 98% rename from sys/compat/linux/linux_timer.h rename to sys/compat/linux/linux_time.h index a01411cec847..55a3cd44cafa 100644 --- a/sys/compat/linux/linux_timer.h +++ b/sys/compat/linux/linux_time.h @@ -30,8 +30,8 @@ * $FreeBSD$ */ -#ifndef _LINUX_TIMER_H -#define _LINUX_TIMER_H +#ifndef _LINUX_TIME_H +#define _LINUX_TIME_H #ifndef __LINUX_ARCH_SIGEV_PREAMBLE_SIZE #define __LINUX_ARCH_SIGEV_PREAMBLE_SIZE \ @@ -141,4 +141,4 @@ int linux_to_native_itimerspec64(struct itimerspec *, int linux_to_native_timerflags(int *, int); -#endif /* _LINUX_TIMER_H */ +#endif /* _LINUX_TIME_H */ diff --git a/sys/compat/linux/linux_timer.c b/sys/compat/linux/linux_timer.c index 5f0f5b28e624..e2cef8347c22 100644 --- a/sys/compat/linux/linux_timer.c +++ b/sys/compat/linux/linux_timer.c @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#include +#include static int linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig) diff --git a/sys/i386/linux/linux_vdso_gtod.c b/sys/i386/linux/linux_vdso_gtod.c index 20f754bfaa17..f4f7472ce9d0 100644 --- a/sys/i386/linux/linux_vdso_gtod.c +++ b/sys/i386/linux/linux_vdso_gtod.c @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include /* The kernel fixup this at vDSO install */ uintptr_t *kern_timekeep_base = NULL; From nobody Tue Feb 14 14:47:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPFF4Rjkz3s2mf; Tue, 14 Feb 2023 14:47: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 4PGPFF3wkqz47K6; Tue, 14 Feb 2023 14:47:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aWo//HHezWoxv2BmNj1DZUvQrQY90IoLD3qAfLemV30=; b=Hy47Rl555eHe2+TfiXNQiLgTDlGrL0sqxv180hGkh/OmUNDVOERDVlAqWsB2mNaB/IL1EN aDmiAfPUhez8tuegLWLbLHr+86C3w6bsmQsRJ7s6eBiJhoF4FZNuDdiVdxwLRmD9qWRUNA 9P56RpxI/LrKQdedfLRUhE+LsaewwTPt4Ea0jYprY+DOvIrI8b/2CTCKwetFIAVs77Bzju 1sg5bYP71mtcBk6I6UkII4Ni+CBFAGH+cihEbaeXQSvsH4Xvy6SjdAVtmOA5+VoCm8vwZU 93qTIRC7j8wifqNosSaxaL70z7eht9nZr8du0vpnCFd5jwGpPBtm9pOsi1iRBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676386049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aWo//HHezWoxv2BmNj1DZUvQrQY90IoLD3qAfLemV30=; b=MfMyndWVmADm0uqXyGF0WIqnsY8mbWTKSFOQWVP0kAGo+f2EQezAME8qQks7QGr97cK8Nl NZBH6JespUALdeE7xjeTxeT2/KQvJkP9/kG9ofsvPXJezrptqiiEyzTUxyyIPBUXqZvDpp e4E5VUvc5Drr6TTxaTgUtpOfBaDBZbAE6SNZiM/cDdVqlZbPht2Hup3R7QtIYPWphhjrsP h3JqIsmBo8YIPinQxNT1mfyZYfvF7iA287jhbWnNAOcl7OrPbULqYRvKTjJI3D+6MJv3pb w2xIpXIGrwUCgp7PFnfBgBRNbuQOPpvZ08mQJaCZ0yc7Vdqu8mUPOECBaIIIYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676386049; a=rsa-sha256; cv=none; b=UTpmMtr6c+3miPzJ14IAtDg/Iz874F1qc7OMbUjQ8QCo8rioENnBGAi9pW9rfN+If2HMtm JUSeAN9I/JSoZ5nXcBg6MB4sMhExZvkSflfqv4aWfMpW0INzfF5DHnZBzhjm56ldnf6KtT NIdQJwZ1RN72ZspgKYXAzSAmoW5qSzLN/VpPOiLWkCE0cIJ4hzzs2NhzuVtDbNc3v6lkg1 ppVso8RoKH7jnkgQjzCpdkrb0vT+c7rwwZzK87WxKwwZh5Cb8IqQAvXDleBKp0NR2XflWR czr0psr9TQd/qTwpEXFzjJYX+iIGD5SIf9Tx4zXm51fOvxKuIzWpr591kpEsWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPFF2slbz12kV; Tue, 14 Feb 2023 14:47: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 31EElTZV072675; Tue, 14 Feb 2023 14:47:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EElTtQ072674; Tue, 14 Feb 2023 14:47:29 GMT (envelope-from git) Date: Tue, 14 Feb 2023 14:47:29 GMT Message-Id: <202302141447.31EElTtQ072674@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: 825fbd087e61 - main - linux(4): Trim unused opt_usb.h from modules Makefiles List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 825fbd087e6150eaf601612a5e7468ddc808e004 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=825fbd087e6150eaf601612a5e7468ddc808e004 commit 825fbd087e6150eaf601612a5e7468ddc808e004 Author: Dmitry Chagin AuthorDate: 2023-02-14 14:46:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-14 14:46:33 +0000 linux(4): Trim unused opt_usb.h from modules Makefiles MFC after: 2 weeks --- sys/modules/linux/Makefile | 1 - sys/modules/linux64/Makefile | 1 - 2 files changed, 2 deletions(-) diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index b3d662740df9..be2c60a42847 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -37,7 +37,6 @@ SRCS= linux${SFX}_dummy_machdep.c \ opt_inet6.h \ opt_ktrace.h \ opt_posix.h \ - opt_usb.h \ bus_if.h \ device_if.h \ vnode_if.h diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index 7f264471bcd8..4fe9ccd576c1 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -32,7 +32,6 @@ SRCS= linux_dummy_machdep.c \ opt_ktrace.h \ opt_inet6.h \ opt_posix.h \ - opt_usb.h \ bus_if.h \ device_if.h \ vnode_if.h \ From nobody Tue Feb 14 15:14:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGPrL3Wscz3s3qw; Tue, 14 Feb 2023 15:14: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 4PGPrL2x1rz4Hry; Tue, 14 Feb 2023 15:14:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676387666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uVZPBJkDiGW9eqYRgTN6Vnrk6h4wORKuZnAJhvuutF0=; b=QPpEORiHlfWZw2WkjQqmXBDu4Dq0fPvARXDgPQ4NdJupsuQ8RhwuZI5AakN6dwSUoTeGRv fL1F9xYRHxARyVL9PrV0Zqif9ybzmn6dIHdgFAw5BOI5DdSeh7THiOpHbgNOLO/rY2R03R /yPh6AfZ5jOrwL8+/GpSKBcry5MF7T7BB+U2Qn8j4o/5f4rS9ZgPVJi89kZKM+CwelbkWG tdShodyUSJhfBYqrHvgK+Utm8CPMrSU4Jh4WzQi2aKPEJzX4mmJ/z0I39XEKUlW1tV1XX9 +sgkcfiowEMRAdbibMRSmB+jvLxpzQtjBqUogEZzmIzhBfvxlX2Xsp/JrV9tZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676387666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uVZPBJkDiGW9eqYRgTN6Vnrk6h4wORKuZnAJhvuutF0=; b=w0PiZjN/eJnjaKNBeLv57sXy65HWvrqSMOTDuV45c/T3OW3Y38PiNMwzM+ur1Ee4YW6DUs W0VIvQ71+hR0Zbp97nBXaeQQ8MrqF28+SWH0F8uFhkrD8C1Lp5VZ4BqLUAshwqB7FAODsr zgabz8D/kSM1mI3d5yd/mQVKcTvYVWax8aFZk8IsI4mKjktPPGNWjbFz/mhFVFZOp1TTRq xw2F66LxR3ipdOzjsj4s7r1s8ZcBuBGasv65/hN4sdij2nisZoHtOJC7Tan78/JH8xkUOt FnMk4VB8xPKJ/1UVGI8gEdjrDSBqV0Bay4ZVsgeQ3aLCjjx7FEG2/6VWGnf+Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676387666; a=rsa-sha256; cv=none; b=bWfHWRhCbFL+WfoisxDfh52avSeHl3qSjQrahI9iQzHUiOhc00xpo4vuSuOpuCRdEEW52Z RdkM//+nmf38DyhhUG3hFh3y99Tw+gE8zXrt004FE0khnsi48ZOHgj1C+msYnyJx4/5iyF 3en+XS7l4T3hDrSnr9evjWwGX60KSmsyi9mYX79edWioCaPzYfOto2nxf8wBKCoLcOLggw 2n8TXP3Hgeleuec/j+bJR36Fbi88r1mhhAUqLZiJKV0kE3s1ho4KlOd1iT4Gu345ODRzYJ znvkUp5lTGlRTi8ch3Z/X9JEBPy+OYAyUmhwgGMjxjE4iZTrzKah/eMrOxYfKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGPrL1zMBz13Lc; Tue, 14 Feb 2023 15:14: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 31EFEQqW015475; Tue, 14 Feb 2023 15:14:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFEQan015474; Tue, 14 Feb 2023 15:14:26 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:14:26 GMT Message-Id: <202302141514.31EFEQan015474@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: 636b19ead43a - main - tcp: Disallow re-connection of a connected socket List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 636b19ead43a722d8434776e0bd185bfc97819b6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=636b19ead43a722d8434776e0bd185bfc97819b6 commit 636b19ead43a722d8434776e0bd185bfc97819b6 Author: Mark Johnston AuthorDate: 2023-02-14 14:27:47 +0000 Commit: Mark Johnston CommitDate: 2023-02-14 15:07:19 +0000 tcp: Disallow re-connection of a connected socket soconnectat() tries to ensure that one cannot connect a connected socket. However, the check is racy and does not really prevent two threads from attempting to connect the same TCP socket. Modify tcp_connect() and tcp6_connect() to perform the check again, this time synchronized by the inpcb lock, under which we call soisconnecting(). Reported by: syzkaller Reviewed by: glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D38507 --- sys/kern/uipc_socket.c | 4 ++++ sys/netinet/tcp_usrreq.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 9b7f63a81617..1d2b06311c8c 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1345,10 +1345,14 @@ soconnectat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td) int error; CURVNET_SET(so->so_vnet); + /* * If protocol is connection-based, can only connect once. * Otherwise, if connected, try to disconnect first. This allows * user to disconnect by connecting to, e.g., a null address. + * + * Note, this check is racy and may need to be re-evaluated at the + * protocol layer. */ if (so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING) && ((so->so_proto->pr_flags & PR_CONNREQUIRED) || diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 43f2fcfb097a..5c98e969c5ce 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1401,6 +1401,10 @@ tcp_connect(struct tcpcb *tp, struct sockaddr_in *sin, struct thread *td) NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); + if (__predict_false((so->so_state & + (SS_ISCONNECTING | SS_ISCONNECTED)) != 0)) + return (EISCONN); + INP_HASH_WLOCK(&V_tcbinfo); error = in_pcbconnect(inp, sin, td->td_ucred, true); INP_HASH_WUNLOCK(&V_tcbinfo); @@ -1433,11 +1437,16 @@ static int tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *sin6, struct thread *td) { struct inpcb *inp = tptoinpcb(tp); + struct socket *so = tptosocket(tp); int error; NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); + if (__predict_false((so->so_state & + (SS_ISCONNECTING | SS_ISCONNECTED)) != 0)) + return (EISCONN); + INP_HASH_WLOCK(&V_tcbinfo); error = in6_pcbconnect(inp, sin6, td->td_ucred, true); INP_HASH_WUNLOCK(&V_tcbinfo); @@ -1449,7 +1458,7 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *sin6, struct thread *td) (TCP_MAXWIN << tp->request_r_scale) < sb_max) tp->request_r_scale++; - soisconnecting(inp->inp_socket); + soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tcp_state_change(tp, TCPS_SYN_SENT); tp->iss = tcp_new_isn(&inp->inp_inc); From nobody Tue Feb 14 15:21:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQ0Z2W3Nz3s4Jk; Tue, 14 Feb 2023 15:21:34 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGQ0Z250lz4Jts; Tue, 14 Feb 2023 15:21:34 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388094; 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=AET0b9l2fWyVObEZ22K8orUAaFZBd9a1FAyxfcXy3FQ=; b=qasyNLenxOwOTi3PriAwqwEkdEoV4LkNUMnRsdFMHMu3sjM3JMLqW9846/Ozz5ePbus2ls 4MRLk4pdXSvIsqFRS2/AWbC0Cq283ptJhD6pOotTG6FKhWvt+ri4gr13l4jF11WfKTNcw9 r3+pnBKHhTCiTBRLjGOZOlKz2p1658WMyqbTky8DS8PNyaiT6wJNc23q/HvnSeM0egrmtJ EVkfHLXG2UuizKgAFSikPaHB/CgRn9j3B7PF0U2Qrxlavou7Znpaz4W7OYQe5daDWEuUwD pyDVRyvECCyMoYYIaSYeuKGtndG2+zgYG4+BKyGCyK89U7o2rcNG7ldjsWNT7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388094; 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=AET0b9l2fWyVObEZ22K8orUAaFZBd9a1FAyxfcXy3FQ=; b=vilpFv/B3Zoj0W1jNEsSRrdKRcxA2fAQClX9/LYghIz+A4db1XtC6fXRqEDqPwfr8hJmFY S6g7dW7RCMQ2XOyu/F4i3utBh4qaA2RDTUIJmGVEtolIMpbC6X6bfW67udAFjvYXCA7Rl3 uG2HCLobqFwSNUtJHzbK1f7MebuhXjFaoeUaD3ARCuBk1n3twlmo4KTyVm0ojgH8lN4XRL anWVI4ZuCO0+5XHNxaKyTUnlQ1sJREES+cZWUVWkToDiuUd+trrS6z4Sw6w3g3eUvHm2bg vO94E6kJjdrS+kem8c1aHOPJeJ/M0IJU919GkoSAZVeWHtZ5fHnYhfyxd5UvlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388094; a=rsa-sha256; cv=none; b=gLrMhBU90vJzwAqo7Beiq9jm0ORwrGh5E3UICzwpZXiXDr0s1iHKCGAXTSy4tc+xS6cxQT Hyp5h/4ETqoD/wub59MYqCFMGPJPqHNqDfrJcZq7K+QRFCE+JKm12BioVhsIv3fq6CqegX bQeZvPhTPE7rroyGPkjUyQiXFiFZxU76w3uX5/PvMqc5xzHFDHBJBALyrmfh7f+Gm+FAfa 7i8WPD06eiLURd9zJoNakl5o8JsjOxguRXIx7k0m9TmWBZOnfMM6Os+a6vx9o3hHDusk4R cP+ZljEkGLqIYg3TK2D/KxubXPoEBJgZ277lOzZAHNooEHKEwrp5Cex4zs8JSQ== Received: from gonegalt.net (ip-74-83-251-177.dynamic.fuse.net [74.83.251.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhibbits) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PGQ0Y6l9HzgBJ; Tue, 14 Feb 2023 15:21:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Date: Tue, 14 Feb 2023 10:21:32 -0500 From: Justin Hibbits To: Stefan =?UTF-8?B?RcOfZXI=?= Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: f20058955c9d - main - sys/kbio.h: make pre-unicode keymap support optional Message-ID: <20230214102005.08621765@gonegalt.net> In-Reply-To: <202302141315.31EDFvN2044413@gitrepo.freebsd.org> References: <202302141315.31EDFvN2044413@gitrepo.freebsd.org> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; powerpc64le-unknown-linux-gnu) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On Tue, 14 Feb 2023 13:15:57 GMT Stefan E=C3=9Fer wrote: > The branch main has been updated by se: >=20 > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Df20058955c9d1041a5a09cd02a27bab= da7e34dc8 >=20 > commit f20058955c9d1041a5a09cd02a27babda7e34dc8 > Author: Stefan E=C3=9Fer > AuthorDate: 2023-02-14 13:03:28 +0000 > Commit: Stefan E=C3=9Fer > CommitDate: 2023-02-14 13:03:28 +0000 >=20 > sys/kbio.h: make pre-unicode keymap support optional > =20 > FreeBSD-9 had introduced support for the full set of Unicode > characters to the parsing and processing of keymap character > tables.=20 > This support has been extended to cover the table for accented > characters that are reached via dead key combinations in > FreeBSD-13.2.=20 > New ioctls have been introduced to support both the pre-Unicode > and the Unicode formats and keyboard drivers have been extended to > support those ioctls. > =20 > This commit makes the ABI compatibility functions in the kernel > optional and dependent on COMPAT_FREEBSD13 in -CURRENT. > =20 > The kbdcontrol command in -CURRENT and 13-STABLE (before 13.2) has > been made ABI compatible with old kernels to allow a new world to > be run on an old kernel (that does not have full Unicode support for > keymaps). > =20 > This commit is not to merged back to 12-STABLE or 13-STABLE. It is > part of review D38465, which has been split into 3 separate > commits due to different MFC and life-time requirements of either > commit.=20 > Approved by: imp > Differential Revision: https://reviews.freebsd.org/D38465 > --- > sys/dev/adb/adb_kbd.c | 4 +++- > sys/dev/atkbdc/atkbd.c | 4 +++- > sys/dev/gpio/gpiokeys.c | 9 ++++++--- > sys/dev/hid/hkbd.c | 9 ++++++--- > sys/dev/hyperv/input/hv_kbd.c | 4 +++- > sys/dev/kbd/kbd.c | 27 ++++++++++++++++++++++----- > sys/dev/kbdmux/kbdmux.c | 6 ++++-- > sys/dev/syscons/syscons.c | 6 ++++-- > sys/dev/usb/input/ukbd.c | 9 ++++++--- > sys/dev/vkbd/vkbd.c | 4 +++- > sys/dev/vt/vt_core.c | 4 +++- > sys/sys/kbio.h | 16 ++++++++-------- > 12 files changed, 71 insertions(+), 31 deletions(-) >=20 > diff --git a/sys/dev/adb/adb_kbd.c b/sys/dev/adb/adb_kbd.c > index 86d3865473bb..614d89c30447 100644 > --- a/sys/dev/adb/adb_kbd.c > +++ b/sys/dev/adb/adb_kbd.c > @@ -795,10 +795,12 @@ static int akbd_ioctl(keyboard_t *kbd, u_long > cmd, caddr_t data) break; > =20 > case PIO_KEYMAP: > - case OPIO_KEYMAP: > case PIO_KEYMAPENT: > case PIO_DEADKEYMAP: > +#ifdef COMPAT_FREEBSD13 > + case OPIO_KEYMAP: > case OPIO_DEADKEYMAP: > +#endif /* COMPAT_FREEBSD13 */ > default: > return (genkbd_commonioctl(kbd, cmd, data)); > } > diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c > index 08266cf4bf51..0c6dadca43aa 100644 > --- a/sys/dev/atkbdc/atkbd.c > +++ b/sys/dev/atkbdc/atkbd.c > @@ -1088,10 +1088,12 @@ atkbd_ioctl(keyboard_t *kbd, u_long cmd, > caddr_t arg) return error; > =20 > case PIO_KEYMAP: /* set keyboard translation table */ > - case OPIO_KEYMAP: /* set keyboard translation table > (compat) */ case PIO_KEYMAPENT: /* set keyboard translation > table entry */ case PIO_DEADKEYMAP: /* set accent key > translation table */ +=C3=A4ifdef COMPAT_FREEBSD13 Looks like a unicode character slipped in here. - Justin From nobody Tue Feb 14 15:36:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQKW60j3z3s50r; Tue, 14 Feb 2023 15:36: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 4PGQKW4Xppz4L05; Tue, 14 Feb 2023 15:36:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1g2Izz3yCTk/lO3HBUr6PBr4odP7x69hAp8HTkDawJ0=; b=s/TthmHD2K4kAh0pImahw2soTBSNOoFZsutz8MrWK982GxVxRnuooqBnolY66yEsyIrmnv YNDjzWXF7+283rB4Wrthn59b4H/wlqV30WFrZBFtQhuwUnL13Uy1qCEZCpU9gw8mGj6gU0 gH+M9moUXIo+ri99vRkZUvktBFoh824LytwXcw7eYVJ5ouS51tbY/0NmVRqfwmKaZY9Kgi yqoNFlqQrZz4d6h7ed1mkQtfGjRKNJzaRQrbGggIwiLaUyggOMBxr4xzpQlGJNz6cdwWBr g84k8xiEWAcWlJk9r1tI/N5U900SHyc0rsg0cCGh54tRN5um/7QgqHsZczq7Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1g2Izz3yCTk/lO3HBUr6PBr4odP7x69hAp8HTkDawJ0=; b=DV+N8LVvtJ+VcAlBiZdq9SvWJr6tRIE7FyobGuw98+E7uvMciAO7GzSDgc8YIoe0pxNHIq iro3WuPmWE5WC3aEZBFo2dTkCvTMNyI0USD7LMGVewai+Ue53vaTn+6jA0vyRjNTxQYAw9 SSIvCiT8PRO4bKGZuihjzcH73dro3wxVWqxY+9I/WDpUuxliRv/ODXwSz/5TVTYb5fUpoC AvqtQcfTQ7xaTk2C+zAc91S9c/UvpRzD1duueMH9FArcrf93rm/NTYnTie9N/AlLwyjEcs yG1M2zU5ZWN+awmsmgfiFvIGA9Wkjl1Pp75SKKgRbG4jxg4smm4eseQJku0UkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388975; a=rsa-sha256; cv=none; b=qBTGD0ExQ5qgzIbZNowXGKe2CueVAAtHeXfkP4PedcU62bFINc+f57pOyQVqS5D6qCZdRK vNG3nxwPPhMQwQ4NUBdmYdxoeZAUSojB1yYG0rgIIuSdNuPrfVcljk/RxRnAyCgGFcxQS3 CCpcI2hbFz/6L4IcNooTMY9MfLnabOz12oneIEYErLBnP9XGR0Dja6VTSuUjenvV4yMBm3 E4OLJiHyGJQY4RetF0aBhCS2cUNfEJgEY82DjBuj6b7vkGPfFFWlgYrATKa9QepdKFAswG snISApheOMARSimGWOdhdqwRZMxoxsD27YXop/czPzb6rec3gUF13iQPwU7agg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGQKW3b3rz148j; Tue, 14 Feb 2023 15:36: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 31EFaFv5043630; Tue, 14 Feb 2023 15:36:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFaFvX043629; Tue, 14 Feb 2023 15:36:15 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:36:15 GMT Message-Id: <202302141536.31EFaFvX043629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: b29549c7f939 - main - etherswitch: Fix leftovers from IfAPI conversion List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b29549c7f939ec93cae1bac115b0010e07538573 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=b29549c7f939ec93cae1bac115b0010e07538573 commit b29549c7f939ec93cae1bac115b0010e07538573 Author: Justin Hibbits AuthorDate: 2023-02-10 14:57:29 +0000 Commit: Justin Hibbits CommitDate: 2023-02-14 15:21:18 +0000 etherswitch: Fix leftovers from IfAPI conversion Sponsored by: Juniper Networks, Inc. --- sys/dev/etherswitch/ar40xx/ar40xx_phy.c | 8 ++++---- sys/dev/etherswitch/e6000sw/e6060sw.c | 4 ++-- sys/dev/etherswitch/felix/felix.c | 4 ++-- sys/dev/etherswitch/infineon/adm6996fc.c | 4 ++-- sys/dev/etherswitch/micrel/ksz8995ma.c | 4 ++-- sys/dev/etherswitch/mtkswitch/mtkswitch.c | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/dev/etherswitch/ar40xx/ar40xx_phy.c b/sys/dev/etherswitch/ar40xx/ar40xx_phy.c index 581eead59bfd..03dad3a8fc04 100644 --- a/sys/dev/etherswitch/ar40xx/ar40xx_phy.c +++ b/sys/dev/etherswitch/ar40xx/ar40xx_phy.c @@ -162,10 +162,10 @@ static int ar40xx_ifmedia_upd(if_t ifp) { struct ar40xx_softc *sc = if_getsoftc(ifp); - struct mii_data *mii = ar40xx_phy_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + struct mii_data *mii = ar40xx_phy_miiforport(sc, if_getdunit(ifp)); AR40XX_DPRINTF(sc, AR40XX_DBG_PORT_STATUS, "%s: called, PHY %d\n", - __func__, ifp->if_dunit); /* XXX - DRVAPI */ + __func__, if_getdunit(ifp)); if (mii == NULL) return (ENXIO); @@ -177,10 +177,10 @@ static void ar40xx_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) { struct ar40xx_softc *sc = if_getsoftc(ifp); - struct mii_data *mii = ar40xx_phy_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + struct mii_data *mii = ar40xx_phy_miiforport(sc, if_getdunit(ifp)); AR40XX_DPRINTF(sc, AR40XX_DBG_PORT_STATUS, "%s: called, PHY %d\n", - __func__, ifp->if_dunit); /* XXX - DRVAPI */ + __func__, if_getdunit(ifp)); if (mii == NULL) return; diff --git a/sys/dev/etherswitch/e6000sw/e6060sw.c b/sys/dev/etherswitch/e6000sw/e6060sw.c index f21b7d2c24d0..8ebbb7e7016a 100644 --- a/sys/dev/etherswitch/e6000sw/e6060sw.c +++ b/sys/dev/etherswitch/e6000sw/e6060sw.c @@ -889,7 +889,7 @@ e6060sw_ifmedia_upd(if_t ifp) struct mii_data *mii; sc = if_getsoftc(ifp); - mii = e6060sw_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + mii = e6060sw_miiforport(sc, if_getdunit(ifp)); DPRINTF(sc->sc_dev, "%s\n", __func__); if (mii == NULL) @@ -905,7 +905,7 @@ e6060sw_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) struct mii_data *mii; sc = if_getsoftc(ifp); - mii = e6060sw_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + mii = e6060sw_miiforport(sc, if_getdunit(ifp)); DPRINTF(sc->sc_dev, "%s\n", __func__); diff --git a/sys/dev/etherswitch/felix/felix.c b/sys/dev/etherswitch/felix/felix.c index 5a08da8fb1ff..fe07cb834be3 100644 --- a/sys/dev/etherswitch/felix/felix.c +++ b/sys/dev/etherswitch/felix/felix.c @@ -970,7 +970,7 @@ felix_ifmedia_upd(if_t ifp) felix_softc_t sc; sc = if_getsoftc(ifp); - mii = felix_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + mii = felix_miiforport(sc, if_getdunit(ifp)); if (mii == NULL) return (ENXIO); @@ -985,7 +985,7 @@ felix_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) struct mii_data *mii; sc = if_getsoftc(ifp); - mii = felix_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + mii = felix_miiforport(sc, if_getdunit(ifp)); if (mii == NULL) return; diff --git a/sys/dev/etherswitch/infineon/adm6996fc.c b/sys/dev/etherswitch/infineon/adm6996fc.c index 7b3c97a99303..e6345629bbc4 100644 --- a/sys/dev/etherswitch/infineon/adm6996fc.c +++ b/sys/dev/etherswitch/infineon/adm6996fc.c @@ -727,7 +727,7 @@ adm6996fc_ifmedia_upd(if_t ifp) struct mii_data *mii; sc = if_getsoftc(ifp); - mii = adm6996fc_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + mii = adm6996fc_miiforport(sc, if_getdunit(ifp)); DPRINTF(sc->sc_dev, "%s\n", __func__); if (mii == NULL) @@ -743,7 +743,7 @@ adm6996fc_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) struct mii_data *mii; sc = if_getsoftc(ifp); - mii = adm6996fc_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + mii = adm6996fc_miiforport(sc, if_getdunit(ifp)); DPRINTF(sc->sc_dev, "%s\n", __func__); diff --git a/sys/dev/etherswitch/micrel/ksz8995ma.c b/sys/dev/etherswitch/micrel/ksz8995ma.c index 6b7bbb3da767..f4f6fa6a127a 100644 --- a/sys/dev/etherswitch/micrel/ksz8995ma.c +++ b/sys/dev/etherswitch/micrel/ksz8995ma.c @@ -777,7 +777,7 @@ ksz8995ma_ifmedia_upd(if_t ifp) struct mii_data *mii; sc = if_getsoftc(ifp); - mii = ksz8995ma_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + mii = ksz8995ma_miiforport(sc, if_getdunit(ifp)); DPRINTF(sc->sc_dev, "%s\n", __func__); if (mii == NULL) @@ -793,7 +793,7 @@ ksz8995ma_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) struct mii_data *mii; sc = if_getsoftc(ifp); - mii = ksz8995ma_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + mii = ksz8995ma_miiforport(sc, if_getdunit(ifp)); DPRINTF(sc->sc_dev, "%s\n", __func__); diff --git a/sys/dev/etherswitch/mtkswitch/mtkswitch.c b/sys/dev/etherswitch/mtkswitch/mtkswitch.c index c10c34c4c21c..d8a474e54c91 100644 --- a/sys/dev/etherswitch/mtkswitch/mtkswitch.c +++ b/sys/dev/etherswitch/mtkswitch/mtkswitch.c @@ -522,7 +522,7 @@ static int mtkswitch_ifmedia_upd(if_t ifp) { struct mtkswitch_softc *sc = if_getsoftc(ifp); - struct mii_data *mii = mtkswitch_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + struct mii_data *mii = mtkswitch_miiforport(sc, if_getdunit(ifp)); if (mii == NULL) return (ENXIO); @@ -534,7 +534,7 @@ static void mtkswitch_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) { struct mtkswitch_softc *sc = if_getsoftc(ifp); - struct mii_data *mii = mtkswitch_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */ + struct mii_data *mii = mtkswitch_miiforport(sc, if_getdunit(ifp)); DPRINTF(sc->sc_dev, "%s\n", __func__); From nobody Tue Feb 14 15:36:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQKX6Xs1z3s4w9; Tue, 14 Feb 2023 15:36: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 4PGQKX5bxYz4L2c; Tue, 14 Feb 2023 15:36:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1GO16mAO3OO9pqBI7R7KPwGIEUdBRl8880f5Tqcxv5E=; b=EoYIn4lRiJmAkFo+1WKSPInWtqOQSnLSiqO2S87f7ilTCwepudlar3IrjndSBlR24WDOKk xO6TBE5qFg1hOCjigeM78s1ZcW9ltNahKvylPXcInKJ7dIDi5pIaLJr59sJWiLCMeI37Km Y51exCt+au0alYagCthLgwfZnI0F3E84IZSrQJ+31AYwAdKvZixLmhQJ6qHBzxQvXEPNcl 0pyjzpbZJaCl3Ub5V5DVOxOyHwAMVVTg9JI+22yx6fdWBmiNPFN5QoP8PCkPtC/NPfkeip QjB5lZIa79MAaJ8BiDsX16QM1kVDOOv0ddUpFbk4N2tzkGWO/dOIIfe4OaSgpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1GO16mAO3OO9pqBI7R7KPwGIEUdBRl8880f5Tqcxv5E=; b=wuPXgkpdL7Cdr8LCn0u9/On1A1p5zZF6gDv0JTAdHJ9BAztm/dAxZgBvJmbSQawS76P1UI gjweeUTzK+orEQUu5K9FFpFdLJWe9pmiEBH3rBTSqobhz4fT2Qq2/RSHLdfGIn/h5qJKlr Y1o4HRdu8c6ZD84PKrTotVPbX5DRbDL0c/P8cs2XUVx5PSxpkkqk2JnD5f0jBZ7fe2ULAh bDTHqKEDN/ZSKr//sAKGVpQhmmRqc5oGLVL03Jx3qkiE99ZEe+15Un3V5Glbj0oezTUX+h xoR+I6Vy5seWHF3Vbk9lXuCYbNgAH1VIrHBPokrekkxqXDF85xShtVAjdk1cww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388976; a=rsa-sha256; cv=none; b=jEJmJ37QfmUdfva/TUFyBtgN4aARbzPALdX/nxhbMepY7wY1YZHH42AnGppWaQwXrsS0ZL FPwIUsFsaWOt3x9KGqINein4CQVdfyclby2bYKyu0TJVcFz4jFcCrOXJc72OlMzrApEzhz CeicIDDg11HZsAn5+Dc6nwrjBoIxL+QC5SxFqJsnY1LM3fxKgCQmRvE9QtwWzJ4Ne3mf0Z uhwSjZi4vHgLZUe8A0Mth5AOb9FKn2krGq0kVrQACuh7zFGpaJe9XEAlSNPsck+sUdxPTk 8N7bQeQb5vEqV2uHpfyjR34ylGUZzIu4f7pkDunbr8KSM23+eJuw5NlFHjQ2zA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGQKX4X4Yz13Vd; Tue, 14 Feb 2023 15:36: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 31EFaG8G043654; Tue, 14 Feb 2023 15:36:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFaGq5043653; Tue, 14 Feb 2023 15:36:16 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:36:16 GMT Message-Id: <202302141536.31EFaGq5043653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 4366ea339ddb - main - mlx4: Finish conversion to IfAPI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4366ea339ddb0945d94a646fc991ff293c6ec526 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=4366ea339ddb0945d94a646fc991ff293c6ec526 commit 4366ea339ddb0945d94a646fc991ff293c6ec526 Author: Justin Hibbits AuthorDate: 2023-02-09 02:36:11 +0000 Commit: Justin Hibbits CommitDate: 2023-02-14 15:21:19 +0000 mlx4: Finish conversion to IfAPI Fix a few stragglers found with further IfAPI work. Sponsored by: Juniper Networks, Inc. --- sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c index 3a2b9d7a8139..ae82f8c1a187 100644 --- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c +++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c @@ -731,11 +731,11 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port, if (!ndev) goto out_unlock; - tmp = iboe_get_mtu(ndev->if_mtu); + tmp = iboe_get_mtu(if_getmtu(ndev)); props->active_mtu = tmp ? min(props->max_mtu, tmp) : IB_MTU_256; - props->state = ((ndev->if_drv_flags & IFF_DRV_RUNNING) != 0 && - ndev->if_link_state == LINK_STATE_UP) ? + props->state = ((if_getdrvflags(ndev) & IFF_DRV_RUNNING) != 0 && + if_getlinkstate(ndev) == LINK_STATE_UP) ? IB_PORT_ACTIVE : IB_PORT_DOWN; props->phys_state = state_to_phys_state(props->state); out_unlock: @@ -2281,7 +2281,7 @@ static int mlx4_ib_netdev_event(struct notifier_block *this, if_t dev = netdev_notifier_info_to_ifp(ptr); struct mlx4_ib_dev *ibdev; - if (dev->if_vnet != &init_net) + if (if_getvnet(dev) != &init_net) return NOTIFY_DONE; ibdev = container_of(this, struct mlx4_ib_dev, iboe.nb); @@ -3021,8 +3021,8 @@ static void handle_bonded_port_state_event(struct work_struct *work) continue; curr_port_state = - ((curr_netdev->if_drv_flags & IFF_DRV_RUNNING) != 0 && - curr_netdev->if_link_state == LINK_STATE_UP) ? + ((if_getdrvflags(curr_netdev) & IFF_DRV_RUNNING) != 0 && + if_getlinkstate(curr_netdev) == LINK_STATE_UP) ? IB_PORT_ACTIVE : IB_PORT_DOWN; bonded_port_state = (bonded_port_state != IB_PORT_ACTIVE) ? From nobody Tue Feb 14 15:36:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQKY6Mkqz3s5FC; Tue, 14 Feb 2023 15:36: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 4PGQKY67Gyz4L7H; Tue, 14 Feb 2023 15:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YFRfvOzwl+VI6CDsXfPFCEzeIGfxF8F0I9VdlEDGuXY=; b=yX47F+YW1nOBPB/BW+Dh2JXQL/cw5zFYJIT8JnvA/087HPmEDRbl+FB/DypBphcEbueAIn Vx0j+h3PkCpPbtsmmuk8KrvMPHmL43iuKmGLikxhfZKNvfpoXU/EST6uuZ0vj3dSoiAJl2 BgvwVmMUPSNzYtg3Vlx1uROoP/Zw4Txt3lU+NapbGGpa5aA5fowrfRw24Lo/htwEfv5I5t QixC5yjYr3fV8VwFZS/dVj6N/IxlVxb32cp9DVGIyFn2q2+vF+GTLLC9wnFWfJqZYMVyZ7 JlgQqlqCC0punW4IFvxqai4hgUqBgadLJGRMxR0zOr2ZujOOGBj6XgL6M7NC9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YFRfvOzwl+VI6CDsXfPFCEzeIGfxF8F0I9VdlEDGuXY=; b=GPD2Sr/u3JQ2DD3reL2r8vmJfMbqWdG+hlXQ0HhkJos+yCg6/Av3wP88KZ4ieJCxz38b5Y zC6nxlnpudDI+6b6og3/fgBm1/+dVnRXiAe3rwFC+ZiC0tkvdorgmbgj5NzC8N4AE3UcDg G6ahDSt4GHNFqMe6AlpD0KKyZEUcGt9Oh+uwpu9qN+d9+44g6wHit5S+QRqsVhQcVoca7Q F/XC2MTplHwGZ88wxExULIqGYoWcgCsQk8ek6TF67kRqZzmd7bzc8fJ6Be3bui4e70CEA9 G8elwRhJjIaY3/QaRUYB5Xt6Mtbb7XOjTVRyGKNv3rEuPYic3MlgL2hIpYpUog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388977; a=rsa-sha256; cv=none; b=LeY7hX64DJnqq972B6/PJ/Nu2sQNGuzeyBWyep1qNTsfq1ZUysYU66QdJ1XvazyUgglMXn O0DbXOW21q9ptDvBvbA4XeCl7/cXIA0BlKmFdNPfiuUo90YZQms1XRDBf/+mxxcwQ3G276 fZzpKC8DZSnzO6rh/xBwetq9icgfQQ5uTLIp5XDQ+3gVzdhH4DzUgnYW0fowKMZuuZnSZ3 dT6lEe5zPxMexN4ReSBXBd1m7ocmZEht0wLi30ufJ5nT25Bc5a+T5RW8/MeBpCvZftH3AW WlSbng2G5IKGuAGoZSWy6a8K7a9SMz4dRm+q4sSW7GRtgZav42bgjvXdsZiV8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGQKY5DK7z13Vf; Tue, 14 Feb 2023 15:36: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 31EFaHJd043686; Tue, 14 Feb 2023 15:36:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFaHkB043685; Tue, 14 Feb 2023 15:36:17 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:36:17 GMT Message-Id: <202302141536.31EFaHkB043685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: e330262f34fc - main - Mechanically convert netmap(4) to IfAPI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e330262f34fc179ce920c16bb28ba8a1c4a73aff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=e330262f34fc179ce920c16bb28ba8a1c4a73aff commit e330262f34fc179ce920c16bb28ba8a1c4a73aff Author: Justin Hibbits AuthorDate: 2023-01-12 18:38:37 +0000 Commit: Justin Hibbits CommitDate: 2023-02-14 15:21:19 +0000 Mechanically convert netmap(4) to IfAPI Reviewed by: vmaffione, zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37814 --- sys/dev/netmap/if_ptnet.c | 86 +++++++++++++++++++------------------- sys/dev/netmap/if_re_netmap.h | 14 +++---- sys/dev/netmap/if_vtnet_netmap.h | 22 +++++----- sys/dev/netmap/netmap.c | 44 ++++++++++---------- sys/dev/netmap/netmap_bdg.c | 4 +- sys/dev/netmap/netmap_bdg.h | 2 +- sys/dev/netmap/netmap_freebsd.c | 90 ++++++++++++++++++++-------------------- sys/dev/netmap/netmap_generic.c | 12 +++--- sys/dev/netmap/netmap_kern.h | 74 ++++++++++++++++----------------- sys/dev/netmap/netmap_kloop.c | 2 +- sys/dev/netmap/netmap_legacy.c | 4 +- sys/dev/netmap/netmap_mem2.c | 14 +++---- sys/dev/netmap/netmap_mem2.h | 4 +- sys/dev/netmap/netmap_monitor.c | 2 +- sys/dev/netmap/netmap_pipe.c | 2 +- sys/dev/netmap/netmap_vale.c | 14 +++---- 16 files changed, 194 insertions(+), 196 deletions(-) diff --git a/sys/dev/netmap/if_ptnet.c b/sys/dev/netmap/if_ptnet.c index be75da2db9dc..5b3332ee5915 100644 --- a/sys/dev/netmap/if_ptnet.c +++ b/sys/dev/netmap/if_ptnet.c @@ -408,14 +408,14 @@ ptnet_attach(device_t dev) } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_baudrate = IF_Gbps(10); - ifp->if_softc = sc; - ifp->if_flags = IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX; - ifp->if_init = ptnet_init; - ifp->if_ioctl = ptnet_ioctl; - ifp->if_get_counter = ptnet_get_counter; - ifp->if_transmit = ptnet_transmit; - ifp->if_qflush = ptnet_qflush; + if_setbaudrate(ifp, IF_Gbps(10)); + if_setsoftc(ifp, sc); + if_setflags(ifp, IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX); + if_setinitfn(ifp, ptnet_init); + if_setioctlfn(ifp, ptnet_ioctl); + if_setget_counter(ifp, ptnet_get_counter); + if_settransmitfn(ifp, ptnet_transmit); + if_setqflushfn(ifp, ptnet_qflush); ifmedia_init(&sc->media, IFM_IMASK, ptnet_media_change, ptnet_media_status); @@ -433,25 +433,25 @@ ptnet_attach(device_t dev) ether_ifattach(ifp, sc->hwaddr); - ifp->if_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU; + if_setifheaderlen(ifp, sizeof(struct ether_vlan_header)); + if_setcapabilitiesbit(ifp, IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU, 0); if (sc->ptfeatures & PTNETMAP_F_VNET_HDR) { /* Similarly to what the vtnet driver does, we can emulate * VLAN offloadings by inserting and removing the 802.1Q * header during transmit and receive. We are then able * to do checksum offloading of VLAN frames. */ - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 + if_setcapabilitiesbit(ifp, IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_LRO | IFCAP_VLAN_HWTSO - | IFCAP_VLAN_HWTAGGING; + | IFCAP_VLAN_HWTAGGING, 0); } - ifp->if_capenable = ifp->if_capabilities; + if_setcapenable(ifp, if_getcapabilities(ifp)); #ifdef DEVICE_POLLING /* Don't enable polling by default. */ - ifp->if_capabilities |= IFCAP_POLLING; + if_setcapabilitiesbit(ifp, IFCAP_POLLING, 0); #endif snprintf(sc->lock_name, sizeof(sc->lock_name), "%s", device_get_nameunit(dev)); @@ -517,7 +517,7 @@ ptnet_detach(device_t dev) ptnet_device_shutdown(sc); #ifdef DEVICE_POLLING - if (sc->ifp->if_capenable & IFCAP_POLLING) { + if (if_getcapenable(sc->ifp) & IFCAP_POLLING) { ether_poll_deregister(sc->ifp); } #endif @@ -761,9 +761,9 @@ ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFFLAGS: - device_printf(dev, "SIOCSIFFLAGS %x\n", ifp->if_flags); + device_printf(dev, "SIOCSIFFLAGS %x\n", if_getflags(ifp)); PTNET_CORE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { + if (if_getflags(ifp) & IFF_UP) { /* Network stack wants the iff to be up. */ err = ptnet_init_locked(sc); } else { @@ -777,8 +777,8 @@ ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) case SIOCSIFCAP: device_printf(dev, "SIOCSIFCAP %x %x\n", - ifr->ifr_reqcap, ifp->if_capenable); - mask = ifr->ifr_reqcap ^ ifp->if_capenable; + ifr->ifr_reqcap, if_getcapenable(ifp)); + mask = ifr->ifr_reqcap ^ if_getcapenable(ifp); #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { struct ptnet_queue *pq; @@ -790,7 +790,7 @@ ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) break; } /* Stop queues and sync with taskqueues. */ - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); for (i = 0; i < sc->num_rings; i++) { pq = sc-> queues + i; /* Make sure the worker sees the @@ -804,7 +804,7 @@ ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) &pq->task); } } - ifp->if_drv_flags |= IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0); } else { err = ether_poll_deregister(ifp); for (i = 0; i < sc->num_rings; i++) { @@ -816,7 +816,7 @@ ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) } } #endif /* DEVICE_POLLING */ - ifp->if_capenable = ifr->ifr_reqcap; + if_setcapenable(ifp, ifr->ifr_reqcap); break; case SIOCSIFMTU: @@ -826,7 +826,7 @@ ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) err = EINVAL; } else { PTNET_CORE_LOCK(sc); - ifp->if_mtu = ifr->ifr_mtu; + if_setmtu(ifp, ifr->ifr_mtu); PTNET_CORE_UNLOCK(sc); } break; @@ -853,22 +853,22 @@ ptnet_init_locked(struct ptnet_softc *sc) unsigned int nm_buf_size; int ret; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { return 0; /* nothing to do */ } device_printf(sc->dev, "%s\n", __func__); /* Translate offload capabilities according to if_capenable. */ - ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist |= PTNET_CSUM_OFFLOAD; - if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) - ifp->if_hwassist |= PTNET_CSUM_OFFLOAD_IPV6; - if (ifp->if_capenable & IFCAP_TSO4) - ifp->if_hwassist |= CSUM_IP_TSO; - if (ifp->if_capenable & IFCAP_TSO6) - ifp->if_hwassist |= CSUM_IP6_TSO; + if_sethwassist(ifp, 0); + if (if_getcapenable(ifp) & IFCAP_TXCSUM) + if_sethwassistbits(ifp, PTNET_CSUM_OFFLOAD, 0); + if (if_getcapenable(ifp) & IFCAP_TXCSUM_IPV6) + if_sethwassistbits(ifp, PTNET_CSUM_OFFLOAD_IPV6, 0); + if (if_getcapenable(ifp) & IFCAP_TSO4) + if_sethwassistbits(ifp, CSUM_IP_TSO, 0); + if (if_getcapenable(ifp) & IFCAP_TSO6) + if_sethwassistbits(ifp, CSUM_IP6_TSO, 0); /* * Prepare the interface for netmap mode access. @@ -919,7 +919,7 @@ ptnet_init_locked(struct ptnet_softc *sc) callout_reset(&sc->tick, hz, ptnet_tick, sc); #endif - ifp->if_drv_flags |= IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0); return 0; @@ -946,14 +946,14 @@ ptnet_stop(struct ptnet_softc *sc) device_printf(sc->dev, "%s\n", __func__); - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) { return 0; /* nothing to do */ } /* Clear the driver-ready flag, and synchronize with all the queues, * so that after this loop we are sure nobody is working anymore with * the device. This scheme is taken from the vtnet driver. */ - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); callout_stop(&sc->tick); for (i = 0; i < sc->num_rings; i++) { PTNET_Q_LOCK(sc->queues + i); @@ -1198,7 +1198,7 @@ ptnet_nm_register(struct netmap_adapter *na, int onoff) pq = sc->queues + i; pq->ktoa->kern_need_kick = 1; pq->atok->appl_need_kick = - (!(ifp->if_capenable & IFCAP_POLLING) + (!(if_getcapenable(ifp) & IFCAP_POLLING) && i >= sc->num_tx_rings); } @@ -1407,7 +1407,7 @@ ptnet_drain_transmit_queue(struct ptnet_queue *pq, unsigned int budget, return 0; } - if (unlikely(!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { + if (unlikely(!(if_getdrvflags(ifp) & IFF_DRV_RUNNING))) { PTNET_Q_UNLOCK(pq); nm_prlim(1, "Interface is down"); return ENETDOWN; @@ -1609,7 +1609,7 @@ ptnet_transmit(if_t ifp, struct mbuf *m) return err; } - if (ifp->if_capenable & IFCAP_POLLING) { + if (if_getcapenable(ifp) & IFCAP_POLLING) { /* If polling is on, the transmit queues will be * drained by the poller. */ return 0; @@ -1693,7 +1693,7 @@ ptnet_rx_eof(struct ptnet_queue *pq, unsigned int budget, bool may_resched) PTNET_Q_LOCK(pq); - if (unlikely(!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { + if (unlikely(!(if_getdrvflags(ifp) & IFF_DRV_RUNNING))) { goto unlock; } @@ -1837,7 +1837,7 @@ host_sync: mhead->m_pkthdr.flowid = pq->kring_id; M_HASHTYPE_SET(mhead, M_HASHTYPE_OPAQUE); - if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { + if (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) { struct ether_header *eh; eh = mtod(mhead, struct ether_header *); @@ -1874,7 +1874,7 @@ skip: pq->stats.bytes += mhead->m_pkthdr.len; PTNET_Q_UNLOCK(pq); - (*ifp->if_input)(ifp, mhead); + if_input(ifp, mhead); PTNET_Q_LOCK(pq); /* The ring->head index (and related indices) are * updated under pq lock by ptnet_ring_update(). @@ -1883,7 +1883,7 @@ skip: * ring from there. */ head = ring->head; - if (unlikely(!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { + if (unlikely(!(if_getdrvflags(ifp) & IFF_DRV_RUNNING))) { /* The interface has gone down while we didn't * have the lock. Stop any processing and exit. */ goto unlock; diff --git a/sys/dev/netmap/if_re_netmap.h b/sys/dev/netmap/if_re_netmap.h index 7c356ab4bd22..d658a3e5c8a7 100644 --- a/sys/dev/netmap/if_re_netmap.h +++ b/sys/dev/netmap/if_re_netmap.h @@ -47,8 +47,8 @@ static int re_netmap_reg(struct netmap_adapter *na, int onoff) { - struct ifnet *ifp = na->ifp; - struct rl_softc *adapter = ifp->if_softc; + if_t ifp = na->ifp; + struct rl_softc *adapter = if_getsoftc(ifp); RL_LOCK(adapter); re_stop(adapter); /* also clears IFF_DRV_RUNNING */ @@ -59,7 +59,7 @@ re_netmap_reg(struct netmap_adapter *na, int onoff) } re_init_locked(adapter); /* also enables intr */ RL_UNLOCK(adapter); - return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); + return (if_getdrvflags(ifp) & IFF_DRV_RUNNING ? 0 : 1); } @@ -70,7 +70,7 @@ static int re_netmap_txsync(struct netmap_kring *kring, int flags) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ u_int nic_i; /* index into the NIC ring */ @@ -79,7 +79,7 @@ re_netmap_txsync(struct netmap_kring *kring, int flags) u_int const head = kring->rhead; /* device-specific */ - struct rl_softc *sc = ifp->if_softc; + struct rl_softc *sc = if_getsoftc(ifp); struct rl_txdesc *txd = sc->rl_ldata.rl_tx_desc; bus_dmamap_sync(sc->rl_ldata.rl_tx_list_tag, @@ -172,7 +172,7 @@ static int re_netmap_rxsync(struct netmap_kring *kring, int flags) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ u_int nic_i; /* index into the NIC ring */ @@ -181,7 +181,7 @@ re_netmap_rxsync(struct netmap_kring *kring, int flags) int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; /* device-specific */ - struct rl_softc *sc = ifp->if_softc; + struct rl_softc *sc = if_getsoftc(ifp); struct rl_rxdesc *rxd = sc->rl_ldata.rl_rx_desc; if (head > lim) diff --git a/sys/dev/netmap/if_vtnet_netmap.h b/sys/dev/netmap/if_vtnet_netmap.h index 8bff697b3fdb..fc18976ee023 100644 --- a/sys/dev/netmap/if_vtnet_netmap.h +++ b/sys/dev/netmap/if_vtnet_netmap.h @@ -37,15 +37,15 @@ static int vtnet_netmap_reg(struct netmap_adapter *na, int state) { - struct ifnet *ifp = na->ifp; - struct vtnet_softc *sc = ifp->if_softc; + if_t ifp = na->ifp; + struct vtnet_softc *sc = if_getsoftc(ifp); /* * Trigger a device reinit, asking vtnet_init_locked() to * also enter or exit netmap mode. */ VTNET_CORE_LOCK(sc); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); vtnet_init_locked(sc, state ? VTNET_INIT_NETMAP_ENTER : VTNET_INIT_NETMAP_EXIT); VTNET_CORE_UNLOCK(sc); @@ -59,7 +59,7 @@ static int vtnet_netmap_txsync(struct netmap_kring *kring, int flags) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int ring_nr = kring->ring_id; u_int nm_i; /* index into the netmap ring */ @@ -67,7 +67,7 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int flags) u_int const head = kring->rhead; /* device-specific */ - struct vtnet_softc *sc = ifp->if_softc; + struct vtnet_softc *sc = if_getsoftc(ifp); struct vtnet_txq *txq = &sc->vtnet_txqs[ring_nr]; struct virtqueue *vq = txq->vtntx_vq; int interrupts = !(kring->nr_kflags & NKR_NOINTR); @@ -154,14 +154,14 @@ static int vtnet_netmap_kring_refill(struct netmap_kring *kring, u_int num) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int ring_nr = kring->ring_id; u_int const lim = kring->nkr_num_slots - 1; u_int nm_i; /* device-specific */ - struct vtnet_softc *sc = ifp->if_softc; + struct vtnet_softc *sc = if_getsoftc(ifp); struct vtnet_rxq *rxq = &sc->vtnet_rxqs[ring_nr]; struct virtqueue *vq = rxq->vtnrx_vq; @@ -245,7 +245,7 @@ static int vtnet_netmap_rxsync(struct netmap_kring *kring, int flags) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int ring_nr = kring->ring_id; u_int nm_i; /* index into the netmap ring */ @@ -256,7 +256,7 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int flags) int interrupts = !(kring->nr_kflags & NKR_NOINTR); /* device-specific */ - struct vtnet_softc *sc = ifp->if_softc; + struct vtnet_softc *sc = if_getsoftc(ifp); struct vtnet_rxq *rxq = &sc->vtnet_rxqs[ring_nr]; struct virtqueue *vq = rxq->vtnrx_vq; @@ -349,7 +349,7 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int flags) static void vtnet_netmap_intr(struct netmap_adapter *na, int state) { - struct vtnet_softc *sc = na->ifp->if_softc; + struct vtnet_softc *sc = if_getsoftc(na->ifp); int i; for (i = 0; i < sc->vtnet_max_vq_pairs; i++) { @@ -416,7 +416,7 @@ vtnet_netmap_rx_slots(struct vtnet_softc *sc) static int vtnet_netmap_config(struct netmap_adapter *na, struct nm_config_info *info) { - struct vtnet_softc *sc = na->ifp->if_softc; + struct vtnet_softc *sc = if_getsoftc(na->ifp); info->num_tx_rings = sc->vtnet_act_vq_pairs; info->num_rx_rings = sc->vtnet_act_vq_pairs; diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index 37723fb36fe8..acc05513fbb2 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -637,7 +637,7 @@ netmap_set_all_rings(struct netmap_adapter *na, int stopped) * onload). */ void -netmap_disable_all_rings(struct ifnet *ifp) +netmap_disable_all_rings(if_t ifp) { if (NM_NA_VALID(ifp)) { netmap_set_all_rings(NA(ifp), NM_KR_LOCKED); @@ -650,7 +650,7 @@ netmap_disable_all_rings(struct ifnet *ifp) * napi_enable(). */ void -netmap_enable_all_rings(struct ifnet *ifp) +netmap_enable_all_rings(if_t ifp) { if (NM_NA_VALID(ifp)) { netmap_set_all_rings(NA(ifp), 0 /* enabled */); @@ -658,7 +658,7 @@ netmap_enable_all_rings(struct ifnet *ifp) } void -netmap_make_zombie(struct ifnet *ifp) +netmap_make_zombie(if_t ifp) { if (NM_NA_VALID(ifp)) { struct netmap_adapter *na = NA(ifp); @@ -669,7 +669,7 @@ netmap_make_zombie(struct ifnet *ifp) } void -netmap_undo_zombie(struct ifnet *ifp) +netmap_undo_zombie(if_t ifp) { if (NM_NA_VALID(ifp)) { struct netmap_adapter *na = NA(ifp); @@ -764,7 +764,7 @@ netmap_update_config(struct netmap_adapter *na) struct nm_config_info info; if (na->ifp && !nm_is_bwrap(na)) { - strlcpy(na->name, na->ifp->if_xname, sizeof(na->name)); + strlcpy(na->name, if_name(na->ifp), sizeof(na->name)); } bzero(&info, sizeof(info)); @@ -1194,7 +1194,7 @@ netmap_dtor(void *data) * After this call the queue is empty. */ static void -netmap_send_up(struct ifnet *dst, struct mbq *q) +netmap_send_up(if_t dst, struct mbq *q) { struct mbuf *m; struct mbuf *head = NULL, *prev = NULL; @@ -1465,7 +1465,7 @@ netmap_rxsync_from_host(struct netmap_kring *kring, int flags) */ static void netmap_hw_dtor(struct netmap_adapter *); /* needed by NM_IS_NATIVE() */ int -netmap_get_hw_na(struct ifnet *ifp, struct netmap_mem_d *nmd, struct netmap_adapter **na) +netmap_get_hw_na(if_t ifp, struct netmap_mem_d *nmd, struct netmap_adapter **na) { /* generic support */ int i = netmap_admode; /* Take a snapshot. */ @@ -1555,7 +1555,7 @@ assign_mem: */ int netmap_get_na(struct nmreq_header *hdr, - struct netmap_adapter **na, struct ifnet **ifp, + struct netmap_adapter **na, if_t *ifp, struct netmap_mem_d *nmd, int create) { struct nmreq_register *req = (struct nmreq_register *)(uintptr_t)hdr->nr_body; @@ -1671,7 +1671,7 @@ out: /* undo netmap_get_na() */ void -netmap_unget_na(struct netmap_adapter *na, struct ifnet *ifp) +netmap_unget_na(struct netmap_adapter *na, if_t ifp) { if (ifp) if_rele(ifp); @@ -2256,12 +2256,12 @@ netmap_buf_size_validate(const struct netmap_adapter *na, unsigned mtu) { nm_prerr("error: large MTU (%d) needed " "but %s does not support " "NS_MOREFRAG", mtu, - na->ifp->if_xname); + if_name(na->ifp)); return EINVAL; } else if (nbs < na->rx_buf_maxsize) { nm_prerr("error: using NS_MOREFRAG on " "%s requires netmap buf size " - ">= %u", na->ifp->if_xname, + ">= %u", if_name(na->ifp), na->rx_buf_maxsize); return EINVAL; } else { @@ -2269,7 +2269,7 @@ netmap_buf_size_validate(const struct netmap_adapter *na, unsigned mtu) { "%s needs to support " "NS_MOREFRAG " "(MTU=%u,netmap_buf_size=%u)", - na->ifp->if_xname, mtu, nbs); + if_name(na->ifp), mtu, nbs); } } return 0; @@ -2744,7 +2744,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data, struct mbq q; /* packets from RX hw queues to host stack */ struct netmap_adapter *na = NULL; struct netmap_mem_d *nmd = NULL; - struct ifnet *ifp = NULL; + if_t ifp = NULL; int error = 0; u_int i, qfirst, qlast; struct netmap_kring **krings; @@ -3039,7 +3039,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data, /* Build a nmreq_register out of the nmreq_port_hdr, * so that we can call netmap_get_bdg_na(). */ struct nmreq_register regreq; - struct ifnet *ifp; + if_t ifp; bzero(®req, sizeof(regreq)); regreq.nr_mode = NR_REG_ALL_NIC; @@ -3973,7 +3973,7 @@ netmap_attach_common(struct netmap_adapter *na) #ifdef __FreeBSD__ if (na->na_flags & NAF_HOST_RINGS && na->ifp) { - na->if_input = na->ifp->if_input; /* for netmap_send_up */ + na->if_input = if_getinputfn(na->ifp); /* for netmap_send_up */ } na->pdev = na; /* make sure netmap_mem_map() is called */ #endif /* __FreeBSD__ */ @@ -4063,7 +4063,7 @@ int netmap_attach_ext(struct netmap_adapter *arg, size_t size, int override_reg) { struct netmap_hw_adapter *hwna = NULL; - struct ifnet *ifp = NULL; + if_t ifp = NULL; if (size < sizeof(struct netmap_hw_adapter)) { if (netmap_debug & NM_DEBUG_ON) @@ -4099,7 +4099,7 @@ netmap_attach_ext(struct netmap_adapter *arg, size_t size, int override_reg) goto fail; hwna->up = *arg; hwna->up.na_flags |= NAF_HOST_RINGS | NAF_NATIVE; - strlcpy(hwna->up.name, ifp->if_xname, sizeof(hwna->up.name)); + strlcpy(hwna->up.name, if_name(ifp), sizeof(hwna->up.name)); if (override_reg) { hwna->nm_hw_register = hwna->up.nm_register; hwna->up.nm_register = netmap_hw_reg; @@ -4197,7 +4197,7 @@ netmap_hw_krings_create(struct netmap_adapter *na) * Called on module unload by the netmap-enabled drivers */ void -netmap_detach(struct ifnet *ifp) +netmap_detach(if_t ifp) { struct netmap_adapter *na; @@ -4243,7 +4243,7 @@ netmap_detach(struct ifnet *ifp) * we make sure to make the mode change visible here. */ int -netmap_transmit(struct ifnet *ifp, struct mbuf *m) +netmap_transmit(if_t ifp, struct mbuf *m) { struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring, *tx_kring; @@ -4483,7 +4483,7 @@ netmap_common_irq(struct netmap_adapter *na, u_int q, u_int *work_done) * calls the proper forwarding routine. */ int -netmap_rx_irq(struct ifnet *ifp, u_int q, u_int *work_done) +netmap_rx_irq(if_t ifp, u_int q, u_int *work_done) { struct netmap_adapter *na = NA(ifp); @@ -4508,7 +4508,7 @@ netmap_rx_irq(struct ifnet *ifp, u_int q, u_int *work_done) void nm_set_native_flags(struct netmap_adapter *na) { - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; /* We do the setup for intercepting packets only if we are the * first user of this adapter. */ @@ -4524,7 +4524,7 @@ nm_set_native_flags(struct netmap_adapter *na) void nm_clear_native_flags(struct netmap_adapter *na) { - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; /* We undo the setup for intercepting packets only if we are the * last user of this adapter. */ diff --git a/sys/dev/netmap/netmap_bdg.c b/sys/dev/netmap/netmap_bdg.c index 1d49a97eec12..62b4c8801a47 100644 --- a/sys/dev/netmap/netmap_bdg.c +++ b/sys/dev/netmap/netmap_bdg.c @@ -390,7 +390,7 @@ netmap_get_bdg_na(struct nmreq_header *hdr, struct netmap_adapter **na, { char *nr_name = hdr->nr_name; const char *ifname; - struct ifnet *ifp = NULL; + if_t ifp = NULL; int error = 0; struct netmap_vp_adapter *vpna, *hostna = NULL; struct nm_bridge *b; @@ -1777,7 +1777,7 @@ netmap_bwrap_attach_common(struct netmap_adapter *na, na->na_flags |= NAF_MOREFRAG; nm_prdis("%s<->%s txr %d txd %d rxr %d rxd %d", - na->name, ifp->if_xname, + na->name, if_name(ifp), na->num_tx_rings, na->num_tx_desc, na->num_rx_rings, na->num_rx_desc); diff --git a/sys/dev/netmap/netmap_bdg.h b/sys/dev/netmap/netmap_bdg.h index ac8629141601..f5148c7407b7 100644 --- a/sys/dev/netmap/netmap_bdg.h +++ b/sys/dev/netmap/netmap_bdg.h @@ -59,7 +59,7 @@ typedef int (*bdg_config_fn_t)(struct nm_ifreq *); typedef void (*bdg_dtor_fn_t)(const struct netmap_vp_adapter *); typedef void *(*bdg_update_private_data_fn_t)(void *private_data, void *callback_data, int *error); typedef int (*bdg_vp_create_fn_t)(struct nmreq_header *hdr, - struct ifnet *ifp, struct netmap_mem_d *nmd, + if_t ifp, struct netmap_mem_d *nmd, struct netmap_vp_adapter **ret); typedef int (*bdg_bwrap_attach_fn_t)(const char *nr_name, struct netmap_adapter *hwna); struct netmap_bdg_ops { diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebsd.c index 8c480f2fb092..3b2fdd214f24 100644 --- a/sys/dev/netmap/netmap_freebsd.c +++ b/sys/dev/netmap/netmap_freebsd.c @@ -171,13 +171,13 @@ nm_os_put_module(void) } static void -netmap_ifnet_arrival_handler(void *arg __unused, struct ifnet *ifp) +netmap_ifnet_arrival_handler(void *arg __unused, if_t ifp) { netmap_undo_zombie(ifp); } static void -netmap_ifnet_departure_handler(void *arg __unused, struct ifnet *ifp) +netmap_ifnet_departure_handler(void *arg __unused, if_t ifp) { netmap_make_zombie(ifp); } @@ -209,9 +209,9 @@ nm_os_ifnet_fini(void) } unsigned -nm_os_ifnet_mtu(struct ifnet *ifp) +nm_os_ifnet_mtu(if_t ifp) { - return ifp->if_mtu; + return if_getmtu(ifp); } rawsum_t @@ -294,7 +294,7 @@ nm_os_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, /* on FreeBSD we send up one packet at a time */ void * -nm_os_send_up(struct ifnet *ifp, struct mbuf *m, struct mbuf *prev) +nm_os_send_up(if_t ifp, struct mbuf *m, struct mbuf *prev) { NA(ifp)->if_input(ifp, m); return NULL; @@ -315,7 +315,7 @@ nm_os_mbuf_has_seg_offld(struct mbuf *m) } static void -freebsd_generic_rx_handler(struct ifnet *ifp, struct mbuf *m) +freebsd_generic_rx_handler(if_t ifp, struct mbuf *m) { int stolen; @@ -341,7 +341,7 @@ int nm_os_catch_rx(struct netmap_generic_adapter *gna, int intercept) { struct netmap_adapter *na = &gna->up.up; - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; int ret = 0; nm_os_ifnet_lock(); @@ -351,10 +351,9 @@ nm_os_catch_rx(struct netmap_generic_adapter *gna, int intercept) ret = EBUSY; /* already set */ goto out; } - - ifp->if_capenable |= IFCAP_NETMAP; - gna->save_if_input = ifp->if_input; - ifp->if_input = freebsd_generic_rx_handler; + if_setcapenablebit(ifp, IFCAP_NETMAP, 0); + gna->save_if_input = if_getinputfn(ifp); + if_setinputfn(ifp, freebsd_generic_rx_handler); } else { if (!gna->save_if_input) { nm_prerr("Failed to undo RX intercept on %s", @@ -362,9 +361,8 @@ nm_os_catch_rx(struct netmap_generic_adapter *gna, int intercept) ret = EINVAL; /* not saved */ goto out; } - - ifp->if_capenable &= ~IFCAP_NETMAP; - ifp->if_input = gna->save_if_input; + if_setcapenablebit(ifp, 0, IFCAP_NETMAP); + if_setinputfn(ifp, gna->save_if_input); gna->save_if_input = NULL; } out: @@ -384,14 +382,14 @@ int nm_os_catch_tx(struct netmap_generic_adapter *gna, int intercept) { struct netmap_adapter *na = &gna->up.up; - struct ifnet *ifp = netmap_generic_getifp(gna); + if_t ifp = netmap_generic_getifp(gna); nm_os_ifnet_lock(); if (intercept) { - na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_transmit; + na->if_transmit = if_gettransmitfn(ifp); + if_settransmitfn(ifp, netmap_transmit); } else { - ifp->if_transmit = na->if_transmit; + if_settransmitfn(ifp, na->if_transmit); } nm_os_ifnet_unlock(); @@ -420,7 +418,7 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a) { int ret; u_int len = a->len; - struct ifnet *ifp = a->ifp; + if_t ifp = a->ifp; struct mbuf *m = a->m; /* Link the external storage to @@ -437,7 +435,7 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a) M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); m->m_pkthdr.flowid = a->ring_nr; m->m_pkthdr.rcvif = ifp; /* used for tx notification */ - CURVNET_SET(ifp->if_vnet); + CURVNET_SET(if_getvnet(ifp)); ret = NA(ifp)->if_transmit(ifp, m); CURVNET_RESTORE(); return ret ? -1 : 0; @@ -447,7 +445,7 @@ nm_os_generic_xmit_frame(struct nm_os_gen_arg *a) struct netmap_adapter * netmap_getna(if_t ifp) { - return (NA((struct ifnet *)ifp)); + return (NA(ifp)); } /* @@ -455,14 +453,14 @@ netmap_getna(if_t ifp) * way to extract the info from the ifp */ int -nm_os_generic_find_num_desc(struct ifnet *ifp, unsigned int *tx, unsigned int *rx) +nm_os_generic_find_num_desc(if_t ifp, unsigned int *tx, unsigned int *rx) { return 0; } void -nm_os_generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq) +nm_os_generic_find_num_queues(if_t ifp, u_int *txq, u_int *rxq) { unsigned num_rings = netmap_generic_rings ? netmap_generic_rings : 1; @@ -513,14 +511,14 @@ nm_os_mitigation_cleanup(struct nm_generic_mit *mit) } static int -nm_vi_dummy(struct ifnet *ifp, u_long cmd, caddr_t addr) +nm_vi_dummy(if_t ifp, u_long cmd, caddr_t addr) { return EINVAL; } static void -nm_vi_start(struct ifnet *ifp) +nm_vi_start(if_t ifp) { panic("nm_vi_start() must not be called"); } @@ -594,9 +592,9 @@ nm_vi_free_index(uint8_t val) * increment this refcount on if_attach(). */ int -nm_os_vi_persist(const char *name, struct ifnet **ret) +nm_os_vi_persist(const char *name, if_t *ret) { - struct ifnet *ifp; + if_t ifp; u_short macaddr_hi; uint32_t macaddr_mid; u_char eaddr[6]; @@ -620,14 +618,14 @@ nm_os_vi_persist(const char *name, struct ifnet **ret) return ENOMEM; } if_initname(ifp, name, IF_DUNIT_NONE); - ifp->if_flags = IFF_UP | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_init = (void *)nm_vi_dummy; - ifp->if_ioctl = nm_vi_dummy; - ifp->if_start = nm_vi_start; - ifp->if_mtu = ETHERMTU; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_capabilities |= IFCAP_LINKSTATE; - ifp->if_capenable |= IFCAP_LINKSTATE; + if_setflags(ifp, IFF_UP | IFF_SIMPLEX | IFF_MULTICAST); + if_setinitfn(ifp, (void *)nm_vi_dummy); + if_setioctlfn(ifp, nm_vi_dummy); + if_setstartfn(ifp, nm_vi_start); + if_setmtu(ifp, ETHERMTU); + if_setsendqlen(ifp, ifqmaxlen); + if_setcapabilitiesbit(ifp, IFCAP_LINKSTATE, 0); + if_setcapenablebit(ifp, IFCAP_LINKSTATE, 0); ether_ifattach(ifp, eaddr); *ret = ifp; @@ -636,9 +634,9 @@ nm_os_vi_persist(const char *name, struct ifnet **ret) /* unregister from the system and drop the final refcount */ void -nm_os_vi_detach(struct ifnet *ifp) +nm_os_vi_detach(if_t ifp) { - nm_vi_free_index(((char *)IF_LLADDR(ifp))[5]); + nm_vi_free_index(((char *)if_getlladdr(ifp))[5]); ether_ifdetach(ifp); if_free(ifp); } @@ -1502,28 +1500,28 @@ out: } void -nm_os_onattach(struct ifnet *ifp) +nm_os_onattach(if_t ifp) { - ifp->if_capabilities |= IFCAP_NETMAP; + if_setcapabilitiesbit(ifp, IFCAP_NETMAP, 0); } void -nm_os_onenter(struct ifnet *ifp) +nm_os_onenter(if_t ifp) { struct netmap_adapter *na = NA(ifp); - na->if_transmit = ifp->if_transmit; - ifp->if_transmit = netmap_transmit; - ifp->if_capenable |= IFCAP_NETMAP; + na->if_transmit = if_gettransmitfn(ifp); + if_settransmitfn(ifp, netmap_transmit); + if_setcapenablebit(ifp, IFCAP_NETMAP, 0); } void -nm_os_onexit(struct ifnet *ifp) +nm_os_onexit(if_t ifp) { struct netmap_adapter *na = NA(ifp); - ifp->if_transmit = na->if_transmit; - ifp->if_capenable &= ~IFCAP_NETMAP; + if_settransmitfn(ifp, na->if_transmit); + if_setcapenablebit(ifp, 0, IFCAP_NETMAP); } extern struct cdevsw netmap_cdevsw; /* XXX used in netmap.c, should go elsewhere */ diff --git a/sys/dev/netmap/netmap_generic.c b/sys/dev/netmap/netmap_generic.c index 83908f10a3fe..038d6efc33f5 100644 --- a/sys/dev/netmap/netmap_generic.c +++ b/sys/dev/netmap/netmap_generic.c @@ -647,7 +647,7 @@ generic_netmap_txsync(struct netmap_kring *kring, int flags) { struct netmap_adapter *na = kring->na; struct netmap_generic_adapter *gna = (struct netmap_generic_adapter *)na; - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap ring */ // j u_int const lim = kring->nkr_num_slots - 1; @@ -811,7 +811,7 @@ generic_netmap_txsync(struct netmap_kring *kring, int flags) * Returns 1 if the packet was stolen, 0 otherwise. */ int -generic_rx_handler(struct ifnet *ifp, struct mbuf *m) +generic_rx_handler(if_t ifp, struct mbuf *m) { struct netmap_adapter *na = NA(ifp); struct netmap_generic_adapter *gna = (struct netmap_generic_adapter *)na; @@ -1019,7 +1019,7 @@ static void generic_netmap_dtor(struct netmap_adapter *na) { struct netmap_generic_adapter *gna = (struct netmap_generic_adapter*)na; - struct ifnet *ifp = netmap_generic_getifp(gna); + if_t ifp = netmap_generic_getifp(gna); struct netmap_adapter *prev_na = gna->prev; if (prev_na != NULL) { @@ -1060,7 +1060,7 @@ na_is_generic(struct netmap_adapter *na) * actual configuration. */ int -generic_netmap_attach(struct ifnet *ifp) +generic_netmap_attach(if_t ifp) { struct netmap_adapter *na; struct netmap_generic_adapter *gna; @@ -1068,7 +1068,7 @@ generic_netmap_attach(struct ifnet *ifp) u_int num_tx_desc, num_rx_desc; #ifdef __FreeBSD__ - if (ifp->if_type == IFT_LOOP) { + if (if_gettype(ifp) == IFT_LOOP) { nm_prerr("if_loop is not supported by %s", __func__); return EINVAL; } @@ -1097,7 +1097,7 @@ generic_netmap_attach(struct ifnet *ifp) return ENOMEM; } na = (struct netmap_adapter *)gna; - strlcpy(na->name, ifp->if_xname, sizeof(na->name)); + strlcpy(na->name, if_name(ifp), sizeof(na->name)); na->ifp = ifp; na->num_tx_desc = num_tx_desc; na->num_rx_desc = num_rx_desc; diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index eb708f5a5cc7..b4c7e4c83f6b 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -110,7 +110,7 @@ #define NM_ATOMIC_TEST_AND_SET(p) (!atomic_cmpset_acq_int((p), 0, 1)) #define NM_ATOMIC_CLEAR(p) atomic_store_rel_int((p), 0) *** 434 LINES SKIPPED *** From nobody Tue Feb 14 15:36:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQKb0Sv5z3s5FD; Tue, 14 Feb 2023 15:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGQKb00Y8z4Kxc; Tue, 14 Feb 2023 15:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Unt8IKA1raQdCK1l0ZDc0sOmc5pKt9KxQ9FPJablz3U=; b=PmZcjW89NHdVUwsKF+qEOPfQbtpeo1Wu+RHts84PS/I9gcRGSbtG+t+5cps468NXevipd8 jSBX5xJ33eVY1kEc9ZfZbEhLUhGxLOIEEHIPmq744RB4OMk6jyl0rpyLqby1+yestnV9ik KTwo5H7JVoB5yJz7k3qOb5DE8JpK+y3buIgNfaaBypCfxnrpRlgKsfuGpY4g02x2eEiZUS tfdIwmVOCOqTafDhfiqHNhYvasE5+2znG8brTCT5MkUrAw8yKs8/GxMT2p2Z/Oof2y7izP 3TUIVV8ExVFrBS50lSWrCRM7VDTYG6jBY2JZqR/e1iv9WNYhhFIfnab7VGp/nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Unt8IKA1raQdCK1l0ZDc0sOmc5pKt9KxQ9FPJablz3U=; b=gW/kyB4ntkzndIhaGo6fSG8vTCsEG5Lev6xoHxvwulcp4nbcm7GWSZu1IOo2iBjcYENP/I Mh8Dey3omFE8a6VJmvbKX69j6tY6SwFNVEA1m+0j8Eybz/9NRkfWNTrBtV5mgUxoLXIZ5X kQxcODSnHW41yNWUwewv5IeTe/l+TlzToJ1pKUINynlbFO4Y5m/0hRHmvNLwbPFT7kHvnu t8/g9+zZxjf9liZ029XdsjJyhZBQOzHi48E35fOZxJ9temQ/c4Qw8mqMzUksCQERtouh2T I/POz6WGcS577bwlg5rzsQulHop4ga17hNe2UB1hA9SENzTZejhAjSIyve9orw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388979; a=rsa-sha256; cv=none; b=GuhFs1SS+UKUvULPFo8+RctvrqJ2Sq5h+94+7SEbPaLkI87bwTvpecV2Mqo2iIitbvQbV3 yAW5F0qqbRGs+ywdNqau4vy/65nhUB5FGBbuwMdvgb0KT+fdMKR+r0LCxjjgbu4ZII/+Xc orYlPBQYhl9OW2CIqB346D5cL5nZmHY1oa9t5dNjJXWG/GLYsJt4KCTXN6GuyXURodMvB/ U2U5QqW8RLm6uUpNKEfK48Nf9UnfZdHKnegs+A2o1ETk1AabLDZ6DicSMpQytCo0B23GBj Lbv84XloExl95ZlEo2Lm1vlYNWQlsaMj49imvTv+SKfj9q2RRW0ZvYDNzGtRPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGQKZ6D2Tz142S; Tue, 14 Feb 2023 15:36: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 31EFaIWL043710; Tue, 14 Feb 2023 15:36:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFaI9i043709; Tue, 14 Feb 2023 15:36:18 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:36:18 GMT Message-Id: <202302141536.31EFaI9i043709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 8d5feede40b4 - main - IfAPI: Finish changes of ice(4). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d5feede40b489a6c0b2f2ee5258f8851ae6af88 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=8d5feede40b489a6c0b2f2ee5258f8851ae6af88 commit 8d5feede40b489a6c0b2f2ee5258f8851ae6af88 Author: Justin Hibbits AuthorDate: 2023-01-23 15:42:13 +0000 Commit: Justin Hibbits CommitDate: 2023-02-14 15:21:19 +0000 IfAPI: Finish changes of ice(4). Reviewed by: erj Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38423 --- sys/dev/ice/ice_iflib_txrx.c | 2 +- sys/dev/ice/ice_lib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ice/ice_iflib_txrx.c b/sys/dev/ice/ice_iflib_txrx.c index f2ae62c77f7c..89c85357a755 100644 --- a/sys/dev/ice/ice_iflib_txrx.c +++ b/sys/dev/ice/ice_iflib_txrx.c @@ -419,7 +419,7 @@ ice_ift_queue_select(void *arg, struct mbuf *m, if_pkt_info_t pi) /* Included to match default iflib behavior */ /* Only go out on default queue if ALTQ is enabled */ struct ifnet *ifp = (struct ifnet *)iflib_get_ifp(sc->ctx); - if (ALTQ_IS_ENABLED(&ifp->if_snd)) + if (if_altq_is_enabled(ifp)) return (0); #endif diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index 43311ddf3f8e..da69145e85de 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -7514,7 +7514,7 @@ ice_link_up_msg(struct ice_softc *sc) int ice_update_laa_mac(struct ice_softc *sc) { - const u8 *lladdr = (const u8 *)IF_LLADDR(sc->ifp); + const u8 *lladdr = (const u8 *)if_getlladdr(sc->ifp); struct ice_hw *hw = &sc->hw; enum ice_status status; From nobody Tue Feb 14 15:36:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQKc1Mthz3s5QM; Tue, 14 Feb 2023 15:36: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 4PGQKc0y5Kz4KyB; Tue, 14 Feb 2023 15:36:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7D6g6+xWgXVOsmvCcPfWCtE/164znXWDImaGgdnOE/I=; b=yEFC1Af04OJAurpm47SNTdFT3VkE5BsogBB8SOblQbDeXEnNx4VmY83PGmDZRhFbKKx264 uevQRAbaDDQ1Ss4wveAfbW1eOEjYSTTkNnU5mFwmn2Nn05wwMlK84le3QsS6f2HvdYRFKd 1v7ackHnUZQcBggSzGF7xEdJT/2CXUi1BL7iNGZFuASzAWbXs+r2C6wp/XFGl038mq9Umu 2eaASRaDxDIJL4dj0D2xwGcQeo/lMt7Rv61uKL+u9foHeVU4lo4zsujtPef9IhTKWbgv/J uSsjdO3iDkubOLG7rUGB4+nWNMEfFCRYZdlRxgyinV+UcTmom9GWjWwWk/bAKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7D6g6+xWgXVOsmvCcPfWCtE/164znXWDImaGgdnOE/I=; b=iWjWXXKe9rAG69vAxebtlGyoZ8nOC5bEoRiz7CoG3zuXU02h7seRw7uCb6xWPcrwxZu5hQ s1PsD3VlIQNFQmVLfwvufW9pkIMEn2n+hIfpaf+KbslhkLB1AtCYmDZ58b+KF5vUC1aunS bmbP1DT91IYNtGnrsZMSJ+WwhA3SZJIC1FOEroGb9fsUHV8thB9Kq9QWccy0Ok6P+IKaYk Hvk45ejXsg3c9G2T6P7jAe0Rpl2q44OduJSxILMRYJgdI/Wc70npowy+LHAuzJuOWS+kWH nGY1HW9FjFbw4OunVIqzI3UTlQjTFHhZWwT1glmelra3RaEFKfrmdHuy5OeyMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388980; a=rsa-sha256; cv=none; b=wXlZyFCWHKia4FKs/PEu1RW8a+W8eNGm20vuuhlf+4g/8/mRkFkSlqvqT0FKpZ8GchkSAA TFeCGLFVV1A6R0n7bUNQxxb8DquoIXuq6DI9kfEtFRP3ly6VGsxMZ3USuTht7hqqgPZUYD 1caHoSxFRDuH7Bf8zUfGpT7EG1Qtl8XQ3mZ8EELqp13smhLRkz15Dtm/Bt9U3AEJLJzOcf wf3whLjRs7rN/xQw2ORnhHFcXhSEpLUMHagwERDUIAaVfcvvJsS6tXuvHVKtpVuALkD/zK qKVvZNG+tD5sWeeZpQWzn5CLm76knaCVj/7yUEiZul/yaRTybluWZco7mEz+LQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGQKc041pz142T; Tue, 14 Feb 2023 15:36: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 31EFaJCN043742; Tue, 14 Feb 2023 15:36:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFaJOJ043741; Tue, 14 Feb 2023 15:36:19 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:36:19 GMT Message-Id: <202302141536.31EFaJOJ043741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 189c3729d84f - main - IfAPI: More accessors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 189c3729d84f620a6be10f62daef32ae9a47eff3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=189c3729d84f620a6be10f62daef32ae9a47eff3 commit 189c3729d84f620a6be10f62daef32ae9a47eff3 Author: Justin Hibbits AuthorDate: 2023-02-10 15:53:19 +0000 Commit: Justin Hibbits CommitDate: 2023-02-14 15:21:19 +0000 IfAPI: More accessors Summary: Add the following accessors needed by infiniband drivers: * if_getaddrlen() * if_setbroadcastaddr() * if_resolvemulti() With these accessors, and additional changes on the drivers' side, an amd64 kernel can be compiled with `struct ifnet` completely hidden. Reviewed by: melifaro Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38488 --- sys/net/if.c | 21 +++++++++++++++++++++ sys/net/if_var.h | 3 +++ 2 files changed, 24 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index 43d1e2b95a63..d17738fda0b7 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4681,6 +4681,15 @@ if_transmit(if_t ifp, struct mbuf *m) return (0); } +int +if_resolvemulti(if_t ifp, struct sockaddr **srcs, struct sockaddr *dst) +{ + if (ifp->if_resolvemulti == NULL) + return (EOPNOTSUPP); + + return (ifp->if_resolvemulti(ifp, srcs, dst)); +} + struct mbuf * if_dequeue(if_t ifp) { @@ -4928,6 +4937,12 @@ if_getbroadcastaddr(if_t ifp) return (ifp->if_broadcastaddr); } +void +if_setbroadcastaddr(if_t ifp, const uint8_t *addr) +{ + ifp->if_broadcastaddr = addr; +} + int if_getnumadomain(if_t ifp) { @@ -4964,6 +4979,12 @@ if_getfib(if_t ifp) return (ifp->if_fib); } +uint8_t +if_getaddrlen(if_t ifp) +{ + return (ifp->if_addrlen); +} + struct bpf_if * if_getbpf(if_t ifp) { diff --git a/sys/net/if_var.h b/sys/net/if_var.h index f33b4fc590c7..f6bb77908d40 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -604,8 +604,10 @@ int if_setflags(if_t ifp, int flags); void if_setllsoftc(if_t ifp, void *softc); void *if_getllsoftc(if_t ifp); u_int if_getfib(if_t ifp); +uint8_t if_getaddrlen(if_t ifp); int if_gethwaddr(const if_t ifp, struct ifreq *); const uint8_t *if_getbroadcastaddr(const if_t ifp); +void if_setbroadcastaddr(if_t ifp, const uint8_t *); int if_setmtu(if_t ifp, int mtu); int if_getmtu(const if_t ifp); int if_getmtu_family(const if_t ifp, int family); @@ -640,6 +642,7 @@ void if_etherbpfmtap(if_t ifp, struct mbuf *m); void if_vlancap(if_t ifp); int if_transmit(if_t ifp, struct mbuf *m); int if_init(if_t ifp, void *ctx); +int if_resolvemulti(if_t ifp, struct sockaddr **, struct sockaddr *); uint64_t if_getcounter(if_t ifp, ift_counter counter); struct label *if_getmaclabel(if_t ifp); void if_setmaclabel(if_t ifp, struct label *label); From nobody Tue Feb 14 15:36:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQKd4n3Yz3s50y; Tue, 14 Feb 2023 15:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGQKd20klz4LDc; Tue, 14 Feb 2023 15:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CQ93FQ8oSS7E1Mjj2sgrQSb8iNgP418F2mJ5/EhAlHo=; b=hMccTEoorh+qMPfveBQHGVkRPgBELaPQd1FVxdHHCYzpXWpg/O9NfN63q+opjIw6fYVaSb zqBFPtt1jnhwxaxMOYlckTN3IP1aLA/+x3ODiRIoWuzOkiFZo6WdzAmLkflCNcFK008Ejh xk93yQxhxt3L7gEnSU+wL1zjA8Ir1nVsQWlnizSIzPXDc/qrksD7BSFlqi9ncJdC3c4IuC rrSQLeofdWI7lTtRJssuT+fTYAbENZ39a3lTl5pJtRSL3UDNdxRSCzEMXJtjdI/HATmGrP e1rfL3uQaArMojmjW71EDRHKObdhKDhZKreuCG8mYwUey06VCMDUcM6mD0Ktaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CQ93FQ8oSS7E1Mjj2sgrQSb8iNgP418F2mJ5/EhAlHo=; b=L4LbGoxooTx7oW/+vjbTQyPqR1tWemXJMPRajpgNYT3GdliyqecIIYW5lGuKGhg/M0w9dk yuRm6R4OCep4d17kJfR3e8DfUVgFt7Ed8KTPSSLTqpVW0J//fnpy0oAa38/Cy6rdsyk5qe a+jliafWWhjUqkoQzvjBxVKMASsh8b3IKbrNwMVeBxSgTnHNrb+GVvi6tEM4xxcDCkoZol iwM0r/g8A+5fobgxcUMflVSkrEyDQf1HzpxNzTuxkgg2x4vICdvfi/5DYBC++3YV5WwqL1 WmaBhvzFtVv6gl+8Z/2+R4RqOFdbk0GjPR1NGz9MKaw5/jNGQad6L/s4/neVlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388981; a=rsa-sha256; cv=none; b=AyddBkef2FjkDV40tziP9NovPqjdIV15MVYzPZYqT7mBNea3X0eadqeyj/vGd31b9Sg85r 00C2hSpdF/kupxwBnRMrQQXVPHbFTJ5YQFO77nqVdU99zoaDM4hg2DAsY5TI/7iTrqDNda JDWcP/0SX2r3HlW/BSt3kPl5MER/sQ8SjM6RmdG7GKb2bI822d0ZX+x3jmjV7czm88XiFR wtRo2zsGkliLgYxZJDA30itB/mKHH6wwsJcTtbxGVmMSPKcakIt16unYc4GKa+7QTRp+A5 lU6/3jDG/GKAPKGikyrD82jIzFtHb1qjl7OgqUSkDgy4iWBheSSWlDtAlW6MoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGQKd0pvgz13Vg; Tue, 14 Feb 2023 15:36:21 +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 31EFaLvB043767; Tue, 14 Feb 2023 15:36:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFaLf9043766; Tue, 14 Feb 2023 15:36:21 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:36:21 GMT Message-Id: <202302141536.31EFaLf9043766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: a3a76c3d9031 - main - IfAPI: Add capabilities2/capenable2 accessors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3a76c3d9031d5fa432145afc8493ebda97719ce Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=a3a76c3d9031d5fa432145afc8493ebda97719ce commit a3a76c3d9031d5fa432145afc8493ebda97719ce Author: Justin Hibbits AuthorDate: 2023-02-10 15:45:44 +0000 Commit: Justin Hibbits CommitDate: 2023-02-14 15:21:20 +0000 IfAPI: Add capabilities2/capenable2 accessors Summary: As a stopgap measure add basic accessors for the if_capabilities2 and if_capenable2 members to further hide the ifnet details. Sponsored by: Juniper Networks, Inc. Reviewed by: glebius, kib Differential Revision: https://reviews.freebsd.org/D38487 --- sys/net/if.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ sys/net/if_var.h | 7 +++++++ 2 files changed, 56 insertions(+) diff --git a/sys/net/if.c b/sys/net/if.c index d17738fda0b7..da684dedec73 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4242,6 +4242,42 @@ if_setcapenablebit(if_t ifp, int setcap, int clearcap) return (0); } +int +if_setcapabilities2(if_t ifp, int capabilities) +{ + ifp->if_capabilities2 = capabilities; + return (0); +} + +int +if_setcapabilities2bit(if_t ifp, int setbit, int clearbit) +{ + ifp->if_capabilities2 &= ~clearbit; + ifp->if_capabilities2 |= setbit; + return (0); +} + +int +if_getcapabilities2(const if_t ifp) +{ + return (ifp->if_capabilities2); +} + +int +if_setcapenable2(if_t ifp, int capabilities2) +{ + ifp->if_capenable2 = capabilities2; + return (0); +} + +int +if_setcapenable2bit(if_t ifp, int setcap, int clearcap) +{ + ifp->if_capenable2 &= ~clearcap; + ifp->if_capenable2 |= setcap; + return (0); +} + const char * if_getdname(const if_t ifp) { @@ -4283,6 +4319,19 @@ if_getcapenable(const if_t ifp) return ((struct ifnet *)ifp)->if_capenable; } +int +if_togglecapenable2(if_t ifp, int togglecap) +{ + ifp->if_capenable2 ^= togglecap; + return (0); +} + +int +if_getcapenable2(const if_t ifp) +{ + return (ifp->if_capenable2); +} + int if_getdunit(const if_t ifp) { diff --git a/sys/net/if_var.h b/sys/net/if_var.h index f6bb77908d40..ef3e3d71a262 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -576,6 +576,13 @@ int if_togglecapenable(if_t ifp, int togglecap); int if_setcapenable(if_t ifp, int capenable); int if_setcapenablebit(if_t ifp, int setcap, int clearcap); int if_getcapenable(const if_t ifp); +int if_setcapabilities2(if_t ifp, int capabilities); +int if_setcapabilities2bit(if_t ifp, int setbit, int clearbit); +int if_getcapabilities2(const if_t ifp); +int if_togglecapenable2(if_t ifp, int togglecap); +int if_setcapenable2(if_t ifp, int capenable); +int if_setcapenable2bit(if_t ifp, int setcap, int clearcap); +int if_getcapenable2(const if_t ifp); int if_getdunit(const if_t ifp); int if_getindex(const if_t ifp); int if_getidxgen(const if_t ifp); From nobody Tue Feb 14 15:36:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQKf2V3Yz3s58j; Tue, 14 Feb 2023 15:36: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 4PGQKf2K4dz4LQJ; Tue, 14 Feb 2023 15:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8KT/x9i4JYYob1wvY7jrPkmkyVop1Gz/iudLur5xTc=; b=Vm9nSNp74ZAaZ1NGtRssDwhY9rOAX0g+M4K5opOcNiiyR2dpe3f32lhVqfPQ95Yx9CELsX 7WHqDrcBUt6ZD5G1wr66lcjqtsyI5wr7laN2xg3iBd3+Pqxi9eDBcMe/eqPcqJJcHq9/cY IRmaI9BSEf1B9XFvvDBMnjS1QjA159mRJ50zPAH5PCq/6GBlTIti4t0kd9b8Fm1KAI8bX8 vN349ystjSZtC0xPy+FY9MKfX5Z9brS0tokJaknatYRuuggtAmbW1JR/OzLlJwPkBAknS+ +7hpYVDFCc3CnoydNQ+wWmeN021k03D3AeWWYb2nO3b7LKx4mEBhZ4Yx6U3VtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8KT/x9i4JYYob1wvY7jrPkmkyVop1Gz/iudLur5xTc=; b=IybtpstnJwuwm0RpZ5Dt1pD35P9ZDUINo4TiohPSy/ijpJji0TpeY5Or2Qv4gDgf//oXbe aOnQAEN3qYr56JbHvpIqsa4ZaN/cx8+A1UVsAvFYz0/eoVlBgycGykHFRdPmsbS0rRwRBx g+Vo4FmdV44ieFJ/TqDIr6OiX80rbICr5JuZchdHNWbgsraq4nlEmJNS6qyBh1ZmMtEJsL QSA0lGOiWyChGtxPl/+70dD8Z98geKuTwO+vA4yKDJoLMzjR7f6feV/N3LBtVpYP+5pRm9 hX+QSjVWbZpSYnpYlsWJxAWsae2s5TNMKcN8hMQ2h/q02iNkiQY/7fMlUnVgbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388982; a=rsa-sha256; cv=none; b=xzaojjKoF4pdCVpsB/sheiH6gIeWB9MxMkvIPCfDZp7e8oB6H48vGkm1cHdduNwe3+JB4s j0j9PN0g8BmxtmvFdp7s38Lwbh6d2tg/y0tR3A7J9NwYJ2vL6dCbI4Cnf0P0blvaf0GB7H RzT2o88EdU18gxgVN4Tk8w5PLxa2WW6K128Pf35oaUX1+BtytJcK+gQH9mkaAEgNBCwvFG Rq3pBMWub3/9DoChlUwB/JKze2Lb24QAymq85mKZ9tKRISe+CBQASApzZ26rKvo+tCBWbn VUvXs3EOTCmyFXgE1+plBTnwWhASY3xHfrMsCjWaaMEgxGihXU/bpuItBilu1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGQKf1NBnz146w; Tue, 14 Feb 2023 15:36: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 31EFaMfd043791; Tue, 14 Feb 2023 15:36:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFaMvv043790; Tue, 14 Feb 2023 15:36:22 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:36:22 GMT Message-Id: <202302141536.31EFaMvv043790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: aac2d19d9385 - main - IfAPI: Style cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aac2d19d9385188bfc08483b4b04da9a9fa79a3c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=aac2d19d9385188bfc08483b4b04da9a9fa79a3c commit aac2d19d9385188bfc08483b4b04da9a9fa79a3c Author: Justin Hibbits AuthorDate: 2023-02-10 21:33:30 +0000 Commit: Justin Hibbits CommitDate: 2023-02-14 15:21:20 +0000 IfAPI: Style cleanup Summary: Clean up style issues from IfAPI additions. Casts to (struct ifnet *) made sense when `if_t` was a `void *`, but since it's a `struct ifnet *` it no longer makes sense. Fix whitespace errors, among others. Reviewed by: kib, glebius Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38499 --- sys/net/if.c | 172 ++++++++++++++++++++++--------------------------------- sys/net/if_var.h | 4 +- 2 files changed, 72 insertions(+), 104 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index da684dedec73..bc13cdaf05f5 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -3964,7 +3964,6 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, int len) static int if_requestencap_default(struct ifnet *ifp, struct if_encap_req *req) { - if (req->rtype != IFENCAP_LL) return (EOPNOTSUPP); @@ -4034,7 +4033,6 @@ if_tunnel_check_nesting(struct ifnet *ifp, struct mbuf *m, uint32_t cookie, int if_gethwaddr(struct ifnet *ifp, struct ifreq *ifr) { - if (ifp->if_hw_addr == NULL) return (ENODEV); @@ -4121,7 +4119,6 @@ if_transmit_default(struct ifnet *ifp, struct mbuf *m) static void if_input_default(struct ifnet *ifp __unused, struct mbuf *m) { - m_freem(m); } @@ -4198,47 +4195,42 @@ if_setbaudrate(struct ifnet *ifp, uint64_t baudrate) uint64_t if_getbaudrate(const if_t ifp) { - - return (((struct ifnet *)ifp)->if_baudrate); + return (ifp->if_baudrate); } int if_setcapabilities(if_t ifp, int capabilities) { - ((struct ifnet *)ifp)->if_capabilities = capabilities; + ifp->if_capabilities = capabilities; return (0); } int if_setcapabilitiesbit(if_t ifp, int setbit, int clearbit) { - ((struct ifnet *)ifp)->if_capabilities &= ~clearbit; - ((struct ifnet *)ifp)->if_capabilities |= setbit; - + ifp->if_capabilities &= ~clearbit; + ifp->if_capabilities |= setbit; return (0); } int if_getcapabilities(const if_t ifp) { - return ((struct ifnet *)ifp)->if_capabilities; + return (ifp->if_capabilities); } int if_setcapenable(if_t ifp, int capabilities) { - ((struct ifnet *)ifp)->if_capenable = capabilities; + ifp->if_capenable = capabilities; return (0); } int if_setcapenablebit(if_t ifp, int setcap, int clearcap) { - if(clearcap) - ((struct ifnet *)ifp)->if_capenable &= ~clearcap; - if(setcap) - ((struct ifnet *)ifp)->if_capenable |= setcap; - + ifp->if_capenable &= ~clearcap; + ifp->if_capenable |= setcap; return (0); } @@ -4281,19 +4273,19 @@ if_setcapenable2bit(if_t ifp, int setcap, int clearcap) const char * if_getdname(const if_t ifp) { - return ((struct ifnet *)ifp)->if_dname; + return (ifp->if_dname); } void if_setdname(if_t ifp, const char *dname) { - ((struct ifnet *)ifp)->if_dname = dname; + ifp->if_dname = dname; } const char * if_name(if_t ifp) { - return ((struct ifnet *)ifp)->if_xname; + return (ifp->if_xname); } int @@ -4301,7 +4293,7 @@ if_setname(if_t ifp, const char *name) { if (strlen(name) > sizeof(ifp->if_xname) - 1) return (ENAMETOOLONG); - strlcpy(ifp->if_xname, name, sizeof(ifp->if_xname)); + strcpy(ifp->if_xname, name); return (0); } @@ -4309,14 +4301,14 @@ if_setname(if_t ifp, const char *name) int if_togglecapenable(if_t ifp, int togglecap) { - ((struct ifnet *)ifp)->if_capenable ^= togglecap; + ifp->if_capenable ^= togglecap; return (0); } int if_getcapenable(const if_t ifp) { - return ((struct ifnet *)ifp)->if_capenable; + return (ifp->if_capenable); } int @@ -4335,13 +4327,13 @@ if_getcapenable2(const if_t ifp) int if_getdunit(const if_t ifp) { - return ((struct ifnet *)ifp)->if_dunit; + return (ifp->if_dunit); } int if_getindex(const if_t ifp) { - return ((struct ifnet *)ifp)->if_index; + return (ifp->if_index); } int @@ -4377,7 +4369,7 @@ if_freedescr(char *descrbuf) int if_getalloctype(const if_t ifp) { - return ((struct ifnet *)ifp)->if_alloctype; + return (ifp->if_alloctype); } /* @@ -4395,8 +4387,8 @@ if_setdev(if_t ifp, void *dev) int if_setdrvflagbits(if_t ifp, int set_flags, int clear_flags) { - ((struct ifnet *)ifp)->if_drv_flags &= ~clear_flags; - ((struct ifnet *)ifp)->if_drv_flags |= set_flags; + ifp->if_drv_flags &= ~clear_flags; + ifp->if_drv_flags |= set_flags; return (0); } @@ -4404,20 +4396,19 @@ if_setdrvflagbits(if_t ifp, int set_flags, int clear_flags) int if_getdrvflags(const if_t ifp) { - return ((struct ifnet *)ifp)->if_drv_flags; + return (ifp->if_drv_flags); } int if_setdrvflags(if_t ifp, int flags) { - ((struct ifnet *)ifp)->if_drv_flags = flags; + ifp->if_drv_flags = flags; return (0); } int if_setflags(if_t ifp, int flags) { - ifp->if_flags = flags; return (0); } @@ -4425,30 +4416,29 @@ if_setflags(if_t ifp, int flags) int if_setflagbits(if_t ifp, int set, int clear) { - ((struct ifnet *)ifp)->if_flags &= ~clear; - ((struct ifnet *)ifp)->if_flags |= set; - + ifp->if_flags &= ~clear; + ifp->if_flags |= set; return (0); } int if_getflags(const if_t ifp) { - return ((struct ifnet *)ifp)->if_flags; + return (ifp->if_flags); } int if_clearhwassist(if_t ifp) { - ((struct ifnet *)ifp)->if_hwassist = 0; + ifp->if_hwassist = 0; return (0); } int if_sethwassistbits(if_t ifp, int toset, int toclear) { - ((struct ifnet *)ifp)->if_hwassist &= ~toclear; - ((struct ifnet *)ifp)->if_hwassist |= toset; + ifp->if_hwassist &= ~toclear; + ifp->if_hwassist |= toset; return (0); } @@ -4456,34 +4446,34 @@ if_sethwassistbits(if_t ifp, int toset, int toclear) int if_sethwassist(if_t ifp, int hwassist_bit) { - ((struct ifnet *)ifp)->if_hwassist = hwassist_bit; + ifp->if_hwassist = hwassist_bit; return (0); } int if_gethwassist(const if_t ifp) { - return ((struct ifnet *)ifp)->if_hwassist; + return (ifp->if_hwassist); } int if_togglehwassist(if_t ifp, int toggle_bits) { - ((struct ifnet *)ifp)->if_hwassist ^= toggle_bits; + ifp->if_hwassist ^= toggle_bits; return (0); } int if_setmtu(if_t ifp, int mtu) { - ((struct ifnet *)ifp)->if_mtu = mtu; + ifp->if_mtu = mtu; return (0); } int if_getmtu(const if_t ifp) { - return ((struct ifnet *)ifp)->if_mtu; + return (ifp->if_mtu); } int @@ -4493,10 +4483,10 @@ if_getmtu_family(const if_t ifp, int family) SLIST_FOREACH(dp, &domains, dom_next) { if (dp->dom_family == family && dp->dom_ifmtu != NULL) - return (dp->dom_ifmtu((struct ifnet *)ifp)); + return (dp->dom_ifmtu(ifp)); } - return (((struct ifnet *)ifp)->if_mtu); + return (ifp->if_mtu); } /* @@ -4625,14 +4615,14 @@ if_foreach_addr_type(if_t ifp, int type, if_addr_cb_t cb, void *cb_arg) int if_setsoftc(if_t ifp, void *softc) { - ((struct ifnet *)ifp)->if_softc = softc; + ifp->if_softc = softc; return (0); } void * if_getsoftc(const if_t ifp) { - return ((struct ifnet *)ifp)->if_softc; + return (ifp->if_softc); } void @@ -4652,41 +4642,39 @@ if_setvtag(struct mbuf *m, uint16_t tag) uint16_t if_getvtag(struct mbuf *m) { - return (m->m_pkthdr.ether_vtag); } int if_sendq_empty(if_t ifp) { - return IFQ_DRV_IS_EMPTY(&((struct ifnet *)ifp)->if_snd); + return (IFQ_DRV_IS_EMPTY(&ifp->if_snd)); } struct ifaddr * if_getifaddr(const if_t ifp) { - return ((struct ifnet *)ifp)->if_addr; + return (ifp->if_addr); } int if_getamcount(const if_t ifp) { - return ((struct ifnet *)ifp)->if_amcount; + return (ifp->if_amcount); } int if_setsendqready(if_t ifp) { - IFQ_SET_READY(&((struct ifnet *)ifp)->if_snd); + IFQ_SET_READY(&ifp->if_snd); return (0); } int if_setsendqlen(if_t ifp, int tx_desc_count) { - IFQ_SET_MAXLEN(&((struct ifnet *)ifp)->if_snd, tx_desc_count); - ((struct ifnet *)ifp)->if_snd.ifq_drv_maxlen = tx_desc_count; - + IFQ_SET_MAXLEN(&ifp->if_snd, tx_desc_count); + ifp->if_snd.ifq_drv_maxlen = tx_desc_count; return (0); } @@ -4705,29 +4693,25 @@ if_getnetmapadapter(if_t ifp) int if_vlantrunkinuse(if_t ifp) { - return ((struct ifnet *)ifp)->if_vlantrunk != NULL?1:0; + return (ifp->if_vlantrunk != NULL); } -int +void if_init(if_t ifp, void *ctx) { - (*((struct ifnet *)ifp)->if_init)(ctx); - return (0); + (*ifp->if_init)(ctx); } -int +void if_input(if_t ifp, struct mbuf* sendmp) { - (*((struct ifnet *)ifp)->if_input)((struct ifnet *)ifp, sendmp); - return (0); - + (*ifp->if_input)(ifp, sendmp); } int if_transmit(if_t ifp, struct mbuf *m) { - (*((struct ifnet *)ifp)->if_transmit)((struct ifnet *)ifp, m); - return (0); + return ((*ifp->if_transmit)(ifp, m)); } int @@ -4743,29 +4727,29 @@ struct mbuf * if_dequeue(if_t ifp) { struct mbuf *m; - IFQ_DRV_DEQUEUE(&((struct ifnet *)ifp)->if_snd, m); + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); return (m); } int if_sendq_prepend(if_t ifp, struct mbuf *m) { - IFQ_DRV_PREPEND(&((struct ifnet *)ifp)->if_snd, m); + IFQ_DRV_PREPEND(&ifp->if_snd, m); return (0); } int if_setifheaderlen(if_t ifp, int len) { - ((struct ifnet *)ifp)->if_hdrlen = len; + ifp->if_hdrlen = len; return (0); } caddr_t if_getlladdr(const if_t ifp) { - return (IF_LLADDR((struct ifnet *)ifp)); + return (IF_LLADDR(ifp)); } void * @@ -4775,83 +4759,72 @@ if_gethandle(u_char type) } void -if_bpfmtap(if_t ifh, struct mbuf *m) +if_bpfmtap(if_t ifp, struct mbuf *m) { - struct ifnet *ifp = (struct ifnet *)ifh; - BPF_MTAP(ifp, m); } void -if_etherbpfmtap(if_t ifh, struct mbuf *m) +if_etherbpfmtap(if_t ifp, struct mbuf *m) { - struct ifnet *ifp = (struct ifnet *)ifh; - ETHER_BPF_MTAP(ifp, m); } void -if_vlancap(if_t ifh) +if_vlancap(if_t ifp) { - struct ifnet *ifp = (struct ifnet *)ifh; VLAN_CAPABILITIES(ifp); } int if_sethwtsomax(if_t ifp, u_int if_hw_tsomax) { - - ((struct ifnet *)ifp)->if_hw_tsomax = if_hw_tsomax; + ifp->if_hw_tsomax = if_hw_tsomax; return (0); } int if_sethwtsomaxsegcount(if_t ifp, u_int if_hw_tsomaxsegcount) { - - ((struct ifnet *)ifp)->if_hw_tsomaxsegcount = if_hw_tsomaxsegcount; + ifp->if_hw_tsomaxsegcount = if_hw_tsomaxsegcount; return (0); } int if_sethwtsomaxsegsize(if_t ifp, u_int if_hw_tsomaxsegsize) { - - ((struct ifnet *)ifp)->if_hw_tsomaxsegsize = if_hw_tsomaxsegsize; + ifp->if_hw_tsomaxsegsize = if_hw_tsomaxsegsize; return (0); } u_int if_gethwtsomax(const if_t ifp) { - - return (((struct ifnet *)ifp)->if_hw_tsomax); + return (ifp->if_hw_tsomax); } u_int if_gethwtsomaxsegcount(const if_t ifp) { - - return (((struct ifnet *)ifp)->if_hw_tsomaxsegcount); + return (ifp->if_hw_tsomaxsegcount); } u_int if_gethwtsomaxsegsize(const if_t ifp) { - - return (((struct ifnet *)ifp)->if_hw_tsomaxsegsize); + return (ifp->if_hw_tsomaxsegsize); } void if_setinitfn(if_t ifp, if_init_fn_t init_fn) { - ((struct ifnet *)ifp)->if_init = init_fn; + ifp->if_init = init_fn; } void if_setinputfn(if_t ifp, if_input_fn_t input_fn) { - ((struct ifnet *)ifp)->if_input = input_fn; + ifp->if_input = input_fn; } if_input_fn_t @@ -4863,19 +4836,19 @@ if_getinputfn(if_t ifp) void if_setioctlfn(if_t ifp, if_ioctl_fn_t ioctl_fn) { - ((struct ifnet *)ifp)->if_ioctl = (void *)ioctl_fn; + ifp->if_ioctl = ioctl_fn; } void if_setoutputfn(if_t ifp, if_output_fn_t output_fn) { - ((struct ifnet *)ifp)->if_output = output_fn; + ifp->if_output = output_fn; } void if_setstartfn(if_t ifp, if_start_fn_t start_fn) { - ((struct ifnet *)ifp)->if_start = (void *)start_fn; + ifp->if_start = start_fn; } if_start_fn_t @@ -4887,7 +4860,7 @@ if_getstartfn(if_t ifp) void if_settransmitfn(if_t ifp, if_transmit_fn_t start_fn) { - ((struct ifnet *)ifp)->if_transmit = start_fn; + ifp->if_transmit = start_fn; } if_transmit_fn_t @@ -4899,21 +4872,19 @@ if_gettransmitfn(if_t ifp) void if_setqflushfn(if_t ifp, if_qflush_fn_t flush_fn) { - ((struct ifnet *)ifp)->if_qflush = flush_fn; - + ifp->if_qflush = flush_fn; } void if_setsndtagallocfn(if_t ifp, if_snd_tag_alloc_t alloc_fn) { - ((struct ifnet *)ifp)->if_snd_tag_alloc = alloc_fn; + ifp->if_snd_tag_alloc = alloc_fn; } int -if_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, +if_snd_tag_alloc(if_t ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **mstp) { - if (ifp->if_snd_tag_alloc == NULL) return (EOPNOTSUPP); return (ifp->if_snd_tag_alloc(ifp, params, mstp)); @@ -4922,7 +4893,6 @@ if_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, void if_setgetcounterfn(if_t ifp, if_get_counter_t fn) { - ifp->if_get_counter = fn; } @@ -5062,7 +5032,6 @@ if_getl2com(if_t ifp) static void if_show_ifnet(struct ifnet *ifp) { - if (ifp == NULL) return; db_printf("%s:\n", ifp->if_xname); @@ -5112,7 +5081,6 @@ if_show_ifnet(struct ifnet *ifp) DB_SHOW_COMMAND(ifnet, db_show_ifnet) { - if (!have_addr) { db_printf("usage: show ifnet \n"); return; diff --git a/sys/net/if_var.h b/sys/net/if_var.h index ef3e3d71a262..7200cd5634d3 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -633,7 +633,7 @@ u_int if_gethwtsomaxsegcount(const if_t ifp); u_int if_gethwtsomaxsegsize(const if_t ifp); void if_setnetmapadapter(if_t ifp, struct netmap_adapter *na); struct netmap_adapter *if_getnetmapadapter(if_t ifp); -int if_input(if_t ifp, struct mbuf* sendmp); +void if_input(if_t ifp, struct mbuf* sendmp); int if_sendq_prepend(if_t ifp, struct mbuf *m); struct mbuf *if_dequeue(if_t ifp); int if_setifheaderlen(if_t ifp, int len); @@ -648,7 +648,7 @@ void if_bpfmtap(if_t ifp, struct mbuf *m); void if_etherbpfmtap(if_t ifp, struct mbuf *m); void if_vlancap(if_t ifp); int if_transmit(if_t ifp, struct mbuf *m); -int if_init(if_t ifp, void *ctx); +void if_init(if_t ifp, void *ctx); int if_resolvemulti(if_t ifp, struct sockaddr **, struct sockaddr *); uint64_t if_getcounter(if_t ifp, ift_counter counter); struct label *if_getmaclabel(if_t ifp); From nobody Tue Feb 14 15:36:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQKg3pVJz3s5Bw; Tue, 14 Feb 2023 15:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGQKg3GlJz4LT7; Tue, 14 Feb 2023 15:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hDKm9ZKT6ONqtv6QY32vSXhAGV2zDFFwXt401rq8mZM=; b=g4d18cwo9Q+g0IP26YbNHZ9uNUwJyyqLCc0QCd43CeDx4ZPDovHdUXwc9ApK6+fzoI0arK HYet6H0duQXuBms8zH0p3wN2ZHj3yTvbxWVBHlitAyFAz9IBnvr+6Anl+RZsOADgxGNo9P xFypeCa3n1W0vEZrNobZb9gfIk90cr7vNJRzAJCxWNGHb0FkIGa6Ajl3Huq9HAYtWhfrVw Zxnnw7bA+0EODbO21trxOKVK7Acw1+VVnvuwonE2YYRKTT1KutDedwA/uSLJb5QDZ86Khc k/q4ClkWsT/kFvBFFs17XdEdpddyKoE5Tx2D+KjI6k/XT2yYhIWaq/b0jDT6ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hDKm9ZKT6ONqtv6QY32vSXhAGV2zDFFwXt401rq8mZM=; b=TAcODsEmiiMH+nOr2gX171gufwCijs5mbos5iEw8S17AWxQdAL+xFpbyQ1k+1m5b75klJC W/ZiYRaCTdj1QqqtI1QcCTZqbKjvBm+g9RxliBlF2uw15ZIj07afXXWwu2nNPkAekqq/wT daOgqcYBTNPNczRUa8cG7jN6VK4lAfIIobv8a9N79jwbursmXxj8xBfOx2E8dU03Amb69Z 0U4hlvZHzF3AZhWnLhdF07qETDyB1Ty5m3tZH9z3YvNbpZ/1mzhBKakmqoAJyk4QeOJXBE KTf5kbaLL5d2ieiP4h98Fw64DVrdglDv9O1nAFet+570M7wWhYvKxGfb9PK5Ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388983; a=rsa-sha256; cv=none; b=vEnAk0a8Dr+MCb/geU7W3uOcOMgctTTAQCOnTC7mWeSxMvW++vXhQAP6yMx1coD/7mdwuW vk4elaklf7y1A4eR9rQPzV2E095FKimq85x5lSrU3P2rGeKvxbQO4nQVwMLC2RLwDclw++ jvkCsdqMas/HQ6D2kwRe8PGCjvJWtTtV7K0ucrF5jMyQMyriD4DZL5N+SuXBUKak2GJHgn Kci19ObbEJvU4H8+tC4IK3zD030jnUXROUFL36YoQdVIuTWITUxilkqh9hLDfLhdM+C3mx 2lh6kYf025tfoIj7uZxmLGklLxG/RS1uaIJAPcIZAPAESWRdP7oxVxfKMIRbqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGQKg2LrDz148k; Tue, 14 Feb 2023 15:36: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 31EFaNWc043820; Tue, 14 Feb 2023 15:36:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFaNe7043819; Tue, 14 Feb 2023 15:36:23 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:36:23 GMT Message-Id: <202302141536.31EFaNe7043819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 68b47dcbe3de - main - Finish mechanical conversion of axgbe(4) to IfAPI. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 68b47dcbe3de6f307d5c3bbe5d637bb07e5c3bad Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=68b47dcbe3de6f307d5c3bbe5d637bb07e5c3bad commit 68b47dcbe3de6f307d5c3bbe5d637bb07e5c3bad Author: Justin Hibbits AuthorDate: 2023-02-07 18:40:06 +0000 Commit: Justin Hibbits CommitDate: 2023-02-14 15:21:20 +0000 Finish mechanical conversion of axgbe(4) to IfAPI. Sponsored by: Juniper Networks, Inc. --- sys/dev/axgbe/xgbe-dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/axgbe/xgbe-dev.c b/sys/dev/axgbe/xgbe-dev.c index 5787db4f0441..2fd0927b89af 100644 --- a/sys/dev/axgbe/xgbe-dev.c +++ b/sys/dev/axgbe/xgbe-dev.c @@ -973,8 +973,8 @@ xgbe_config_rx_mode(struct xgbe_prv_data *pdata) { unsigned int pr_mode, am_mode; - pr_mode = ((pdata->netdev->if_flags & IFF_PPROMISC) != 0); - am_mode = ((pdata->netdev->if_flags & IFF_ALLMULTI) != 0); + pr_mode = ((if_getflags(pdata->netdev) & IFF_PPROMISC) != 0); + am_mode = ((if_getflags(pdata->netdev) & IFF_ALLMULTI) != 0); xgbe_set_promiscuous_mode(pdata, pr_mode); xgbe_set_all_multicast_mode(pdata, am_mode); From nobody Tue Feb 14 15:36:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGQKh4x9Fz3s5QR; Tue, 14 Feb 2023 15:36: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 4PGQKh4KN8z4LZG; Tue, 14 Feb 2023 15:36:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cntpjuop3aCbFlsxQH7ZfpwjC6p+aBuCNYr65GQqVbA=; b=vJDvbnNErEr8m2CsCWXlxgkz3wwqSSq9RLt/KkbROYIK5/PfNu6E38/+YbZ+y9om+9AkJQ oAtEUhLkTBjOTfxYMWLL/aIxLOTppj6G2c5fjij9yOGvqu8FSlqKSiPoO74rci12L6ZVKX tv07BzjHMAW8OkpyjrqAjD0RAfa8KbZWg3Hu0MXUYnVY5dG1+tnGqz4V8fAX8BUxdOavP/ rbv4nspbz3b8R/8nP87NDAGE5lSKd4GOJtuoXttklOoK4rpKhCIyLjheDeMABUu2QiiEIP VqxCj4bXBjAayf45FgfgaoEwheq96w/L428X2TzdguWxyKFhrfU5i7cDIuIUaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676388984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cntpjuop3aCbFlsxQH7ZfpwjC6p+aBuCNYr65GQqVbA=; b=IxqjuQVXAnBlADpWbRlTXI+WkTtrTJEo4XUWRfa8UK9jj5A5GikCY8MED062Ar92/9f489 w4UtN9oe7WiF5pRu2GTeGRKoXdLDjdmin99Ly9Khh40SmZ5eLL1hLBshKfrxEIVH6+1pZW Dif7BGHuLVO/daQtwr9hMvSX7hKINYNAo/QPgVrPMQDL/HU4z+SVXSS6yz+jFjbiw0hyvP 2kymWJ8EZkNn5ADrgKFCCEsod8+7eiUvv4B6Cf7/wV++ZdwP8J6uC933JWHPfmR+eag7HT LAGhrPEAE9SADBY8PJ1EUrytUoi8ez1KadaM/RMQjq8TynwBm+N0g7KN4Qs6vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676388984; a=rsa-sha256; cv=none; b=XIibYlOEkv7WK7p3Et+o/8J0eFMERdc7GqiKIwYx0FTydw9IsN5fCLV2LNhAhjnJjNcwzm ZZojppZ+7mSszVMNwqKgSU6VF+d7YHDxuCVK+a0WhdU9PTtXXe8ygrXQ/73r5CEAofThTF JOpZUaiOfpyzzod60DuH9bJJYY+Uk9iACbuA/99T9ClLDrwg7mro0xe7sqKO9Vpw14kWEX Nd75+JO04+k650X76LVOTPQOul0a74/qkeSP6NvC/Ouc94WH2X4wn15X5kfz9Zc4IY5CoR F0r/vyRSs0whtk7lSfhsLTtbIWklEMI31XavU5Nyt4uFvqceUgnELw7BcdVGzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGQKh3NgYz13py; Tue, 14 Feb 2023 15:36: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 31EFaOVc043845; Tue, 14 Feb 2023 15:36:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EFaOoO043844; Tue, 14 Feb 2023 15:36:24 GMT (envelope-from git) Date: Tue, 14 Feb 2023 15:36:24 GMT Message-Id: <202302141536.31EFaOoO043844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 52d984831d82 - main - Port Linuxulator to IfAPI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52d984831d82d97dc132d0d57fca6ee89572799b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=52d984831d82d97dc132d0d57fca6ee89572799b commit 52d984831d82d97dc132d0d57fca6ee89572799b Author: Justin Hibbits AuthorDate: 2023-02-01 21:30:22 +0000 Commit: Justin Hibbits CommitDate: 2023-02-14 15:28:44 +0000 Port Linuxulator to IfAPI Reviewed by: dchagin Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38349 --- sys/compat/linux/linux.c | 104 +++++++++++++-------- sys/compat/linux/linux.h | 4 +- sys/compat/linux/linux_ioctl.c | 205 +++++++++++++++++++++++++---------------- 3 files changed, 195 insertions(+), 118 deletions(-) diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index 4e435081b3b6..16aa731b20ff 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -241,6 +241,36 @@ bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss) } } +struct ifname_linux_to_bsd_cb_s { + if_t ifp; + const char *lxname; + int unit; + int index; + bool is_lo; + bool is_eth; +}; + +static int +ifname_linux_to_bsd_cb(if_t ifp, void *arg) +{ + struct ifname_linux_to_bsd_cb_s *cbs = arg; + + /* + * Allow Linux programs to use FreeBSD names. Don't presume + * we never have an interface named "eth", so don't make + * the test optional based on is_eth. + */ + cbs->ifp = ifp; + if (strncmp(if_name(ifp), cbs->lxname, LINUX_IFNAMSIZ) == 0) + return (-1); + if (cbs->is_eth && IFP_IS_ETH(ifp) && cbs->unit == cbs->index++) + return (-1); + if (cbs->is_lo && IFP_IS_LOOP(ifp)) + return (-1); + cbs->ifp = NULL; + + return (0); +} /* * Translate a Linux interface name to a FreeBSD interface name, * and return the associated ifnet structure @@ -250,46 +280,33 @@ bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss) struct ifnet * ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) { - struct ifnet *ifp; - int len, unit; + struct ifname_linux_to_bsd_cb_s cbs = {}; + int len; char *ep; - int index; - bool is_eth, is_lo; + cbs.lxname = lxname; for (len = 0; len < LINUX_IFNAMSIZ; ++len) if (!isalpha(lxname[len]) || lxname[len] == '\0') break; if (len == 0 || len == LINUX_IFNAMSIZ) return (NULL); /* Linux loopback interface name is lo (not lo0) */ - is_lo = (len == 2 && strncmp(lxname, "lo", len) == 0); - unit = (int)strtoul(lxname + len, &ep, 10); + cbs.is_lo = (len == 2 && strncmp(lxname, "lo", len) == 0); + cbs.unit = (int)strtoul(lxname + len, &ep, 10); if ((ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) && - is_lo == 0) + cbs.is_lo == 0) return (NULL); - index = 0; - is_eth = (len == 3 && strncmp(lxname, "eth", len) == 0); + cbs.index = 0; + cbs.is_eth = (len == 3 && strncmp(lxname, "eth", len) == 0); CURVNET_SET(TD_TO_VNET(td)); IFNET_RLOCK(); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - /* - * Allow Linux programs to use FreeBSD names. Don't presume - * we never have an interface named "eth", so don't make - * the test optional based on is_eth. - */ - if (strncmp(ifp->if_xname, lxname, LINUX_IFNAMSIZ) == 0) - break; - if (is_eth && IFP_IS_ETH(ifp) && unit == index++) - break; - if (is_lo && IFP_IS_LOOP(ifp)) - break; - } + if_foreach(ifname_linux_to_bsd_cb, &cbs); IFNET_RUNLOCK(); CURVNET_RESTORE(); - if (ifp != NULL && bsdname != NULL) - strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); - return (ifp); + if (cbs.ifp != NULL && bsdname != NULL) + strlcpy(bsdname, if_name(cbs.ifp), IFNAMSIZ); + return (cbs.ifp); } void @@ -297,7 +314,7 @@ linux_ifflags(struct ifnet *ifp, short *flags) { unsigned short fl; - fl = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; + fl = (if_getflags(ifp) | if_getdrvflags(ifp)) & 0xffff; *flags = 0; if (fl & IFF_UP) *flags |= LINUX_IFF_UP; @@ -321,11 +338,28 @@ linux_ifflags(struct ifnet *ifp, short *flags) *flags |= LINUX_IFF_MULTICAST; } +static u_int +linux_ifhwaddr_cb(void *arg, struct ifaddr *ifa, u_int count) +{ + struct sockaddr_dl *sdl = (struct sockaddr_dl *)ifa->ifa_addr; + struct l_sockaddr *lsa = arg; + + if (count > 0) + return (0); + + if (sdl->sdl_type != IFT_ETHER) + return (0); + + bzero(lsa, sizeof(*lsa)); + lsa->sa_family = LINUX_ARPHRD_ETHER; + bcopy(LLADDR(sdl), lsa->sa_data, LINUX_IFHWADDRLEN); + + return (1); +} + int linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa) { - struct ifaddr *ifa; - struct sockaddr_dl *sdl; if (IFP_IS_LOOP(ifp)) { bzero(lsa, sizeof(*lsa)); @@ -336,16 +370,8 @@ linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa) if (!IFP_IS_ETH(ifp)) return (ENOENT); - CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - sdl = (struct sockaddr_dl*)ifa->ifa_addr; - if (sdl != NULL && (sdl->sdl_family == AF_LINK) && - (sdl->sdl_type == IFT_ETHER)) { - bzero(lsa, sizeof(*lsa)); - lsa->sa_family = LINUX_ARPHRD_ETHER; - bcopy(LLADDR(sdl), lsa->sa_data, LINUX_IFHWADDRLEN); - return (0); - } - } + if (if_foreach_addr_type(ifp, AF_LINK, linux_ifhwaddr_cb, lsa) > 0) + return (0); return (ENOENT); } @@ -732,5 +758,5 @@ bool linux_use_real_ifname(const struct ifnet *ifp) { - return (use_real_ifnames || !IFP_IS_ETH(ifp)); + return (use_real_ifnames || !IFP_IS_ETH(__DECONST(if_t, ifp))); } diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index 055d8e3b9cf6..e133c35010cf 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -287,8 +287,8 @@ struct l_statx { /* * Criteria for interface name translation */ -#define IFP_IS_ETH(ifp) ((ifp)->if_type == IFT_ETHER) -#define IFP_IS_LOOP(ifp) ((ifp)->if_type == IFT_LOOP) +#define IFP_IS_ETH(ifp) (if_gettype(ifp) == IFT_ETHER) +#define IFP_IS_LOOP(ifp) (if_gettype(ifp) == IFT_LOOP) struct ifnet; diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 2cb0e9ead23f..c70060b8bf5d 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -2087,46 +2087,138 @@ linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args) /* * Implement the SIOCGIFNAME ioctl */ +struct linux_ioctl_ifname_cb_s { + struct l_ifreq ifr; + int index; + int ethno; +}; + +static int +linux_ioctl_ifname_cb(if_t ifp, void *arg) +{ + struct linux_ioctl_ifname_cb_s *cbs = arg; + + if (cbs->ifr.ifr_ifindex == cbs->index) { + if (!linux_use_real_ifname(ifp)) + snprintf(cbs->ifr.ifr_name, LINUX_IFNAMSIZ, + "eth%d", cbs->ethno); + else + strlcpy(cbs->ifr.ifr_name, if_name(ifp), + LINUX_IFNAMSIZ); + return (-1); + } + if (!linux_use_real_ifname(ifp)) + cbs->ethno++; + cbs->index++; + + return (0); +} static int linux_ioctl_ifname(struct thread *td, struct l_ifreq *uifr) { + struct linux_ioctl_ifname_cb_s cbs; struct l_ifreq ifr; - struct ifnet *ifp; - int error, ethno, index; + int error; - error = copyin(uifr, &ifr, sizeof(ifr)); + error = copyin(uifr, &cbs.ifr, sizeof(cbs.ifr)); if (error != 0) return (error); CURVNET_SET(TD_TO_VNET(curthread)); IFNET_RLOCK(); - index = 1; /* ifr.ifr_ifindex starts from 1 */ - ethno = 0; - error = ENODEV; - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (ifr.ifr_ifindex == index) { - if (!linux_use_real_ifname(ifp)) - snprintf(ifr.ifr_name, LINUX_IFNAMSIZ, - "eth%d", ethno); - else - strlcpy(ifr.ifr_name, ifp->if_xname, - LINUX_IFNAMSIZ); - error = 0; - break; - } - if (!linux_use_real_ifname(ifp)) - ethno++; - index++; - } - IFNET_RUNLOCK(); + cbs.index = 1; /* ifr.ifr_ifindex starts from 1 */ + cbs.ethno = 0; + error = if_foreach(linux_ioctl_ifname_cb, &cbs); + if (error == 0) + error = ENODEV; + IFNET_RUNLOCK(); + if (error == -1) error = copyout(&ifr, uifr, sizeof(ifr)); CURVNET_RESTORE(); return (error); } +static u_int +linux_ifconf_ifaddr_cb(void *arg, struct ifaddr *ifa, u_int count) +{ +#ifdef COMPAT_LINUX32 + struct l_ifconf *ifc; +#else + struct ifconf *ifc; +#endif + ifc = arg; + ifc->ifc_len += sizeof(struct l_ifreq); + + return (1); +} + +static int +linux_ifconf_ifnet_cb(if_t ifp, void *arg) +{ + if_foreach_addr_type(ifp, AF_INET, linux_ifconf_ifaddr_cb, arg); + + return (0); +} + +struct linux_ifconfig_ifaddr_cb2_s { + struct l_ifreq ifr; + struct sbuf *sb; + size_t max_len; + size_t valid_len; + int ethno; +}; + +static u_int +linux_ifconf_ifaddr_cb2(void *arg, struct ifaddr *ifa, u_int len) +{ + struct linux_ifconfig_ifaddr_cb2_s *cbs = arg; + struct sockaddr *sa = ifa->ifa_addr; + + cbs->ifr.ifr_addr.sa_family = LINUX_AF_INET; + memcpy(cbs->ifr.ifr_addr.sa_data, sa->sa_data, + sizeof(cbs->ifr.ifr_addr.sa_data)); + sbuf_bcat(cbs->sb, &cbs->ifr, sizeof(cbs->ifr)); + cbs->max_len += sizeof(cbs->ifr); + + if (sbuf_error(cbs->sb) == 0) + cbs->valid_len = sbuf_len(cbs->sb); + + return (len); +} + +static int +linux_ifconf_ifnet_cb2(if_t ifp, void *arg) +{ + struct linux_ifconfig_ifaddr_cb2_s *cbs = arg; + int addrs = 0; + + bzero(&cbs->ifr, sizeof(cbs->ifr)); + if (IFP_IS_ETH(ifp)) + snprintf(cbs->ifr.ifr_name, LINUX_IFNAMSIZ, "eth%d", + cbs->ethno++); + else + strlcpy(cbs->ifr.ifr_name, if_name(ifp), LINUX_IFNAMSIZ); + + /* Walk the address list */ + addrs = if_foreach_addr_type(ifp, AF_INET, + linux_ifconf_ifaddr_cb2, cbs); + if (sbuf_error(cbs->sb) == 0) + cbs->valid_len = sbuf_len(cbs->sb); + if (addrs == 0) { + bzero((caddr_t)&cbs->ifr.ifr_addr, sizeof(cbs->ifr.ifr_addr)); + sbuf_bcat(cbs->sb, &cbs->ifr, sizeof(cbs->ifr)); + cbs->max_len += sizeof(cbs->ifr); + + if (sbuf_error(cbs->sb) == 0) + cbs->valid_len = sbuf_len(cbs->sb); + } + + return (0); +} + /* * Implement the SIOCGIFCONF ioctl */ @@ -2139,30 +2231,22 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) #else struct ifconf ifc; #endif - struct l_ifreq ifr; - struct ifnet *ifp; - struct ifaddr *ifa; + struct linux_ifconfig_ifaddr_cb2_s cbs; struct sbuf *sb; - int error, ethno, full = 0, valid_len, max_len; + int error, full = 0; error = copyin(uifc, &ifc, sizeof(ifc)); if (error != 0) return (error); - max_len = maxphys - 1; + cbs.max_len = maxphys - 1; CURVNET_SET(TD_TO_VNET(td)); /* handle the 'request buffer size' case */ if ((l_uintptr_t)ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; IFNET_RLOCK(); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - struct sockaddr *sa = ifa->ifa_addr; - if (sa->sa_family == AF_INET) - ifc.ifc_len += sizeof(ifr); - } - } + if_foreach(linux_ifconf_ifnet_cb, &ifc); IFNET_RUNLOCK(); error = copyout(&ifc, uifc, sizeof(ifc)); CURVNET_RESTORE(); @@ -2175,61 +2259,28 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) } again: + cbs.ethno = 0; /* Keep track of eth interfaces */ - ethno = 0; - if (ifc.ifc_len <= max_len) { - max_len = ifc.ifc_len; + if (ifc.ifc_len <= cbs.max_len) { + cbs.max_len = ifc.ifc_len; full = 1; } - sb = sbuf_new(NULL, NULL, max_len + 1, SBUF_FIXEDLEN); - max_len = 0; - valid_len = 0; + sb = sbuf_new(NULL, NULL, cbs.max_len + 1, SBUF_FIXEDLEN); + cbs.max_len = 0; + cbs.valid_len = 0; + cbs.sb = sb; /* Return all AF_INET addresses of all interfaces */ IFNET_RLOCK(); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - int addrs = 0; - - bzero(&ifr, sizeof(ifr)); - if (IFP_IS_ETH(ifp)) - snprintf(ifr.ifr_name, LINUX_IFNAMSIZ, "eth%d", - ethno++); - else - strlcpy(ifr.ifr_name, ifp->if_xname, LINUX_IFNAMSIZ); - - /* Walk the address list */ - CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - struct sockaddr *sa = ifa->ifa_addr; - - if (sa->sa_family == AF_INET) { - ifr.ifr_addr.sa_family = LINUX_AF_INET; - memcpy(ifr.ifr_addr.sa_data, sa->sa_data, - sizeof(ifr.ifr_addr.sa_data)); - sbuf_bcat(sb, &ifr, sizeof(ifr)); - max_len += sizeof(ifr); - addrs++; - } - - if (sbuf_error(sb) == 0) - valid_len = sbuf_len(sb); - } - if (addrs == 0) { - bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr)); - sbuf_bcat(sb, &ifr, sizeof(ifr)); - max_len += sizeof(ifr); - - if (sbuf_error(sb) == 0) - valid_len = sbuf_len(sb); - } - } + if_foreach(linux_ifconf_ifnet_cb2, &cbs); IFNET_RUNLOCK(); - if (valid_len != max_len && !full) { + if (cbs.valid_len != cbs.max_len && !full) { sbuf_delete(sb); goto again; } - ifc.ifc_len = valid_len; + ifc.ifc_len = cbs.valid_len; sbuf_finish(sb); error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); if (error == 0) From nobody Tue Feb 14 16:54:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGS3R2gVyz3pjB4; Tue, 14 Feb 2023 16:54: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 4PGS3R1rfkz3Fpr; Tue, 14 Feb 2023 16:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMQe3rHaknWD8dxjRzexX/beDEK0nZ+atGec2MXZ3yY=; b=TXSXH0EY08uWfr2ZpOF12us+KdXFMLyzc+FTWAjZQQo3zzD9aFabUbJ9ko92xK+dEgNjWp ayVOTbQhJ1zWqAAEZ6X0LZg6kXCj28ouIMPbesV3k6DPQwPoWJ/mZqQnD5/z5lIw4v09Us t2JuknkGTffGSOS1Ln4Jgzc1dWgJTIX9JNMxaP+bVbg4rivAP3HlHTLVMrZbrejNUAIz1y AYJst9cnMBc8+g49wWMLAlq4RdDmuKK7nilgmpSPtYVqtDwnlMDsJDz67dYvNlulukcg+1 DMGFtzgQ2lfgyTfFq5ADG99LcBzblcvd07i/nEs4/zwFAOQytip2l4fTHmd33g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xMQe3rHaknWD8dxjRzexX/beDEK0nZ+atGec2MXZ3yY=; b=eHmN4KcQvi/i86SHc4mxRurPMFDniTb0bPmsTz58L9MQNvkP9nPKjE6gNo1zjcwxhu1509 WXpgWXOi7JA8nh5yytL1T46hLOFfNuOT5Fm0+elQ86YMME4eJCSRkonQTB+7iId7qY+ci0 +VoXj8qESBRrlUSWkdcfpcEOxc1DPr2PWrESTBDUVTdC1qEQmAd8NCcug4jKRFqrfukC+8 6nRqEczsEiqUXE6tR4morgZxhTnp66DbHLRNGMOi/B75w9ErO3J+TSRPOygmdeo6t+yf7Q ZGxNfN3EdIlLhuirtbiPYfuGhcMohr9AmTbGBq+NCap1VjqafeBFrz++nUeSPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676393651; a=rsa-sha256; cv=none; b=t4QbcOXrVTgFj6lnzdBkuLsco74ys6lzkZKoXThuzDygWoGvgGfAJNTBNmGpjUY28krp9y CkNr6gCspdOxaqx7kUMInxw4yzysUAKuSaTPe6KyJnchMIyEnLAGYUQSAa+UVrNwQWdMir 5gJUzg5NWhn5pIjd5fqaEg7qSmDuFmenIwaNFnY030tz14Q4WdVV0Mz6qawd5z9S9A5YWU wt7zmPw/wgzQbgBd2yD+npO4UpuYumAmIHekghX3AoyVUgKhpF9oOF2HKHxSUz+A8Yah0v VNacuV7ohwiDsIhiSVe0K8xxcztzG5TFz/sJ22uQTKkHT0PhoE0fzdiEe4K2OA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGS3R0tyXz167V; Tue, 14 Feb 2023 16:54: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 31EGsBYi057311; Tue, 14 Feb 2023 16:54:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EGsBtE057310; Tue, 14 Feb 2023 16:54:11 GMT (envelope-from git) Date: Tue, 14 Feb 2023 16:54:11 GMT Message-Id: <202302141654.31EGsBtE057310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e35448a901aa - main - powerpc: Drop old workaround for old gcc List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e35448a901aa56aa232efbc4fe7a73a9bdac3511 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e35448a901aa56aa232efbc4fe7a73a9bdac3511 commit e35448a901aa56aa232efbc4fe7a73a9bdac3511 Author: Warner Losh AuthorDate: 2023-02-14 16:47:08 +0000 Commit: Warner Losh CommitDate: 2023-02-14 16:47:08 +0000 powerpc: Drop old workaround for old gcc Very old versions of gcc defined _BIG_ENDIAN and _LITTLE_ENDIAN. So to work around that, we undefined them here. However, that causes problems for programs that do: (and many other variations on that theme). Since this often is the result of weirdly nested includes in the ports world that are hard to unwind, drop this workaround to help more ports build out of the box. If there's still an issue here (and my testing hasn't shown it), we'll fix the issue in a brand-new way once I have a reproducer. This fixes the mesa-devel build, and others Sponsored by: Netflix Tested by: pkubaj MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D38564 --- sys/powerpc/include/endian.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sys/powerpc/include/endian.h b/sys/powerpc/include/endian.h index 9e28237bfd24..0fac50361632 100644 --- a/sys/powerpc/include/endian.h +++ b/sys/powerpc/include/endian.h @@ -36,18 +36,6 @@ #define _MACHINE_ENDIAN_H_ #include - -/* - * GCC defines _BIG_ENDIAN and _LITTLE_ENDIAN equal to __BIG_ENDIAN__ - * and __LITTLE_ENDIAN__ (resp). - */ -#ifdef _BIG_ENDIAN -#undef _BIG_ENDIAN -#endif -#ifdef _LITTLE_ENDIAN -#undef _LITTLE_ENDIAN -#endif - #include #endif /* !_MACHINE_ENDIAN_H_ */ From nobody Tue Feb 14 16:54:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGS3S6FYfz3pjGK; Tue, 14 Feb 2023 16:54: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 4PGS3S2qDgz3FY8; Tue, 14 Feb 2023 16:54:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wBYa8Bq4D3ECxMTmDZ49z0yVH9zVbo2XEBzAdxE5bfo=; b=Gpxs7C6TpDeQqdNtGUPNSiQAtU2iCO9ZM13CqiQo31TKtenQti3MwYusxCHe2M6Bw/ywJM szixc5RIYcxaFcEiqRVliI6VqF1m/HTBfgF9GYVrGA8f5y+Bzjd/N3hem/pPCktdxDUaWK 87FFXgRiWEsvslj7VaIabqv+DpryULJImzchscrsFw99A0mXxJOebbyWxyLPobZiCcWNpO A23vZPvKag4gt4nECz0x5+5dcwAaTKkhQnPBerR/OF951vYMpoZjufza+g688me9EaM8js pzX02pvGZQrKcyHnEE6PAplf5ePMv4ePAzbI223xdB6jTuk2/Afx6jRBPDdaXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wBYa8Bq4D3ECxMTmDZ49z0yVH9zVbo2XEBzAdxE5bfo=; b=hCtkCv/RfwjxKrn2bkQ8sf1I0ToH+VXEEdpevixaYEJvwNR6PO21hS9lv8pkXbJr2hR+da KtpSYImfLXRZL18+hPPcHT0GuHZJeaJhnETB//eAtbmYfnoICK4Z0JnyYCIW6jUMOO5CoU XaegVDEmopoOEK6wAJpaqpb+JNlxKK17932p/CbETeZlzDPJsWsxFK8MsqaD9LycUO0gfh xDuzkN/11P3GYLY6+TjZ3hF+ERxmXwQ3ykJiqevFWnZD/zUCwvTTp14iKlxPyGRTy1yUST fXfbq1CMhvTkkhLoj28wztNMtnVqXEuseCjEaETJOVl5kVETFRuXkcXvVzcjTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676393652; a=rsa-sha256; cv=none; b=HQU4qU3mPNs2IQFVyX9o6jbugiKcjw+b13v38OR/PYT601tYL8LvB7Nc1j+ck75jbWsAyH 5Q6Hb3x8Ws4bAaCN0+WlHp8/ZHOL8oifCPkSur9N6AWDwzAJ7ZWLqj3CurYCJdjsMBdQqJ iFDwhN0fFGkmAgXYKfNsGHOd57dkyQrzH4BuguSMdF1hiihyfDx1jBGITiuIsRoQznAseY MVT+xeOnFDl2mmTGmrRA8I6fM9MTSzNnZRV9VHQoHFOKiTmfWPYWjeo5F7XcNAu59TRgQm uHbobzC+iDjV3upSer8ug7gXd2P5gpGMHTxepNViy7VMjsdectTHkRyQhKeayQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGS3S1qVmz15xy; Tue, 14 Feb 2023 16:54: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 31EGsCoN057335; Tue, 14 Feb 2023 16:54:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EGsCtH057334; Tue, 14 Feb 2023 16:54:12 GMT (envelope-from git) Date: Tue, 14 Feb 2023 16:54:12 GMT Message-Id: <202302141654.31EGsCtH057334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5c33688475a5 - main - arm: Remove armv5 supprt List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c33688475a5bb97d644079d5320068991c26b76 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5c33688475a5bb97d644079d5320068991c26b76 commit 5c33688475a5bb97d644079d5320068991c26b76 Author: Warner Losh AuthorDate: 2023-02-14 16:48:37 +0000 Commit: Warner Losh CommitDate: 2023-02-14 16:48:37 +0000 arm: Remove armv5 supprt This can only be true on armv5, so we can GC it. Sponsored by: Netflix Reviewed by: fuz@fuz.su, brooks, emaste Differential Revision: https://reviews.freebsd.org/D38563 --- share/mk/bsd.sys.mk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 43359fed29c7..169f9fe50779 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -108,10 +108,6 @@ CWARNFLAGS.clang+= -Wno-address-of-packed-member .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 90100 CWARNFLAGS.gcc+= -Wno-address-of-packed-member .endif -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 70000 && \ - ${MACHINE_CPUARCH} == "arm" && !${MACHINE_ARCH:Marmv[67]*} -CWARNFLAGS.clang+= -Wno-atomic-alignment -.endif .endif # WARNS <= 3 .if ${WARNS} <= 2 CWARNFLAGS.clang+= -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter From nobody Tue Feb 14 16:54:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGS3T3xFvz3pjGP; Tue, 14 Feb 2023 16:54: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 4PGS3T3Thjz3Flf; Tue, 14 Feb 2023 16:54:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hUC6B37PdSNPGtdMkQvwOuXXn3yYy5/lF3lae+4cOAA=; b=yP52wesTXRLkT6Ecw3tLd1hRIJTUTrHKrHN0Q3n/iGGivJF+UIAFBBfxW94GCYZuP9zgeW HEd7KtHWnN2i58rezDhnpgaCkqz9IMTShCaue1u4pq+kDNbaqbYSIOVlLXPUJzUXbytxro DuXX8qA1nNVlgVAuvoBV4VqAeIYCJY1Oq7xyD/bVseNOB85WhfmKIbLmMJZJkZsW0CV9gU 9tjjof3uOtnpI7TUdz7vjTc6VNl6wIL+oZbBz/zjFhY+Fh3JMwriyQNccP9qFngOcXGZnC UCNU0IeXs68Rv31L9f/RgGXj4rODxFsa/RavQYLQb6u0EFl8HfIF128JheiF1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hUC6B37PdSNPGtdMkQvwOuXXn3yYy5/lF3lae+4cOAA=; b=jwTR7+hbNBipuSVLMiqembT38eET7DfARAUYbYDbZUQybiNpiiYkAuasgkWrNKgZ8aJlRC j8aGdUJ9/uAAPyR6LJBqCWmT++0onjm7NFxZV/PdWeZgsGhyShFdSsL99IMaLLr0yZKuSx 3QWGonFWZPq9gvXv2xxQNxpZfpRE0Pco/3BEkTjwyci6p8vo/xheSsyWjzji3kY1HYTsVd YEAX7M5J5WIHa5bqKgHzSRN9wgZs8GYWcJrXeK9dVtqNtCv6Fz7EKlNF+Q59StVbMVVYX8 eETvSE6ED1I2fbD34YoiqmrVKn1NjKVP/UyeUX6/u86LQ+u65Xqc6RvBviWkVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676393653; a=rsa-sha256; cv=none; b=QZYdJ3mGAJhgzOf6fnL7AQ+6/PHoSn08YbQbCMBwmFXzYTZSfdNjRNxUTkEbpRQK06ObGC XXvNsVU0/v+5oJMQIMD27e+ip7MV0bVa3/ZZQahClayrbVL3O6jNhVPKl1yIlQ76oZhYNU jev9HbyqXWkr+53OaAm3dCOwYPDvhcoktb43Pu1DVKSHl9/yb01UJqu+LAwaXAx+jOt68f yNK4pmcVMT52stJeAnD83vgH0xpn4Wsqy5LWoW5s94WG5r+rPhIE0UFoihxKCUaK2mWyRy 5bf7Ly+xoxzC01o0dIpSCTkGaSTdP/57q4c3ItxNa/r09cU+jkSm0mB3g5TDdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGS3T2ZFjz16DM; Tue, 14 Feb 2023 16:54:13 +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 31EGsDqD057480; Tue, 14 Feb 2023 16:54:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EGsDhE057479; Tue, 14 Feb 2023 16:54:13 GMT (envelope-from git) Date: Tue, 14 Feb 2023 16:54:13 GMT Message-Id: <202302141654.31EGsDhE057479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ae902a5be9b8 - main - libc: Simplify soft-float on 32-bit arm List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae902a5be9b814332269a70350f4e27cb4eb1d94 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ae902a5be9b814332269a70350f4e27cb4eb1d94 commit ae902a5be9b814332269a70350f4e27cb4eb1d94 Author: Warner Losh AuthorDate: 2023-02-14 16:48:51 +0000 Commit: Warner Losh CommitDate: 2023-02-14 16:53:08 +0000 libc: Simplify soft-float on 32-bit arm Simplify the tests for 32-bit arm soft float support. For the files included only on arm, drop the test entirely. For others, test MACHINE_CPUARCH against arm. No functional change intended. File lists appear the same before / after the change. Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38582 --- lib/libc/Makefile | 3 +-- lib/libc/arm/Makefile.inc | 2 +- lib/libc/arm/aeabi/Makefile.inc | 5 ++--- lib/libc/arm/gen/Makefile.inc | 2 +- lib/libc/sys/Makefile.inc | 2 +- lib/libcompiler_rt/Makefile.inc | 2 +- lib/msun/arm/Makefile.inc | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/libc/Makefile b/lib/libc/Makefile index c9150869f223..2ca5458d1437 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -124,8 +124,7 @@ NOASM= .include "${LIBC_SRCTOP}/rpc/Makefile.inc" .include "${LIBC_SRCTOP}/uuid/Makefile.inc" .include "${LIBC_SRCTOP}/xdr/Makefile.inc" -.if (${LIBC_ARCH} == "arm" && \ - (${MACHINE_ARCH:Marmv[67]*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \ +.if (${LIBC_ARCH} == "arm" && (defined(CPUTYPE) && ${CPUTYPE:M*soft*})) || \ (${LIBC_ARCH} == "riscv" && ${MACHINE_ARCH:Mriscv*sf} != "") .include "${LIBC_SRCTOP}/softfloat/Makefile.inc" .endif diff --git a/lib/libc/arm/Makefile.inc b/lib/libc/arm/Makefile.inc index c4b3458ba2cd..c844c32778b8 100644 --- a/lib/libc/arm/Makefile.inc +++ b/lib/libc/arm/Makefile.inc @@ -11,7 +11,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol.map .include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc" -.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") +.if !defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "" SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map .endif diff --git a/lib/libc/arm/aeabi/Makefile.inc b/lib/libc/arm/aeabi/Makefile.inc index 9ccabc2186f9..dfb640564bdf 100644 --- a/lib/libc/arm/aeabi/Makefile.inc +++ b/lib/libc/arm/aeabi/Makefile.inc @@ -5,14 +5,13 @@ SRCS+= aeabi_atexit.c \ aeabi_unwind_cpp.c \ aeabi_unwind_exidx.c -.if (${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "") || \ - ${MACHINE_ARCH:Marmv[67]*} == "" +.if defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" SRCS+= aeabi_asm_double.S \ aeabi_asm_float.S \ aeabi_double.c \ aeabi_float.c .endif -.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") +.if !defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "" SRCS+= aeabi_vfp_double.S \ aeabi_vfp_float.S .endif diff --git a/lib/libc/arm/gen/Makefile.inc b/lib/libc/arm/gen/Makefile.inc index 77c995f70cbc..4a35a0eb7efd 100644 --- a/lib/libc/arm/gen/Makefile.inc +++ b/lib/libc/arm/gen/Makefile.inc @@ -23,7 +23,7 @@ MAN+= \ arm_drain_writebuf.2 \ arm_sync_icache.2 \ -.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") +.if !defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "" SRCS+= \ fpgetmask_vfp.c \ diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index a86d7d160b6c..45287813fe13 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -128,7 +128,7 @@ SYM_MAPS+= ${LIBC_SRCTOP}/sys/Symbol.map CLEANFILES+= ${SASM} ${SPSEUDO} .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv[67]*} + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n' .else NOTE_GNU_STACK='' diff --git a/lib/libcompiler_rt/Makefile.inc b/lib/libcompiler_rt/Makefile.inc index 45eb72165cd8..a1cc3d4cac07 100644 --- a/lib/libcompiler_rt/Makefile.inc +++ b/lib/libcompiler_rt/Makefile.inc @@ -226,7 +226,7 @@ SRCF+= stdatomic .endif .for file in ${SRCF} -.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ +.if ${MACHINE_CPUARCH} == "arm" && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) SRCS+= ${file}vfp.S . elif exists(${CRTSRC}/${CRTARCH}/${file}.S) diff --git a/lib/msun/arm/Makefile.inc b/lib/msun/arm/Makefile.inc index 6ebf21a9c3c5..05f3548f946a 100644 --- a/lib/msun/arm/Makefile.inc +++ b/lib/msun/arm/Makefile.inc @@ -3,7 +3,7 @@ LDBL_PREC = 53 SYM_MAPS += ${.CURDIR}/arm/Symbol.map -.if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" +.if defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" ARCH_SRCS = fenv-softfp.c fenv-vfp.c .endif From nobody Tue Feb 14 16:54:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGS3V4Wrmz3phrZ; Tue, 14 Feb 2023 16:54: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 4PGS3V40b8z3Fw2; Tue, 14 Feb 2023 16:54:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iPpBvCaogaDe4eQh2RpHsgOe1V1CCFHt+Arg7LziR2I=; b=vfM19nuBMhpDANndmTd26mzqvNMg4Dd/XVjeACUYfa7/YHKGmOWhtVMGhMAqHEjGcorruJ SyNELjGOLYDs+DucWGWp6Cbq35caVGGyfxoIYSELYLdXV/QRWRabVVW6dLrLf7XSWgzgHY t7Nu0x8kJXmbZHN5Pkx/9WU5eiY4mNWSXKbiTikN4gDxNaLsuDCcs8pWCakSta4JTrb5tE 55V619KOwh3wWx+QWsD7DqDeTM50g8I2KqiNIY9G8jNVqoYuVPRHCP1NxpVi+bDcnFv3lQ i/bEhnQRHUtXSjZVJqZrvyCXfMHB5ggt3CmH179jFoEXUi9JeEpK3CGwgabVcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iPpBvCaogaDe4eQh2RpHsgOe1V1CCFHt+Arg7LziR2I=; b=QihloTor3g7YiUWjrYrNHRTPScDL33zW+jem6Fzv4Oxe5S+drBglFpn/G7YYpME+uxGaAg +1XjlcXnveBwsEY4o1oIkVb6l5wTloQya0YMP7sIFyBraqwyKnAnT/nIqqSmXGNxf7Lowb yz8973OtuytFvwEpcZ+dQ8P4oWM4UnSsBc/X68TJnQgOLndNKgvSd5cUFjin+h8dFCMLS0 NQMVf/r2fhe3KPJGyrHpBTn+OAalZ7hVCS7P1WPzp8KKpKpgabWO5c3Y87PAJ5PiwV7ulJ CZ1g5ZH7gWNvjwTAk16evkGAYD/5lyqIXXCauJ2S7obUJDZZ4DkvAU/unyTSAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676393654; a=rsa-sha256; cv=none; b=Wd+y2VQylJA4z4Ntdw8m5s+ExGgAcalXsH3flhVbzEmFr1Nja2+TDbYpgRizStJLsUESD3 TdeHz4bIPcZ2Det4q5sknHCFu9YaBvydk2zZW+jETvY7Gumfp0+1ePMytvs4ZNuXdB8DJh skHAbpfkJjMNP+FfKtyAhuTie+n9Cs7jFAnmFp1HYkkVIUsCiJJoTgYHefyyq2ezszGEKk RlAldCKfuh1YAgpJK3rmSXRuwVqtd+PHCw6y3Etbbqgl5XTIWbGzZxXDs6hgIHsWZrYlXk 2DgImzdQ9irj6qyx8ZzWRQpLt0akhVlNxnatK78Z5sdqHO18MF9hXWLnHNdNIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGS3V33fZz16K5; Tue, 14 Feb 2023 16:54: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 31EGsE4P057527; Tue, 14 Feb 2023 16:54:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EGsEPu057525; Tue, 14 Feb 2023 16:54:14 GMT (envelope-from git) Date: Tue, 14 Feb 2023 16:54:14 GMT Message-Id: <202302141654.31EGsEPu057525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e88e9894395e - main - armv5: Remove dead code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e88e9894395e27e2a5f7fef40f61ad3ed96b8399 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e88e9894395e27e2a5f7fef40f61ad3ed96b8399 commit e88e9894395e27e2a5f7fef40f61ad3ed96b8399 Author: Warner Losh AuthorDate: 2023-02-14 16:49:00 +0000 Commit: Warner Losh CommitDate: 2023-02-14 16:53:15 +0000 armv5: Remove dead code No need to mark anything as broken on armv5 anymore. Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38583 --- sys/conf/kern.opts.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index eae05882cb17..5cda70156394 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -78,12 +78,6 @@ __DEFAULT_NO_OPTIONS = \ BROKEN_OPTIONS+= INIT_ALL_ZERO .endif -.if ${MACHINE_CPUARCH} == "arm" -. if ${MACHINE_ARCH:Marmv[67]*} == "" -BROKEN_OPTIONS+= CDDL ZFS -. endif -.endif - .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} == "powerpc" BROKEN_OPTIONS+= ZFS .endif From nobody Tue Feb 14 16:54:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGS3W5gxNz3phxC; Tue, 14 Feb 2023 16:54: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 4PGS3W4wK1z3G2J; Tue, 14 Feb 2023 16:54:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4iX30IWwmpOL5K8A12b0r/3J0mMUieZtUBra/66xF1E=; b=ignbsNoraeMSEALarwXQuz55pimZhhDLJVs2pXKFoZdiOXn7kQX146d/xLqCWZoFm53RRT /Om2BGI9gva96BVSMH44iBkwq3u/pBdyo8FixtsUjmjpn+z1c56J1MtO+qjd/bfQtTwFTU G9Y4UUKyzLlmnIjc9/bHdkh4LCQQXQW7Hh27C3exekb9xf2T9o2zTyvy7I942XevaZLNuY kKVlQbUpVRHxx5HEM53/t/5EmaXq66/jI3zjb5bStDiAfaBFeGBDIrKxG74s9OrdJNvYJY fv09cR111Eqg9sOUWFboTzQg2/yrN5FZfFa8NbQoBDGrfUeCrU+wWw5GDPzyDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4iX30IWwmpOL5K8A12b0r/3J0mMUieZtUBra/66xF1E=; b=L8t8uKD763PUTKlpc/zHp/I4d6q1RoVG2UZX+juSpui14VPApzBzHfwVFD+kmZznfzYA22 DtiamRAgKjYELbEybWtwk5Rtu/WqZwbtM77LB+LBMI6PJNOvJqsy14/O+A2pEzXFt3fxGh YX+0TN8SwBnmLvc4Nr8Y7hwg1h1TJFltrIwqu65uFW/ABd02N+vtFCgb5AaHasc51AkzRr o0VN3Eu2WubobJY+lWzy2e/RZHN/60tgNelR81qCAnbc6v1xo5z8oyUCgg4lE1sOUEXZPf FbQ6P8Xx03UFGHpkT9yz7H5i/Nkc3PCi0JgmBomRTT7Eo9aVUCD6+h7POrH7Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676393655; a=rsa-sha256; cv=none; b=DoQKPYDI1gTXmpBjNtdCzd7Tveyc4dfx+Pq56QlLd9dOl3KO7U5Ulw5DbR7FJrq6jy/Tk7 mDWP1q0+u5Ds/4LJDUPTY9ZRnN3nvC8qnEkPsnrUNcgqms2chDyQ/qeMFFdsJnP3a/e4VE nY6PLJNe5DRXS0bZxLivUUciVfgLDBivTMKZR719DHjzLwq2DwtQY1BoH12uMQ1+8j72ow P4R7LERDIRAj4LUNkxWTnEK8p0b9b5fNuE3JxyrvLstJUAJ4IS3CRn/jbP1QPcCWvO/Mv1 nSPybRb2XLdzj9fCP3A2kt4u3x3idnh3mYGKMO1qUkGVJlTgVt3UddKFem896A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGS3W4194z15y0; Tue, 14 Feb 2023 16:54: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 31EGsF94057574; Tue, 14 Feb 2023 16:54:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EGsFT0057567; Tue, 14 Feb 2023 16:54:15 GMT (envelope-from git) Date: Tue, 14 Feb 2023 16:54:15 GMT Message-Id: <202302141654.31EGsFT0057567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3ae78d66d9e5 - main - bsd.cpu.mk: Simplify armv[67] support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ae78d66d9e56fdda35bdf07b21c374ea5f2906b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3ae78d66d9e56fdda35bdf07b21c374ea5f2906b commit 3ae78d66d9e56fdda35bdf07b21c374ea5f2906b Author: Warner Losh AuthorDate: 2023-02-14 16:49:26 +0000 Commit: Warner Losh CommitDate: 2023-02-14 16:53:15 +0000 bsd.cpu.mk: Simplify armv[67] support Drop a clause that's no longer relevant to v4/v5. Drop support for softfloat for v[45]. Simplify soft float expression by assuming we're always either armv6 or armv7. Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38584 --- share/mk/bsd.cpu.mk | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index db5fa08df4bc..693a9b5209da 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -103,9 +103,9 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ _CPUCFLAGS = -mfloat-abi=softfp . elif ${CPUTYPE} == "cortexa" _CPUCFLAGS = -march=armv7 -mfpu=vfp -. elif ${CPUTYPE:Marmv[4567]*} != "" +. elif ${CPUTYPE:Marmv[67]*} != "" # Handle all the armvX types that FreeBSD runs: -# armv4, armv4t, armv5, armv5te, armv6, armv6t2, armv7, armv7-a, armv7ve +# armv6, armv6t2, armv7, armv7-a, armv7ve # they require -march=. All the others require -mcpu=. _CPUCFLAGS = -march=${CPUTYPE} . else @@ -292,17 +292,11 @@ MACHINE_CPU += armv6 . if ${MACHINE_ARCH:Marmv7*} != "" MACHINE_CPU += armv7 . endif -# armv6 and armv7 are a hybrid. It can use the softfp ABI, but doesn't emulate -# floating point in the general case, so don't define softfp for it at this -# time. arm is pure softfp, so define it for them. -. if ${MACHINE_ARCH:Marmv[67]*} == "" -MACHINE_CPU += softfp -. endif # Normally armv6 and armv7 are hard float ABI from FreeBSD 11 onwards. However # when CPUTYPE has 'soft' in it, we use the soft-float ABI to allow building of # soft-float ABI libraries. In this case, we have to add the -mfloat-abi=softfp # to force that. -. if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" +. if defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "" # Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI # not a nice optimization. Please note: softfp ABI uses hardware floating # instructions, but passes arguments to function calls in integer regsiters. From nobody Tue Feb 14 16:55:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGS5T3crpz3phxn; Tue, 14 Feb 2023 16:55: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 4PGS5T39qfz3HmH; Tue, 14 Feb 2023 16:55:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xHzYeGwFJy6FLwgRrMPUj1vtIHG2NedirPDdaNVQNfw=; b=jumyI97a4z4taaJWiwnOjhPi3EVOGjWHFbzbkzUZ/DPR84fBcvCBGhwZAbzfobf1cABWbP 169W2zb/SB+yFjLMzX6RIChC7czq/oUSzfm0pjBXuEbRR4prIv5j8M8xKpifbOYWymWHTv 73ZgZanx011EwN9E0aslDpzx9yXoHfseIuiweAr0Eph14roV412Y7xoirW+AA20xyMRpVZ YP3x9JV4lGYOqhMQbDXi7O+xF8VpN+HSPR1mG00g///QRLYguotq0gIHwmCdddAI/etzI4 5Q2cgIC1ZTcOoN+J5dRkFemHJ9nQQIikuRsfcFD4+f3xtOa2AdG3BQEk26093w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676393757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xHzYeGwFJy6FLwgRrMPUj1vtIHG2NedirPDdaNVQNfw=; b=nnJsU7kPkD/dXuL8+IXi32kfyFaZs0UaT3o0DVfwzZa3kNIplaWD116gxUAgb83ki3w9Qt qRhrnKTf1y1e0NlVDSOe7THkp8NQjWAOKhy8WSixn6AD6KpFs4H+q8T679id/wkNEPemcf V6Y3nbJU2LqcogZID3751wy/RCnS1Ex8xS7k+P/BxdEFNe7kguOcSskY8jZMEqpMsHuJXu bbeW9XpMStbRdXvVMC2s2Q8t4mfGiLPVJZo+0tzbVqIHS2gXf96BtUNF+NEUdZ+TTvQz+K oxsAdWSHxT7MBuguzEFAt4XuDroTJYMKGwMj9QNwT+9ffzrL+l5pslfGYwNMfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676393757; a=rsa-sha256; cv=none; b=eYWHEWEhleYd5W/I0UImvdoPB6FD73AXvjiDbbOFrGZegkGWoYpJzm9HuLRADWJwGO9EW+ lUTVVWq6oucjphc9wYQG2M++tMGfQ5w6cWaysSI+Ve6hQOWZTMFAgVBRNU2HMm6VpWlf/C dU2KXfcMiTStUBvJjJ3VOGiUKtluwhoWTJSbyUpStmSofoZn5qfJqCBKLZIsuR54y9PIap nb6gmWaXFmy9s0ldMrBnaE0p8Tm1laroEc1TzYy7JkJMDeFW1sSSeKAfWkRXHjfma9P+ru TMxTC9TXtmnvAFL0fN9K8QG8WRVLh4Dcg1jCXoy2dag5/SdfOAQag7dNbTqaFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGS5T2DMnz15y4; Tue, 14 Feb 2023 16:55: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 31EGtvSh058000; Tue, 14 Feb 2023 16:55:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EGtvM7057999; Tue, 14 Feb 2023 16:55:57 GMT (envelope-from git) Date: Tue, 14 Feb 2023 16:55:57 GMT Message-Id: <202302141655.31EGtvM7057999@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: 50fce3b4b070 - main - atkbd: correct bogus character in #ifdef List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50fce3b4b070a9eb59d7988da8b3356c4cf26b26 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=50fce3b4b070a9eb59d7988da8b3356c4cf26b26 commit 50fce3b4b070a9eb59d7988da8b3356c4cf26b26 Author: Ed Maste AuthorDate: 2023-02-14 16:54:12 +0000 Commit: Ed Maste CommitDate: 2023-02-14 16:55:52 +0000 atkbd: correct bogus character in #ifdef Fixes: f20058955c9d ("sys/kbio.h: make pre-unicode keymap...") Sponsored by: The FreeBSD Foundation --- sys/dev/atkbdc/atkbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c index 0c6dadca43aa..5e3c65686363 100644 --- a/sys/dev/atkbdc/atkbd.c +++ b/sys/dev/atkbdc/atkbd.c @@ -1090,7 +1090,7 @@ atkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) case PIO_KEYMAP: /* set keyboard translation table */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ -äifdef COMPAT_FREEBSD13 +#ifdef COMPAT_FREEBSD13 case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case OPIO_DEADKEYMAP: /* set accent key translation table (compat) */ #endif /* COMPAT_FREEBSD13 */ From nobody Tue Feb 14 17:52:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGTLD13Phz3pmfd; Tue, 14 Feb 2023 17:52: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 4PGTLD0bRxz3QGT; Tue, 14 Feb 2023 17:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676397124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x03YNmMOFSLUieF64JUHl9JFusqjLg+kmUlbRe1JdoE=; b=mCiYp1MmMXfVTZnvtpoeKXEuhk8DTKR7Yt+16gGrMlwCnnqSHGpzOuToTsczU6exsLoxR9 xgalWq6b5bdfDR3RdXlv0giV5wRuCSJcypXOCVwHuasoycBtKbKdFQe+Sm+5lycJLMa71F SrpcZlR/PtO4zrjAZHZ0ub0CqUzAHx84y1LIEgDM9v1V5tRpkoG+VeUpNFNRtz6raCJ/BR vnctn8dvfGE+iTyMENKJSw8jy2KMmsKhTRDX/SI9DlbTkCZCQkwC4Y9c42rLqSCFFD8IFe eGm80RAkBW3aZhdrRg4qddGk2hWSbFfGuBY6BGykFCkZ6ETiaIHIb/2hTJE6Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676397124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x03YNmMOFSLUieF64JUHl9JFusqjLg+kmUlbRe1JdoE=; b=nEck96hE7GMJZ97KUXlDQi+1+UCVtKXX/daANXIjTWrUQYQGpzczfI+/jMrH8nXBLaBTWu LXLbfffNT/FuCd9IW4fpImyclbDWH+zrqFkot7hOzEETk6/f/nL7I3nq05M8DQFRGkwFFN Cy95l5MflqNbI7gjtMyE/PJivvFvzf0ozAR9EuudSl+U8bbJOnOTe0MX6n/cdMQk7xmz7n 3v38ISv0RWb1OGUHZux9i1VgxSkF3v/E35VNWiHdDnXo1yKrSwGIH+/rFgYvb6dHZFbpge bQ0Hf4NMaiySDLgqIyNfwjMMnIUQWN1yryWYRZMRvzfMAmdwMKiIbzayecUItg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676397124; a=rsa-sha256; cv=none; b=T1mxOcHOh5rYzgF1lGpjULXNzuWbDsLqU4wL0Lcz5Swe115hE1bgNdfBDyVgzxSl+U6okO AITcdZu1zm1W+TeGhPFsMh3M19XtMRBg5CClJJAIsvGhqZytx81p1LKOaJpY2F4qMxF3qz dk1gBG40x1KasLsPimZT6wI1fb26D7wKRFnROfqioP1nyUEWuasnrrmi07nhL/+1Uwh/oG nk6RrHnqRuj1OuTLH1ir6Nk0wZlIwM9J/0nZgr/iw4J0vtZoxGU1/ZmgFdaeees634tlHb ibw2LVyUEDNgwF1ygc+85Bdt82sQwbK7HK/P/7VpCiYtx75d9p6gQnb+vGikEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGTLC6m9dz17b5; Tue, 14 Feb 2023 17:52: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 31EHq3Ng044090; Tue, 14 Feb 2023 17:52:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EHq3wK044089; Tue, 14 Feb 2023 17:52:03 GMT (envelope-from git) Date: Tue, 14 Feb 2023 17:52:03 GMT Message-Id: <202302141752.31EHq3wK044089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 6f23df1ae7f6 - main - sys/_endian.h: Move powerpc workaround into _endian.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b commit 6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b Author: Warner Losh AuthorDate: 2023-02-14 17:48:05 +0000 Commit: Warner Losh CommitDate: 2023-02-14 17:51:21 +0000 sys/_endian.h: Move powerpc workaround into _endian.h Powerpc compilers often define _BIG_ENDIAN or _LITTLE_ENDIAN depending on the byte order of the target. This interfers with the endian.h and sys/endian.h APIs which expect those two to be 4321 or 1234. Unconditionally undefine these two before we define them to work around this issue. By including endian.h, the programmer is saying they want this API not the native one. This matches historic practice as well. Fixes: e35448a901aa Sponsored by: Netflix Noticed by: powerpc, powerpc64 CI jobs --- sys/sys/_endian.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/sys/_endian.h b/sys/sys/_endian.h index ff909f532663..7ac39386e2e1 100644 --- a/sys/sys/_endian.h +++ b/sys/sys/_endian.h @@ -41,9 +41,13 @@ /* * Definitions for byte order, according to byte significance from low - * address to high. + * address to high. We undefine any prior definition of them because + * powerpc compilers define _LITTLE_ENDIAN and _BIG_ENDIAN to mean + * something else. */ +#undef _LITTLE_ENDIAN #define _LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ /* LSB first: 1234 */ +#undef _BIG_ENDIAN #define _BIG_ENDIAN __ORDER_BIG_ENDIAN__ /* MSB first: 4321 */ #define _PDP_ENDIAN __ORDER_PDP_ENDIAN__ /* LSB first in word, * MSW first in long: 3412 */ From nobody Tue Feb 14 18:03:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGTby29G3z3pnRt; Tue, 14 Feb 2023 18:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGTby1cXVz3h0Z; Tue, 14 Feb 2023 18:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676397838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kvMjKwrBo5ZRoAfj7gdAot6XdeYaXz9NZsKGuw97jxU=; b=rZrDvXGPZAKL64k3YVzx6bXJtC0IgdPLkzdQcALdpLV9/9oep0i+J6zv3dm95tXiqzBo+v Lh1kfUYYDjLNe9PBksaEfmuiwU4f1tXydRyVJu0iloPOpKZ9cH/FxWO8Z3zrS2Zm26Vdhs QNy+aDVPEkcf2tTirfmjK1XBuxAl3JFNS6GAwz3YbIULD+5RDgqEWoQqJBrI/+SVsqzyr0 MYO9EPZoAoQ51fLdhaulQ0GrbCzkya39sTHyDEn95ZhYyjZL9RllDtdcgwDuS4auSvfDvu TS/uBZKPlA4teEpKnCcg0L2aqQSZ26QSujvRlOTLh6i5ekgl+OjreVVQCvy78Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676397838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kvMjKwrBo5ZRoAfj7gdAot6XdeYaXz9NZsKGuw97jxU=; b=K8x6DVIbbjUaN50QNlLBvjJgvlBdPirPFQtoDS5jHdijoVdPIaYVDVjFgJnr5kwRH2zgbA bDp3L+NhQDF2T6r+GEhuLrZVNJ7nKxqrTP2A9kKfLctsRgpzLlcTwIuBCuuYF7PcHkzFMi HliVjmdN2o2hmaJexC+n/7v/c6KVkoDy10SmmrBFJcFCilg1AWrs9gqb/Wir1K1dx1Am4a MN14pyvNOwyMzMwuZ/cxEvRwtlX5tqoJtF2THJdAaHngpu3yFyRyJaEZyFCcQPTLynhwsg 9pogByvhBboNnVe8SmR/E7EuFjZQdK3hDcGDhdYzOxXAdM6EkrLBya1KQey8sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676397838; a=rsa-sha256; cv=none; b=Q0ZPCgFdjfqswV8eT+KLNk1IGVPQrUb4Pz1FnLUauexeDuRcOl7m5gzTOIrRnxP+4PuJPg 78dYDq0mWcLbKuW6PQvOqgVphyIvKwrqUTNuKdoDGkF8RgUz7VokjiuWfPy+IIE3h6rGuj XFBnp2CC99/HjQe2cVA6aVhb8vywZ82d6VRUjFN/XTnUAINeI6pXWMHyG90jkAoHnj2+gu dlVDP+QYwr/+6Dv2qcn0fFr08os7FTpBh4RBPUSxbY69jVovCOk3VbkTBJlK4oNtmI+wlS Vq24RvMc53lYOOPfm93AFSYgB7VJ4kO+cMr8TtCiy0lUb0D9+ReTzQWAtYkLmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGTby0dY6z17TH; Tue, 14 Feb 2023 18:03: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 31EI3vC2059090; Tue, 14 Feb 2023 18:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EI3vin059089; Tue, 14 Feb 2023 18:03:57 GMT (envelope-from git) Date: Tue, 14 Feb 2023 18:03:57 GMT Message-Id: <202302141803.31EI3vin059089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: a22561501ff8 - main - net: use pfil_mbuf_{in,out} where we always have an mbuf List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a22561501ff807b227305617ea2fb46072ce8b06 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=a22561501ff807b227305617ea2fb46072ce8b06 commit a22561501ff807b227305617ea2fb46072ce8b06 Author: Gleb Smirnoff AuthorDate: 2023-02-14 18:02:49 +0000 Commit: Gleb Smirnoff CommitDate: 2023-02-14 18:02:49 +0000 net: use pfil_mbuf_{in,out} where we always have an mbuf This finalizes what has been started in 0b70e3e78b0. Reviewed by: kp, mjg Differential revision: https://reviews.freebsd.org/D37976 --- sys/dev/virtio/network/if_vtnet.c | 6 +----- sys/net/if_bridge.c | 32 +++++++++++++++++++------------- sys/net/if_enc.c | 8 ++++++-- sys/net/if_ethersubr.c | 5 ++--- sys/netinet/ip_output.c | 3 +-- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 505a62b01b4e..41eaa6a56086 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -2137,12 +2137,8 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) if (PFIL_HOOKED_IN(sc->vtnet_pfil)) { pfil_return_t pfil; - pfil = pfil_run_hooks(sc->vtnet_pfil, &m, ifp, PFIL_IN, - NULL); + pfil = pfil_mbuf_in(sc->vtnet_pfil, &m, ifp, NULL); switch (pfil) { - case PFIL_REALLOCED: - m = pfil_mem2mbuf(m->m_data); - break; case PFIL_DROPPED: case PFIL_CONSUMED: continue; diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 5a4954e84869..9f99434dd4e0 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -3365,7 +3365,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) /* Run the packet through pfil before stripping link headers */ if (PFIL_HOOKED_OUT(V_link_pfil_head) && V_pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { - switch (pfil_run_hooks(V_link_pfil_head, mp, ifp, dir, NULL)) { + switch (pfil_mbuf_out(V_link_pfil_head, mp, ifp, NULL)) { case PFIL_DROPPED: return (EACCES); case PFIL_CONSUMED: @@ -3419,17 +3419,20 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) * in_if -> bridge_if -> out_if */ if (V_pfil_bridge && dir == PFIL_OUT && bifp != NULL && (rv = - pfil_run_hooks(V_inet_pfil_head, mp, bifp, dir, NULL)) != + pfil_mbuf_out(V_inet_pfil_head, mp, bifp, NULL)) != PFIL_PASS) break; - if (V_pfil_member && ifp != NULL && (rv = - pfil_run_hooks(V_inet_pfil_head, mp, ifp, dir, NULL)) != - PFIL_PASS) - break; + if (V_pfil_member && ifp != NULL) { + rv = (dir == PFIL_OUT) ? + pfil_mbuf_out(V_inet_pfil_head, mp, ifp, NULL) : + pfil_mbuf_in(V_inet_pfil_head, mp, ifp, NULL); + if (rv != PFIL_PASS) + break; + } if (V_pfil_bridge && dir == PFIL_IN && bifp != NULL && (rv = - pfil_run_hooks(V_inet_pfil_head, mp, bifp, dir, NULL)) != + pfil_mbuf_in(V_inet_pfil_head, mp, bifp, NULL)) != PFIL_PASS) break; @@ -3467,17 +3470,20 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) #ifdef INET6 case ETHERTYPE_IPV6: if (V_pfil_bridge && dir == PFIL_OUT && bifp != NULL && (rv = - pfil_run_hooks(V_inet6_pfil_head, mp, bifp, dir, NULL)) != + pfil_mbuf_out(V_inet6_pfil_head, mp, bifp, NULL)) != PFIL_PASS) break; - if (V_pfil_member && ifp != NULL && (rv = - pfil_run_hooks(V_inet6_pfil_head, mp, ifp, dir, NULL)) != - PFIL_PASS) - break; + if (V_pfil_member && ifp != NULL) { + rv = (dir == PFIL_OUT) ? + pfil_mbuf_out(V_inet6_pfil_head, mp, ifp, NULL) : + pfil_mbuf_in(V_inet6_pfil_head, mp, ifp, NULL); + if (rv != PFIL_PASS) + break; + } if (V_pfil_bridge && dir == PFIL_IN && bifp != NULL && (rv = - pfil_run_hooks(V_inet6_pfil_head, mp, bifp, dir, NULL)) != + pfil_mbuf_in(V_inet6_pfil_head, mp, bifp, NULL)) != PFIL_PASS) break; break; diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index da6ce7a1a815..b5ea1c68692c 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -247,7 +247,7 @@ enc_hhook(int32_t hhook_type, int32_t hhook_id, void *udata, void *ctx_data, struct enc_softc *sc; struct ifnet *ifp, *rcvif; struct pfil_head *ph; - int pdir; + int pdir, ret; sc = (struct enc_softc *)udata; ifp = sc->sc_ifp; @@ -307,7 +307,11 @@ enc_hhook(int32_t hhook_type, int32_t hhook_id, void *udata, void *ctx_data, /* Make a packet looks like it was received on enc(4) */ rcvif = (*ctx->mp)->m_pkthdr.rcvif; (*ctx->mp)->m_pkthdr.rcvif = ifp; - if (pfil_run_hooks(ph, ctx->mp, ifp, pdir, ctx->inp) != PFIL_PASS) { + if (pdir == PFIL_IN) + ret = pfil_mbuf_in(ph, ctx->mp, ifp, ctx->inp); + else + ret = pfil_mbuf_out(ph, ctx->mp, ifp, ctx->inp); + if (ret != PFIL_PASS) { *ctx->mp = NULL; /* consumed by filter */ return (EACCES); } diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 8bc66497e161..34ff4ac22e7f 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -474,8 +474,7 @@ ether_output_frame(struct ifnet *ifp, struct mbuf *m) return (0); if (PFIL_HOOKED_OUT(V_link_pfil_head)) - switch (pfil_run_hooks(V_link_pfil_head, &m, ifp, PFIL_OUT, - NULL)) { + switch (pfil_mbuf_out(V_link_pfil_head, &m, ifp, NULL)) { case PFIL_DROPPED: return (EACCES); case PFIL_CONSUMED: @@ -853,7 +852,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m) /* Do not grab PROMISC frames in case we are re-entered. */ if (PFIL_HOOKED_IN(V_link_pfil_head) && !(m->m_flags & M_PROMISC)) { - i = pfil_run_hooks(V_link_pfil_head, &m, ifp, PFIL_IN, NULL); + i = pfil_mbuf_in(V_link_pfil_head, &m, ifp, NULL); if (i != 0 || m == NULL) return; } diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 739138a6f791..e62935b247da 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -116,14 +116,13 @@ ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, int flags, struct mbuf *m; struct in_addr odst; struct ip *ip; - int pflags = PFIL_OUT; m = *mp; ip = mtod(m, struct ip *); /* Run through list of hooks for output packets. */ odst.s_addr = ip->ip_dst.s_addr; - switch (pfil_run_hooks(V_inet_pfil_head, mp, ifp, pflags, inp)) { + switch (pfil_mbuf_out(V_inet_pfil_head, mp, ifp, inp)) { case PFIL_DROPPED: *error = EACCES; /* FALLTHROUGH */ From nobody Tue Feb 14 18:03:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGTbz2Z8lz3pnRy; Tue, 14 Feb 2023 18:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGTbz2KbNz3hDY; Tue, 14 Feb 2023 18:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676397839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ngHUDF8GDewsCJCPPLYB/R6caZ0Q9bjhzQIolzHPm48=; b=HMnArO3Hu88JM7TobhQwb3bAzWskGlFy6mqUzfBYO9b2qzu+ajVRBNNBXmuN4J0LAUIe5i Nsl1w9ZKCUd8eDblfXbjmhwLdoTG4jFC8Iva6hJFt9hUaSgUViMxvNOPlldmk+tWWJ2soy IlGahBy0yrZhgH0rVqsQVdPyPXWUxWHvyjMRlsQ8blKfnRsN6m0kXKS4TG845f6Dza+y9V evMgZnErXdNPWkT3sdDwFVvCcYgjbsoq5wAfR4eBguiRGvuzSlHr0lia01XswKkkgcpAUb cyfm8bQ5l9nRz6DIGPr4FhGPUeHldgofp9778nNu5wLOTQkxmHR18IDDiq1ccg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676397839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ngHUDF8GDewsCJCPPLYB/R6caZ0Q9bjhzQIolzHPm48=; b=AQqmj/zWuPRc4L6f57uDyVw2wne4M0oZQYMIegYRTG1DN/I6Kug6o1U54Wfa7+9pYKjyhQ DErSgrbfKM+BZfw4kg9XWeK7KTS1C26LP8KIQ7lBwwz3htBWg7c4gFHDI5QkGC3xTf5qxq 72QiF+IuF8gjKta7VXZL421GsnIu33Gizw9wFh/Vu/WKlRjxU8s+92hkw4kVC+sPbmp5kY 1IKbIjFFD0s0dUJKHDvSxsslCqgkwLLpsYonSuq6KnfFFJsIpJJ5mnLU5V3EgW4Q266KY+ nv73rD1nibsaXfI1MJhyaSAY7sqIAmIqOesHf65McecQrHkesZ/omdMN1H1Wqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676397839; a=rsa-sha256; cv=none; b=LB5LlOSdjeH7IShMqAqTyH0GobjAi8T0WpgqVhEaKnP+X+/p6QuFB3mWaFue3QL798eKvT VYf6g3gdwz6gvNLLro7BwWMeBWviQanhImEGv42D26P1snNbyJG8zz7v2X36VnkoDcDSCR 4kIr/ahnWduwakDhQ6jZikzvpw1RA/q+ua/erLpFgRnNk3UsGVHFyRCNbuY6PhV1hKJIhB qqZk7ee6aD7fKRoqCSetXExv8gMkw0tYjHmhNKgieeaN07QyQMah7dCXNF7tAjtep4Vu8G yKNs3PU715WSON/1fhCR6A0PVrlf2KCYxA5iHqZJEJPoMo3NlALiKIR8U6fqbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGTbz1RGKz17fM; Tue, 14 Feb 2023 18:03: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 31EI3xwQ059116; Tue, 14 Feb 2023 18:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EI3xCd059115; Tue, 14 Feb 2023 18:03:59 GMT (envelope-from git) Date: Tue, 14 Feb 2023 18:03:59 GMT Message-Id: <202302141803.31EI3xCd059115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: caf32b260ad4 - main - pfil: add pfil_mem_{in,out}() and retire pfil_run_hooks() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: caf32b260ad46b17a4c1a8ce6383e37ac489f023 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=caf32b260ad46b17a4c1a8ce6383e37ac489f023 commit caf32b260ad46b17a4c1a8ce6383e37ac489f023 Author: Gleb Smirnoff AuthorDate: 2023-02-14 18:02:49 +0000 Commit: Gleb Smirnoff CommitDate: 2023-02-14 18:02:49 +0000 pfil: add pfil_mem_{in,out}() and retire pfil_run_hooks() The 0b70e3e78b0 changed the original design of a single entry point into pfil(9) chains providing separate functions for the filtering points that always provide mbufs and know the direction of a flow. The motivation was to reduce branching. The logical continuation would be to do the same for the filtering points that always provide a memory pointer and retire the single entry point. o Hooks now provide two functions: one for mbufs and optional for memory pointers. o pfil_hook_args() has a new member and pfil_add_hook() has a requirement to zero out uninitialized data. Bump PFIL_VERSION. o As it was before, a hook function for a memory pointer may realloc into an mbuf. Such mbuf would be returned via a pointer that must be provided in argument. o The only hook that supports memory pointers is ipfw:default-link. It is rewritten to provide two functions. o All remaining uses of pfil_run_hooks() are converted to pfil_mem_in(). o Transparent union of pfil_packet_t and tricks to fix pointer alignment are retired. Internal pfil_realloc() reduces down to m_devget() and thus is retired, too. Reviewed by: mjg, ocochard Differential revision: https://reviews.freebsd.org/D37977 --- sys/dev/cxgbe/t4_sge.c | 4 +- sys/dev/mlx5/mlx5_en/mlx5_en_rx.c | 6 +- sys/net/iflib.c | 5 +- sys/net/pfil.c | 122 +++++++++--------- sys/net/pfil.h | 51 +++----- sys/netinet/siftr.c | 26 ++-- sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 30 ++--- sys/netpfil/ipfw/ip_fw_pfil.c | 171 ++++++++++++++++---------- sys/netpfil/pf/pf_ioctl.c | 44 ++++--- 9 files changed, 233 insertions(+), 226 deletions(-) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 8dbb9e1fe93a..88a7f44cadb7 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -1998,8 +1998,7 @@ eth_rx(struct adapter *sc, struct sge_rxq *rxq, const struct iq_desc *d, sc->params.sge.fl_pktshift; frame = sd->cl + fl->rx_offset + sc->params.sge.fl_pktshift; CURVNET_SET_QUIET(ifp->if_vnet); - rc = pfil_run_hooks(vi->pfil, frame, ifp, - slen | PFIL_MEMPTR | PFIL_IN, NULL); + rc = pfil_mem_in(vi->pfil, frame, slen, ifp, &m0); CURVNET_RESTORE(); if (rc == PFIL_DROPPED || rc == PFIL_CONSUMED) { skip_fl_payload(sc, fl, plen); @@ -2007,7 +2006,6 @@ eth_rx(struct adapter *sc, struct sge_rxq *rxq, const struct iq_desc *d, } if (rc == PFIL_REALLOCED) { skip_fl_payload(sc, fl, plen); - m0 = pfil_mem2mbuf(frame); goto have_mbuf; } } diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c index f6caddfdf933..4b1fb25e0f82 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c @@ -536,9 +536,8 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) } if (pfil != NULL && PFIL_HOOKED_IN(pfil)) { seglen = MIN(byte_cnt, MLX5E_MAX_RX_BYTES); - rv = pfil_run_hooks(rq->channel->priv->pfil, - rq->mbuf[wqe_counter].data, rq->ifp, - seglen | PFIL_MEMPTR | PFIL_IN, NULL); + rv = pfil_mem_in(rq->channel->priv->pfil, + rq->mbuf[wqe_counter].data, seglen, rq->ifp, &mb); switch (rv) { case PFIL_DROPPED: @@ -556,7 +555,6 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) * and receive the new mbuf allocated * by the Filter */ - mb = pfil_mem2mbuf(rq->mbuf[wqe_counter].data); goto rx_common; default: /* diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 0a500f8e2810..39f3ccea4317 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2732,8 +2732,7 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, bool unload, if_rxsd_t sd, payload = *sd->ifsd_cl; payload += ri->iri_pad; len = ri->iri_len - ri->iri_pad; - *pf_rv = pfil_run_hooks(rxq->pfil, payload, ri->iri_ifp, - len | PFIL_MEMPTR | PFIL_IN, NULL); + *pf_rv = pfil_mem_in(rxq->pfil, payload, len, ri->iri_ifp, &m); switch (*pf_rv) { case PFIL_DROPPED: case PFIL_CONSUMED: @@ -2746,8 +2745,8 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, bool unload, if_rxsd_t sd, case PFIL_REALLOCED: /* * The filter copied it. Everything is recycled. + * 'm' points at new mbuf. */ - m = pfil_mem2mbuf(payload); unload = 0; break; case PFIL_PASS: diff --git a/sys/net/pfil.c b/sys/net/pfil.c index b68fbe8db5c5..e6f3ff8c1269 100644 --- a/sys/net/pfil.c +++ b/sys/net/pfil.c @@ -70,7 +70,8 @@ MTX_SYSINIT(pfil_mtxinit, &pfil_lock, "pfil(9) lock", MTX_DEF); #define PFIL_LOCK_ASSERT() mtx_assert(&pfil_lock, MA_OWNED) struct pfil_hook { - pfil_func_t hook_func; + pfil_mbuf_chk_t hook_mbuf_chk; + pfil_mem_chk_t hook_mem_chk; void *hook_ruleset; int hook_flags; int hook_links; @@ -82,7 +83,8 @@ struct pfil_hook { struct pfil_link { CK_STAILQ_ENTRY(pfil_link) link_chain; - pfil_func_t link_func; + pfil_mbuf_chk_t link_mbuf_chk; + pfil_mem_chk_t link_mem_chk; void *link_ruleset; int link_flags; struct pfil_hook *link_hook; @@ -114,92 +116,86 @@ VNET_DEFINE_STATIC(struct pfilhookhead, pfil_hook_list) = static struct pfil_link *pfil_link_remove(pfil_chain_t *, pfil_hook_t ); static void pfil_link_free(epoch_context_t); -int -pfil_realloc(pfil_packet_t *p, int flags, struct ifnet *ifp) -{ - struct mbuf *m; - - MPASS(flags & PFIL_MEMPTR); - - if ((m = m_devget(p->mem, PFIL_LENGTH(flags), 0, ifp, NULL)) == NULL) - return (ENOMEM); - *p = pfil_packet_align(*p); - *p->m = m; - - return (0); -} - +/* + * To couple a filtering point that provides memory pointer with a filter that + * works on mbufs only. + */ static __noinline int -pfil_fake_mbuf(pfil_func_t func, pfil_packet_t *p, struct ifnet *ifp, int flags, - void *ruleset, struct inpcb *inp) +pfil_fake_mbuf(pfil_mbuf_chk_t func, void *mem, u_int len, struct ifnet *ifp, + int flags, void *ruleset, struct mbuf **mp) { - struct mbuf m, *mp; + struct mbuf m; pfil_return_t rv; (void)m_init(&m, M_NOWAIT, MT_DATA, M_NOFREE | M_PKTHDR); - m_extadd(&m, p->mem, PFIL_LENGTH(flags), NULL, NULL, NULL, 0, - EXT_RXRING); - m.m_len = m.m_pkthdr.len = PFIL_LENGTH(flags); - mp = &m; - flags &= ~(PFIL_MEMPTR | PFIL_LENMASK); - - rv = func(&mp, ifp, flags, ruleset, inp); - if (rv == PFIL_PASS && mp != &m) { + m_extadd(&m, mem, len, NULL, NULL, NULL, 0, EXT_RXRING); + m.m_len = m.m_pkthdr.len = len; + *mp = &m; + + rv = func(mp, ifp, flags, ruleset, NULL); + if (rv == PFIL_PASS && *mp != &m) { /* * Firewalls that need pfil_fake_mbuf() most likely don't * know they need return PFIL_REALLOCED. */ rv = PFIL_REALLOCED; - *p = pfil_packet_align(*p); - *p->m = mp; } return (rv); } -/* - * pfil_run_hooks() runs the specified packet filter hook chain. - */ -int -pfil_run_hooks(struct pfil_head *head, pfil_packet_t p, struct ifnet *ifp, - int flags, struct inpcb *inp) +static __always_inline int +pfil_mem_common(pfil_chain_t *pch, void *mem, u_int len, int flags, + struct ifnet *ifp, struct mbuf **m) { - pfil_chain_t *pch; struct pfil_link *link; pfil_return_t rv; bool realloc = false; NET_EPOCH_ASSERT(); - - if (PFIL_DIR(flags) == PFIL_IN) - pch = &head->head_in; - else if (__predict_true(PFIL_DIR(flags) == PFIL_OUT)) - pch = &head->head_out; - else - panic("%s: bogus flags %d", __func__, flags); + KASSERT(flags == PFIL_IN || flags == PFIL_OUT, + ("%s: unsupported flags %d", __func__, flags)); rv = PFIL_PASS; CK_STAILQ_FOREACH(link, pch, link_chain) { - if ((flags & PFIL_MEMPTR) && !(link->link_flags & PFIL_MEMPTR)) - rv = pfil_fake_mbuf(link->link_func, &p, ifp, flags, - link->link_ruleset, inp); + if (__predict_true(link->link_mem_chk != NULL && !realloc)) + rv = link->link_mem_chk(mem, len, flags, ifp, + link->link_ruleset, m); + else if (!realloc) + rv = pfil_fake_mbuf(link->link_mbuf_chk, mem, len, ifp, + flags, link->link_ruleset, m); else - rv = (*link->link_func)(p, ifp, flags, - link->link_ruleset, inp); + rv = link->link_mbuf_chk(m, ifp, flags, + link->link_ruleset, NULL); + if (rv == PFIL_DROPPED || rv == PFIL_CONSUMED) break; - else if (rv == PFIL_REALLOCED) { - flags &= ~(PFIL_MEMPTR | PFIL_LENMASK); + else if (rv == PFIL_REALLOCED) realloc = true; - } } if (realloc && rv == PFIL_PASS) rv = PFIL_REALLOCED; return (rv); } +int +pfil_mem_in(struct pfil_head *head, void *mem, u_int len, struct ifnet *ifp, + struct mbuf **m) +{ + + return (pfil_mem_common(&head->head_in, mem, len, PFIL_IN, ifp, m)); +} + +int +pfil_mem_out(struct pfil_head *head, void *mem, u_int len, struct ifnet *ifp, + struct mbuf **m) +{ + + return (pfil_mem_common(&head->head_out, mem, len, PFIL_OUT, ifp, m)); +} + static __always_inline int -pfil_mbuf_common(pfil_chain_t *pch, pfil_packet_t p, struct ifnet *ifp, +pfil_mbuf_common(pfil_chain_t *pch, struct mbuf **m, struct ifnet *ifp, int flags, struct inpcb *inp) { struct pfil_link *link; @@ -211,7 +207,8 @@ pfil_mbuf_common(pfil_chain_t *pch, pfil_packet_t p, struct ifnet *ifp, rv = PFIL_PASS; CK_STAILQ_FOREACH(link, pch, link_chain) { - rv = (*link->link_func)(p, ifp, flags, link->link_ruleset, inp); + rv = link->link_mbuf_chk(m, ifp, flags, link->link_ruleset, + inp); if (rv == PFIL_DROPPED || rv == PFIL_CONSUMED) break; } @@ -219,19 +216,19 @@ pfil_mbuf_common(pfil_chain_t *pch, pfil_packet_t p, struct ifnet *ifp, } int -pfil_mbuf_in(struct pfil_head *head, pfil_packet_t p, struct ifnet *ifp, +pfil_mbuf_in(struct pfil_head *head, struct mbuf **m, struct ifnet *ifp, struct inpcb *inp) { - return (pfil_mbuf_common(&head->head_in, p, ifp, PFIL_IN, inp)); + return (pfil_mbuf_common(&head->head_in, m, ifp, PFIL_IN, inp)); } int -pfil_mbuf_out(struct pfil_head *head, pfil_packet_t p, struct ifnet *ifp, +pfil_mbuf_out(struct pfil_head *head, struct mbuf **m, struct ifnet *ifp, struct inpcb *inp) { - return (pfil_mbuf_common(&head->head_out, p, ifp, PFIL_OUT, inp)); + return (pfil_mbuf_common(&head->head_out, m, ifp, PFIL_OUT, inp)); } /* @@ -298,7 +295,8 @@ pfil_add_hook(struct pfil_hook_args *pa) MPASS(pa->pa_version == PFIL_VERSION); hook = malloc(sizeof(struct pfil_hook), M_PFIL, M_WAITOK | M_ZERO); - hook->hook_func = pa->pa_func; + hook->hook_mbuf_chk = pa->pa_mbuf_chk; + hook->hook_mem_chk = pa->pa_mem_chk; hook->hook_ruleset = pa->pa_ruleset; hook->hook_flags = pa->pa_flags; hook->hook_type = pa->pa_type; @@ -416,7 +414,8 @@ pfil_link(struct pfil_link_args *pa) if (pa->pa_flags & PFIL_IN) { in->link_hook = hook; - in->link_func = hook->hook_func; + in->link_mbuf_chk = hook->hook_mbuf_chk; + in->link_mem_chk = hook->hook_mem_chk; in->link_flags = hook->hook_flags; in->link_ruleset = hook->hook_ruleset; if (pa->pa_flags & PFIL_APPEND) @@ -428,7 +427,8 @@ pfil_link(struct pfil_link_args *pa) } if (pa->pa_flags & PFIL_OUT) { out->link_hook = hook; - out->link_func = hook->hook_func; + out->link_mbuf_chk = hook->hook_mbuf_chk; + out->link_mem_chk = hook->hook_mem_chk; out->link_flags = hook->hook_flags; out->link_ruleset = hook->hook_ruleset; if (pa->pa_flags & PFIL_APPEND) diff --git a/sys/net/pfil.h b/sys/net/pfil.h index d5e9eadd8b8c..b99ec6896266 100644 --- a/sys/net/pfil.h +++ b/sys/net/pfil.h @@ -82,41 +82,16 @@ struct pfilioc_link { #define PFIL_OUT 0x00020000 /* UNUSED 0x00040000 */ #define PFIL_DIR(f) ((f) & (PFIL_IN|PFIL_OUT)) -#define PFIL_MEMPTR 0x00080000 #define PFIL_HEADPTR 0x00100000 #define PFIL_HOOKPTR 0x00200000 #define PFIL_APPEND 0x00400000 #define PFIL_UNLINK 0x00800000 -#define PFIL_LENMASK 0x0000ffff -#define PFIL_LENGTH(f) ((f) & PFIL_LENMASK) #ifdef _KERNEL struct mbuf; struct ifnet; struct inpcb; -typedef union { - struct mbuf **m; - void *mem; - uintptr_t __ui; -} pfil_packet_t __attribute__((__transparent_union__)); - -static inline pfil_packet_t -pfil_packet_align(pfil_packet_t p) -{ - - return ((pfil_packet_t ) (((uintptr_t)(p).mem + - (_Alignof(void *) - 1)) & - _Alignof(void *))); -} - -static inline struct mbuf * -pfil_mem2mbuf(void *v) -{ - - return (*(struct mbuf **) (((uintptr_t)(v) + - (_Alignof(void *) - 1)) & - _Alignof(void *))); -} - typedef enum { PFIL_PASS = 0, PFIL_DROPPED, @@ -124,8 +99,11 @@ typedef enum { PFIL_REALLOCED, } pfil_return_t; -typedef pfil_return_t (*pfil_func_t)(pfil_packet_t, struct ifnet *, int, +typedef pfil_return_t (*pfil_mbuf_chk_t)(struct mbuf **, struct ifnet *, int, void *, struct inpcb *); +typedef pfil_return_t (*pfil_mem_chk_t)(void *, u_int, int, struct ifnet *, + void *, struct mbuf **); + /* * A pfil head is created by a packet intercept point. * @@ -142,14 +120,15 @@ typedef struct pfil_head * pfil_head_t; /* * Give us a chance to modify pfil_xxx_args structures in future. */ -#define PFIL_VERSION 1 +#define PFIL_VERSION 2 /* Argument structure used by packet filters to register themselves. */ struct pfil_hook_args { int pa_version; int pa_flags; enum pfil_types pa_type; - pfil_func_t pa_func; + pfil_mbuf_chk_t pa_mbuf_chk; + pfil_mem_chk_t pa_mem_chk; void *pa_ruleset; const char *pa_modname; const char *pa_rulname; @@ -192,12 +171,15 @@ pfil_head_t pfil_head_register(struct pfil_head_args *); void pfil_head_unregister(pfil_head_t); /* Public functions to run the packet inspection by inspection points. */ -int pfil_run_hooks(struct pfil_head *, pfil_packet_t, struct ifnet *, int, +int pfil_mem_in(struct pfil_head *, void *, u_int, struct ifnet *, + struct mbuf **); +int pfil_mem_out(struct pfil_head *, void *, u_int, struct ifnet *, + struct mbuf **); +int pfil_mbuf_in(struct pfil_head *, struct mbuf **, struct ifnet *, struct inpcb *inp); -int pfil_mbuf_in(struct pfil_head *, pfil_packet_t, struct ifnet *, - struct inpcb *inp); -int pfil_mbuf_out(struct pfil_head *, pfil_packet_t, struct ifnet *, +int pfil_mbuf_out(struct pfil_head *, struct mbuf **, struct ifnet *, struct inpcb *inp); + /* * Minimally exposed structure to avoid function call in case of absence * of any filters by protocols and macros to do the check. @@ -209,10 +191,5 @@ struct _pfil_head { #define PFIL_HOOKED_IN(p) (((struct _pfil_head *)(p))->head_nhooksin > 0) #define PFIL_HOOKED_OUT(p) (((struct _pfil_head *)(p))->head_nhooksout > 0) -/* - * Alloc mbuf to be used instead of memory pointer. - */ -int pfil_realloc(pfil_packet_t *, int, struct ifnet *); - #endif /* _KERNEL */ #endif /* _NET_PFIL_H_ */ diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index e21d15212979..7861031b724b 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -1139,18 +1139,16 @@ VNET_DEFINE_STATIC(pfil_hook_t, siftr_inet6_hook); static int siftr_pfil(int action) { - struct pfil_hook_args pha; - struct pfil_link_args pla; - - pha.pa_version = PFIL_VERSION; - pha.pa_flags = PFIL_IN | PFIL_OUT; - pha.pa_modname = "siftr"; - pha.pa_ruleset = NULL; - pha.pa_rulname = "default"; - - pla.pa_version = PFIL_VERSION; - pla.pa_flags = PFIL_IN | PFIL_OUT | - PFIL_HEADPTR | PFIL_HOOKPTR; + struct pfil_hook_args pha = { + .pa_version = PFIL_VERSION, + .pa_flags = PFIL_IN | PFIL_OUT, + .pa_modname = "siftr", + .pa_rulname = "default", + }; + struct pfil_link_args pla = { + .pa_version = PFIL_VERSION, + .pa_flags = PFIL_IN | PFIL_OUT | PFIL_HEADPTR | PFIL_HOOKPTR, + }; VNET_ITERATOR_DECL(vnet_iter); @@ -1159,14 +1157,14 @@ siftr_pfil(int action) CURVNET_SET(vnet_iter); if (action == HOOK) { - pha.pa_func = siftr_chkpkt; + pha.pa_mbuf_chk = siftr_chkpkt; pha.pa_type = PFIL_TYPE_IP4; V_siftr_inet_hook = pfil_add_hook(&pha); pla.pa_hook = V_siftr_inet_hook; pla.pa_head = V_inet_pfil_head; (void)pfil_link(&pla); #ifdef SIFTR_IPV6 - pha.pa_func = siftr_chkpkt6; + pha.pa_mbuf_chk = siftr_chkpkt6; pha.pa_type = PFIL_TYPE_IP6; V_siftr_inet6_hook = pfil_add_hook(&pha); pla.pa_hook = V_siftr_inet6_hook; diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c index 95c8b73e6388..1822d19fbb4c 100644 --- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c @@ -1311,31 +1311,31 @@ int ipf_pfil_unhook(void) { } int ipf_pfil_hook(void) { - struct pfil_hook_args pha; - struct pfil_link_args pla; int error, error6; - pha.pa_version = PFIL_VERSION; - pha.pa_flags = PFIL_IN | PFIL_OUT; - pha.pa_modname = "ipfilter"; - pha.pa_rulname = "default-ip4"; - pha.pa_func = ipf_check_wrapper; - pha.pa_ruleset = NULL; - pha.pa_type = PFIL_TYPE_IP4; + struct pfil_hook_args pha = { + .pa_version = PFIL_VERSION, + .pa_flags = PFIL_IN | PFIL_OUT, + .pa_modname = "ipfilter", + .pa_rulname = "default-ip4", + .pa_mbuf_chk = ipf_check_wrapper, + .pa_type = PFIL_TYPE_IP4, + }; V_ipf_inet_hook = pfil_add_hook(&pha); #ifdef USE_INET6 pha.pa_rulname = "default-ip6"; - pha.pa_func = ipf_check_wrapper6; + pha.pa_mbuf_chk = ipf_check_wrapper6; pha.pa_type = PFIL_TYPE_IP6; V_ipf_inet6_hook = pfil_add_hook(&pha); #endif - pla.pa_version = PFIL_VERSION; - pla.pa_flags = PFIL_IN | PFIL_OUT | - PFIL_HEADPTR | PFIL_HOOKPTR; - pla.pa_head = V_inet_pfil_head; - pla.pa_hook = V_ipf_inet_hook; + struct pfil_link_args pla = { + .pa_version = PFIL_VERSION, + .pa_flags = PFIL_IN | PFIL_OUT | PFIL_HEADPTR | PFIL_HOOKPTR, + .pa_head = V_inet_pfil_head, + .pa_hook = V_ipf_inet_hook, + }; error = pfil_link(&pla); error6 = 0; diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c index 29ae06ba7713..ec46c077d8bb 100644 --- a/sys/netpfil/ipfw/ip_fw_pfil.c +++ b/sys/netpfil/ipfw/ip_fw_pfil.c @@ -327,52 +327,104 @@ again: } /* - * ipfw processing for ethernet packets (in and out). + * ipfw processing for ethernet packets (in and out), mbuf version. */ static pfil_return_t -ipfw_check_frame(pfil_packet_t p, struct ifnet *ifp, int flags, +ipfw_check_frame_mbuf(struct mbuf **m0, struct ifnet *ifp, const int flags, void *ruleset __unused, struct inpcb *inp) { - struct ip_fw_args args; + struct ip_fw_args args = { + .flags = IPFW_ARGS_ETHER | + ((flags & PFIL_IN) ? IPFW_ARGS_IN : IPFW_ARGS_OUT), + .ifp = ifp, + .inp = inp, + }; + struct m_tag *mtag; pfil_return_t ret; - bool mem, realloc; int ipfw; - if (flags & PFIL_MEMPTR) { - mem = true; - realloc = false; - args.flags = PFIL_LENGTH(flags) | IPFW_ARGS_ETHER; - args.mem = p.mem; - } else { - mem = realloc = false; - args.flags = IPFW_ARGS_ETHER; +again: + /* + * Fetch start point from rule, if any. + * Remove the tag if present. + */ + mtag = m_tag_locate(*m0, MTAG_IPFW_RULE, 0, NULL); + if (mtag != NULL) { + args.rule = *((struct ipfw_rule_ref *)(mtag+1)); + m_tag_delete(*m0, mtag); + if (args.rule.info & IPFW_ONEPASS) + return (PFIL_PASS); + args.flags |= IPFW_ARGS_REF; } - args.flags |= (flags & PFIL_IN) ? IPFW_ARGS_IN : IPFW_ARGS_OUT; - args.ifp = ifp; - args.inp = inp; + args.m = *m0, -again: - if (!mem) { - /* - * Fetch start point from rule, if any. - * Remove the tag if present. - */ - struct m_tag *mtag; - - mtag = m_tag_locate(*p.m, MTAG_IPFW_RULE, 0, NULL); - if (mtag != NULL) { - args.rule = *((struct ipfw_rule_ref *)(mtag+1)); - m_tag_delete(*p.m, mtag); - if (args.rule.info & IPFW_ONEPASS) - return (PFIL_PASS); - args.flags |= IPFW_ARGS_REF; + ipfw = ipfw_chk(&args); + *m0 = args.m; + + ret = PFIL_PASS; + switch (ipfw) { + case IP_FW_PASS: + break; + + case IP_FW_DENY: + ret = PFIL_DROPPED; + break; + + case IP_FW_DUMMYNET: + if (ip_dn_io_ptr == NULL) { + ret = PFIL_DROPPED; + break; } - args.m = *p.m; + MPASS(args.flags & IPFW_ARGS_REF); + ip_dn_io_ptr(m0, &args); + return (PFIL_CONSUMED); + + case IP_FW_NGTEE: + case IP_FW_NETGRAPH: + if (ng_ipfw_input_p == NULL) { + ret = PFIL_DROPPED; + break; + } + MPASS(args.flags & IPFW_ARGS_REF); + (void )ng_ipfw_input_p(m0, &args, ipfw == IP_FW_NGTEE); + if (ipfw == IP_FW_NGTEE) /* ignore errors for NGTEE */ + goto again; /* continue with packet */ + ret = PFIL_CONSUMED; + break; + + default: + KASSERT(0, ("%s: unknown retval", __func__)); } + if (ret != PFIL_PASS) { + if (*m0) + FREE_PKT(*m0); + *m0 = NULL; + } + + return (ret); +} + +/* + * ipfw processing for ethernet packets (in and out), memory pointer version, + * two in/out accessors. + */ +static pfil_return_t +ipfw_check_frame_mem(void *mem, u_int len, int flags, struct ifnet *ifp, + void *ruleset __unused, struct mbuf **m) +{ + struct ip_fw_args args = { + .flags = len | IPFW_ARGS_ETHER | + ((flags & PFIL_IN) ? IPFW_ARGS_IN : IPFW_ARGS_OUT), + .ifp = ifp, + .mem = mem, + }; + pfil_return_t ret; + int ipfw; + + *m = NULL; +again: ipfw = ipfw_chk(&args); - if (!mem) - *p.m = args.m; ret = PFIL_PASS; switch (ipfw) { @@ -388,16 +440,13 @@ again: ret = PFIL_DROPPED; break; } - if (mem) { - if (pfil_realloc(&p, flags, ifp) != 0) { - ret = PFIL_DROPPED; - break; - } - mem = false; - realloc = true; + *m = m_devget(mem, len, 0, ifp, NULL); + if (*m == NULL) { + ret = PFIL_DROPPED; + break; } MPASS(args.flags & IPFW_ARGS_REF); - ip_dn_io_ptr(p.m, &args); + ip_dn_io_ptr(m, &args); return (PFIL_CONSUMED); case IP_FW_NGTEE: @@ -406,16 +455,13 @@ again: ret = PFIL_DROPPED; break; } - if (mem) { - if (pfil_realloc(&p, flags, ifp) != 0) { - ret = PFIL_DROPPED; - break; - } - mem = false; - realloc = true; + *m = m_devget(mem, len, 0, ifp, NULL); + if (*m == NULL) { + ret = PFIL_DROPPED; + break; } MPASS(args.flags & IPFW_ARGS_REF); - (void )ng_ipfw_input_p(p.m, &args, ipfw == IP_FW_NGTEE); + (void )ng_ipfw_input_p(m, &args, ipfw == IP_FW_NGTEE); if (ipfw == IP_FW_NGTEE) /* ignore errors for NGTEE */ goto again; /* continue with packet */ ret = PFIL_CONSUMED; @@ -425,13 +471,7 @@ again: KASSERT(0, ("%s: unknown retval", __func__)); } - if (!mem && ret != PFIL_PASS) { - if (*p.m) - FREE_PKT(*p.m); - *p.m = NULL; - } - - if (realloc && ret == PFIL_PASS) + if (*m != NULL && ret == PFIL_PASS) ret = PFIL_REALLOCED; return (ret); @@ -543,34 +583,33 @@ VNET_DEFINE_STATIC(pfil_hook_t, ipfw_link_hook); static void ipfw_hook(int pf) { - struct pfil_hook_args pha; + struct pfil_hook_args pha = { + .pa_version = PFIL_VERSION, + .pa_flags = PFIL_IN | PFIL_OUT, + .pa_modname = "ipfw", + }; pfil_hook_t *h; - pha.pa_version = PFIL_VERSION; - pha.pa_flags = PFIL_IN | PFIL_OUT; - pha.pa_modname = "ipfw"; - pha.pa_ruleset = NULL; - switch (pf) { case AF_INET: - pha.pa_func = ipfw_check_packet; + pha.pa_mbuf_chk = ipfw_check_packet; pha.pa_type = PFIL_TYPE_IP4; pha.pa_rulname = "default"; h = &V_ipfw_inet_hook; break; #ifdef INET6 case AF_INET6: - pha.pa_func = ipfw_check_packet; + pha.pa_mbuf_chk = ipfw_check_packet; pha.pa_type = PFIL_TYPE_IP6; pha.pa_rulname = "default6"; h = &V_ipfw_inet6_hook; break; #endif case AF_LINK: - pha.pa_func = ipfw_check_frame; + pha.pa_mbuf_chk = ipfw_check_frame_mbuf; + pha.pa_mem_chk = ipfw_check_frame_mem; pha.pa_type = PFIL_TYPE_ETHERNET; pha.pa_rulname = "default-link"; - pha.pa_flags |= PFIL_MEMPTR; h = &V_ipfw_link_hook; break; } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 76742aebf01a..cc1f5a5c2138 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -6532,21 +6532,20 @@ VNET_DEFINE_STATIC(pfil_hook_t, pf_ip6_out_hook); static void hook_pf_eth(void) { - struct pfil_hook_args pha; - struct pfil_link_args pla; + struct pfil_hook_args pha = { + .pa_version = PFIL_VERSION, + .pa_modname = "pf", + .pa_type = PFIL_TYPE_ETHERNET, + }; + struct pfil_link_args pla = { + .pa_version = PFIL_VERSION, + }; int ret __diagused; if (atomic_load_bool(&V_pf_pfil_eth_hooked)) return; - pha.pa_version = PFIL_VERSION; - pha.pa_modname = "pf"; - pha.pa_ruleset = NULL; - - pla.pa_version = PFIL_VERSION; - - pha.pa_type = PFIL_TYPE_ETHERNET; - pha.pa_func = pf_eth_check_in; + pha.pa_mbuf_chk = pf_eth_check_in; pha.pa_flags = PFIL_IN; pha.pa_rulname = "eth-in"; V_pf_eth_in_hook = pfil_add_hook(&pha); @@ -6555,7 +6554,7 @@ hook_pf_eth(void) pla.pa_hook = V_pf_eth_in_hook; ret = pfil_link(&pla); MPASS(ret == 0); - pha.pa_func = pf_eth_check_out; + pha.pa_mbuf_chk = pf_eth_check_out; pha.pa_flags = PFIL_OUT; pha.pa_rulname = "eth-out"; V_pf_eth_out_hook = pfil_add_hook(&pha); @@ -6571,22 +6570,21 @@ hook_pf_eth(void) static void hook_pf(void) { - struct pfil_hook_args pha; - struct pfil_link_args pla; + struct pfil_hook_args pha = { + .pa_version = PFIL_VERSION, + .pa_modname = "pf", + }; + struct pfil_link_args pla = { + .pa_version = PFIL_VERSION, + }; int ret __diagused; if (atomic_load_bool(&V_pf_pfil_hooked)) return; - pha.pa_version = PFIL_VERSION; - pha.pa_modname = "pf"; - pha.pa_ruleset = NULL; - - pla.pa_version = PFIL_VERSION; - #ifdef INET pha.pa_type = PFIL_TYPE_IP4; - pha.pa_func = pf_check_in; + pha.pa_mbuf_chk = pf_check_in; pha.pa_flags = PFIL_IN; pha.pa_rulname = "default-in"; V_pf_ip4_in_hook = pfil_add_hook(&pha); @@ -6595,7 +6593,7 @@ hook_pf(void) pla.pa_hook = V_pf_ip4_in_hook; ret = pfil_link(&pla); MPASS(ret == 0); - pha.pa_func = pf_check_out; + pha.pa_mbuf_chk = pf_check_out; pha.pa_flags = PFIL_OUT; pha.pa_rulname = "default-out"; V_pf_ip4_out_hook = pfil_add_hook(&pha); @@ -6607,7 +6605,7 @@ hook_pf(void) #endif #ifdef INET6 pha.pa_type = PFIL_TYPE_IP6; - pha.pa_func = pf_check6_in; + pha.pa_mbuf_chk = pf_check6_in; pha.pa_flags = PFIL_IN; pha.pa_rulname = "default-in6"; V_pf_ip6_in_hook = pfil_add_hook(&pha); @@ -6616,7 +6614,7 @@ hook_pf(void) pla.pa_hook = V_pf_ip6_in_hook; ret = pfil_link(&pla); MPASS(ret == 0); - pha.pa_func = pf_check6_out; + pha.pa_mbuf_chk = pf_check6_out; pha.pa_rulname = "default-out6"; pha.pa_flags = PFIL_OUT; V_pf_ip6_out_hook = pfil_add_hook(&pha); From nobody Tue Feb 14 18:23:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGV2x4Qm9z3pp4t; Tue, 14 Feb 2023 18:23: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 4PGV2x3xFyz3k8t; Tue, 14 Feb 2023 18:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676399033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=riN7ley6MZo9lLpD4PqG+wokqJvzhdjxe+hBmdQNlMs=; b=ZIBOoILCmNzwV5wFs5NEqMl3jTcBy08fcdDq6VvcaV7FcDVN0gdMxFWenMZ9NA7tOcmW58 0h7keuKoPqx3SVqspgFZvvg5SuQGiXp/FhSXV4n+Mh6xTaJGeiL+UkNkGdg77jdLWQTstO hwJkwYMFtgMqTirkOhS/55z+jXS7YJou1NbkN5X5YiQowoy7MxAFu6W3vmCx+UYUNOp2GD t3b5GIbDkAz7xy9klgyW6fWx4QLU69hTXrOPAh/BR0I/gUnfQ+kK6LhzJcb54GK5FUG7iA IUlDRb+W7ugzyqIQBsNvdjABTvI0fwWQpEpjL2Ct+5AK3pxn7lwVj3lvPZ1XLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676399033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=riN7ley6MZo9lLpD4PqG+wokqJvzhdjxe+hBmdQNlMs=; b=XpJwq7yBcdHaLObVUXoGIS/qRFIQjRFLcBu2j/uUqEpfzMsv86PzvtzQ6v3WhrdYYI6S1y s4Yc5UlRKh5jI7voRyVCJj4TR7xMAepqNxmOdSvWB8oCbl34n7h6Q/r9P5oCCV4qH7FAkc BmNyA8M2y9IFQORs4M895Vg5/mf6/hB4rNlZI50XnB0Wbla+umXHMAf3IlKsd1yCFGMcWB pyExPXr4f5jwrhdYq9XqbyW9WkyWRD60PXCLFYilLR+9b3L0stRNIPBQ+SCTT1gwI4e/A2 d/KqENiDgf9HbGJW/1XWuHH2IffG9/XmpR18nuWDOErEJ8BVWr9tc2lvZHUUDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676399033; a=rsa-sha256; cv=none; b=oV5UwWi5fwmMQhyRBgjretXofy6Log0hL5HOiF3PHc5m+VNsia1HkRgsBHhx8r2MrML69T sXLOc5pJ7Lh0ZHKmtoImt77E030Da+wZK6QxGz493axZzpND73Zs34iOtH/qzaHgLoL1tu RqD+cbMX+oGMOLRZwVaxDp2rERuzJ1l4I8I2HntypRMgsrM9I0hMnEnxxIU07fVBgOUd+h +Hjg8oONrvmjhHcnC7fPrhyMTW06Zhkdg3c9v8Eh2z+yVxt6jIX5MnEz7US/UT/jpHFiMk Pq4EuyeS3lJ9+N5M7vUz9Q25FIwf8L9/54slObKQP4XpAFvYb55bCKHwOA6Gbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGV2x310Rz17y6; Tue, 14 Feb 2023 18:23: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 31EINraW087430; Tue, 14 Feb 2023 18:23:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EINree087429; Tue, 14 Feb 2023 18:23:53 GMT (envelope-from git) Date: Tue, 14 Feb 2023 18:23:53 GMT Message-Id: <202302141823.31EINree087429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 82e846df5bc2 - main - intrng: sort includes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82e846df5bc20418b792f948fa5b558e523f0746 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=82e846df5bc20418b792f948fa5b558e523f0746 commit 82e846df5bc20418b792f948fa5b558e523f0746 Author: Mitchell Horne AuthorDate: 2023-02-04 17:04:30 +0000 Commit: Mitchell Horne CommitDate: 2023-02-14 18:06:00 +0000 intrng: sort includes MFC after: 3 days --- sys/kern/subr_intr.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 17f4a24ab860..96a319b3c8b4 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -42,31 +42,31 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include #include #include -#include -#include #include +#include #include #include -#include -#include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include #include #ifdef HWPMC_HOOKS #include #endif #include -#include #include +#include #include #include From nobody Tue Feb 14 18:23:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGV2y5PS5z3ppCM; Tue, 14 Feb 2023 18:23: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 4PGV2y4qkvz3kJG; Tue, 14 Feb 2023 18:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676399034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SwpJVWVPLvH8jMW6liC1szJUQCycjz6FDL4TtLYX5yU=; b=cyIxlMT9mJ9EBYIzBLwZUMGxlMtbzVsaj0MUyWcf0cFJBxAYhiZxZPgTKWSiskrk0rVEQm 2BmVu+LwQYJggTtTGgJ9DAANgMhqd1JMfznjBOkGGgXqzE025cVi5HJwSksA+qqi6ymF6e yvabbP5mG7UI0otzvaEr2dEtclAz5f00gwuEf+yqQr5+AqRGyVpeNkOlXc9ResZsxGOXfa GpaNc2b0Pt6xyvFKePvOJ/pAvYPf9s8NJe5OUWskckvshd1yGIyP+E9MlGv/5uU6ilB/Zg 3z/ltmPdVzKTnoteKAw62tHCax4bXmWZOEfBZpF6wr7EoGNkqRwvxE4ZpyZULw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676399034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SwpJVWVPLvH8jMW6liC1szJUQCycjz6FDL4TtLYX5yU=; b=PFfRlePlH2WjuP5kMcKmLSv2q5WdpwQE5sxiSdX3VmYgO6Nxkf0ePPMFNAZ2Wg3KiRhBkk R/P32aJnCLZtyIQfS9oFkhK78DGNj3VmRI21lkvnrzP/krofmDQUvk/q4YZuA6YvVK+1oY ttkzWTd/tbmmvuW9GLsOhEDltO2IaT3BjIQ21pn05dvQxbR59Tw7V0fMiVkN6oJYUQ9SSX 9HBpwLpUbzy7mY5IoPkNVYykGfy10e94wfDb1tiToImQ2EckoFsLpZzSVvj3dZsxBJv0IT IYXWnD6L4jqVUlCWFhskbphAGOcKoyVe3gJj2UePiI9A99K8jBp7E9AwJG8Qrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676399034; a=rsa-sha256; cv=none; b=upDPgOCix0OOADQXNnRye5a6DBy0Ar6nQcMH3XNpjWEp4OF6cYTR5m+ZS4EtVvuWyj3ZAN C1rriv9XVfX/zOelisvtxxWpE5AvN8WCtRI8b+UvIJERleENXO64PT5vVHvANa4wVoRXmz WSoC5X6b2MOaXtxTd1Rnfb3lHp41FYWnVSCD6hwzsK8E58SLQnveC03ZEbwKEpBot1no/7 Sbnnnp/4KQOfnf9hHl9c3mFevPI77XNETforhuBJp8TPiZ9A7smHsNloWBuStMBFOnIZSp FvfLBTzwiOvnAdgzF+timAAAZnHtGjedmaW7dj42lKWNHXvUHmw+eXchNzvXxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGV2y3x4rz17wW; Tue, 14 Feb 2023 18:23: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 31EINsTf087460; Tue, 14 Feb 2023 18:23:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EINsQi087459; Tue, 14 Feb 2023 18:23:54 GMT (envelope-from git) Date: Tue, 14 Feb 2023 18:23:54 GMT Message-Id: <202302141823.31EINsQi087459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 28137bdb19aa - main - intrng: track counter allocation with a bitmap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28137bdb19aa34b8351108de4257795a93c0ba09 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=28137bdb19aa34b8351108de4257795a93c0ba09 commit 28137bdb19aa34b8351108de4257795a93c0ba09 Author: Mitchell Horne AuthorDate: 2023-02-14 18:02:12 +0000 Commit: Mitchell Horne CommitDate: 2023-02-14 18:06:00 +0000 intrng: track counter allocation with a bitmap Crucially, this allows releasing counters, and interrupt sources by extension. Where before we were incrementing intrcnt_index with atomics, now we protect the bitmap using the existing isrc_table_lock mutex. Reviewed by: mmel MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38437 --- sys/kern/subr_intr.c | 54 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 96a319b3c8b4..a95d2adbed04 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -152,7 +153,8 @@ u_long *intrcnt; char *intrnames; size_t sintrcnt; size_t sintrnames; -static u_int intrcnt_index; +int nintrcnt; +static bitstr_t *intrcnt_bitmap; static struct intr_irqsrc *intr_map_get_isrc(u_int res_id); static void intr_map_set_isrc(u_int res_id, struct intr_irqsrc *isrc); @@ -166,7 +168,6 @@ static void intr_map_copy_map_data(u_int res_id, device_t *dev, intptr_t *xref, static void intr_irq_init(void *dummy __unused) { - u_int intrcnt_count; SLIST_INIT(&pic_list); mtx_init(&pic_list_lock, "intr pic list", NULL, MTX_DEF); @@ -177,17 +178,21 @@ intr_irq_init(void *dummy __unused) * - 2 counters for each I/O interrupt. * - MAXCPU counters for each IPI counters for SMP. */ - intrcnt_count = intr_nirq * 2; + nintrcnt = intr_nirq * 2; #ifdef SMP - intrcnt_count += INTR_IPI_COUNT * MAXCPU; + nintrcnt += INTR_IPI_COUNT * MAXCPU; #endif - intrcnt = mallocarray(intrcnt_count, sizeof(u_long), M_INTRNG, + intrcnt = mallocarray(nintrcnt, sizeof(u_long), M_INTRNG, M_WAITOK | M_ZERO); - intrnames = mallocarray(intrcnt_count, INTRNAME_LEN, M_INTRNG, + intrnames = mallocarray(nintrcnt, INTRNAME_LEN, M_INTRNG, M_WAITOK | M_ZERO); - sintrcnt = intrcnt_count * sizeof(u_long); - sintrnames = intrcnt_count * INTRNAME_LEN; + sintrcnt = nintrcnt * sizeof(u_long); + sintrnames = nintrcnt * INTRNAME_LEN; + + /* Allocate the bitmap tracking counter allocations. */ + intrcnt_bitmap = bit_alloc(nintrcnt, M_INTRNG, M_WAITOK | M_ZERO); + irq_sources = mallocarray(intr_nirq, sizeof(struct intr_irqsrc*), M_INTRNG, M_WAITOK | M_ZERO); } @@ -266,13 +271,17 @@ isrc_update_name(struct intr_irqsrc *isrc, const char *name) static void isrc_setup_counters(struct intr_irqsrc *isrc) { - u_int index; + int index; + + mtx_assert(&isrc_table_lock, MA_OWNED); /* - * XXX - it does not work well with removable controllers and - * interrupt sources !!! + * Allocate two counter values, the second tracking "stray" interrupts. */ - index = atomic_fetchadd_int(&intrcnt_index, 2); + bit_ffc_area(intrcnt_bitmap, nintrcnt, 2, &index); + if (index == -1) + panic("Failed to allocate 2 counters. Array exhausted?"); + bit_nset(intrcnt_bitmap, index, index + 1); isrc->isrc_index = index; isrc->isrc_count = &intrcnt[index]; isrc_update_name(isrc, NULL); @@ -284,8 +293,11 @@ isrc_setup_counters(struct intr_irqsrc *isrc) static void isrc_release_counters(struct intr_irqsrc *isrc) { + int idx = isrc->isrc_index; - panic("%s: not implemented", __func__); + mtx_assert(&isrc_table_lock, MA_OWNED); + + bit_nclear(intrcnt_bitmap, idx, idx + 1); } #ifdef SMP @@ -298,11 +310,25 @@ intr_ipi_setup_counters(const char *name) u_int index, i; char str[INTRNAME_LEN]; - index = atomic_fetchadd_int(&intrcnt_index, MAXCPU); + mtx_lock(&isrc_table_lock); + + /* + * We should never have a problem finding MAXCPU contiguous counters, + * in practice. Interrupts will be allocated sequentially during boot, + * so the array should fill from low to high index. Once reserved, the + * IPI counters will never be released. Similarly, we will not need to + * allocate more IPIs once the system is running. + */ + bit_ffc_area(intrcnt_bitmap, nintrcnt, MAXCPU, &index); + if (index == -1) + panic("Failed to allocate %d counters. Array exhausted?", + MAXCPU); + bit_nset(intrcnt_bitmap, index, index + MAXCPU - 1); for (i = 0; i < MAXCPU; i++) { snprintf(str, INTRNAME_LEN, "cpu%d:%s", i, name); intrcnt_setname(str, index + i); } + mtx_unlock(&isrc_table_lock); return (&intrcnt[index]); } #endif From nobody Tue Feb 14 20:44:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGY9l0p7cz3pySk; Tue, 14 Feb 2023 20:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGY9k6WlKz42L6; Tue, 14 Feb 2023 20:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676407498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iwN4JNUmHJWXshm2qFsAMOVR9WODFvXAUKH+YRpvw8Q=; b=W0hXhKtKYyAbDnoTfBZtgJN1jIbAA/IApuEjTBoCPKVvhY+nSJtVQkSjIZFgASrdnaBAWH 1LRVOI3h8XchpKYEbKXl+YyL0ht0EnIRVDH6IH/W8BAAkmUwjx4FqRbDtb+VpVZLdG55A9 Omooihmj3VwjSAD5nNdPWl+cSQgZUFW1SnVF0APrlFWKtxeIKrBZUuOBZNpuIikJ+C+Ntv D7MJGsLcwa5U2xBKRk8IZYW+aiF96LA6b8KK68FWA+7SVpFeQm0GPOO+1FoSI1MOmHIJNi DWYGhSD/CMh8/KXWTp+ZrPittqEzGAF9P9W5KUhapUFSGH/YQrAnRZ25G4ViZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676407498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iwN4JNUmHJWXshm2qFsAMOVR9WODFvXAUKH+YRpvw8Q=; b=niX/TRiTKtSZfPJ4MZKugENjnGwwAIsOYW2TpQohMFkZwkUyB3Esp77Vy1NX/itDTwm4P2 Vc8Kipfua7vIXGhrRmfjYD9e569BWacrRhn3uz4vDHZS1VDPC2sZNyURAxHeguvKBbAJIN x/AAH/YP6IRqV8D7atEAK3hbiDllDsOySWqNRdyHwFXTbOnJ8p8KIPkoT3JCeXupyxIsJB zSKb4pjvCX5afWQjQuYxtOgE7QdEzUitpFS8D+HUS86ZHKa7ocp2oSQpZNi2nuC9vN6l+0 MU/T+/Z0vwjotDDouET3/GilhbBc3djjCw3lNvgEC2llZYUlAkBBZA8+O44e2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676407498; a=rsa-sha256; cv=none; b=s2aSZYz965aakzd453U+pIYHylsZ1u8GAzIf/CiPMxpgaV/rHSGKTZbSX55AZuaW4WE3w6 9VjFh87Y2RhCBp77slr8HPInsY0fFWjOEXYF6uX6XAhJbLPT3fWOnZIBPY/tuoCKcx0EVn 79X66xrSMG/gnFJrMKeWMJrVP4tD4KLuTPlFGde/ZFdoyjfErOmnhwkEFVVVjaQifiRk39 LbK33XWOhWpv7x2gUN7up0fakYnD1zTAEz5ccoMX0z3vrogcoUBGvF1mFLISctHySmREAp 7Wa40Bc7SklYGaqYK9KJGQnSSAocbFBR6ZgxWj2Y/GLCaOvrRtpj/H6Y/p9UJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGY9k5ZgJz1Byy; Tue, 14 Feb 2023 20:44: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 31EKiwui088700; Tue, 14 Feb 2023 20:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EKiw6b088699; Tue, 14 Feb 2023 20:44:58 GMT (envelope-from git) Date: Tue, 14 Feb 2023 20:44:58 GMT Message-Id: <202302142044.31EKiw6b088699@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: 7b0593fdcbbb - main - Cirrus-CI: use makefs if root size exceeds QEMU's virtual FAT limit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b0593fdcbbb9c73d282fc0024d844c044423b31 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7b0593fdcbbb9c73d282fc0024d844c044423b31 commit 7b0593fdcbbb9c73d282fc0024d844c044423b31 Author: Ed Maste AuthorDate: 2023-02-13 17:39:39 +0000 Commit: Ed Maste CommitDate: 2023-02-14 20:41:01 +0000 Cirrus-CI: use makefs if root size exceeds QEMU's virtual FAT limit We use QEMU's virtual FAT support to avoid having to create a disk image because it is much faster, but it has a limit of about 500MB. Artifacts produced by the GCC 12 CI job exceeded this size. Add support for creating a FAT partition image and MBR-partitioned disk image and use it when the file system is too large for QEMU. In one run the Cirrus-CI LLVM test task took 1m33s using QEMU's virtual FAT while the GCC task took 6m48s using makefs+mkimg. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38589 --- tools/boot/ci-qemu-test.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/boot/ci-qemu-test.sh b/tools/boot/ci-qemu-test.sh index e6481c794af5..b730e9725014 100755 --- a/tools/boot/ci-qemu-test.sh +++ b/tools/boot/ci-qemu-test.sh @@ -21,7 +21,7 @@ die() tempdir_cleanup() { trap - EXIT SIGINT SIGHUP SIGTERM SIGQUIT - rm -rf ${ROOTDIR} + rm -rf ${WORKDIR} } tempdir_setup() @@ -99,18 +99,31 @@ arm64) esac # Create a temp dir to hold the boot image. -ROOTDIR=$(mktemp -d -t ci-qemu-test-fat-root) +WORKDIR=$(mktemp -d -t ci-qemu-test-fat-root) +ROOTDIR=${WORKDIR}/stage-root trap tempdir_cleanup EXIT SIGINT SIGHUP SIGTERM SIGQUIT # Populate the boot image in a temp dir. ( cd ${SRCTOP} && tempdir_setup ) +# Using QEMU's virtual FAT support is much faster than creating a disk image, +# but only supports about 500MB. Fall back to creating a disk image if the +# staged root is too large. +hda="fat:${ROOTDIR}" +rootsize=$(du -skA ${ROOTDIR} | sed 's/[[:space:]].*$//') +if [ $rootsize -gt 512000 ]; then + echo "Root size ${rootsize}K too large for QEMU virtual FAT" >&2 + makefs -t msdos -s 1g $WORKDIR/image.fat $ROOTDIR + mkimg -s mbr -p efi:=$WORKDIR/image.fat -o $WORKDIR/image.mbr + hda="$WORKDIR/image.mbr" +fi + # And, boot in QEMU. : ${BOOTLOG:=${TMPDIR:-/tmp}/ci-qemu-test-boot.log} timeout 300 \ $QEMU -m 256M -nodefaults \ -serial stdio -vga none -nographic -monitor none \ - -snapshot -hda fat:${ROOTDIR} 2>&1 | tee ${BOOTLOG} + -snapshot -hda $hda 2>&1 | tee ${BOOTLOG} # Check whether we succesfully booted... if grep -q 'Hello world.' ${BOOTLOG}; then From nobody Tue Feb 14 21:21:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGYzR26wqz3q1Hd; Tue, 14 Feb 2023 21:21: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 4PGYzR1g0bz44qF; Tue, 14 Feb 2023 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676409667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xdX9U6cSLYwSKNSoWvtXD6Vow9fuldcUOrXl/W20UKU=; b=NT8OSmo3bpd48oQtoTOnShvTac6yXAs/givuSYC1ItMpSuLJBe3olY/oIxQkpBszHym/M8 YcAy//vWx8cFtUYpVKrSXZcZ5cDde18QW10gSV0EIG4/KXbXymxnKeB3aFRrgQTkvCeZK9 NvN0WKmmJ0tiPIiyWLIdjsRYZCrG3uWppoeSD3Kk/PF1s8HV/RrYHv75SuTOvlX+IeNk7D Cj8QEo5kjdDaJvVp4nuYcgHs6wfnUwJr98prUIXFdzollh2U8GqLGOeZ5K21sg3U2hyo0t iNzbOnGmMbbkTvwQ/gtlEs8mcdsI7ODhdyb5hZk3km0y0MZro2Olqnt/wB/Pow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676409667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xdX9U6cSLYwSKNSoWvtXD6Vow9fuldcUOrXl/W20UKU=; b=Y5zmDEkzk7L7w8yZ5GzOI27i/tf8GdN2+qp5r5kZ1KnTbMZr5sKmY0qQm9fm6ULZrXQxEP gYhzxoWnRfIX3SXSOFAkSMt9+tzbtcPtk2uhN1hfHP8/xVXos8uBVX+pXDA/Nm6NT4SOH/ zrItt5BOsDqQp62P3bjHx5OSVdDqWldVTnbLgbOcgLfWD8s4iHEccSNt589Wl/1Esb2WPD foUNT0MQY8JIpzPwg4mGgB/ADXQsgLgDswc+nqTg08FCZjG3T9XMANHQ8BsaysDB+zgHwm DauScNOEC2s46ytFshEArFW4Dk10L/f/90dWYrB1k8xlUAIeSnWQgPkB2uenHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676409667; a=rsa-sha256; cv=none; b=sfX4v8XIhr+GAwFqF0nMfCpuctEcCWokNLK8DLAXlowBmaWmK1bazNFi+MO1OusqIXrrJ0 U8VHvm8LxSrUfAybwKAB5L2o3JXK3dhvZKYT9Eq+AEsMscyxgZL16PYn5IgPjkwr80Vgvm ubAIzwh7N/1Zkgo+TsEQPut+n1rp41nyileLoPuGrQjCsdicUBGvbUa3sVgLS4+Zb+sXhp myrpAbv226r1KmNT1qkFWCOvIT2nxN3wdU/53fCXFRaYvxrRLlVYTNWj1G0UgdvhSeJS/g PsCqBo0NPla75808HduB3GRHx5Z83EyfMf9zfQw/zxsHcU3TiLW4kJ+vcB33dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGYzR0jQhz1DLb; Tue, 14 Feb 2023 21:21: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 31ELL7Sb041981; Tue, 14 Feb 2023 21:21:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31ELL6Cx041980; Tue, 14 Feb 2023 21:21:06 GMT (envelope-from git) Date: Tue, 14 Feb 2023 21:21:06 GMT Message-Id: <202302142121.31ELL6Cx041980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 1bdf879b97b6 - main - fusefs: fix some resource leaks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1bdf879b97b686a8f36fdba050b68f9e7493f363 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1bdf879b97b686a8f36fdba050b68f9e7493f363 commit 1bdf879b97b686a8f36fdba050b68f9e7493f363 Author: Alan Somers AuthorDate: 2023-02-11 23:43:30 +0000 Commit: Alan Somers CommitDate: 2023-02-14 21:19:59 +0000 fusefs: fix some resource leaks fusefs would leak tickets in three cases: * After FUSE_CREATE, if the server returned a bad inode number. * After a FUSE_FALLOCATE operation during VOP_ALLOCATE * After a FUSE_FALLOCATE operation during VOP_DEALLOCATE MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38526 --- sys/fs/fuse/fuse_vnops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index a088fe318d81..f97a1a52eaad 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -667,6 +667,7 @@ fuse_vnop_allocate(struct vop_allocate_args *ap) } } + fdisp_destroy(&fdi); return (err); } @@ -1103,6 +1104,7 @@ fuse_vnop_create(struct vop_create_args *ap) uint64_t nodeid = feo->nodeid; uint64_t fh_id = foo->fh; + fdisp_destroy(fdip); fdisp_init(fdip, sizeof(*fri)); fdisp_make(fdip, FUSE_RELEASE, mp, nodeid, td, cred); fri = fdip->indata; @@ -3021,6 +3023,7 @@ fuse_vnop_deallocate(struct vop_deallocate_args *ap) err = fdisp_wait_answ(&fdi); if (err == ENOSYS) { + fdisp_destroy(&fdi); fsess_set_notimpl(mp, FUSE_FALLOCATE); goto fallback; } else if (err == EOPNOTSUPP) { @@ -3028,6 +3031,7 @@ fuse_vnop_deallocate(struct vop_deallocate_args *ap) * The file system server does not support FUSE_FALLOCATE with * the supplied mode for this particular file. */ + fdisp_destroy(&fdi); goto fallback; } else if (!err) { /* @@ -3047,6 +3051,7 @@ fuse_vnop_deallocate(struct vop_deallocate_args *ap) } out: + fdisp_destroy(&fdi); if (closefufh) fuse_filehandle_close(vp, fufh, curthread, cred); From nobody Tue Feb 14 21:38:04 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGZM03jzXz3q28V; Tue, 14 Feb 2023 21:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGZM03V2Lz46kv; Tue, 14 Feb 2023 21:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676410684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cn+8GPobxlpLR2OINYm61nbZdorFbbjcuIOkfJeEzXQ=; b=trKuUhUpCTikhE/0CuOkmSx7Ty9onnCx3IvStEnYzDKdyKw6x/QPKpscsOz+6h76+5DQg/ 0/3PEtcMKi3cVgvqKzTjykCiOVYXxprBVXbSBQ1olLwVJt7Kk4yHh1s8X3TmO4sUNiCyhE 5pHAMmWU/clX1o17UH9S+FYfxzhU1Bf3stxEiryvvBMGRVLaiIRRmHxoeVV5Zeb+QDqYWX TeSIYU7giOODMf4oNiFyaWzbF8fjvOyDgPweb93Vi62n9SskscPCChqJcIq5cZ350Zryr3 KKVYsdsMj/phCaqBEdCXnwJVO59cIwIPVF4TmVOR68iHugEP7mqeBCsqJVsCiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676410684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Cn+8GPobxlpLR2OINYm61nbZdorFbbjcuIOkfJeEzXQ=; b=xabM7wzNHS4t3GeJpRZBdrA/Sz/O7f8eZUc6wqK3dpy4Z7MkDSqZBPObpyYBwotoWlDPJG 00Zkzh9Gsxaoccni6AySJZOidP/lrNsYAsdu53cSwBYVHMxisDqzEO1zgn5taMyBW0UyJJ 3E0NYVSyqEwzWy1LJfSal3VoOQsrxBDaT5Y9+jfXEjhpJUCITg5CmGO7rzwnsCMCaDGUux c2JMSGPBl2yKYqVKuEXR3Qu22Umi7TRI9nKsKIGimMxehEg0t86B0P7bu8TzWqV94/mDUp BT8ibatmjkrZk5bY6ixvrEjYmX6f9Ub6zzsT3vexLIHUkbyhw/PeFkkXd+hhPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676410684; a=rsa-sha256; cv=none; b=heRCddxsz7lzLvwJ9n1eYBBBqf2tat6lMew8IDRS7W2D7dF6S4RBYipI2FDa+zk0Ur1Epz toKEAjqR6Uyxj2U9txdTpKEIMMg5hkT9th9KMx8r320c+t8par58ckXw7MgpyI1tACul54 KI/VDTV279OJAUwnvmU4FfX/7EifIvKsoT5PNppZnHaA6EODficX+Y3KUxt6UeDDeAz5SK cQrK6RaZfEdLy1PKSADabva3yI3CN6qAzy24RFIxZBxFBGK+eACK76qYjRNmsJjgwlBii4 v+L0E9NovsIDseCyfNjxZpeDUypqpQ1LTWJh/pWRvI4X8Kb4wWdCrPRkRVmzbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGZM02XYqz1DpC; Tue, 14 Feb 2023 21:38: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 31ELc4wK060970; Tue, 14 Feb 2023 21:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31ELc4aq060969; Tue, 14 Feb 2023 21:38:04 GMT (envelope-from git) Date: Tue, 14 Feb 2023 21:38:04 GMT Message-Id: <202302142138.31ELc4aq060969@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: f0db2b6022df - main - nfsd: Continue adding macros so nfsd can run in a vnet prison List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0db2b6022dfa15f375f5fcdd278b9df21cb88f5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f0db2b6022dfa15f375f5fcdd278b9df21cb88f5 commit f0db2b6022dfa15f375f5fcdd278b9df21cb88f5 Author: Rick Macklem AuthorDate: 2023-02-14 21:33:35 +0000 Commit: Rick Macklem CommitDate: 2023-02-14 21:33:35 +0000 nfsd: Continue adding macros so nfsd can run in a vnet prison Commit 7344856e3a6d added a lot of macros that will front end vnet macros so that nfsd(8) can run in vnet prison. This patch adds some more, to allow the nfsuserd(8) daemon to run in vnet prison, once the macros map to vnet ones. This is the last commit for NFSD_VNET_xxx macros, but there are still some for KRPC_VNET_xxx and KGSS_VNET_xx to allow the rpc.tlsservd(8) and gssd(8) daemons to run in a vnet prison. MFC after: 3 months --- sys/fs/nfs/nfs_commonport.c | 14 ++- sys/fs/nfs/nfs_commonsubs.c | 289 ++++++++++++++++++++++++-------------------- 2 files changed, 169 insertions(+), 134 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index e45f26d53799..2a2869641d25 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include extern int nfscl_ticks; -extern nfsuserd_state nfsrv_nfsuserd; -extern struct nfssockreq nfsrv_nfsuserdsock; extern void (*nfsd_call_recall)(struct vnode *, int, struct ucred *, struct thread *); extern int nfsrv_useacl; @@ -77,6 +75,9 @@ uint32_t nfs_srvmaxio = NFS_SRVMAXIO; NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p); +NFSD_VNET_DECLARE(struct nfssockreq, nfsrv_nfsuserdsock); +NFSD_VNET_DECLARE(nfsuserd_state, nfsrv_nfsuserd); + int nfs_pnfsio(task_fn_t *, void *); static int nfs_realign_test; @@ -857,6 +858,7 @@ nfs_clean(struct prison *pr) { NFSD_CURVNET_SET(pr->pr_vnet); + mtx_destroy(&NFSD_VNET(nfsrv_nfsuserdsock).nr_mtx); if (pr != &prison0) free(NFSD_VNET(nfsstatsv1_p), M_TEMP); /* Clean out the name<-->id cache. */ @@ -876,6 +878,8 @@ nfs_vnetinit(const void *unused __unused) else NFSD_VNET(nfsstatsv1_p) = malloc(sizeof(struct nfsstatsv1), M_TEMP, M_WAITOK | M_ZERO); + mtx_init(&NFSD_VNET(nfsrv_nfsuserdsock).nr_mtx, "nfsuserd", + NULL, MTX_DEF); } SYSINIT(nfs_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, nfs_vnetinit, NULL); @@ -900,8 +904,6 @@ nfscommon_modevent(module_t mod, int type, void *data) mtx_init(&nfs_sockl_mutex, "nfs_sockl_mutex", NULL, MTX_DEF); mtx_init(&nfs_slock_mutex, "nfs_slock_mutex", NULL, MTX_DEF); mtx_init(&nfs_req_mutex, "nfs_req_mutex", NULL, MTX_DEF); - mtx_init(&nfsrv_nfsuserdsock.nr_mtx, "nfsuserd", NULL, - MTX_DEF); mtx_init(&nfsrv_dslock_mtx, "nfs4ds", NULL, MTX_DEF); TAILQ_INIT(&nfsrv_devidhead); newnfs_init(); @@ -910,7 +912,8 @@ nfscommon_modevent(module_t mod, int type, void *data) break; case MOD_UNLOAD: - if (newnfs_numnfsd != 0 || nfsrv_nfsuserd != NOTRUNNING || + if (newnfs_numnfsd != 0 || + NFSD_VNET(nfsrv_nfsuserd) != NOTRUNNING || nfs_numnfscbd != 0) { error = EBUSY; break; @@ -926,7 +929,6 @@ nfscommon_modevent(module_t mod, int type, void *data) mtx_destroy(&nfs_sockl_mutex); mtx_destroy(&nfs_slock_mutex); mtx_destroy(&nfs_req_mutex); - mtx_destroy(&nfsrv_nfsuserdsock.nr_mtx); mtx_destroy(&nfsrv_dslock_mtx); loaded = 0; break; diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index c974e029efa8..e2e15063cf99 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -66,17 +66,10 @@ enum vtype nv34tov_type[8]={ VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO }; struct timeval nfsboottime; /* Copy boottime once, so it never changes */ int nfscl_ticks; int nfsrv_useacl = 1; -struct nfssockreq nfsrv_nfsuserdsock; -nfsuserd_state nfsrv_nfsuserd = NOTRUNNING; -static int nfsrv_userdupcalls = 0; struct nfsreqhead nfsd_reqq; -uid_t nfsrv_defaultuid = UID_NOBODY; -gid_t nfsrv_defaultgid = GID_NOGROUP; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; -int nfsd_enable_stringtouid = 0; int nfsrv_doflexfile = 0; -static int nfs_enable_uidtostring = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; extern int nfsrv_lughashsize; @@ -87,9 +80,20 @@ extern struct nfsdevicehead nfsrv_devidhead; extern struct nfsstatsv1 nfsstatsv1; extern uint32_t nfs_srvmaxio; +NFSD_VNET_DEFINE(int, nfsd_enable_stringtouid) = 0; +NFSD_VNET_DEFINE(struct nfssockreq, nfsrv_nfsuserdsock); +NFSD_VNET_DEFINE(nfsuserd_state, nfsrv_nfsuserd) = NOTRUNNING; +NFSD_VNET_DEFINE(uid_t, nfsrv_defaultuid) = UID_NOBODY; +NFSD_VNET_DEFINE(gid_t, nfsrv_defaultgid) = GID_NOGROUP; + +NFSD_VNET_DEFINE_STATIC(int, nfsrv_userdupcalls) = 0; + SYSCTL_DECL(_vfs_nfs); -SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, CTLFLAG_RW, - &nfs_enable_uidtostring, 0, "Make nfs always send numeric owner_names"); + +NFSD_VNET_DEFINE_STATIC(int, nfs_enable_uidtostring) = 0; +SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, + CTLFLAG_NFSD_VNET | CTLFLAG_RW, &NFSD_VNET_NAME(nfs_enable_uidtostring), 0, + "Make nfs always send numeric owner_names"); int nfsrv_maxpnfsmirror = 1; SYSCTL_INT(_vfs_nfs, OID_AUTO, pnfsmirror, CTLFLAG_RD, @@ -192,18 +196,19 @@ struct nfsv4_opflag nfsv4_opflag[NFSV42_NOPS] = { }; static int ncl_mbuf_mhlen = MHLEN; -static int nfsrv_usercnt = 0; -static int nfsrv_dnsnamelen; -static u_char *nfsrv_dnsname = NULL; -static int nfsrv_usermax = 999999999; struct nfsrv_lughash { struct mtx mtx; struct nfsuserhashhead lughead; }; -static struct nfsrv_lughash *nfsuserhash; -static struct nfsrv_lughash *nfsusernamehash; -static struct nfsrv_lughash *nfsgrouphash; -static struct nfsrv_lughash *nfsgroupnamehash; + +NFSD_VNET_DEFINE_STATIC(int, nfsrv_usercnt) = 0; +NFSD_VNET_DEFINE_STATIC(int, nfsrv_dnsnamelen) = 0; +NFSD_VNET_DEFINE_STATIC(int, nfsrv_usermax) = 999999999; +NFSD_VNET_DEFINE_STATIC(struct nfsrv_lughash *, nfsuserhash) = NULL; +NFSD_VNET_DEFINE_STATIC(struct nfsrv_lughash *, nfsusernamehash) = NULL; +NFSD_VNET_DEFINE_STATIC(struct nfsrv_lughash *, nfsgrouphash) = NULL; +NFSD_VNET_DEFINE_STATIC(struct nfsrv_lughash *, nfsgroupnamehash) = NULL; +NFSD_VNET_DEFINE_STATIC(u_char *, nfsrv_dnsname) = NULL; /* * This static array indicates whether or not the RPC generates a large @@ -1245,6 +1250,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, #endif CTASSERT(sizeof(ino_t) == sizeof(uint64_t)); + NFSD_CURVNET_SET_QUIET(NFSD_TD_TO_VNET(curthread)); if (compare) { retnotsup = 0; error = nfsrv_getattrbits(nd, &attrbits, NULL, &retnotsup); @@ -1870,7 +1876,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, } } else if (nap != NULL) { if (nfsv4_strtouid(nd, cp, j, &uid)) - nap->na_uid = nfsrv_defaultuid; + nap->na_uid = + NFSD_VNET(nfsrv_defaultuid); else nap->na_uid = uid; } @@ -1903,7 +1910,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, } } else if (nap != NULL) { if (nfsv4_strtogid(nd, cp, j, &gid)) - nap->na_gid = nfsrv_defaultgid; + nap->na_gid = + NFSD_VNET(nfsrv_defaultgid); else nap->na_gid = gid; } @@ -2266,6 +2274,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, error = nfsm_advance(nd, attrsize - attrsum, -1); } nfsmout: + NFSD_CURVNET_RESTORE(); NFSEXITCODE2(error, nd); return (error); } @@ -3142,14 +3151,16 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp) int cnt, hasampersand, len = NFSV4_SMALLSTR, ret; struct nfsrv_lughash *hp; + NFSD_CURVNET_SET_QUIET(NFSD_TD_TO_VNET(curthread)); cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { + if (NFSD_VNET(nfsrv_dnsnamelen) > 0 && + !NFSD_VNET(nfs_enable_uidtostring)) { /* * Always map nfsrv_defaultuid to "nobody". */ - if (uid == nfsrv_defaultuid) { - i = nfsrv_dnsnamelen + 7; + if (uid == NFSD_VNET(nfsrv_defaultuid)) { + i = NFSD_VNET(nfsrv_dnsnamelen) + 7; if (i > len) { if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); @@ -3161,7 +3172,9 @@ tryagain: *retlenp = i; NFSBCOPY("nobody@", cp, 7); cp += 7; - NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); + NFSBCOPY(NFSD_VNET(nfsrv_dnsname), cp, + NFSD_VNET(nfsrv_dnsnamelen)); + NFSD_CURVNET_RESTORE(); return; } hasampersand = 0; @@ -3185,7 +3198,7 @@ tryagain: i = usrp->lug_namelen; else i = usrp->lug_namelen + - nfsrv_dnsnamelen + 1; + NFSD_VNET(nfsrv_dnsnamelen) + 1; if (i > len) { mtx_unlock(&hp->mtx); if (len > NFSV4_SMALLSTR) @@ -3200,12 +3213,14 @@ tryagain: if (!hasampersand) { cp += usrp->lug_namelen; *cp++ = '@'; - NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); + NFSBCOPY(NFSD_VNET(nfsrv_dnsname), cp, + NFSD_VNET(nfsrv_dnsnamelen)); } TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); TAILQ_INSERT_TAIL(&hp->lughead, usrp, lug_numhash); mtx_unlock(&hp->mtx); + NFSD_CURVNET_RESTORE(); return; } } @@ -3233,6 +3248,7 @@ tryagain: *cp-- = '0' + (tmp % 10); tmp /= 10; } + NFSD_CURVNET_RESTORE(); return; } @@ -3253,7 +3269,7 @@ nfsrv_getgrpscred(struct ucred *oldcred) cnt = 0; uid = oldcred->cr_uid; tryagain: - if (nfsrv_dnsnamelen > 0) { + if (NFSD_VNET(nfsrv_dnsnamelen) > 0) { hp = NFSUSERHASH(uid); mtx_lock(&hp->mtx); TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) { @@ -3300,6 +3316,7 @@ nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp) uid_t tuid; struct nfsrv_lughash *hp, *hp2; + NFSD_CURVNET_SET_QUIET(NFSD_TD_TO_VNET(curthread)); if (len == 0) { error = NFSERR_BADOWNER; goto out; @@ -3311,7 +3328,7 @@ nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp) /* A numeric string. */ if ((nd->nd_flag & ND_KERBV) == 0 && ((nd->nd_flag & ND_NFSCL) != 0 || - nfsd_enable_stringtouid != 0)) + NFSD_VNET(nfsd_enable_stringtouid) != 0)) *uidp = tuid; else error = NFSERR_BADOWNER; @@ -3328,7 +3345,7 @@ nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp) cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0) { + if (NFSD_VNET(nfsrv_dnsnamelen) > 0) { /* * If an '@' is found and the domain name matches, search for * the name with dns stripped off. @@ -3336,9 +3353,10 @@ tryagain: * all upper case will not. */ if (cnt == 0 && i < len && i > 0 && - (len - 1 - i) == nfsrv_dnsnamelen && - !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { - len -= (nfsrv_dnsnamelen + 1); + (len - 1 - i) == NFSD_VNET(nfsrv_dnsnamelen) && + !nfsrv_cmpmixedcase(cp, + NFSD_VNET(nfsrv_dnsname), NFSD_VNET(nfsrv_dnsnamelen))) { + len -= (NFSD_VNET(nfsrv_dnsnamelen) + 1); *(cp - 1) = '\0'; } @@ -3346,7 +3364,7 @@ tryagain: * Check for the special case of "nobody". */ if (len == 6 && !NFSBCMP(str, "nobody", 6)) { - *uidp = nfsrv_defaultuid; + *uidp = NFSD_VNET(nfsrv_defaultuid); error = 0; goto out; } @@ -3380,6 +3398,7 @@ tryagain: error = NFSERR_BADOWNER; out: + NFSD_CURVNET_RESTORE(); NFSEXITCODE(error); return (error); } @@ -3401,14 +3420,16 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp) int cnt, hasampersand, len = NFSV4_SMALLSTR, ret; struct nfsrv_lughash *hp; + NFSD_CURVNET_SET_QUIET(NFSD_TD_TO_VNET(curthread)); cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { + if (NFSD_VNET(nfsrv_dnsnamelen) > 0 && + !NFSD_VNET(nfs_enable_uidtostring)) { /* * Always map nfsrv_defaultgid to "nogroup". */ - if (gid == nfsrv_defaultgid) { - i = nfsrv_dnsnamelen + 8; + if (gid == NFSD_VNET(nfsrv_defaultgid)) { + i = NFSD_VNET(nfsrv_dnsnamelen) + 8; if (i > len) { if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); @@ -3420,7 +3441,9 @@ tryagain: *retlenp = i; NFSBCOPY("nogroup@", cp, 8); cp += 8; - NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); + NFSBCOPY(NFSD_VNET(nfsrv_dnsname), cp, + NFSD_VNET(nfsrv_dnsnamelen)); + NFSD_CURVNET_RESTORE(); return; } hasampersand = 0; @@ -3444,7 +3467,7 @@ tryagain: i = usrp->lug_namelen; else i = usrp->lug_namelen + - nfsrv_dnsnamelen + 1; + NFSD_VNET(nfsrv_dnsnamelen) + 1; if (i > len) { mtx_unlock(&hp->mtx); if (len > NFSV4_SMALLSTR) @@ -3459,12 +3482,14 @@ tryagain: if (!hasampersand) { cp += usrp->lug_namelen; *cp++ = '@'; - NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); + NFSBCOPY(NFSD_VNET(nfsrv_dnsname), cp, + NFSD_VNET(nfsrv_dnsnamelen)); } TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); TAILQ_INSERT_TAIL(&hp->lughead, usrp, lug_numhash); mtx_unlock(&hp->mtx); + NFSD_CURVNET_RESTORE(); return; } } @@ -3492,6 +3517,7 @@ tryagain: *cp-- = '0' + (tmp % 10); tmp /= 10; } + NFSD_CURVNET_RESTORE(); return; } @@ -3514,6 +3540,7 @@ nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp) gid_t tgid; struct nfsrv_lughash *hp, *hp2; + NFSD_CURVNET_SET_QUIET(NFSD_TD_TO_VNET(curthread)); if (len == 0) { error = NFSERR_BADOWNER; goto out; @@ -3525,7 +3552,7 @@ nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp) /* A numeric string. */ if ((nd->nd_flag & ND_KERBV) == 0 && ((nd->nd_flag & ND_NFSCL) != 0 || - nfsd_enable_stringtouid != 0)) + NFSD_VNET(nfsd_enable_stringtouid) != 0)) *gidp = tgid; else error = NFSERR_BADOWNER; @@ -3542,15 +3569,16 @@ nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp) cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0) { + if (NFSD_VNET(nfsrv_dnsnamelen) > 0) { /* * If an '@' is found and the dns name matches, search for the * name with the dns stripped off. */ if (cnt == 0 && i < len && i > 0 && - (len - 1 - i) == nfsrv_dnsnamelen && - !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { - len -= (nfsrv_dnsnamelen + 1); + (len - 1 - i) == NFSD_VNET(nfsrv_dnsnamelen) && + !nfsrv_cmpmixedcase(cp, + NFSD_VNET(nfsrv_dnsname), NFSD_VNET(nfsrv_dnsnamelen))) { + len -= (NFSD_VNET(nfsrv_dnsnamelen) + 1); *(cp - 1) = '\0'; } @@ -3558,7 +3586,7 @@ tryagain: * Check for the special case of "nogroup". */ if (len == 7 && !NFSBCMP(str, "nogroup", 7)) { - *gidp = nfsrv_defaultgid; + *gidp = NFSD_VNET(nfsrv_defaultgid); error = 0; goto out; } @@ -3592,6 +3620,7 @@ tryagain: error = NFSERR_BADOWNER; out: + NFSD_CURVNET_RESTORE(); NFSEXITCODE(error); return (error); } @@ -3642,12 +3671,12 @@ nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPROC_T *p) int error; NFSLOCKNAMEID(); - if (nfsrv_nfsuserd != NOTRUNNING) { + if (NFSD_VNET(nfsrv_nfsuserd) != NOTRUNNING) { NFSUNLOCKNAMEID(); error = EPERM; goto out; } - nfsrv_nfsuserd = STARTSTOP; + NFSD_VNET(nfsrv_nfsuserd) = STARTSTOP; /* * Set up the socket record and connect. * Set nr_client NULL before unlocking, just to ensure that no other @@ -3655,7 +3684,7 @@ nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPROC_T *p) * occur if the use of the nameid lock to protect nfsrv_nfsuserd is * broken. */ - rp = &nfsrv_nfsuserdsock; + rp = &NFSD_VNET(nfsrv_nfsuserdsock); rp->nr_client = NULL; NFSUNLOCKNAMEID(); rp->nr_sotype = SOCK_DGRAM; @@ -3696,12 +3725,12 @@ nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPROC_T *p) &rp->nr_client); if (error == 0) { NFSLOCKNAMEID(); - nfsrv_nfsuserd = RUNNING; + NFSD_VNET(nfsrv_nfsuserd) = RUNNING; NFSUNLOCKNAMEID(); } else { free(rp->nr_nam, M_SONAME); NFSLOCKNAMEID(); - nfsrv_nfsuserd = NOTRUNNING; + NFSD_VNET(nfsrv_nfsuserd) = NOTRUNNING; NFSUNLOCKNAMEID(); } out: @@ -3717,20 +3746,20 @@ nfsrv_nfsuserddelport(void) { NFSLOCKNAMEID(); - if (nfsrv_nfsuserd != RUNNING) { + if (NFSD_VNET(nfsrv_nfsuserd) != RUNNING) { NFSUNLOCKNAMEID(); return; } - nfsrv_nfsuserd = STARTSTOP; + NFSD_VNET(nfsrv_nfsuserd) = STARTSTOP; /* Wait for all upcalls to complete. */ - while (nfsrv_userdupcalls > 0) - msleep(&nfsrv_userdupcalls, NFSNAMEIDMUTEXPTR, PVFS, + while (NFSD_VNET(nfsrv_userdupcalls) > 0) + msleep(&NFSD_VNET(nfsrv_userdupcalls), NFSNAMEIDMUTEXPTR, PVFS, "nfsupcalls", 0); NFSUNLOCKNAMEID(); - newnfs_disconnect(NULL, &nfsrv_nfsuserdsock); - free(nfsrv_nfsuserdsock.nr_nam, M_SONAME); + newnfs_disconnect(NULL, &NFSD_VNET(nfsrv_nfsuserdsock)); + free(NFSD_VNET(nfsrv_nfsuserdsock).nr_nam, M_SONAME); NFSLOCKNAMEID(); - nfsrv_nfsuserd = NOTRUNNING; + NFSD_VNET(nfsrv_nfsuserd) = NOTRUNNING; NFSUNLOCKNAMEID(); } @@ -3750,7 +3779,7 @@ nfsrv_getuser(int procnum, uid_t uid, gid_t gid, char *name) int error; NFSLOCKNAMEID(); - if (nfsrv_nfsuserd != RUNNING) { + if (NFSD_VNET(nfsrv_nfsuserd) != RUNNING) { NFSUNLOCKNAMEID(); error = EPERM; goto out; @@ -3759,9 +3788,9 @@ nfsrv_getuser(int procnum, uid_t uid, gid_t gid, char *name) * Maintain a count of upcalls in progress, so that nfsrv_X() * can wait until no upcalls are in progress. */ - nfsrv_userdupcalls++; + NFSD_VNET(nfsrv_userdupcalls)++; NFSUNLOCKNAMEID(); - KASSERT(nfsrv_userdupcalls > 0, + KASSERT(NFSD_VNET(nfsrv_userdupcalls) > 0, ("nfsrv_getuser: non-positive upcalls")); nd = &nfsd; cred = newnfs_getcred(); @@ -3779,11 +3808,13 @@ nfsrv_getuser(int procnum, uid_t uid, gid_t gid, char *name) len = strlen(name); (void) nfsm_strtom(nd, name, len); } - error = newnfs_request(nd, NULL, NULL, &nfsrv_nfsuserdsock, NULL, NULL, - cred, RPCPROG_NFSUSERD, RPCNFSUSERD_VERS, NULL, 0, NULL, NULL); + error = newnfs_request(nd, NULL, NULL, &NFSD_VNET(nfsrv_nfsuserdsock), + NULL, NULL, cred, RPCPROG_NFSUSERD, RPCNFSUSERD_VERS, NULL, 0, + NULL, NULL); NFSLOCKNAMEID(); - if (--nfsrv_userdupcalls == 0 && nfsrv_nfsuserd == STARTSTOP) - wakeup(&nfsrv_userdupcalls); + if (--NFSD_VNET(nfsrv_userdupcalls) == 0 && + NFSD_VNET(nfsrv_nfsuserd) == STARTSTOP) + wakeup(&NFSD_VNET(nfsrv_userdupcalls)); NFSUNLOCKNAMEID(); NFSFREECRED(cred); if (!error) { @@ -3823,7 +3854,8 @@ nfssvc_idname(struct nfsd_idargs *nidp) free(cp, M_NFSSTRING); goto out; } - if (atomic_cmpset_acq_int(&nfsrv_dnsnamelen, 0, 0) == 0) { + if (atomic_cmpset_acq_int(&NFSD_VNET(nfsrv_dnsnamelen), 0, 0) == + 0) { /* * Free up all the old stuff and reinitialize hash * lists. All mutexes for both lists must be locked, @@ -3831,80 +3863,81 @@ nfssvc_idname(struct nfsd_idargs *nidp) * ones, to avoid a LOR. */ for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsusernamehash[i].mtx); + mtx_lock(&NFSD_VNET(nfsusernamehash)[i].mtx); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsuserhash[i].mtx); + mtx_lock(&NFSD_VNET(nfsuserhash)[i].mtx); for (i = 0; i < nfsrv_lughashsize; i++) TAILQ_FOREACH_SAFE(usrp, - &nfsuserhash[i].lughead, lug_numhash, nusrp) + &NFSD_VNET(nfsuserhash)[i].lughead, lug_numhash, nusrp) nfsrv_removeuser(usrp, 1); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_unlock(&nfsuserhash[i].mtx); + mtx_unlock(&NFSD_VNET(nfsuserhash)[i].mtx); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_unlock(&nfsusernamehash[i].mtx); + mtx_unlock(&NFSD_VNET(nfsusernamehash)[i].mtx); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsgroupnamehash[i].mtx); + mtx_lock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsgrouphash[i].mtx); + mtx_lock(&NFSD_VNET(nfsgrouphash)[i].mtx); for (i = 0; i < nfsrv_lughashsize; i++) TAILQ_FOREACH_SAFE(usrp, - &nfsgrouphash[i].lughead, lug_numhash, + &NFSD_VNET(nfsgrouphash)[i].lughead, lug_numhash, nusrp) nfsrv_removeuser(usrp, 0); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_unlock(&nfsgrouphash[i].mtx); + mtx_unlock(&NFSD_VNET(nfsgrouphash)[i].mtx); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_unlock(&nfsgroupnamehash[i].mtx); - free(nfsrv_dnsname, M_NFSSTRING); - nfsrv_dnsname = NULL; + mtx_unlock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); + free(NFSD_VNET(nfsrv_dnsname), M_NFSSTRING); + NFSD_VNET(nfsrv_dnsname) = NULL; } - if (nfsuserhash == NULL) { + if (NFSD_VNET(nfsuserhash) == NULL) { /* Allocate the hash tables. */ - nfsuserhash = malloc(sizeof(struct nfsrv_lughash) * + NFSD_VNET(nfsuserhash) = malloc(sizeof(struct nfsrv_lughash) * nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | M_ZERO); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_init(&nfsuserhash[i].mtx, "nfsuidhash", + mtx_init(&NFSD_VNET(nfsuserhash)[i].mtx, "nfsuidhash", NULL, MTX_DEF | MTX_DUPOK); - nfsusernamehash = malloc(sizeof(struct nfsrv_lughash) * + NFSD_VNET(nfsusernamehash) = malloc(sizeof(struct nfsrv_lughash) * nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | M_ZERO); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_init(&nfsusernamehash[i].mtx, + mtx_init(&NFSD_VNET(nfsusernamehash)[i].mtx, "nfsusrhash", NULL, MTX_DEF | MTX_DUPOK); - nfsgrouphash = malloc(sizeof(struct nfsrv_lughash) * + NFSD_VNET(nfsgrouphash) = malloc(sizeof(struct nfsrv_lughash) * nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | M_ZERO); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_init(&nfsgrouphash[i].mtx, "nfsgidhash", + mtx_init(&NFSD_VNET(nfsgrouphash)[i].mtx, "nfsgidhash", NULL, MTX_DEF | MTX_DUPOK); - nfsgroupnamehash = malloc(sizeof(struct nfsrv_lughash) * + NFSD_VNET(nfsgroupnamehash) = malloc(sizeof(struct nfsrv_lughash) * nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | M_ZERO); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_init(&nfsgroupnamehash[i].mtx, + mtx_init(&NFSD_VNET(nfsgroupnamehash)[i].mtx, "nfsgrphash", NULL, MTX_DEF | MTX_DUPOK); } /* (Re)initialize the list heads. */ for (i = 0; i < nfsrv_lughashsize; i++) - TAILQ_INIT(&nfsuserhash[i].lughead); + TAILQ_INIT(&NFSD_VNET(nfsuserhash)[i].lughead); for (i = 0; i < nfsrv_lughashsize; i++) - TAILQ_INIT(&nfsusernamehash[i].lughead); + TAILQ_INIT(&NFSD_VNET(nfsusernamehash)[i].lughead); for (i = 0; i < nfsrv_lughashsize; i++) - TAILQ_INIT(&nfsgrouphash[i].lughead); + TAILQ_INIT(&NFSD_VNET(nfsgrouphash)[i].lughead); for (i = 0; i < nfsrv_lughashsize; i++) - TAILQ_INIT(&nfsgroupnamehash[i].lughead); + TAILQ_INIT(&NFSD_VNET(nfsgroupnamehash)[i].lughead); /* * Put name in "DNS" string. */ - nfsrv_dnsname = cp; - nfsrv_defaultuid = nidp->nid_uid; - nfsrv_defaultgid = nidp->nid_gid; - nfsrv_usercnt = 0; - nfsrv_usermax = nidp->nid_usermax; - atomic_store_rel_int(&nfsrv_dnsnamelen, nidp->nid_namelen); + NFSD_VNET(nfsrv_dnsname) = cp; + NFSD_VNET(nfsrv_defaultuid) = nidp->nid_uid; + NFSD_VNET(nfsrv_defaultgid) = nidp->nid_gid; + NFSD_VNET(nfsrv_usercnt) = 0; + NFSD_VNET(nfsrv_usermax) = nidp->nid_usermax; + atomic_store_rel_int(&NFSD_VNET(nfsrv_dnsnamelen), + nidp->nid_namelen); goto out; } @@ -3931,7 +3964,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) cr->cr_uid = cr->cr_ruid = cr->cr_svuid = nidp->nid_uid; crsetgroups(cr, nidp->nid_ngroup, grps); cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0]; - cr->cr_prison = &prison0; + cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); #ifdef MAC mac_cred_associate_nfsd(cr); @@ -3963,7 +3996,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) if (nidp->nid_flag & (NFSID_DELUID | NFSID_ADDUID)) { /* Must lock all username hash lists first, to avoid a LOR. */ for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsusernamehash[i].mtx); + mtx_lock(&NFSD_VNET(nfsusernamehash)[i].mtx); username_locked = 1; hp_idnum = NFSUSERHASH(nidp->nid_uid); mtx_lock(&hp_idnum->mtx); @@ -3992,7 +4025,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) } else if (nidp->nid_flag & (NFSID_DELGID | NFSID_ADDGID)) { /* Must lock all groupname hash lists first, to avoid a LOR. */ for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsgroupnamehash[i].mtx); + mtx_lock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); groupname_locked = 1; hp_idnum = NFSGROUPHASH(nidp->nid_gid); mtx_lock(&hp_idnum->mtx); @@ -4035,7 +4068,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) thp = NFSUSERNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); mtx_assert(&thp->mtx, MA_OWNED); TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_namehash); - atomic_add_int(&nfsrv_usercnt, 1); + atomic_add_int(&NFSD_VNET(nfsrv_usercnt), 1); } else if (nidp->nid_flag & (NFSID_ADDGID | NFSID_ADDGROUPNAME)) { newusrp->lug_gid = nidp->nid_gid; thp = NFSGROUPHASH(newusrp->lug_gid); @@ -4044,7 +4077,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) thp = NFSGROUPNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); mtx_assert(&thp->mtx, MA_OWNED); TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_namehash); - atomic_add_int(&nfsrv_usercnt, 1); + atomic_add_int(&NFSD_VNET(nfsrv_usercnt), 1); } else { if (newusrp->lug_cred != NULL) crfree(newusrp->lug_cred); @@ -4073,17 +4106,17 @@ nfssvc_idname(struct nfsd_idargs *nidp) NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) != 0) { if (username_locked == 0) { for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsusernamehash[i].mtx); + mtx_lock(&NFSD_VNET(nfsusernamehash)[i].mtx); username_locked = 1; } KASSERT(user_locked == 0, ("nfssvc_idname: user_locked")); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsuserhash[i].mtx); + mtx_lock(&NFSD_VNET(nfsuserhash)[i].mtx); user_locked = 1; for (i = 0; i < nfsrv_lughashsize; i++) { TAILQ_FOREACH_SAFE(usrp, - &nfsuserhash[i].lughead, lug_numhash, + &NFSD_VNET(nfsuserhash)[i].lughead, lug_numhash, nusrp) if (usrp->lug_expiry < NFSD_MONOSEC) nfsrv_removeuser(usrp, 1); @@ -4094,26 +4127,26 @@ nfssvc_idname(struct nfsd_idargs *nidp) * algorithm. This code deletes the least * recently used entry on each hash list. */ - if (nfsrv_usercnt <= nfsrv_usermax) + if (NFSD_VNET(nfsrv_usercnt) <= NFSD_VNET(nfsrv_usermax)) break; - usrp = TAILQ_FIRST(&nfsuserhash[i].lughead); + usrp = TAILQ_FIRST(&NFSD_VNET(nfsuserhash)[i].lughead); if (usrp != NULL) nfsrv_removeuser(usrp, 1); } } else { if (groupname_locked == 0) { for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsgroupnamehash[i].mtx); + mtx_lock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); groupname_locked = 1; } KASSERT(group_locked == 0, ("nfssvc_idname: group_locked")); for (i = 0; i < nfsrv_lughashsize; i++) - mtx_lock(&nfsgrouphash[i].mtx); + mtx_lock(&NFSD_VNET(nfsgrouphash)[i].mtx); group_locked = 1; for (i = 0; i < nfsrv_lughashsize; i++) { TAILQ_FOREACH_SAFE(usrp, - &nfsgrouphash[i].lughead, lug_numhash, + &NFSD_VNET(nfsgrouphash)[i].lughead, lug_numhash, nusrp) if (usrp->lug_expiry < NFSD_MONOSEC) nfsrv_removeuser(usrp, 0); @@ -4124,9 +4157,9 @@ nfssvc_idname(struct nfsd_idargs *nidp) * algorithm. This code deletes the least * recently user entry on each hash list. */ - if (nfsrv_usercnt <= nfsrv_usermax) + if (NFSD_VNET(nfsrv_usercnt) <= NFSD_VNET(nfsrv_usermax)) break; - usrp = TAILQ_FIRST(&nfsgrouphash[i].lughead); + usrp = TAILQ_FIRST(&NFSD_VNET(nfsgrouphash)[i].lughead); if (usrp != NULL) nfsrv_removeuser(usrp, 0); } @@ -4142,16 +4175,16 @@ nfssvc_idname(struct nfsd_idargs *nidp) mtx_unlock(&hp_name->mtx); if (user_locked != 0) for (i = 0; i < nfsrv_lughashsize; i++) - mtx_unlock(&nfsuserhash[i].mtx); + mtx_unlock(&NFSD_VNET(nfsuserhash)[i].mtx); if (username_locked != 0) for (i = 0; i < nfsrv_lughashsize; i++) - mtx_unlock(&nfsusernamehash[i].mtx); + mtx_unlock(&NFSD_VNET(nfsusernamehash)[i].mtx); if (group_locked != 0) for (i = 0; i < nfsrv_lughashsize; i++) - mtx_unlock(&nfsgrouphash[i].mtx); + mtx_unlock(&NFSD_VNET(nfsgrouphash)[i].mtx); if (groupname_locked != 0) for (i = 0; i < nfsrv_lughashsize; i++) - mtx_unlock(&nfsgroupnamehash[i].mtx); + mtx_unlock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); out: NFSEXITCODE(error); return (error); @@ -4180,7 +4213,7 @@ nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser) mtx_assert(&hp->mtx, MA_OWNED); TAILQ_REMOVE(&hp->lughead, usrp, lug_namehash); } - atomic_add_int(&nfsrv_usercnt, -1); + atomic_add_int(&NFSD_VNET(nfsrv_usercnt), -1); if (usrp->lug_cred != NULL) crfree(usrp->lug_cred); free(usrp, M_NFSUSERGROUP); @@ -4190,7 +4223,7 @@ nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser) * Free up all the allocations related to the name<-->id cache. * This function should only be called when the nfsuserd daemon isn't * running, since it doesn't do any locking. - * This function is meant to be used when the nfscommon module is unloaded. + * This function is meant to be called when a vnet jail is destroyed. */ void nfsrv_cleanusergroup(void) @@ -4199,11 +4232,11 @@ nfsrv_cleanusergroup(void) struct nfsusrgrp *nusrp, *usrp; int i; - if (nfsuserhash == NULL) + if (NFSD_VNET(nfsuserhash) == NULL) return; for (i = 0; i < nfsrv_lughashsize; i++) { - hp = &nfsuserhash[i]; + hp = &NFSD_VNET(nfsuserhash)[i]; TAILQ_FOREACH_SAFE(usrp, &hp->lughead, lug_numhash, nusrp) { TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); hp2 = NFSUSERNAMEHASH(usrp->lug_name, @@ -4213,7 +4246,7 @@ nfsrv_cleanusergroup(void) crfree(usrp->lug_cred); free(usrp, M_NFSUSERGROUP); } - hp = &nfsgrouphash[i]; + hp = &NFSD_VNET(nfsgrouphash)[i]; TAILQ_FOREACH_SAFE(usrp, &hp->lughead, lug_numhash, nusrp) { TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); hp2 = NFSGROUPNAMEHASH(usrp->lug_name, @@ -4223,16 +4256,16 @@ nfsrv_cleanusergroup(void) crfree(usrp->lug_cred); free(usrp, M_NFSUSERGROUP); } - mtx_destroy(&nfsuserhash[i].mtx); - mtx_destroy(&nfsusernamehash[i].mtx); - mtx_destroy(&nfsgroupnamehash[i].mtx); - mtx_destroy(&nfsgrouphash[i].mtx); + mtx_destroy(&NFSD_VNET(nfsuserhash)[i].mtx); + mtx_destroy(&NFSD_VNET(nfsusernamehash)[i].mtx); + mtx_destroy(&NFSD_VNET(nfsgroupnamehash)[i].mtx); + mtx_destroy(&NFSD_VNET(nfsgrouphash)[i].mtx); } - free(nfsuserhash, M_NFSUSERGROUP); - free(nfsusernamehash, M_NFSUSERGROUP); - free(nfsgrouphash, M_NFSUSERGROUP); - free(nfsgroupnamehash, M_NFSUSERGROUP); - free(nfsrv_dnsname, M_NFSSTRING); + free(NFSD_VNET(nfsuserhash), M_NFSUSERGROUP); + free(NFSD_VNET(nfsusernamehash), M_NFSUSERGROUP); + free(NFSD_VNET(nfsgrouphash), M_NFSUSERGROUP); + free(NFSD_VNET(nfsgroupnamehash), M_NFSUSERGROUP); + free(NFSD_VNET(nfsrv_dnsname), M_NFSSTRING); } /* From nobody Tue Feb 14 21:44:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGZV64htSz3q33G; Tue, 14 Feb 2023 21:44:14 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGZV648PQz47br; Tue, 14 Feb 2023 21:44:14 +0000 (UTC) (envelope-from rpokala@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676411054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uumGPxa4yPIoGShGj0vNuv+wZYz7mXJ+5eRWLUnHIug=; b=w/rRhvYb0RUL8RxOP2d6nKs/6P1pUhJyYjZpiYC2LH0nqb2/aiRnzKM9tegnLcleXrsmza kna8Ig+nqUxIvzB650MNwTCLlokTCjt09JcCKS+vuYplG2EHsLybq0Pb6njuZD/xd6XpsJ ste+akCcOVMdzNQQLnj1Kz6WCxN5dxDAwLx7QVPyCoZ201WuqVHGIx79KBy9kwjvu1LPkG bt38JpIpoyWS70f3wiZIA3X638vBuQkWBay4QFj9xvscUPeNUPdilN+ugdLaTjialxprT4 9C/6Tbyj9/EPBEjEjVRz3ak/cyC01daByK16oP8yis7qjSMis94Q46LvIt68Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676411054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uumGPxa4yPIoGShGj0vNuv+wZYz7mXJ+5eRWLUnHIug=; b=QNLWQfzWN9c6Ef1ZfJa7oDPxbwzh6WfmMv0ifeiMnThYQeIYJtaCAmG0tMwBZlJ2rP6HeA zpmJX+KaCRdW00jGmYpf6KMLWEN082Q3CtoSwRMNgIn1OFjXClu03/fTeeLcLKtPzkt+ko Gi373HE1bfo7/dS1LkgRkTNPWl2LF2cS5BH2xwH29OPJfhLqyXAiSCprXdYbl+QDx15Mvw GPqchl1EEa2mBWUy91GTOdNzOAwR8kzUojfmZp7mbApNvus3428y6G4TeRfa+w3udDdCpV kWEFB9kswz/3DYLTPDXe10/Y0cshjqq7XcsTspGiKRGSrJB5kwt+HXRi2T79HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676411054; a=rsa-sha256; cv=none; b=D5H9/JbsMzlDpCT24KIY2Kz+OGOX3NcZ4qL8svxK/Ha/uHx3xA44Xi+g8knh0HrLHCa0FN J7nsu7cLYGLlucg8R/oeGkvxFEl5j/mGCD0KpnRs/AdVDxV5uVI1clIUplFS80iFbGmZEC J6rgJPavCr6rNisoDj7GaPNQ6vx8PRPez0rxVhjLQSrkNscBqXVX8pf4lPTkkd3wLBUeT5 DdSOhMlMxRwBzmoTNUJWc+Kg4ufcFKSzqU7k+vmZa/lT5y9QdGJyHyNdCYr56Hs2jeJ6NP n4aehH2m6F7a5KP/Qby17Fjri1LOYf4eVSFq0Ix+L84wgSkJNVdgVloGA/g+Xw== Received: from [192.168.1.10] (unknown [98.42.164.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PGZV56fjtzmfb; Tue, 14 Feb 2023 21:44:13 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.69.23011802 Date: Tue, 14 Feb 2023 13:44:09 -0800 Subject: Re: e35448a901aa - main - powerpc: Drop old workaround for old gcc From: Ravi Pokala To: Warner Losh , , , Message-ID: <68E1F686-AB9F-4AC9-BBC5-0FE5F17041C0@panasas.com> Thread-Topic: e35448a901aa - main - powerpc: Drop old workaround for old gcc References: <202302141654.31EGsBtE057310@gitrepo.freebsd.org> In-Reply-To: <202302141654.31EGsBtE057310@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N > However, that causes problems > for programs that do: It feels like there was supposed to be an example there, but there isn't on= e...? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: > on behalf of Warner Losh > Date: 2023-02-14, Tuesday at 08:54 To: >, >, > Subject: git: e35448a901aa - main - powerpc: Drop old workaround for old gc= c The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3De35448a901aa56aa232efbc4fe7a73= a9bdac3511 commit e35448a901aa56aa232efbc4fe7a73a9bdac3511 Author: Warner Losh > AuthorDate: 2023-02-14 16:47:08 +0000 Commit: Warner Losh > CommitDate: 2023-02-14 16:47:08 +0000 powerpc: Drop old workaround for old gcc Very old versions of gcc defined _BIG_ENDIAN and _LITTLE_ENDIAN. So to work around that, we undefined them here. However, that causes problems for programs that do: (and many other variations on that theme). Since this often is the result of weirdly nested includes in the ports world that are hard to unwind, drop this workaround to help more ports build out of the box. If there's still an issue here (and my testing hasn't shown it), we'll fix the issue in a brand-new way once I have a reproducer. This fixes the mesa-devel build, and others Sponsored by: Netflix Tested by: pkubaj MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D38564 --- sys/powerpc/include/endian.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sys/powerpc/include/endian.h b/sys/powerpc/include/endian.h index 9e28237bfd24..0fac50361632 100644 --- a/sys/powerpc/include/endian.h +++ b/sys/powerpc/include/endian.h @@ -36,18 +36,6 @@ #define _MACHINE_ENDIAN_H_ #include - -/* - * GCC defines _BIG_ENDIAN and _LITTLE_ENDIAN equal to __BIG_ENDIAN__ - * and __LITTLE_ENDIAN__ (resp). - */ -#ifdef _BIG_ENDIAN -#undef _BIG_ENDIAN -#endif -#ifdef _LITTLE_ENDIAN -#undef _LITTLE_ENDIAN -#endif - #include #endif /* !_MACHINE_ENDIAN_H_ */ From nobody Tue Feb 14 21:54:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGZjy3wx6z3q3T7; Tue, 14 Feb 2023 21:54:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGZjy3NpJz4Bj3; Tue, 14 Feb 2023 21:54:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676411670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kOgXDxNkhz1c4XJVkhQYIqjmZkDgqmKVNbNZnu4F0qk=; b=nn7D+S2KBD5tXJHZVOgoWlf8VJk0p/UqQJ0FKrUu1NEMGj0HB9WIKlxEJKCKVhkUmwLOqw 2zxR1APX3TTh/RN9HTAS8Ga2nVK1nGGCaTPFGA4yvuUPzuaYMBhMzoSFaAsH7m1nOJHR5t uR5XUsy3tKwcVb8QmPYIOho0U68+1AnhaAJXorrMy0hSYzVFhbh5ImkQ5DrlwZwevN7BR7 kO37Imfqz19H58kgCYbDkYrHzh3tz4aeIXXrDs2skDHRs751WOvkhhEk2SnFvaqg0bhgDI ANW1Hc9PDTDXAuoOvHZlguNe6b2y0DtHu+8L/8t+n5fOJ8DOrvOX33DDMVnEJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676411670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kOgXDxNkhz1c4XJVkhQYIqjmZkDgqmKVNbNZnu4F0qk=; b=qaJUGZp7/K+kWYNBoWoY+OjHzRBRE2LFo9aTD8pFJ5TErqP0aG89xpsWOPzMcx1WbfjWvn hMQf1x7wG/XAHrcjX4YiO7d9pjlTVxGhBCEW7MV85gVyklkRPtYbU6dVSaM96M0HvUwF43 jQ1zvubGoLPrUE4oEOq5eGd8g03aMVoMgO32jjvcglK2JktNIM50kI3DWOI297iplE6YEf nMTKgFBg6MFQfQw6kRUX4S1QuTclYy9yUEcAaUQDbB9L5xwHnqy7x1IMILH1kMVCkDZfyv pguyyHd2AIXJaaXZMT4Sjd8QgKscTruZG02vOcox5s4Boc8IOE1zfPY493zcQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676411670; a=rsa-sha256; cv=none; b=jpaZxwrwqmLnFhm5hzqmVSKYohOOwEDQIJyuKx/XR06Pdh4MOLL/bCuzerx+3TC8Gzp1Tf vTrJlEk/8623P4ObL7Ofikd2P4uV448W6QBp5rwlpPGXmnfo8hfV9JE8hXUUyImmKjOey5 jfUZOIc39PY4FwPRsuE2kPhSI7jnZrIyFqcijV/4a6vjBE62fMeVw3mjrD1KulJUQq4E4/ fpYnp8M6wtHQBfo27bL9j8Fk5W4rijAUTGcFNdZo7gH/lsXjy3IcTMuMaV28UIpkse7okH oKNtouX0rLJrJ6mMRTIH3eIC9TgiGur9MHMhRcrEcUWRC6GFzhh8h31p18KZbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGZjy2Qy8z1Dqs; Tue, 14 Feb 2023 21:54:30 +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 31ELsUes088219; Tue, 14 Feb 2023 21:54:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31ELsU2p088218; Tue, 14 Feb 2023 21:54:30 GMT (envelope-from git) Date: Tue, 14 Feb 2023 21:54:30 GMT Message-Id: <202302142154.31ELsU2p088218@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: 364391a9bb5e - main - krpc: Remove VNET_NFSD #ifdefs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 364391a9bb5eb85af5f711a952ba40a4b1f768da Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=364391a9bb5eb85af5f711a952ba40a4b1f768da commit 364391a9bb5eb85af5f711a952ba40a4b1f768da Author: Rick Macklem AuthorDate: 2023-02-14 21:53:39 +0000 Commit: Rick Macklem CommitDate: 2023-02-14 21:53:39 +0000 krpc: Remove VNET_NFSD #ifdefs The consensus is that the VNET_NFSD kernel option is not needed, so this commit removes its use from the kernel RPC. MFC after: 3 months --- sys/rpc/svc_auth.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/rpc/svc_auth.c b/sys/rpc/svc_auth.c index a5c9753c4fde..22ce83f72bdb 100644 --- a/sys/rpc/svc_auth.c +++ b/sys/rpc/svc_auth.c @@ -198,12 +198,7 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp) cr->cr_uid = cr->cr_ruid = cr->cr_svuid = xprt->xp_uid; crsetgroups(cr, xprt->xp_ngrps, xprt->xp_gidp); cr->cr_rgid = cr->cr_svgid = xprt->xp_gidp[0]; -#ifdef VNET_NFSD - if (jailed(curthread->td_ucred)) - cr->cr_prison = curthread->td_ucred->cr_prison; - else -#endif - cr->cr_prison = &prison0; + cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp = cr; return (TRUE); @@ -216,12 +211,7 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp) cr->cr_uid = cr->cr_ruid = cr->cr_svuid = xcr->cr_uid; crsetgroups(cr, xcr->cr_ngroups, xcr->cr_groups); cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0]; -#ifdef VNET_NFSD - if (jailed(curthread->td_ucred)) - cr->cr_prison = curthread->td_ucred->cr_prison; - else -#endif - cr->cr_prison = &prison0; + cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp = cr; return (TRUE); From nobody Tue Feb 14 22:06:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGZzq3qyqz3q3v1; Tue, 14 Feb 2023 22:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGZzq3JM7z4DVJ; Tue, 14 Feb 2023 22:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlKsCxi4Wv+cu2AUApB/51RtdUwVbCqqbE8Er+Ggros=; b=kMn3qXwL+DcO16qjALHIq8//7A5lyVVZm61+PRMyCKWWVKAmw246x6Qumu+bg2c0rJ1Xdk 3hIA0LD95SBbsB5Carmi2c7hgy/90cmvzbKIy38AGcBhDffHR0lwB2YpkG12rVa+aKZNw9 1TrvvXsdOp0XNJjtz9X9pNJSBi/uacL4jwHR3jmJnq/hrMGHXX6apRYv+3Hcorb2XzGbEw onyd27YviBwp+6l94HQT2BRx5bv6Mge5OsCK+Ya3jZRm7g2U2E3BW2BmG7lgZpzTWdFdDj f91WIP+Q0tAkWDqoL9R/C8ynSUht5U3Amy3ZnCEN/fiHKRBktplIMyGXVudH2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlKsCxi4Wv+cu2AUApB/51RtdUwVbCqqbE8Er+Ggros=; b=IAM1AgIAVgSM+eIOduiI7PBKzd0e/T63PDNN8OjN5CEshA+ZCry/JilrtphQOiZBPQM89C FdwActvZ3B4bMt9lBV194DM8PTK2JZaYynruXgOV5ktQPl9CmYNou6cTfD9YykCU31yXq1 vEI3AO5aSgY9NPD23B/rJf4ml5kK57OfzlRsW3KErNfeoFVx1jHVFq2Sqjee5XxlRksOcQ 8SKC0WK0GB/JLAQqaOBN+yvNVtUjHZnM06XaDdGYEIGo+T1yVWOajkHABaqX3Fw/JaMD6s R6Y/yMKeit6PBXds2SU1oiqG2OS/mitluIOf2QyS9pOLRE5qv+V2fXYLXyPwCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676412391; a=rsa-sha256; cv=none; b=pCJoZEO0daHFuufvT18S5o+z6LjW17B/RY/rpf5yy0LBLk9O3STRaFUWQRFwQQCYH3VvA2 XeQ6XqY/WoWb1WY3n/OJd8GeNUBEOTYGR9QYftXZ3fRJfdmcz+XLUvMf+TbZsS8CUUo9UM E+Z7uVPuGiHxWLaTaOd3ylPHbOYnlmDLyeIGdFnSp+VchZ30spr+pYcfAo/m8kUb3S2z03 2J0EOo9Wr3lig8qeIoskXHfG3FvcyBFdWA0/eBP46yHuRJhqgCIBD4/bieKXV3zGVstD6i IhQNkpJt5+QlFf0wYpCCbs1BvhxRdskWXCEVvK5DZQfW3+qI2Jxu1/CfqJv8Uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGZzq2M7mz1FH9; Tue, 14 Feb 2023 22:06: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 31EM6Vmk004027; Tue, 14 Feb 2023 22:06:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EM6V9K004026; Tue, 14 Feb 2023 22:06:31 GMT (envelope-from git) Date: Tue, 14 Feb 2023 22:06:31 GMT Message-Id: <202302142206.31EM6V9K004026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 3102ea3b15b6 - main - linuxkpi: Accept NULL as a value in `linux_xarray` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3102ea3b15b6c3ed1ea50716d65980b680375ebc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3102ea3b15b6c3ed1ea50716d65980b680375ebc commit 3102ea3b15b6c3ed1ea50716d65980b680375ebc Author: Jean-Sébastien Pédron AuthorDate: 2023-02-11 10:12:08 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-14 22:01:02 +0000 linuxkpi: Accept NULL as a value in `linux_xarray` Linux' XArray allows to store a NULL pointer as a value. `xa_load()` would return NULL for both an unused index and an index set to NULL. But it impacts `xa_alloc()` which needs to find the next available index. However, our implementation relies on a radix tree (see `linux_radix.c`) which does not accept NULL pointers as values. I'm not sure if this is a limitation or a feature, so to work around this, a NULL value is replaced by `NULL_VALUE`, an unlikely address, when we pass it to linux_radix. Reviewed by: emaste, manu Approved by: emaste, manu Differential Revision: https://reviews.freebsd.org/D38543 --- sys/compat/linuxkpi/common/src/linux_xarray.c | 38 ++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_xarray.c b/sys/compat/linuxkpi/common/src/linux_xarray.c index a41784103852..e8a107fa6f27 100644 --- a/sys/compat/linuxkpi/common/src/linux_xarray.c +++ b/sys/compat/linuxkpi/common/src/linux_xarray.c @@ -31,6 +31,18 @@ __FBSDID("$FreeBSD$"); #include +/* + * Linux' XArray allows to store a NULL pointer as a value. xa_load() would + * return NULL for both an unused index and an index set to NULL. But it + * impacts xa_alloc() which needs to find the next available index. + * + * However, our implementation relies on a radix tree (see `linux_radix.c`) + * which does not accept NULL pointers as values. I'm not sure this is a + * limitation or a feature, so to work around this, a NULL value is replaced by + * `NULL_VALUE`, an unlikely address, when we pass it to linux_radix. + */ +#define NULL_VALUE (void *)0x1 + /* * This function removes the element at the given index and returns * the pointer to the removed element, if any. @@ -38,9 +50,15 @@ __FBSDID("$FreeBSD$"); void * __xa_erase(struct xarray *xa, uint32_t index) { + void *retval; + XA_ASSERT_LOCKED(xa); - return (radix_tree_delete(&xa->root, index)); + retval = radix_tree_delete(&xa->root, index); + if (retval == NULL_VALUE) + retval = NULL; + + return (retval); } void * @@ -68,6 +86,9 @@ xa_load(struct xarray *xa, uint32_t index) retval = radix_tree_lookup(&xa->root, index); xa_unlock(xa); + if (retval == NULL_VALUE) + retval = NULL; + return (retval); } @@ -109,6 +130,8 @@ __xa_alloc(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, gfp_t MPASS((mask & (mask + 1)) == 0); *pindex = (xa->flags & XA_FLAGS_ALLOC1) != 0 ? 1 : 0; + if (ptr == NULL) + ptr = NULL_VALUE; retry: retval = radix_tree_insert(&xa->root, *pindex, ptr); @@ -137,6 +160,9 @@ xa_alloc(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, gfp_t gf { int retval; + if (ptr == NULL) + ptr = NULL_VALUE; + xa_lock(xa); retval = __xa_alloc(xa, pindex, ptr, mask, gfp); xa_unlock(xa); @@ -166,6 +192,8 @@ __xa_alloc_cyclic(struct xarray *xa, uint32_t *pindex, void *ptr, uint32_t mask, MPASS((mask & (mask + 1)) == 0); *pnext_index = (xa->flags & XA_FLAGS_ALLOC1) != 0 ? 1 : 0; + if (ptr == NULL) + ptr = NULL_VALUE; retry: retval = radix_tree_insert(&xa->root, *pnext_index, ptr); @@ -220,6 +248,8 @@ __xa_insert(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) int retval; XA_ASSERT_LOCKED(xa); + if (ptr == NULL) + ptr = NULL_VALUE; retry: retval = radix_tree_insert(&xa->root, index, ptr); @@ -262,11 +292,15 @@ __xa_store(struct xarray *xa, uint32_t index, void *ptr, gfp_t gfp) int retval; XA_ASSERT_LOCKED(xa); + if (ptr == NULL) + ptr = NULL_VALUE; retry: retval = radix_tree_store(&xa->root, index, &ptr); switch (retval) { case 0: + if (ptr == NULL_VALUE) + ptr = NULL; break; case -ENOMEM: if (likely(gfp & M_WAITOK)) { @@ -374,6 +408,8 @@ __xa_next(struct xarray *xa, unsigned long *pindex, bool not_first) found = radix_tree_iter_find(&xa->root, &iter, &ppslot); if (likely(found)) { retval = *ppslot; + if (retval == NULL_VALUE) + retval = NULL; *pindex = iter.index; } else { retval = NULL; From nobody Tue Feb 14 22:06:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGZzr57Mxz3q40P; Tue, 14 Feb 2023 22:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGZzr4RBHz4DSN; Tue, 14 Feb 2023 22:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JzdLAphA6PEfR6ER0hG5gW5ciOp/Cf8/E2TuEswgKnE=; b=YFJoMUh7rPMbq1hJ+lM9tM2nuoidVEkDbVLoL1vpmn5E8W1XH9defm73qITSCgXuVkVbwZ BRFgm/CcCuEIqPQPy92Npraqz6e6e1uiIpmap2vbGSmjvYi2M6BxZs2GNZ+8V+ygHofAK7 L4jvcoBGyWkvTZIrJfwKWtejRWMMLOTSHFVXTtVOFUlpDoBWES1uBzB8cZmottsuojFhy0 daS3HZFokBg7cEucrbO6OiejExvHDKzK7qfuWrPdtXKpF10IXRMC0vi/HBFgDnYkIe2wUs gWejUGKPh6noVgg4Eh17OQJPyTEUIQcSC+Sn/AzoQILVDYd24N5LPOehjlGgXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JzdLAphA6PEfR6ER0hG5gW5ciOp/Cf8/E2TuEswgKnE=; b=vme6nHgaxPZ31Yvur2MQpcr2Ode3QfP3WsR6GXS9A8nMP54qWga9dCG0DjKeBrn3MW3l2H yYUR7GFll4zyQq49Mypr7+HQ2niKaulMHpLeDB2AWKI5OZXOVoCZtcdWJT81RKkiFfQTbw 1t1iafv8dQXjUngVQDG6utJltF8SWSQDy1J+T3Bsey81xoAxLselr53dJGG0p930UAfNsg 2Rg94xafM165BrzJnRPrmv93udxu5QH+0d8quJGni6C3ByfIEWfnMOXw45KvvKJppJgYgZ B78U2k/h3yQQ/XlNPhbUhUNtOz1kCmXPScFJ+WNYLG1yrS51/3bWJKySNllEcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676412392; a=rsa-sha256; cv=none; b=S8jz5K9TtegflUVQNT04dNQByeRINXlnWQTHD4eEZhG/9l25zTZcVbx89pQ6POtsv0Slre kCMZu7y3S4E7VsExU67WgABQBEt01my80OQAsy8ZBWl1+H0UCS1yNboBxsM47Ty1PnWd0h eGyvEBYfv+/kC4XhTlAJos+LzqODtNFalnJE2oyBVC5LkmEPBaFoUSof6uGAFrlGmKGRtS Y+YUjQMXFhX+tns0AFR7jY+9/COwQcHyYuXEEzO7r7BLydSPIYJXmbTrIB7fIwhYfPjAsE zOA0PFTuiD1p/BuLO84ZE/joum2myp4aR8aUQR9PWhdE4114F2AvkiJo/fP8cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGZzr3LDwz1FLL; Tue, 14 Feb 2023 22:06: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 31EM6W9o004056; Tue, 14 Feb 2023 22:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EM6WBA004055; Tue, 14 Feb 2023 22:06:32 GMT (envelope-from git) Date: Tue, 14 Feb 2023 22:06:32 GMT Message-Id: <202302142206.31EM6WBA004055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 53da54b936e6 - main - linuxkpi: Define `totalram_pages()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53da54b936e646ba1216c0cc19582dad058ca5d0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=53da54b936e646ba1216c0cc19582dad058ca5d0 commit 53da54b936e646ba1216c0cc19582dad058ca5d0 Author: Jean-Sébastien Pédron AuthorDate: 2023-02-08 17:52:43 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-14 22:01:06 +0000 linuxkpi: Define `totalram_pages()` It returns `physmem`. `__FreeBSD_version` is bumped to 1400080. We need that to remove a copy of this function in the i915 DRM driver, maintained outside of base. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38531 --- sys/compat/linuxkpi/common/include/linux/mm.h | 6 ++++++ sys/sys/param.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 2dcf32cbe84a..8dab5b9daa76 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -348,6 +348,12 @@ unlock_page(struct page *page) extern int is_vmalloc_addr(const void *addr); void si_meminfo(struct sysinfo *si); +static inline unsigned long +totalram_pages(void) +{ + return ((unsigned long)physmem); +} + #define unmap_mapping_range(...) lkpi_unmap_mapping_range(__VA_ARGS__) void lkpi_unmap_mapping_range(void *obj, loff_t const holebegin __unused, loff_t const holelen, int even_cows __unused); diff --git a/sys/sys/param.h b/sys/sys/param.h index b2c2b1a04b4b..751020f6d087 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 1400079 +#define __FreeBSD_version 1400080 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Tue Feb 14 22:06:33 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGZzs71srz3q47S; Tue, 14 Feb 2023 22:06: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 4PGZzs6S4Qz4Dkf; Tue, 14 Feb 2023 22:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=riXx+Qb5ztdqh2QkfnRgo7rcjMD1Tk1opJwu8tlxBx8=; b=DFf4RLK1+sUaKjDYFi/oNuW7YhkVJusVl8shrq1j0GO7ZqMjN83mKPRyH3SnA30f+NubEr C3L/xyrrVST3YQ1WIpCEwX7Ts9PqRFk9F258t3kLLAM+t6SsKltdOKs/f2it3BfREemU+B tsUnO4DxiTmQqB7zWtWs/YWa01Oxpj3OIehO2qIbacIqZmyISQW4AnIZ/9I98DGHGIWe4+ mGao+mFAmEvCGhlH+g6IhTf0g/162pqisn2JREp4qLIj/Fbwc3k7KcAFQQARMH6DHLHeQG g12KBe65PNaIrJ3lLQUk0QACJQN4TgSe32GeBl206l/MDEjR11escGlHRi3JFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=riXx+Qb5ztdqh2QkfnRgo7rcjMD1Tk1opJwu8tlxBx8=; b=ZppBi+ZRvBW3ku6mC6VFLyuGyObgEFlai9qpPGU4guU8n48RGOILuz1HSBNgJkmeLKcgHi CdYK6Gmnf/8qMB9ppuNWaPuGRa9ZidfjCurmMZyG9n36i3+JIEiIFoSmk6/4lWMNNKkCXv E3LwTelYwUFkcR8FbWHvUWq1sKenUDbK+9iTWQo1U0MSekZspn72I/sXHmnQ+0SjESX/Mo 8ZOVKF6UlabY+VP1yIH3ID13sXhkt5rS1HPRZyvxjvFSd3MhX9LvKdqvIdPZJk9fJXLX3k RkCXhzfhiteHSnvvUNFTtUSN9tTI6hG08Fp5r1vKyXmmQFBIdeKGQnHlyXIhGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676412393; a=rsa-sha256; cv=none; b=RrfuGUErnfwitq8Fi4RdekLmDU3u26M5XEV154QWWbXDH0ORKVGNp2eGi+LSI8IPwd5M4v WCZpIS58E3/wqcCK52IsqAlsQ6qq4UmNJp5Dov8hY83Yvh9O52vhlhcZMQoelOpkedrg6g jyp8bE6uyiE1o8tQKzxaRXfNlgSHTnhZ/TRb9Cvwt+i6VVJRqwrOrEkVrhP+PhBBYY6qb1 xICdHjK1N7kUCyuSUx1nTwpt8JS1NYWfzUAvg6UNFtbUny2VOzYQVponPpZXaUr7rDmKdQ VqzZeFnfw0yhujWWtwWpfld/u9R/KubCEfquLq7trN9PwGmfd1m3Soxx1ADMNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGZzs4J1fz1FbZ; Tue, 14 Feb 2023 22:06: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 31EM6Xdh004085; Tue, 14 Feb 2023 22:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EM6XPx004084; Tue, 14 Feb 2023 22:06:33 GMT (envelope-from git) Date: Tue, 14 Feb 2023 22:06:33 GMT Message-Id: <202302142206.31EM6XPx004084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 836367272917 - main - linuxkpi: Add `synchronize_shrinkers()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83636727291714c235726da987a02c5b1d51bb54 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=83636727291714c235726da987a02c5b1d51bb54 commit 83636727291714c235726da987a02c5b1d51bb54 Author: Jean-Sébastien Pédron AuthorDate: 2023-02-13 20:49:28 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-14 22:01:06 +0000 linuxkpi: Add `synchronize_shrinkers()` It takes the lock and release it immediately to make sure no shrinkers are running in parallel. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38565 --- sys/compat/linuxkpi/common/include/linux/shrinker.h | 2 ++ sys/compat/linuxkpi/common/src/linux_shrinker.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/shrinker.h b/sys/compat/linuxkpi/common/include/linux/shrinker.h index 39ea35f0a862..04e96a12c4bd 100644 --- a/sys/compat/linuxkpi/common/include/linux/shrinker.h +++ b/sys/compat/linuxkpi/common/include/linux/shrinker.h @@ -51,8 +51,10 @@ struct shrinker { int linuxkpi_register_shrinker(struct shrinker *s); void linuxkpi_unregister_shrinker(struct shrinker *s); +void linuxkpi_synchronize_shrinkers(void); #define register_shrinker(s) linuxkpi_register_shrinker(s) #define unregister_shrinker(s) linuxkpi_unregister_shrinker(s) +#define synchronize_shrinkers() linuxkpi_synchronize_shrinkers() #endif /* _LINUXKPI_LINUX_SHRINKER_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_shrinker.c b/sys/compat/linuxkpi/common/src/linux_shrinker.c index b48e491a4e2f..227ef3261cb3 100644 --- a/sys/compat/linuxkpi/common/src/linux_shrinker.c +++ b/sys/compat/linuxkpi/common/src/linux_shrinker.c @@ -64,6 +64,14 @@ linuxkpi_unregister_shrinker(struct shrinker *s) sx_xunlock(&sx_shrinker); } +void +linuxkpi_synchronize_shrinkers(void) +{ + + sx_xlock(&sx_shrinker); + sx_xunlock(&sx_shrinker); +} + #define SHRINKER_BATCH 512 static void From nobody Tue Feb 14 22:06:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGZzt6cqgz3q452; Tue, 14 Feb 2023 22:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGZzt6BNrz4Dmk; Tue, 14 Feb 2023 22:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SlUtMmGnJPoKhg7NXJHbwkZANEXJlLxyKLOm+7UVHXM=; b=vygpMQDgCaWIbs/0hVT3CjNN3mIHwwS1ssrGrkeYpoyoV1+5nlELebREvnq2KDJ5f2AsMn B4/NRUgCxt3G1ZLPKtrWzHjzeIS/2mFSPRSJHe8n3PHibnJaO76mGvaYHt2RimCQfmNqRa ubgzXDJguGxNZoed3Om4y4FXqtC7GB8jt7LDw09MseFPY5E8Cm+W/GYplCVQBG7g54DC0I SQiLglznBgwnSSLTGPVywHl+KooeZ3jOvB3SL7cAAt2B4u3cYVK1CSXNGZ9Y+jdiroSr1F dbyjpfoaIqqLc8znSsbLQqaQ9C41O5Npwly43X3DVQeToK9zXehib/WCGrJo8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SlUtMmGnJPoKhg7NXJHbwkZANEXJlLxyKLOm+7UVHXM=; b=HE95wZMyNCuS2M8P4LwPLHBPsaJgAvjaiFMRFJukVrYMyYUa5TtblUhIuHX8GGiel8oP9b UuHs/FFnSS8PblYScuV2FDRtBTmAknV7ntgBT4F79eflMu9I9vxX9O0IFzWU6auD4Odqi0 LOE0+Vtj/LgfLP+t1H0wW//wq8DWodK1G1qGQJYdj9KBON5CGyT3xEJyMa7LD595XilYFU U8XCbYkhTLWAGIQa8GRYqDbkum8n3Jju934dgjaMXL/q7lzJE7zJjntP3XKML4SUJEzFLC oM1rYn0Ubx8qsno9IQUEGiwIS2Kr7bA+waHcnzPXn05Wq1KDb8jfpskAPxqhZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676412394; a=rsa-sha256; cv=none; b=IfY9iLcETLeSA/UAf7kCRmddFfIbeq+/txEIAPDEJNaV2kohQyrx3EzqzW4w1w8GdpkQVV KvxTxgGlcrsqaMxaEUSJduEes1YbpfO33pLwoWxRDMV/5BsieaNK2pbbI2vjRrzv4Mfdws s+pKi09UGHgT5M8GVSd1gb4pzYFGIg6PXdpK7yAWUTdUzA9ub4JQsHvfZLzWH8N+JEzWOq Q2GU6M3sLIXRPqvKEIU3TID9yb5LyScMV1R3NhV+vFReHiCy/QfNKtJtzu6RIHoFhHSwGc SH3bZh+92ZLwhHV70TE5pQfxVcG9WM2CpTH8S0BTNfngAMUrwRj2TJoO8A2sKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGZzt5GNbz1F3Z; Tue, 14 Feb 2023 22:06: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 31EM6YYt004114; Tue, 14 Feb 2023 22:06:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EM6Yi5004113; Tue, 14 Feb 2023 22:06:34 GMT (envelope-from git) Date: Tue, 14 Feb 2023 22:06:34 GMT Message-Id: <202302142206.31EM6Yi5004113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 7d03acf065ed - main - linuxkpi: Declare `struct fwnode_handle` in List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d03acf065ed96fd04a54bf8e1c83a032ffed097 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7d03acf065ed96fd04a54bf8e1c83a032ffed097 commit 7d03acf065ed96fd04a54bf8e1c83a032ffed097 Author: Jean-Sébastien Pédron AuthorDate: 2023-02-13 20:51:00 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-14 22:01:06 +0000 linuxkpi: Declare `struct fwnode_handle` in Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38566 --- sys/compat/linuxkpi/common/include/linux/device.h | 2 +- sys/compat/linuxkpi/common/include/linux/fwnode.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 32dc7a30769c..18f2eef895c0 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -48,13 +48,13 @@ #include #include #include /* via linux/dev_printk.h */ +#include #include #include #include struct device; -struct fwnode_handle; struct class { const char *name; diff --git a/sys/compat/linuxkpi/common/include/linux/fwnode.h b/sys/compat/linuxkpi/common/include/linux/fwnode.h new file mode 100644 index 000000000000..a1fbc1b6d6a3 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/fwnode.h @@ -0,0 +1,10 @@ +/* Public domain. */ + +#ifndef _LINUXKPI_LINUX_FWNODE_H_ +#define _LINUXKPI_LINUX_FWNODE_H_ + +struct fwnode_handle { + struct fwnode_handle *secondary; +}; + +#endif /* _LINUXKPI_LINUX_FWNODE_H_ */ From nobody Tue Feb 14 22:06:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGZzw0L5Wz3q4DJ; Tue, 14 Feb 2023 22:06:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGZzv6lzmz4DnB; Tue, 14 Feb 2023 22:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/CSztGl3XMUZeZA8h9YEF+GLHsSi0jJH284pZ+S4K9c=; b=usflIlWEjOv+d/VK7XDTlguCDTl3ATzMx/83Xsx/LgRuKT7lsrMeTTrRzpTI9iJMzxnxw6 SkQN6cUxh5PFjnMwdrTrxpd8mSgnKuVXedTrNesYvpryd7LtcEMRP5NucUXSY1mw8947CJ xFSikTgTFQMZfIajdKo7y6A6D24skZZW+ph6zJ8OyOWEXTIL7Twch4q0IYP1bs7i9EsQTj isfT8pD/Vtashyczzs1YmSqj3T5/H96fZjasCgMkSFXCphCeeb6BD/hH22lg+SwvFJOcJX Q8GiPwXVXHWRxhecIToOR/tJx8mwIEMLU+9o8CmG9h3Yy7CoaSRF4etQUeS35g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/CSztGl3XMUZeZA8h9YEF+GLHsSi0jJH284pZ+S4K9c=; b=XDaXgdBOWbuXV6zjmPlfcfM3LvD28cOdOubVQVQhwVLw5pknHJPlMD/a+NkmjBGXu5IBfV 8oA4nBrne9Vk89ECnbigrNAG5t/+RalBbuqmVyBXnYi0RWsyDiDGsYKTtLFOyd05IEBpM8 Bj4067Nli68x5i0Iuu/RszLeWeuwt06tM/hCyhq7uiuGHiw5/SbvrDtCVFE8/kjk58i0Uy EWrt5kRXGzVxcn9mlkNgJC+RXTe68oO69LG4M01YckX4cXUd78m2AfOFJlOe0Y/5XvrE3V NwSSP/YV8OW3Zv+8fUun7ffec/aE2cbRn1gG2BuSoXiLD3V3p1CzAwJuVuN/aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676412396; a=rsa-sha256; cv=none; b=tOZez/NBjeD01VqTPGipZJHrKqaTtWpwU21P/HGUCJfwpU0HMoyqYXKQJNZjE/DUnmCCuz 7tjbIZHnL5HVapXo+e0B+hxJTaAMCoH7vlIiGCtxr9Iv6laZmAEAccb4NwuA6YSHHyM1xV aKoMX3hfaKbCbYtS/FeSn+vA9eFL6UjYcOXUC+c65+PSsP9nvP4meDt1que+gnN9geubJe jCgK7Zk/JZT3nKCtMs1zFH3PJcnVoEXD6Lt67LUzch3FjGBMZ72APFMt6gOxVylAsRekeU paoA2j6XhoEXX1ZIEeWoiFhX6fXrclpjXGdro4+SQb03hafbNqsDcKv50TGwrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGZzv5t9fz1FYG; Tue, 14 Feb 2023 22:06: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 31EM6Z4d004146; Tue, 14 Feb 2023 22:06:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EM6ZLw004145; Tue, 14 Feb 2023 22:06:35 GMT (envelope-from git) Date: Tue, 14 Feb 2023 22:06:35 GMT Message-Id: <202302142206.31EM6ZLw004145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: e6f7fe74a903 - main - linuxkpi: Update `ww_mutex_trylock()` API for Linux 5.16 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6f7fe74a903b4085d60b0054ff75ee677beaf76 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e6f7fe74a903b4085d60b0054ff75ee677beaf76 commit e6f7fe74a903b4085d60b0054ff75ee677beaf76 Author: Jean-Sébastien Pédron AuthorDate: 2023-02-13 22:22:54 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-14 22:01:07 +0000 linuxkpi: Update `ww_mutex_trylock()` API for Linux 5.16 It gains new `struct ww_acquire_ctx *` argument we don't use currently. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38568 --- sys/compat/linuxkpi/common/include/linux/ww_mutex.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/ww_mutex.h b/sys/compat/linuxkpi/common/include/linux/ww_mutex.h index d0dd7cd52601..651b39a45b15 100644 --- a/sys/compat/linuxkpi/common/include/linux/ww_mutex.h +++ b/sys/compat/linuxkpi/common/include/linux/ww_mutex.h @@ -72,8 +72,13 @@ struct ww_mutex { #define ww_mutex_lock_slow_interruptible(_m, _x) \ ww_mutex_lock_interruptible(_m, _x) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51600 +static inline int __must_check +ww_mutex_trylock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx __unused) +#else static inline int __must_check ww_mutex_trylock(struct ww_mutex *lock) +#endif { return (mutex_trylock(&lock->base)); } From nobody Tue Feb 14 22:09:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGb2l562fz3q4G8; Tue, 14 Feb 2023 22:09: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 4PGb2l4g4nz4GNm; Tue, 14 Feb 2023 22:09:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v8myQ58JeShgI95arDfzJzUSkTT4LkR2+e+DhXyiIn4=; b=shO2tKlOzl8kOmW6il3RHq75vixJ9TpjuRGN0Etk1E8oTVjJWA++YksXYtYb/yyGnxjvPf FYuBmMlpeFZXdj1HfK7Kc9SI1q7SH1GCSvDkNgvYb3eIrAR85R2Ei3yrekhB47ztf9z1AL 7+uXbbPwnOSl5w7b8z9LX1zMb5IwzrmOgx7hCUYEdtF4KpTGMLDJQDYu3rXXEo3tIO4zKz /+FawLxmImpBToSw92vmaaCvCqDJeXMn+4rgbtWs9/efkHgOKFDpum7f5Qgu4W8X6/bOVg honFyq7mVxP/6zHJ6ptAeoORShY7k/+uWyBbabp2ZzOa2iJDW0e1W+I4dathGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676412543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v8myQ58JeShgI95arDfzJzUSkTT4LkR2+e+DhXyiIn4=; b=IZwHtKB8fg41B9V2Gf68CxrUW+AhJkGhY0Skjbt/Aock2b2kbt/ZU88rHv046OsHtsNBWZ sXspAOoMi6lkxAFicK97f/LuwI+YyhLojPo/IzBF6BuJWlp/MjFl9dhmgfHefrG7oexa+3 9AFtvooD+kQ/UZXit+sWh3VTag80dq2zetx3RWvaehfm1do9yDrXz6WWayAlEx+gyycwME yDOdAhZm6VFLS+cLloDhnA8IDDjfYX5kTRu0d12qn7Ze5ECvrV+ZxDV15eAMkyYVAaE0qd EMApsQDZEBUhLpDC8qnXTevVPQqkn45nJmXik1l0Z4dIVxxgJUjf/HDgcj69nA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676412543; a=rsa-sha256; cv=none; b=VYAdjVOR8q4SBxdFpE3JaqL6ht9LPhgV2tBeaO2KgfbBvfDur+E8quPiP/N8PDeFJ27Zku m1tlFvA6PL5uXQ5RfCaGTqSfR8l2LjVQmovIpcD99aaN/7iYLoXsBRlRAWho9IF1tHotAg BQUEdaFQMFaKBaIJh9H4XdXXhcAtVH6VSTps0aq68Mf9kI4lKqFVMErsjIc2oe6rrM+3Nm biWwXx3AEaV+6nHVN/zD5KrvAPdKUGwU/XzVrrPL16CeirFKfDthINaSExTqXk0o6ZUIon ++PElbmtq2ho6+MiiT8wj1oKD93CyPS8OQ7CuG47eiHxApH+JfYJ8wIOrlNVaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGb2l3hlsz1FVp; Tue, 14 Feb 2023 22:09: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 31EM93Qs004571; Tue, 14 Feb 2023 22:09:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EM93RW004570; Tue, 14 Feb 2023 22:09:03 GMT (envelope-from git) Date: Tue, 14 Feb 2023 22:09:03 GMT Message-Id: <202302142209.31EM93RW004570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 96e16cf368f6 - main - linuxkpi: Add List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96e16cf368f6d8aa3c0efd44db4c4678892e1fea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=96e16cf368f6d8aa3c0efd44db4c4678892e1fea commit 96e16cf368f6d8aa3c0efd44db4c4678892e1fea Author: Jean-Sébastien Pédron AuthorDate: 2023-02-14 21:44:21 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-14 22:07:19 +0000 linuxkpi: Add It defines the `cc_platform_has()` function. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38596 --- sys/compat/linuxkpi/common/include/linux/cc_platform.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/cc_platform.h b/sys/compat/linuxkpi/common/include/linux/cc_platform.h new file mode 100644 index 000000000000..727dbc98dab2 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/cc_platform.h @@ -0,0 +1,17 @@ +/* Public domain. */ + +#ifndef _LINUXKPI_LINUX_CC_PLATFORM_H_ +#define _LINUXKPI_LINUX_CC_PLATFORM_H_ + +enum cc_attr { + CC_ATTR_MEM_ENCRYPT, +}; + +static inline bool +cc_platform_has(enum cc_attr attr __unused) +{ + + return (false); +} + +#endif /* _LINUXKPI_LINUX_CC_PLATFORM_H_ */ From nobody Tue Feb 14 22:26:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGbRR5KHWz3q4tr; Tue, 14 Feb 2023 22:26: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 4PGbRR4MPqz4Jf8; Tue, 14 Feb 2023 22:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676413619; h=from:from:reply-to:subject:subject: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+LtCgJxIgKf1ars98XWEW5ipz2d4kh3qZxVOyc+gds=; b=QucEDhiDvW+NqO6PMREkeSUIRRiuJhnYUgUSi27pOSEtDEZialwqtFZJweG52rqLMnFvbT MKQ4eccsEhSVvaHg66hB88gR6qFZ8cGxsP1wRWQofCcpczERJ6eroW7KIUs7MPkI82665M eq30VBihJk881rHupSA+qR5QFMddAIFcx/JtQ/w3hi3IqfqUcbgo9Rx+P86jsd23ow+Dof 72QGGv74hDDGXKipWzG4R/RN+6cIRRj7Zl5BgQqHPXd+cgOXKrbXR4JAod3xqV4yaVJYRC IRyrWiEOYYWlJybva+HTJ7cQPck2e5plGXr8LjezMPFVSNvhZZHh45/smBW3xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676413619; h=from:from:reply-to:subject:subject: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+LtCgJxIgKf1ars98XWEW5ipz2d4kh3qZxVOyc+gds=; b=l3GCQC7lD60mSjXxVB8KKI91Yuv/agMdVR9y2ISF0ObA/k6gXnrMHjwBePlORdfc2ArFYM yJlBiiB5Dh3Cj9jkUqIetz1w4xXSU431vUiAY7tdNAJed1FuC0eQjyAZaocM83u4wahLzm FkEPF3zNjnKxpF0+Uq/rS1z+4ewWRN8rlDkEGxc9dQbgt3VQsW5N+W2DdBBTHByc0iM2uU s2K4RiljHCtpKlNzyQ+gXNZnCyxA4dN8MepYK0VW9joUCWfab4BrtcB2Zg/WzVZ5RbMuF1 r7G++XXrs6b+hdMcWfAiWofrCBkPUP1L5MVp55jU3fTW4GAsHIBz4CAWeJ4R0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676413619; a=rsa-sha256; cv=none; b=tPl3bJxg5ochErWQ0/cLLpdYFfTIqn4RzqW/Gap/wOcc4mb+kJttlLi0FpVusKAmoXt/6D jaNBpqW8Z9n11BIDqdlUlrwl1SoQ8SU2JL55GzFz202XUiYDp6HPw8ceIIAUGGBOJaimR9 JDd+G0YaTSoRo9vFOFnHrTQAY1XX1f9PYam+/n2uEWe8aHsgLeZsLeArBWYZlIgYcI1p7n I5PaTwlGNiDql+VL9ssvyfwi7vPmC0WBrEnWhAiq3K3Xe2UAbqcOh7i86qV0kw/ku8tK1/ ZgqEbqLleFNLevUfXkjjdjERbnaFWzeoGuce2AYupJ6Cne3ETsbhzZFyauORBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGbRR3Jkjz1G1S; Tue, 14 Feb 2023 22:26: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 31EMQxOo032422; Tue, 14 Feb 2023 22:26:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EMQxfJ032421; Tue, 14 Feb 2023 22:26:59 GMT (envelope-from git) Date: Tue, 14 Feb 2023 22:26:59 GMT Message-Id: <202302142226.31EMQxfJ032421@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: dad64f0e7cad - main - wc: Clean up and modernize. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dad64f0e7cadb5913d6463fc014f59f8706d316c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=dad64f0e7cadb5913d6463fc014f59f8706d316c commit dad64f0e7cadb5913d6463fc014f59f8706d316c Author: Dag-Erling Smørgrav AuthorDate: 2023-02-14 22:26:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-14 22:26:47 +0000 wc: Clean up and modernize. * Drop , which is unnecessary since we use libxo. * As per POSIX, report an error if output fails. * Fix some type mismatches. * Use bool instead of int where appropriate. * Avoid repeatedly checking for a null filename. * Miscellaneous other tidying. * Add tests (partly derived from work performed by SHENG-YI HONG ). Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D38496 --- etc/mtree/BSD.tests.dist | 2 + usr.bin/wc/Makefile | 3 + usr.bin/wc/tests/Makefile | 8 ++ usr.bin/wc/tests/wc_test.sh | 197 ++++++++++++++++++++++++++++++++++++++++++++ usr.bin/wc/wc.c | 142 ++++++++++++++++--------------- 5 files changed, 279 insertions(+), 73 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 910db16f0d15..859b5c5ace7f 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1120,6 +1120,8 @@ .. vmstat .. + wc + .. xargs .. xinstall diff --git a/usr.bin/wc/Makefile b/usr.bin/wc/Makefile index 550b718e1478..060c67193e00 100644 --- a/usr.bin/wc/Makefile +++ b/usr.bin/wc/Makefile @@ -12,4 +12,7 @@ LIBADD+= cap_fileargs CFLAGS+=-DWITH_CASPER .endif +HAS_TESTS= +SUBDIR.${MK_TESTS}= tests + .include diff --git a/usr.bin/wc/tests/Makefile b/usr.bin/wc/tests/Makefile new file mode 100644 index 000000000000..81e6c4246544 --- /dev/null +++ b/usr.bin/wc/tests/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH= wc_test +BINDIR= ${TESTSDIR} + +.include diff --git a/usr.bin/wc/tests/wc_test.sh b/usr.bin/wc/tests/wc_test.sh new file mode 100755 index 000000000000..574f2daacaca --- /dev/null +++ b/usr.bin/wc/tests/wc_test.sh @@ -0,0 +1,197 @@ +# +# Copyright (c) 2023 Klara, Inc. +# +# SPDX-License-Identifier: BSD-2-Clause +# + +# +# These tests need to run in a multibyte locale with non-localized +# error messages. +# +export LC_CTYPE=C.UTF-8 +export LC_MESSAGES=C + +# +# Sample text containing multibyte characters +# +tv="Der bode en underlig gråsprængt en +på den yderste nøgne ø; – +han gjorde visst intet menneske mén +hverken på land eller sjø; +dog stundom gnistred hans øjne stygt, – +helst mod uroligt vejr, – +og da mente folk, at han var forrykt, +og da var der få, som uden frykt +kom Terje Vigen nær. +" +tvl=10 +tvw=55 +tvc=300 +tvm=283 +tvcL=42 +tvmL=39 + +# +# Run a series of tests using the same input file. The first argument +# is the name of the file. The next three are the expected line, +# word, and byte counts. The optional fifth is the expected character +# count; if not provided, it is expected to be identical to the byte +# count. +# +atf_check_wc() { + local file="$1" + local l="$2" + local w="$3" + local c="$4" + local m="${5-$4}" + + atf_check -o match:"^ +${l} +${w} +${c}\$" wc <"${file}" + atf_check -o match:"^ +${l}\$" wc -l <"${file}" + atf_check -o match:"^ +${w}\$" wc -w <"${file}" + atf_check -o match:"^ +${c}\$" wc -c <"${file}" + atf_check -o match:"^ +${m}\$" wc -m <"${file}" + atf_check -o match:"^ +${l} +${w} +${c} ${file}\$" wc "$file" + atf_check -o match:"^ +${l} ${file}\$" wc -l "$file" + atf_check -o match:"^ +${w} ${file}\$" wc -w "$file" + atf_check -o match:"^ +${c} ${file}\$" wc -c "$file" + atf_check -o match:"^ +${m} ${file}\$" wc -m "$file" +} + +atf_test_case basic +basic_head() +{ + atf_set "descr" "Basic test case" +} +basic_body() +{ + printf "a b\n" >foo + atf_check_wc foo 1 2 4 +} + +atf_test_case blank +blank_head() +{ + atf_set "descr" "Input containing only blank lines" +} +blank_body() +{ + printf "\n\n\n" >foo + atf_check_wc foo 3 0 3 +} + +atf_test_case empty +empty_head() +{ + atf_set "descr" "Empty input" +} +empty_body() +{ + printf "" >foo + atf_check_wc foo 0 0 0 +} + +atf_test_case invalid +invalid_head() +{ + atf_set "descr" "Invalid multibyte input" +} +invalid_body() +{ + printf "a\377b\n" >foo + atf_check \ + -e match:"Illegal byte sequence" \ + -o match:"^ +4 foo$" \ + wc -m foo +} + +atf_test_case multiline +multiline_head() +{ + atf_set "descr" "Multiline, multibyte input" +} +multiline_body() +{ + printf "%s\n" "$tv" >foo + atf_check_wc foo $tvl $tvw $tvc $tvm + # longest line in bytes + atf_check -o match:"^ +$tvc +$tvcL foo" wc -cL foo + atf_check -o match:"^ +$tvc +$tvcL" wc -cL foo + atf_check_wc foo $((tvl*c)) $((tvw*c)) $((tvc*c)) $((tvm*c)) +} + +atf_test_case total +total_head() +{ + atf_set "descr" "Multiple inputs" +} +total_body() +{ + printf "%s\n" "$tv" >foo + printf "%s\n" "$tv" >bar + atf_check \ + -o match:"^ +$((tvl*2)) +$((tvw*2)) +$((tvc*2)) total$" \ + wc foo bar +} + +atf_test_case unterminated +unterminated_head() +{ + atf_set "descr" "Input not ending in newline" +} +unterminated_body() +{ + printf "a b" >foo + atf_check_wc foo 0 2 3 +} + +atf_test_case usage +usage_head() +{ + atf_set "descr" "Trigger usage message" +} +usage_body() +{ + atf_check -s exit:1 -e match:"usage: wc" wc -\? +} + +atf_test_case whitespace +whitespace_head() +{ + atf_set "descr" "Input containing only whitespace and newlines" +} +whitespace_body() +{ + printf "\n \n\t\n" >foo + atf_check_wc foo 3 0 5 +} + +atf_init_test_cases() +{ + atf_add_test_case basic + atf_add_test_case blank + atf_add_test_case empty + atf_add_test_case invalid + atf_add_test_case multiline + atf_add_test_case multiline_repeated + atf_add_test_case total + atf_add_test_case unterminated + atf_add_test_case usage + atf_add_test_case whitespace +} diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c index a12c13a3e36d..9c129917dd04 100644 --- a/usr.bin/wc/wc.c +++ b/usr.bin/wc/wc.c @@ -50,10 +50,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include +#include #include #include #include @@ -66,9 +66,11 @@ __FBSDID("$FreeBSD$"); #include #include +static const char *stdin_filename = "stdin"; + static fileargs_t *fa; static uintmax_t tlinect, twordct, tcharct, tlongline; -static int doline, doword, dochar, domulti, dolongline; +static bool doline, doword, dochar, domulti, dolongline; static volatile sig_atomic_t siginfo; static xo_handle_t *stderr_handle; @@ -102,26 +104,26 @@ main(int argc, char *argv[]) argc = xo_parse_args(argc, argv); if (argc < 0) - return (argc); + exit(EXIT_FAILURE); while ((ch = getopt(argc, argv, "clmwL")) != -1) switch((char)ch) { case 'l': - doline = 1; + doline = true; break; case 'w': - doword = 1; + doword = true; break; case 'c': - dochar = 1; - domulti = 0; + dochar = true; + domulti = false; break; case 'L': - dolongline = 1; + dolongline = true; break; case 'm': - domulti = 1; - dochar = 0; + domulti = true; + dochar = false; break; case '?': default: @@ -134,27 +136,17 @@ main(int argc, char *argv[]) fa = fileargs_init(argc, argv, O_RDONLY, 0, cap_rights_init(&rights, CAP_READ, CAP_FSTAT), FA_OPEN); - if (fa == NULL) { - xo_warn("Unable to init casper"); - exit(1); - } - + if (fa == NULL) + xo_err(EXIT_FAILURE, "Unable to initialize casper"); caph_cache_catpages(); - if (caph_limit_stdio() < 0) { - xo_warn("Unable to limit stdio"); - fileargs_free(fa); - exit(1); - } - - if (caph_enter_casper() < 0) { - xo_warn("Unable to enter capability mode"); - fileargs_free(fa); - exit(1); - } + if (caph_limit_stdio() < 0) + xo_err(EXIT_FAILURE, "Unable to limit stdio"); + if (caph_enter_casper() < 0) + xo_err(EXIT_FAILURE, "Unable to enter capability mode"); /* Wc's flags are on by default. */ - if (doline + doword + dochar + domulti + dolongline == 0) - doline = doword = dochar = 1; + if (!(doline || doword || dochar || domulti || dolongline)) + doline = doword = dochar = true; stderr_handle = xo_create_to_file(stderr, XO_STYLE_TEXT, 0); xo_open_container("wc"); @@ -162,19 +154,19 @@ main(int argc, char *argv[]) errors = 0; total = 0; - if (!*argv) { - xo_open_instance("file"); - if (cnt((char *)NULL) != 0) + if (argc == 0) { + xo_open_instance("file"); + if (cnt(NULL) != 0) ++errors; - xo_close_instance("file"); + xo_close_instance("file"); } else { - do { - xo_open_instance("file"); - if (cnt(*argv) != 0) + while (argc--) { + xo_open_instance("file"); + if (cnt(*argv++) != 0) ++errors; - xo_close_instance("file"); + xo_close_instance("file"); ++total; - } while(*++argv); + } } xo_close_list("file"); @@ -187,8 +179,9 @@ main(int argc, char *argv[]) fileargs_free(fa); xo_close_container("wc"); - xo_finish(); - exit(errors == 0 ? 0 : 1); + if (xo_finish() < 0) + xo_err(EXIT_FAILURE, "stdout"); + exit(errors == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } static void @@ -212,7 +205,7 @@ show_cnt(const char *file, uintmax_t linect, uintmax_t wordct, xo_emit_h(xop, " {:characters/%7ju/%ju}", charct); if (dolongline) xo_emit_h(xop, " {:long-lines/%7ju/%ju}", llct); - if (file != NULL) + if (file != stdin_filename) xo_emit_h(xop, " {:filename/%s}\n", file); else xo_emit_h(xop, "\n"); @@ -221,20 +214,21 @@ show_cnt(const char *file, uintmax_t linect, uintmax_t wordct, static int cnt(const char *file) { + char buf[MAXBSIZE], *p; struct stat sb; + mbstate_t mbs; uintmax_t linect, wordct, charct, llct, tmpll; - int fd, len, warned; + ssize_t len; size_t clen; - short gotsp; - u_char *p; - u_char buf[MAXBSIZE]; + int fd; wchar_t wch; - mbstate_t mbs; + bool gotsp, warned; linect = wordct = charct = llct = tmpll = 0; - if (file == NULL) + if (file == NULL) { fd = STDIN_FILENO; - else if ((fd = fileargs_open(fa, file)) < 0) { + file = stdin_filename; + } else if ((fd = fileargs_open(fa, file)) < 0) { xo_warn("%s: open", file); return (1); } @@ -246,7 +240,7 @@ cnt(const char *file) */ if (doline == 0 && dolongline == 0) { if (fstat(fd, &sb)) { - xo_warn("%s: fstat", file != NULL ? file : "stdin"); + xo_warn("%s: fstat", file); (void)close(fd); return (1); } @@ -265,9 +259,9 @@ cnt(const char *file) * lines than to get words, since the word count requires locale * handling. */ - while ((len = read(fd, buf, MAXBSIZE))) { - if (len == -1) { - xo_warn("%s: read", file != NULL ? file : "stdin"); + while ((len = read(fd, buf, sizeof(buf)))) { + if (len < 0) { + xo_warn("%s: read", file); (void)close(fd); return (1); } @@ -275,14 +269,16 @@ cnt(const char *file) show_cnt(file, linect, wordct, charct, llct); charct += len; if (doline || dolongline) { - for (p = buf; len--; ++p) + for (p = buf; len > 0; --len, ++p) { if (*p == '\n') { if (tmpll > llct) llct = tmpll; tmpll = 0; ++linect; - } else + } else { tmpll++; + } + } } } reset_siginfo(); @@ -297,12 +293,12 @@ cnt(const char *file) return (0); /* Do it the hard way... */ -word: gotsp = 1; - warned = 0; +word: gotsp = true; + warned = false; memset(&mbs, 0, sizeof(mbs)); - while ((len = read(fd, buf, MAXBSIZE)) != 0) { - if (len == -1) { - xo_warn("%s: read", file != NULL ? file : "stdin"); + while ((len = read(fd, buf, sizeof(buf))) != 0) { + if (len < 0) { + xo_warn("%s: read", file); (void)close(fd); return (1); } @@ -313,21 +309,20 @@ word: gotsp = 1; if (!domulti || MB_CUR_MAX == 1) { clen = 1; wch = (unsigned char)*p; - } else if ((clen = mbrtowc(&wch, p, len, &mbs)) == - (size_t)-1) { + } else if ((clen = mbrtowc(&wch, p, len, &mbs)) == 0) { + clen = 1; + } else if (clen == (size_t)-1) { if (!warned) { errno = EILSEQ; - xo_warn("%s", - file != NULL ? file : "stdin"); - warned = 1; + xo_warn("%s", file); + warned = true; } memset(&mbs, 0, sizeof(mbs)); clen = 1; wch = (unsigned char)*p; - } else if (clen == (size_t)-2) + } else if (clen == (size_t)-2) { break; - else if (clen == 0) - clen = 1; + } charct++; if (wch != L'\n') tmpll++; @@ -339,18 +334,19 @@ word: gotsp = 1; tmpll = 0; ++linect; } - if (iswspace(wch)) - gotsp = 1; - else if (gotsp) { - gotsp = 0; + if (iswspace(wch)) { + gotsp = true; + } else if (gotsp) { + gotsp = false; ++wordct; } } } reset_siginfo(); - if (domulti && MB_CUR_MAX > 1) + if (domulti && MB_CUR_MAX > 1) { if (mbrtowc(NULL, NULL, 0, &mbs) == (size_t)-1 && !warned) - xo_warn("%s", file != NULL ? file : "stdin"); + xo_warn("%s", file); + } if (doline) tlinect += linect; if (doword) @@ -368,5 +364,5 @@ static void usage(void) { xo_error("usage: wc [-Lclmw] [file ...]\n"); - exit(1); + exit(EXIT_FAILURE); } From nobody Tue Feb 14 23:07:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGcLf3D9Wz3qN9n; Tue, 14 Feb 2023 23:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGcLf2jX5z4NDC; Tue, 14 Feb 2023 23:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676416074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KmzMEdH/X7E54smInXy6DQKEznOT1R5YGcN6f+/ExUY=; b=CAgW8wPkMJXSwFdJAJ244tw6Zxe+HOlCANlQuBe+UIjtSfLQTEFdsycpLJ5wKBmqNdMOWc ZTp7EfZg/LB0pBNfC2KtgphMl5J2rUkIKHgDAabQprBtZ6oYkHf+Pi5B3C2sQ9gZVhAg9C dHr80OHXni6dgyWQuuGqFAoCl9wSCvAKMSFnnFwJYiz6gm0QraMV+zsoAdjQh9D5GRpWum XjDEC9tuZYDcy/iLYeg0JptjtiAoQeR+fy7IvupRSdvJJx5PYz4h/MWWGTduGYqQoSeT88 8Upq+dcI4ekMamaQJjDsE4dHdLZiSN3IPd6/v8/XD4fNmOa0IIAO+fswD3c0gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676416074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KmzMEdH/X7E54smInXy6DQKEznOT1R5YGcN6f+/ExUY=; b=xAYPIGjZIex3yrmm8MYlmWXn8jEqPx4YX7W6MrFOp3IyO9FED97X9Us6AFjejVGuT/BPS/ SEnjgtX/7lV+yM8TTyOuEt4f+lJM9yOB45nCFXi3GZEZAGJIoSanK0pXAYZGBw82fnwm4r QvpvTj7z4sanrHAMCf/GvYfOnQ/dDKrfU/PbyGrRn8hF6QVTx20f9DgC3unWqKlcT0EOsS Fbb+QbDWoDbFbv4dl7181sCPILYL35r6KITcDx6t5UD8loQ7d1Ob/EmpqdA5PEj8PviZPB YNra8lhE0kZYLF5Oj07dXt9cSci3s+IiIMhIdhrgTcCM8yUHUqopL1A/xuUgsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676416074; a=rsa-sha256; cv=none; b=AjJcyVFqz8sJQDFQOTi+MZJ2XBmO/7PK3DJrFEj/KyCmNi1jSsxQB9RY1/AeDjao4S7CAm olenG5LKMJDdq0HLPOFkHDmQd11yg+q6YX2JNTxmFpaXft6xsUStcupMM9StXTlc1YXabt 64rHHzaKCoMXYt7Ym2SBEvLjH8jNjP9RpO8UESYxcwm8sbJw20EK8x1VacagKn5EzW78CT 281rD7O1QsJzh3rvLjZ7pPmpFLLI68IOtWxCdhHlBWG5+jfu4ktX59F/Hq0hRkVI+Wmjvs YYzmsv/DQd7ydfvo8O17ZFCuY9tGlILFoWqzZ3LiTkWoJWYXYEWMeqoPsl2WGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGcLf1lpkz1GYG; Tue, 14 Feb 2023 23:07: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 31EN7sRt091041; Tue, 14 Feb 2023 23:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EN7sX9091040; Tue, 14 Feb 2023 23:07:54 GMT (envelope-from git) Date: Tue, 14 Feb 2023 23:07:54 GMT Message-Id: <202302142307.31EN7sX9091040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 4b0552d5f4ea - main - linuxkpi: Move `IS_ENABLED()` and friends to List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b0552d5f4ea0bd09d7f0f178810886472e84d63 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4b0552d5f4ea0bd09d7f0f178810886472e84d63 commit 4b0552d5f4ea0bd09d7f0f178810886472e84d63 Author: Jean-Sébastien Pédron AuthorDate: 2023-02-13 20:52:08 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-14 23:06:32 +0000 linuxkpi: Move `IS_ENABLED()` and friends to The header is included in like it is on Linux. Some DRM code depends on this header "pollution". Reviewed by: bz Approved by: bz Differential Revision: https://reviews.freebsd.org/D38567 --- sys/compat/linuxkpi/common/include/linux/kconfig.h | 78 ++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/kernel.h | 43 +----------- sys/compat/linuxkpi/common/include/linux/xarray.h | 1 + 3 files changed, 80 insertions(+), 42 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kconfig.h b/sys/compat/linuxkpi/common/include/linux/kconfig.h new file mode 100644 index 000000000000..b109d664ce8f --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/kconfig.h @@ -0,0 +1,78 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_KCONFIG_H_ +#define _LINUXKPI_LINUX_KCONFIG_H_ + +/* + * Checking if an option is defined would be easy if we could do CPP inside CPP. + * The defined case whether -Dxxx or -Dxxx=1 are easy to deal with. In either + * case the defined value is "1". A more general -Dxxx= case will require + * more effort to deal with all possible "true" values. Hope we do not have + * to do this as well. + * The real problem is the undefined case. To avoid this problem we do the + * concat/varargs trick: "yyy" ## xxx can make two arguments if xxx is "1" + * by having a #define for yyy_1 which is "ignore,". + * Otherwise we will just get "yyy". + * Need to be careful about variable substitutions in macros though. + * This way we make a (true, false) problem a (don't care, true, false) or a + * (don't care true, false). Then we can use a variadic macro to only select + * the always well known and defined argument #2. And that seems to be + * exactly what we need. Use 1 for true and 0 for false to also allow + * #if IS_*() checks pre-compiler checks which do not like #if true. + */ +#define ___XAB_1 dontcare, +#define ___IS_XAB(_ignore, _x, ...) (_x) +#define __IS_XAB(_x) ___IS_XAB(_x 1, 0) +#define _IS_XAB(_x) __IS_XAB(__CONCAT(___XAB_, _x)) + +/* This is if CONFIG_ccc=y. */ +#define IS_BUILTIN(_x) _IS_XAB(_x) +/* This is if CONFIG_ccc=m. */ +#define IS_MODULE(_x) _IS_XAB(_x ## _MODULE) +/* This is if CONFIG_ccc is compiled in(=y) or a module(=m). */ +#define IS_ENABLED(_x) (IS_BUILTIN(_x) || IS_MODULE(_x)) +/* + * This is weird case. If the CONFIG_ccc is builtin (=y) this returns true; + * or if the CONFIG_ccc is a module (=m) and the caller is built as a module + * (-DMODULE defined) this returns true, but if the callers is not a module + * (-DMODULE not defined, which means caller is BUILTIN) then it returns + * false. In other words, a module can reach the kernel, a module can reach + * a module, but the kernel cannot reach a module, and code never compiled + * cannot be reached either. + * XXX -- I'd hope the module-to-module case would be handled by a proper + * module dependency definition (MODULE_DEPEND() in FreeBSD). + */ +#define IS_REACHABLE(_x) (IS_BUILTIN(_x) || \ + (IS_MODULE(_x) && IS_BUILTIN(MODULE))) + +#endif /* _LINUXKPI_LINUX_KCONFIG_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index aee299efa732..22b25a202395 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -760,46 +761,4 @@ mac_pton(const char *macin, uint8_t *macout) #define DECLARE_FLEX_ARRAY(_t, _n) \ struct { struct { } __dummy_ ## _n; _t _n[0]; } -/* - * Checking if an option is defined would be easy if we could do CPP inside CPP. - * The defined case whether -Dxxx or -Dxxx=1 are easy to deal with. In either - * case the defined value is "1". A more general -Dxxx= case will require - * more effort to deal with all possible "true" values. Hope we do not have - * to do this as well. - * The real problem is the undefined case. To avoid this problem we do the - * concat/varargs trick: "yyy" ## xxx can make two arguments if xxx is "1" - * by having a #define for yyy_1 which is "ignore,". - * Otherwise we will just get "yyy". - * Need to be careful about variable substitutions in macros though. - * This way we make a (true, false) problem a (don't care, true, false) or a - * (don't care true, false). Then we can use a variadic macro to only select - * the always well known and defined argument #2. And that seems to be - * exactly what we need. Use 1 for true and 0 for false to also allow - * #if IS_*() checks pre-compiler checks which do not like #if true. - */ -#define ___XAB_1 dontcare, -#define ___IS_XAB(_ignore, _x, ...) (_x) -#define __IS_XAB(_x) ___IS_XAB(_x 1, 0) -#define _IS_XAB(_x) __IS_XAB(__CONCAT(___XAB_, _x)) - -/* This is if CONFIG_ccc=y. */ -#define IS_BUILTIN(_x) _IS_XAB(_x) -/* This is if CONFIG_ccc=m. */ -#define IS_MODULE(_x) _IS_XAB(_x ## _MODULE) -/* This is if CONFIG_ccc is compiled in(=y) or a module(=m). */ -#define IS_ENABLED(_x) (IS_BUILTIN(_x) || IS_MODULE(_x)) -/* - * This is weird case. If the CONFIG_ccc is builtin (=y) this returns true; - * or if the CONFIG_ccc is a module (=m) and the caller is built as a module - * (-DMODULE defined) this returns true, but if the callers is not a module - * (-DMODULE not defined, which means caller is BUILTIN) then it returns - * false. In other words, a module can reach the kernel, a module can reach - * a module, but the kernel cannot reach a module, and code never compiled - * cannot be reached either. - * XXX -- I'd hope the module-to-module case would be handled by a proper - * module dependency definition (MODULE_DEPEND() in FreeBSD). - */ -#define IS_REACHABLE(_x) (IS_BUILTIN(_x) || \ - (IS_MODULE(_x) && IS_BUILTIN(MODULE))) - #endif /* _LINUXKPI_LINUX_KERNEL_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/xarray.h b/sys/compat/linuxkpi/common/include/linux/xarray.h index 8a9d8fa3ea41..004efebc55d6 100644 --- a/sys/compat/linuxkpi/common/include/linux/xarray.h +++ b/sys/compat/linuxkpi/common/include/linux/xarray.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include From nobody Wed Feb 15 00:44:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGfTw3rVNz3qV27; Wed, 15 Feb 2023 00:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGfTw3M4hz4VKr; Wed, 15 Feb 2023 00:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676421860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NP0jxJuelgjOI1UYSjmGwXbMNRUkPHaBgWKjRdmt3wc=; b=reC+IhpJ6UMUqqfaz2q0z99iGU169FzVVRmaAXWyLcU8riJsQRw7D95cH6dVZAIXeuq7MX Z2XxIhih/cyyT/DkHifXNzdvkpBtKo4yMG1EfQmYxoOhXYg/BB2XOS8Vg4MDTAn/hB9xIx RkYwQ0qzWodOq6y4xhl1Yuipxv6udrmN2xFYSP9jtxb+e85nYDCAsvVDpBvDakMpVJZtiM TUtyj53XVN7OQYAT1Rdhm9qwO70rqLkettlIqAtxow9Kf0Ms9q0ckWJHVlfyD4Gy8EbYEH Qa4JtO/boXQhTuZpTjl/OYxNaGxTn7UHyepCv6SDrmJhWf4eX9P8xbQNZ+YHLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676421860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NP0jxJuelgjOI1UYSjmGwXbMNRUkPHaBgWKjRdmt3wc=; b=uAqUBa8s60VpkM/QdeO9acu4Kf0Rk1D8qIsBc0EP7hmtdR0vyl+LZu3LiBHwGFpaR1cgL8 Fj3wZcZjwTY0zCDxlqtU+PEz0z1XPUlWLmOiqEVhJG5Md68vOd6ds6LWVojoQsTynesjrL Cw3Xql/XIPWyQpCOC7q0hyzGfUWM68upvzIIIpYgl3pIxKG7zDv9bfFY6dFRaVbmBrPczU 5DKiAMLGYr7RrAODbInjIMJvkpObWno1uj32/LNxGLwFeuiDoCAyuU6IcPvEL8jC6kKlSF 9WjAkQLoyxWvCQDcnkulRMJp5qi/u3Z89YaQnuv97fzbhLO14wdjqp887MAUxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676421860; a=rsa-sha256; cv=none; b=DboeZVwOFMtolYpQO/bST8NmyJjq5SAAn+PReVYx9BF/HeFyGzawUpKraDoFmvj7N5MA2R rqT854yhJitqXGBnGpf0KbwESUHOmJZ9sfxHOJOlkeclGP4UFsEK9mgu0NB3Ldv5be1H7W OPj3qOypyhmluKBJ7rQYfl6AdNV/bBbgqDZX6m09LO0I8RvrqQbqQoG1L6O8ukF2NppOaj IrdrMg2523pf3KXk6sWji2gLv3wLw6gaZ5nasDZwQ4wCQxr+YWUaAduASC8tHKObOZFK4B fzpSkZZEWmq8c9UNEjCguenskexp0M/QmzILsXTm1ywR/71cDLy++Y9WO7T7dA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGfTw2Prfz1K5v; Wed, 15 Feb 2023 00:44: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 31F0iK2i033431; Wed, 15 Feb 2023 00:44:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31F0iKLn033430; Wed, 15 Feb 2023 00:44:20 GMT (envelope-from git) Date: Wed, 15 Feb 2023 00:44:20 GMT Message-Id: <202302150044.31F0iKLn033430@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: 5942b4b6fde3 - main - sys/param.h: Add _WANT_P_OSREL List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5942b4b6fde3f4ce6d0295fbcf135f552f92c607 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5942b4b6fde3f4ce6d0295fbcf135f552f92c607 commit 5942b4b6fde3f4ce6d0295fbcf135f552f92c607 Author: Konstantin Belousov AuthorDate: 2023-02-14 08:52:14 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-15 00:43:18 +0000 sys/param.h: Add _WANT_P_OSREL Use it instead of defining IN_RTLD by base sources that want P_OSREL_ defines in userspace, but are not rtld. This allows to remove abuse of IN_RTLD from userspace. Reviewed by: dchagin, markj, imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38585 --- lib/libc/amd64/sys/amd64_get_fsbase.c | 3 +-- lib/libc/amd64/sys/amd64_get_gsbase.c | 3 +-- lib/libc/amd64/sys/amd64_set_fsbase.c | 3 +-- lib/libc/amd64/sys/amd64_set_gsbase.c | 3 +-- libexec/rtld-elf/amd64/reloc.c | 1 + libexec/rtld-elf/map_object.c | 1 + sbin/fsck_ffs/main.c | 2 +- sbin/newfs/mkfs.c | 2 +- sys/sys/param.h | 2 +- 9 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/libc/amd64/sys/amd64_get_fsbase.c b/lib/libc/amd64/sys/amd64_get_fsbase.c index 2de99912daf2..04d872165e32 100644 --- a/lib/libc/amd64/sys/amd64_get_fsbase.c +++ b/lib/libc/amd64/sys/amd64_get_fsbase.c @@ -33,9 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#define IN_RTLD 1 +#define _WANT_P_OSREL #include -#undef IN_RTLD #include #include #include diff --git a/lib/libc/amd64/sys/amd64_get_gsbase.c b/lib/libc/amd64/sys/amd64_get_gsbase.c index 0deac34c90d1..35f69da6ac1e 100644 --- a/lib/libc/amd64/sys/amd64_get_gsbase.c +++ b/lib/libc/amd64/sys/amd64_get_gsbase.c @@ -33,9 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#define IN_RTLD 1 +#define _WANT_P_OSREL #include -#undef IN_RTLD #include #include #include diff --git a/lib/libc/amd64/sys/amd64_set_fsbase.c b/lib/libc/amd64/sys/amd64_set_fsbase.c index 02ca9233d855..9474b1148161 100644 --- a/lib/libc/amd64/sys/amd64_set_fsbase.c +++ b/lib/libc/amd64/sys/amd64_set_fsbase.c @@ -33,9 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#define IN_RTLD 1 +#define _WANT_P_OSREL #include -#undef IN_RTLD #include #include #include diff --git a/lib/libc/amd64/sys/amd64_set_gsbase.c b/lib/libc/amd64/sys/amd64_set_gsbase.c index c4880c126ae9..5ecde27f27f0 100644 --- a/lib/libc/amd64/sys/amd64_set_gsbase.c +++ b/lib/libc/amd64/sys/amd64_set_gsbase.c @@ -33,9 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#define IN_RTLD 1 +#define _WANT_P_OSREL #include -#undef IN_RTLD #include #include #include diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index c7cf7bd58845..c9a2734853b6 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -33,6 +33,7 @@ * John Polstra . */ +#define _WANT_P_OSREL #include #include #include diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index 4bf32398710d..1ca5fc16477a 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -27,6 +27,7 @@ * $FreeBSD$ */ +#define _WANT_P_OSREL #include #include #include diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 14b5c1076d5e..f7d995a54d1b 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95"; #include __FBSDID("$FreeBSD$"); -#define IN_RTLD /* So we pickup the P_OSREL defines */ +#define _WANT_P_OSREL #include #include #include diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 48091d7882d0..56496eacdc7c 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95"; #include __FBSDID("$FreeBSD$"); -#define IN_RTLD /* So we pickup the P_OSREL defines */ +#define _WANT_P_OSREL #include #include #include diff --git a/sys/sys/param.h b/sys/sys/param.h index 751020f6d087..2d5edf9a0b90 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -94,7 +94,7 @@ #undef __FreeBSD_kernel__ #define __FreeBSD_kernel__ -#if defined(_KERNEL) || defined(IN_RTLD) +#if defined(_KERNEL) || defined(_WANT_P_OSREL) #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 From nobody Wed Feb 15 00:57:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGfng6NFXz3qVXP; Wed, 15 Feb 2023 00: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 4PGfng5nxhz4WyY; Wed, 15 Feb 2023 00: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=1676422679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5pxo9aEHMJqLGR7LSADAty45A8abkt+6hRqYBQdbuM0=; b=Rq8TXA5pcvmqSzKPaTrJhmm9kzBHHKNK2MsQyiv8DlbRAmoIn5AlmqIIBc7yvlIksx7l76 9O7XCUsG+osqGwhTtX+iSdwEpwqiKoxWIaXNQ7XpA576HMyZSoqrF/o5b9SbFbXaY5zb3t KVh3JonCTW77jvBARDW3OrfaP+zqH40SaLpJKfIrBJDF+NOjMtDLAjzQ4AC6Fy3Nggr51g 1NrkcsBjqgzTp0mZZqs6beOamyn7n3+5ew9MkeZV9QWjX+HnkTGIEdNBvFzPAf7RGuQj7T 3BVazogp9Ud7qCIuJwqWfQRMpLex+C8Tw4bNjBPX2Ayh5hlI11ppTY0XQL4B9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676422679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5pxo9aEHMJqLGR7LSADAty45A8abkt+6hRqYBQdbuM0=; b=LvszN7eEmFte9FNs2hPfXL6NBZceVgUg6a7mhcYloFWsnz5nBplrQZRrg/8059mG23I9Hm FSkbSxlCtraKk46zd3ifPD2N16rd+BtsXWXxn6/7ro3k8kvD81UPXGLXLtyz10yvndq9Gi I8w4ddgZ7BXoQodwaIR7Jcd6igjauloYKUPgxGLRVcAiOGbod7FlStsLm0rlAzp8lZ1wTB KYXUe2BekTSZZ2S47NiLBaYaRkZzPtgqPVwkTU9LutJvEHHKwG30ToRWd/hSjMLCktYCQA dvfASv7Ho7tvoM8399wqbmHx/mOMoDKdU9hwAOPjn3uJJZd9VtzfToKm1uO5rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676422679; a=rsa-sha256; cv=none; b=u2E+LK+OuBgLfZUN1U1AlniaF/de0+nCgy3s5+6oUoGyvwHhWp21POBwkNo/FTM1oc6M89 y1QaSEWTszsoE/fMR+N/QJnnXhMfsVd7HMRsUVLGPx5W35UGuuTtnvP+53EeNwji5SIX4v tgJMJ39EgE+FCbCrqtwk30SOce149zfbiPF+OTeR1GDUyxDBh3TMEV4cD9BNi/xYVYyVe4 wsP/LiHjpaprLlWhwQcAcE8s2Q45CxBofLMXfaHQlcy6qa/eSyGcUlhtFyW3nWiLbuFzu3 h4RJo2OkMlRa8Ra5sg0rvxlG81/U2N/wYTZIMxB9zB/wFBSvyLuHY9+zVCUGkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGfng4rNzz1K6Y; Wed, 15 Feb 2023 00: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 31F0vxn3047920; Wed, 15 Feb 2023 00: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 31F0vxJw047919; Wed, 15 Feb 2023 00:57:59 GMT (envelope-from git) Date: Wed, 15 Feb 2023 00:57:59 GMT Message-Id: <202302150057.31F0vxJw047919@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: 9ff2fbdf2ded - main - tmpfs: remove bogus MPASS(VOP_ISLOCKED(vp)) asserts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ff2fbdf2ded59e276fdbf7ef7d18c726386b6fb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9ff2fbdf2ded59e276fdbf7ef7d18c726386b6fb commit 9ff2fbdf2ded59e276fdbf7ef7d18c726386b6fb Author: Konstantin Belousov AuthorDate: 2023-02-13 23:23:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-15 00:57:40 +0000 tmpfs: remove bogus MPASS(VOP_ISLOCKED(vp)) asserts VOP_ISLOCKED() does not return bool, its only reliable use it to check that the vnode is exclusively locked by the calling thread. Almost all asserts of this form repeated auto-generated assertions from vnode_if.src for VOPs, in the incorrect way. In two places where the assertions would be meaningful, convert them to ASSERT_VOP_LOCKED() statements. Reviewed by: markj, mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38576 --- sys/fs/tmpfs/tmpfs_subr.c | 3 ++- sys/fs/tmpfs/tmpfs_vnops.c | 24 ++++++++---------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index ccb9977c39eb..cfd4787fb712 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1110,7 +1110,8 @@ out: *vpp = vp; #ifdef INVARIANTS - MPASS(*vpp != NULL && VOP_ISLOCKED(*vpp)); + MPASS(*vpp != NULL); + ASSERT_VOP_LOCKED(*vpp, __func__); TMPFS_NODE_LOCK(node); MPASS(*vpp == node->tn_vnode); TMPFS_NODE_UNLOCK(node); diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index b1d6bce6754f..ea09170661e7 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -218,11 +218,18 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) cache_enter(dvp, *vpp, cnp); out: +#ifdef INVARIANTS /* * If there were no errors, *vpp cannot be null and it must be * locked. */ - MPASS(IFF(error == 0, *vpp != NULLVP && VOP_ISLOCKED(*vpp))); + if (error == 0) { + MPASS(*vpp != NULLVP); + ASSERT_VOP_LOCKED(*vpp, __func__); + } else { + MPASS(*vpp == NULL); + } +#endif return (error); } @@ -545,7 +552,6 @@ tmpfs_setattr(struct vop_setattr_args *v) int error; - MPASS(VOP_ISLOCKED(vp)); ASSERT_VOP_IN_SEQC(vp); error = 0; @@ -588,8 +594,6 @@ tmpfs_setattr(struct vop_setattr_args *v) */ tmpfs_update(vp); - MPASS(VOP_ISLOCKED(vp)); - return (error); } @@ -725,8 +729,6 @@ tmpfs_fsync(struct vop_fsync_args *v) { struct vnode *vp = v->a_vp; - MPASS(VOP_ISLOCKED(vp)); - tmpfs_check_mtime(vp); tmpfs_update(vp); @@ -745,9 +747,6 @@ tmpfs_remove(struct vop_remove_args *v) struct tmpfs_node *dnode; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(dvp)); - MPASS(VOP_ISLOCKED(vp)); - if (vp->v_type == VDIR) { error = EISDIR; goto out; @@ -796,7 +795,6 @@ tmpfs_link(struct vop_link_args *v) struct tmpfs_dirent *de; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(dvp)); MPASS(dvp != vp); /* XXX When can this be false? */ node = VP_TO_TMPFS_NODE(vp); @@ -987,9 +985,6 @@ tmpfs_rename(struct vop_rename_args *v) int error; bool want_seqc_end; - MPASS(VOP_ISLOCKED(tdvp)); - MPASS(IMPLIES(tvp != NULL, VOP_ISLOCKED(tvp))); - want_seqc_end = false; /* @@ -1323,9 +1318,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v) struct tmpfs_node *dnode; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(dvp)); - MPASS(VOP_ISLOCKED(vp)); - tmp = VFS_TO_TMPFS(dvp->v_mount); dnode = VP_TO_TMPFS_DIR(dvp); node = VP_TO_TMPFS_DIR(vp); From nobody Wed Feb 15 00:58:00 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGfnj0b4gz3qVHY; Wed, 15 Feb 2023 00:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGfnh6tzBz4X00; Wed, 15 Feb 2023 00: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=1676422681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tfqIHpiM1Jc3IDeBjDFI1h9aPqPoxYLq1YsXTRLU7QM=; b=mIVQVLiBLrvBwwsd2AOD1IF/XddS2+Ej6XTCaGMyjeSC10Xl+iI7DEZ5os8mjUL+lz98uq ULy7wC5zuG7lhR/xq6l2O/TX2fLJlkxRXGQmVZBFZMwiADqQxSBw+mQ9CDjYTHSXdo1nLf OfglZtpGgy/BP8R3zMqlXfgFNGCtldegBk6xX20s0/q7ea2ouY9cMp6JzvbvCBCrpHOcni UdIKZnNv+bzK6czFa0ojeOeJq6DHZT7iNmesoy9MMoKFwyVWi5rfNjR8KN/7ilsrQZVxJN T19rkc8BNFu771/+svklfa4oSyA7QqcnnU2zHum2RTgil14qkBgscyI6Gj6lEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676422681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tfqIHpiM1Jc3IDeBjDFI1h9aPqPoxYLq1YsXTRLU7QM=; b=LA+ioprd0DtgqkrpwRrnvJ/OQr2Ck9NCFfqUJDdWFPHE+ncgrSUvKoV6xQm2GhCuN7IBic 3fulURuxt6FNWfu2dHMZMPvh91d6kwBu/tTkZ5aGbY1nnM4ErBSrvTGa34SIh8rFtNILuD 3ThgFG9XhWPHmnhIPLFpk88tV4GrJMglNSXpx9FDP/xK+zWCZAz7shDJnIr3UHqDN69b84 emNLeP6iR27V4SFSMM6dU52/oCThOSU/MsvZgGecK6G2UxleYi2lqIeZwgGba0JxRk1UcZ 8ikNZ3bQjU4f95iDRupWX4EDG6OgDl+Y2eUEXPLcM+QQ60WMZPxn+GQ1AVnlig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676422681; a=rsa-sha256; cv=none; b=tbl6pjnx3+fWej3czeXuhWDF0RL06nBANQrY+r0E762McMi9rnwFuwjEgRIqf7JiVyHTMm RpwRgS2S+Mrou1b77kGhRS+eyt7RftYPtqX/Cqn4RluXygMwzWqzqsWAmAul5Vb59Loxs1 3x0Q5txKzc9whp4af2C9SNmenEzo5Wk/qFD/z5XVLXfbQTfYKUU3NeV9DluvqSqU2q3mi7 uWsNlrh5CrZ+dp9IP3L3qekEABIW3ZYhn47nTu4b2TDBoawvPaKNeOR7KPwJyimVrkR/HU eyKiT559tXhgGUCH5KAwuwrYZ+6VJLFsZsXAr0D6uUDFj587IODbj7mGFdP5/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 4PGfnh5zyBz1KB0; Wed, 15 Feb 2023 00: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 31F0w0Ok047951; Wed, 15 Feb 2023 00: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 31F0w06E047950; Wed, 15 Feb 2023 00:58:00 GMT (envelope-from git) Date: Wed, 15 Feb 2023 00:58:00 GMT Message-Id: <202302150058.31F0w06E047950@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: b918ee2ce485 - main - tmpfs: remove IFF macro List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b918ee2ce4850253ddd884e39dabecd6e96bf474 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b918ee2ce4850253ddd884e39dabecd6e96bf474 commit b918ee2ce4850253ddd884e39dabecd6e96bf474 Author: Konstantin Belousov AuthorDate: 2023-02-13 23:47:44 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-15 00:57:41 +0000 tmpfs: remove IFF macro Requested by: mjg Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38576 --- sys/fs/tmpfs/tmpfs.h | 1 - sys/fs/tmpfs/tmpfs_subr.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 70ed066ef0f5..eda1c3b12c24 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -516,7 +516,6 @@ tmpfs_update(struct vnode *vp) * Convenience macros to simplify some logical expressions. */ #define IMPLIES(a, b) (!(a) || (b)) -#define IFF(a, b) (IMPLIES(a, b) && IMPLIES(b, a)) /* * Checks that the directory entry pointed by 'de' matches the name 'name' diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index cfd4787fb712..351ca825f203 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -547,8 +547,8 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, * allocated, this must be the request to do it. */ MPASS(IMPLIES(tmp->tm_root == NULL, parent == NULL && type == VDIR)); - MPASS(IFF(type == VLNK, target != NULL)); - MPASS(IFF(type == VBLK || type == VCHR, rdev != VNOVAL)); + MPASS((type == VLNK) ^ (target == NULL)); + MPASS((type == VBLK || type == VCHR) ^ (rdev == VNOVAL)); if (tmp->tm_nodes_inuse >= tmp->tm_nodes_max) return (ENOSPC); From nobody Wed Feb 15 02:13:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGhSt6R6Hz3qb6P; Wed, 15 Feb 2023 02:13: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 4PGhSt5w59z4cY9; Wed, 15 Feb 2023 02:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676427214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RL9h+KyfIDAHyyQdIlkP40PUg5ggRo920tTQqQKxsn0=; b=XNevxtq3vjtnzgGTCl9GFRwTZvp5dQo4K5k8+3GSgIH10fS+e4BIu/LOKxDu74zqJ+1uDL Te5jadV/EWOdL1uOEJV5Y0qGRuiZgl4o8HtkqFNYq+REH8Iv8jIRLgYKxskSITEeVz8v93 xOir50SDG5VlTE2FDcn63hpoAvWHCKziKoRToaCvahnnCR5o3SPEEOlUol25qBnivklG7l kiSKmw36G4Rro/C7ziIc45EFWgIK/QJkkPsPow8fp+Ha4S8LuN8cL2M4ejREWMYS1Pc7kg n7YtNSxJ+P9e4rQBmzn8KjxOBdJeHxlDuRsn/XF09FqXIF4P9D2EaDkjpTrUxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676427214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RL9h+KyfIDAHyyQdIlkP40PUg5ggRo920tTQqQKxsn0=; b=xUzcQRC4pTGUI5nNMSwtpEqBFHUoRDU2lgGGsEHlS3Uu3nQ1CJJb8vMIquI/HDAaYR0Qfu pMKsPlMw8OLF5XHk4J5eIgve9lZDs9WtQxiAwKIH1XANyMOXbIy67/+juYA82ThdqN7f00 kKdPbPv8y8H7zEQalaTPGvbNX4iFSrTgx6pVjlcM0JdbtucCpQ+mFKclb2mHwocYa2CRBl Mh/hnlo/6z8qndfsbP0fAftoyd4qTd68t91zw/NLlozkbcZKmnyPbBaQUcHYCocs0KCgA2 JMLA+5zUlD1wtWeoxgsEqqY2ut9+KQfhIVJ6VRjGIAjJM3/7o9IF1dL9Zm0Uwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676427214; a=rsa-sha256; cv=none; b=VgkZPJT/WdWylTbJP1HKMw+SnEgdQSGRTuS8G8H28gNOlNm7YHs5rUQsgnIh2AgInjSzuL mVFdWPKMQGzHn0FI0hDHMXQ1pQtHqgOU16pQjpn/0kWRyKUoBr8gC05dKbU0sXIlieugOf 0wzs++IWxWsjY/sNYzkR+/8v+FYQRnGosMBLcDnbNdSGCnC42WMJMWXB3j+8B3ZfYTir+r OU3N+OCtNgTB8OCRyVKLH0Z2zJYnOaOXg5v0EgLn9VFRguVwuL1tqw2ONVKVCl/3y4l7So 1yY7FJ0eVaCx+RC+saphkoJq4zbGI2x8QOQA9JhAhLa6PgYMTSaD6yCVDDqKKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGhSt4gSJz1M6d; Wed, 15 Feb 2023 02:13: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 31F2DY2I062011; Wed, 15 Feb 2023 02:13:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31F2DYAH062010; Wed, 15 Feb 2023 02:13:34 GMT (envelope-from git) Date: Wed, 15 Feb 2023 02:13:34 GMT Message-Id: <202302150213.31F2DYAH062010@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: ae6cff89738b - main - tarfs: Don't panic if the parent of a new node is not a directory. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae6cff89738bab9a4a956c230fb9dc6c4d5e113f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ae6cff89738bab9a4a956c230fb9dc6c4d5e113f commit ae6cff89738bab9a4a956c230fb9dc6c4d5e113f Author: Dag-Erling Smørgrav AuthorDate: 2023-02-15 02:12:45 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-15 02:13:11 +0000 tarfs: Don't panic if the parent of a new node is not a directory. PR: 269519 Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38587 --- sys/fs/tarfs/tarfs_subr.c | 3 ++- sys/fs/tarfs/tarfs_vfsops.c | 12 +++++++++++- tests/sys/fs/tarfs/tarfs_test.sh | 30 ++++++++++++++++++++++++++---- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/sys/fs/tarfs/tarfs_subr.c b/sys/fs/tarfs/tarfs_subr.c index fc2955b44606..0cba43a8c21b 100644 --- a/sys/fs/tarfs/tarfs_subr.c +++ b/sys/fs/tarfs/tarfs_subr.c @@ -171,6 +171,8 @@ tarfs_alloc_node(struct tarfs_mount *tmp, const char *name, size_t namelen, TARFS_DPF(ALLOC, "%s(%.*s)\n", __func__, (int)namelen, name); + if (parent != NULL && parent->type != VDIR) + return (ENOTDIR); tnp = malloc(sizeof(struct tarfs_node), M_TARFSNODE, M_WAITOK | M_ZERO); mtx_init(&tnp->lock, "tarfs node lock", NULL, MTX_DEF); tnp->gen = arc4random(); @@ -233,7 +235,6 @@ tarfs_alloc_node(struct tarfs_mount *tmp, const char *name, size_t namelen, panic("%s: type %d not allowed", __func__, type); } if (parent != NULL) { - MPASS(parent->type == VDIR); TARFS_NODE_LOCK(parent); TAILQ_INSERT_TAIL(&parent->dir.dirhead, tnp, dirents); parent->size += sizeof(struct tarfs_node); diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index 138a57c22e7f..b3c30e884a9d 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -320,6 +320,12 @@ tarfs_lookup_path(struct tarfs_mount *tmp, char *name, size_t namelen, break; } + /* we're not at the end, so parent must be a directory */ + if (parent->type != VDIR) { + error = ENOTDIR; + break; + } + /* locate the next separator */ for (sep = name, len = 0; *sep != '\0' && *sep != '/' && len < namelen; @@ -685,8 +691,12 @@ again: error = tarfs_lookup_path(tmp, name, namelen, &namep, &sep, &parent, &tnp, true); - if (error != 0) + if (error != 0) { + TARFS_DPF(ALLOC, "%s: failed to look up %.*s\n", __func__, + (int)namelen, name); + error = EINVAL; goto bad; + } if (tnp != NULL) { if (hdrp->typeflag[0] == TAR_TYPE_DIRECTORY) { /* XXX set attributes? */ diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index d812ced80bbb..634b6be3dd08 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -33,10 +33,11 @@ mnt="$(realpath ${TMPDIR:-/tmp})/mnt.$$" sum=4da2143234486307bb44eaa610375301781a577d1172f362b88bb4b1643dee62 atf_test_case tarfs_test -tarfs_test_head() { +tarfs_basic_head() { + atf_set "descr" "Basic function test" atf_set "require.user" "root" } -tarfs_test_body() { +tarfs_basic_body() { mkdir "${mnt}" "${mktar}" tarfs_test.tar.zst atf_check mount -rt tarfs tarfs_test.tar.zst "${mnt}" @@ -45,10 +46,31 @@ tarfs_test_body() { atf_check_equal "$(stat -f%d,%i "${mnt}"/sparse_file)" "$(stat -L -f%d,%i "${mnt}"/long_link)" atf_check_equal "$(sha256 -q "${mnt}"/sparse_file)" ${sum} } -tarfs_test_cleanup() { +tarfs_basic_cleanup() { + umount "${mnt}" +} + +atf_test_case tarfs_notdir +tarfs_notdir_head() { + atf_set "descr" "Regression test for PR 269519" + atf_set "require.user" "root" +} +tarfs_notdir_body() { + mkdir "${mnt}" + echo "hello" >d + tar cf tarfs_notdir.tar d + rm d + mkdir -p d/s + echo "world" >d/s/f + tar rf tarfs_notdir.tar d/s/f + atf_check -s not-exit:0 -e match:"Invalid" \ + mount -rt tarfs tarfs_notdir.tar "${mnt}" +} +tarfs_notdir_cleanup() { umount "${mnt}" } atf_init_test_cases() { - atf_add_test_case tarfs_test + atf_add_test_case tarfs_basic + atf_add_test_case tarfs_notdir } From nobody Wed Feb 15 05:18:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGmYz5sC1z3rHhP; Wed, 15 Feb 2023 05:18: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 4PGmYz5L2fz3N2L; Wed, 15 Feb 2023 05:18:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676438295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OdaoEQSZ71U+TFggIFYvuRL21zVDKAe/XF7QP0fFlzA=; b=vYFr7y01BWv5SOz2gKlbcIig2X5FOvY7FJJpX+IBYttD6ny9tR3wFtba6HK/I+5clgR5vq IdAl5YZ69HeED4ICTLiqbsmvxUMi4tlhzwdQmBFTHC3Sg+vUVgGMtK2enEGaLyJ+Jl2Q1x 9nXJMSXYhF7G7jF1V3Blp23d9/Mt7+/Ggm43z4YCtaIwbS9JhfvI3HozV/szz243apDuVz 6rQkDaguxp62mKc9Pob6V3lOXV2uDjieetG2PAbGljiQAz7MPF6GnkIgWchusyKdfiiCtX rK1J+zK30Pa+316e9OQTS9h0dp7mXYdT/3Ol4kMMQscdq4FPBwg9EftVXh0oMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676438295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OdaoEQSZ71U+TFggIFYvuRL21zVDKAe/XF7QP0fFlzA=; b=r5ntK0pcFgZlQdggBWY6utBA7FO9Nl82aKdOEI0h3S2sC6mOVi1M/i3j9AF33NHP1hdfNY EhSebQkdqJVnthk1AHLDzypaPqpymFSKvrlPDyZhwM8nswlE1tHi1dt59OOp4LJZYohHne tNm4bWLdY940wtAcMC4yplrC+u41TMnrlU7QydlDLzUptebDT1+I3HH8v9Uy7/U5wERsF2 cqC5Y65QJW88bHTc6c/TxuDUu0KlC8W4bvt+oWG9GHfx/eZcU3Y5QDeSZN07soljrofUdm 7TSIltl9FNGvNi+ypm0Cvn/wSOQE7zWBfxLVDZ1F6JPJY1DQAj1hoydXa6vXDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676438295; a=rsa-sha256; cv=none; b=ErzGY6MBZYkkkkw3LvFzsskMnDolLzUADKM40oi44wBdREBz+k5SbciwZs3lFcVcTv2qOY p6QgHinqNRy+MRn8j/2bio6l6sOJnRhTud8Ph1mZwbkTgrBRxc2S9+NPZPkk8yDPNEWkHa au2hvHCUIn/2XbE/xh2XGzrM1MTtOfirLGfb7xRids0g8aPOYEdXntcWzv4hve1qXQUmTe rqS8RsX55MTpftN/sEROVR52HIzf7wj7erv8aC/+cvrD50d1EZiy07OcWvrzqz7Dk816j9 8iIJyjM++nqjmD+Ttin1WGqhNvBH4JxaFOdRZSQiG8niZ3Xw29KLqj0OTphn/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 4PGmYz4M0Yz1RRZ; Wed, 15 Feb 2023 05:18: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 31F5IFTb019528; Wed, 15 Feb 2023 05:18:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31F5IFiL019526; Wed, 15 Feb 2023 05:18:15 GMT (envelope-from git) Date: Wed, 15 Feb 2023 05:18:15 GMT Message-Id: <202302150518.31F5IFiL019526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 3bafe73affe3 - main - usb: Remove unused member in struct mos_softc List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3bafe73affe37de3e94d91d4c1310f1272375970 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3bafe73affe37de3e94d91d4c1310f1272375970 commit 3bafe73affe37de3e94d91d4c1310f1272375970 Author: Zhenlei Huang AuthorDate: 2023-02-15 05:07:19 +0000 Commit: Zhenlei Huang CommitDate: 2023-02-15 05:07:19 +0000 usb: Remove unused member in struct mos_softc Spotted by jhibbits in D37812. Reviewed by: #network, glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38581 --- sys/dev/usb/net/if_mosreg.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/usb/net/if_mosreg.h b/sys/dev/usb/net/if_mosreg.h index b8034feb8e44..993526b8d502 100644 --- a/sys/dev/usb/net/if_mosreg.h +++ b/sys/dev/usb/net/if_mosreg.h @@ -160,7 +160,6 @@ struct mos_softc { struct usb_ether sc_ue; - struct ifnet ifp; struct mtx sc_mtx; struct usb_xfer *sc_xfer[MOS_ENDPT_MAX]; From nobody Wed Feb 15 06:35:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGpHY3Jrfz3rMgq for ; Wed, 15 Feb 2023 06:35:53 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-8.consmr.mail.gq1.yahoo.com (sonic315-8.consmr.mail.gq1.yahoo.com [98.137.65.32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGpHX0Vy1z3hqG for ; Wed, 15 Feb 2023 06:35:51 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=KaSW8IEz; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.32 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676442949; bh=pVzpJYinbnVwVC+7BTXmYktMXffa7CFKCyCPLM0FGJ8=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=KaSW8IEz+Cq4OssJ52+nbqCWcFprRm17gkgQ6Nl2G2GiWH+9vhxSs8Q/wae/XWZ/OR6YKgRUsLxekYOwrLhUd+MpIBFdY03LXNAgoFcWSSdtH0/0uNczW2fLF8K3g6i+ivpTJdI9FobCpFYTzjWI7jzcSlsVrjWqMttlM1ZaIhUtTzNaB5X+xB+dEnVgInYDm0LOEssUCF/wk3fUtFn3f9CtkleGRaYYBIcVOAs9wPlM/CkqKo6ytazY/+8uUMb9GcepLUebL8X2qSHfYTonmxYeiontGhQv011rt9BkytQILi1NbKcLQBe/wTWvxe4aUQ/apIX9XM1orUUsk1gUgw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676442949; bh=xJ1pJdPJWyPwq7DD0vfUcCHcPaP0PIWMtghAba660Pe=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=ZzI7BCoOkLisJ6dE+TFRdamjXiTTb5cB8mFrvGwmSz7Hm7mXKY7Zs+hUQ94TFsZ7Ip6s/LylzzmFbF648Q40G56wM8vytwYeiTlHXiq4wSlZXX8A5gjyCDGmbefLR7eRix//KRBCwSQbXPyM+385IPB7ETU422MZQYC6yFJvKdDlwu/N0pU+OInN8Kha4NI7wZZhlAWuJi/WHnI6zNmKNeYfHZhcP0QNHjqaprIJp4566O5ldc/+ZmLbrjyfjmqSf7poAMq/JDZnfr/nV6AIjkaDlrTOKHTDH34uOmQUD4u2n0SrWOH7l8CiwyStCkchjkw3ItecXDGfzvZbn0MURA== X-YMail-OSG: FAUv3ckVM1moQ4kssN_gGVGg8zEzeuTn90_EdtOziKIoZJBRT8KurCGnSEsno4w Xx06F_r._s9lzs2V6NJzVXa6ra8MqlhtO65y35.FM5fBLIpaFRZTPrxn5vhieXNpuj2Htj6dmo6c lTD8vRNsvPmf0I_ZBf1S8oKLbEWkVENmv7Hc9usWXk_l99L7J.tJABqu8t_tNgg6dTZM5FGbtozM oH2Io5AY2mJoDL7QyVk_baLLe1ANRyZp0.EAHpZL.wecrfCuZeLlt.nK.CdyDUe_o_DtfY0xRaoQ yJP9ON1RWXf2GFdIaKZfdhT1UqHOLx84NcMvvtFQRR0WYFzvAiglzXCTazNOgxo2g_0axdf_mkZC e2RfQXB_HxQBTBkB6NyT10lkIAjZimyjvH4fkR5CxEGfuP4FVuwNrI0A6TPh2wXcF1ege1AL3QlD 9r5Q_Cbj3MEb4Uq1JcX.WNE_.ZtaYMwpyjCAnxJn_npPpOomqCC7iKiy4SiwhDvaLOcUl53vK3sj 1lALi2ncNAzuWi1GyHpqZpGUANL3KKX0F_.oo36VobktKGPjfyQkN4OiBp0PhZFD2ibupG6VHKIZ 3W6RVZ5lUp8QvsKbG_M4_i5qgqB8CinnbKuBNHrJwI8yLnrnnHmgNb_89hOWJJZnPaaKwk7ar.wk JNROLQHoQgVdgTIr3q6GshHlAyoO5jlX2cAmQXmZxirAn7fGCsWiXBx0Ps0g7XZUqy7torE5LYMR QUaOCOIaRjt5QNnczCeIo.1TTeBwHRVFXohtRS_bJzq8HSd_hvjLQvb1so8OKl3lHjJJnb8xw0xw od3o1Hibl5ZSDXUVDoAFQmoxrw4HPDWLz3rsB8ToZwIqS67FgR3AR7w3_9IdeINtIJPxxFcDyuX5 HO691dS_h7v0Z14uIPzS5qzV3NA8Uw6WYK8O_9bK6Dv66cQi_MMZF0EEFb3Nfnw8tdTBeZTNt8oE Favx7_5iqGyU5FFvWjveUvm1U64bvRYfCGrd9v_CgaOPjW9mvVBmmOXLeyjJ1tZz8rbR7g7lYpDL gMliNkY534M2zcTLMpJqQU6dhRc_yqIG9LQhdf_aFlGIsmY4KjUdcEiOPtBXjTVB2yLCH0RIAwoY UuLDICeEYg5Nipve0rxO6JDB18diRQRl1qQw3E4to7YcDX9ndHPxxBX_Xzlsg8FE1aqnNquWifoC fUdIa6rUI7KRkH8Th1ILT6sGtmE9N1ycg7fQ1.z6ETQj554PYPX4bCa1xydeWj9FNtwcGXHmPMyb HWOsVh0IeOEh1gB6Gbu8tebYO2xcRryNb_bnDf_WjVjnQIfAz_llC.G4kHlh0TZVccw78CYS1Lkf ap5_3mhLxh3YUxwhHqONwbTJeFJtG_0W6REkpxzsCLEj8KQPOtaUaGW_.UPBY488WR4KrDHmBICO _tlWHJtbNzT7JpPeUyH0y96rgU8P9vBN6N78k6_JeM6LS8F5mVCsljHdeNmYdg6X_gPEe5iSDszP HUpsBGkcxWuPgTkc3waR2A3WR6szItJFe5kuVQkebV5R1wTkuUhcmyDs0o_jY5U_UVqK0AZaxFx5 0ctKr1LMe4TGdm9Q31tscRumD_2PpUwr_WFVhag7mY80ITHkCsTtAPWqiUpNO1Ytb2Xdc1s4QiWc sYZBcF1JnLAm31fgyhhW70hRFKH2n6vEMAKofTiMOhmkkaZGYcbr6sOGFtscttQl8rlPavoKwAM5 j5YzCzOcZZ.0OPjyJ1FV2jdXFSaXCLlX69QUl3wa87inbiduDRQ_rgA040zxtOqRgasO0o8XW7gK 3gfruSL0wvQCyhFgSNG9zTIrW42YTUJakSZ1k8_8lB6kkNPj7Gz65N0nQ3NMrksPhRcrAyDs10BQ BwxP4VufVmiEJ.eLYJRAHT9cjF3ehoEtOzmw4lx_aAUizeG70YWUIyz5fKtTI91AH7ofCX4LXq8L CBGs0HZ7MgeoGsMS_HdD5z3drvBTVmt9NAgMKoZPpCVt82GPIfzl8nvVcsCtaVJ5PPLSHwvtCsAv nFjTiVW0kjIZdcrmMg0Vd6Oi77NqkZrWCDpDCMtx9uwtX4sqkLbGdoDIjhewlivUL2Eb9Mv2seNS lszx4ZzXOirOKJCnqdV4n3CAFIa.NcKckex_Zz9FCHmVTO5QWBVDNl5.eHv.tjp4AlTzJwFdnYOL JitsS8A9gCK4nlrS.1yzrPkgnkuU_HYiK63eSnjI7Vlh61YhLPlLVulzD1leFpxaBUab6OqNWu8L YwZM7uQtxr0bOdcejkcjYg94pWHIcGayOpO5Q12hSOTj0URAOBKtE.mOZ1KXEA2tFtBKmxQBXig5 Ng4Q- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Wed, 15 Feb 2023 06:35:49 +0000 Received: by hermes--production-ne1-746bc6c6c4-b28lr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 3c3ae32a08b88913359f13fffbd11546; Wed, 15 Feb 2023 06:35:46 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: RE: git: d9d5f2c042a5 - main - cpuset: add --count [changed/broken command line parsing] Message-Id: Date: Tue, 14 Feb 2023 22:35:35 -0800 To: "mjg@freebsd.org" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.300.101.1.3) References: X-Spamd-Result: default: False [-3.44 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.94)[-0.943]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.32:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.32:from] X-Rspamd-Queue-Id: 4PGpHX0Vy1z3hqG X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Mateusz Guzik wrote on Date: Sat, 04 Feb 2023 17:51:27 UTC : > The branch main has been updated by mjg: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd9d5f2c042a51a9f0dd69eb1fc349efd= 81ffa483 >=20 > commit d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483 > Author: Mateusz Guzik > AuthorDate: 2023-02-04 17:47:41 +0000 > Commit: Mateusz Guzik > CommitDate: 2023-02-04 17:50:41 +0000 >=20 > cpuset: add --count >=20 > Can be used to count the number of hardware threads in the cpu set. >=20 > For example: > $ cpuset -g -p $$ > pid 2440 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, = 16, > 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, = 34, > 35, 36, 37, 38, 39 > pid 2440 domain policy: first-touch mask: 0, 1 > $ cpuset -g --count -p $$ > 40 >=20 > The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus = which > can be found in the tree, which are not adequate given existence of > cpusets. >=20 > Right now only -g -p combination is supported to reduce complexity. > As anything else errors out, this can be expanded later as needed. >=20 > Differential Revision: https://reviews.freebsd.org/D36351 This broke long standing commands sequences in some makefiles that I use to build and run some benchmarks, the commands at issue involve use of cpuset. However I can show the oddity in a much simpler context: # cpuset echo "text" text # cpuset echo "-text" usage: cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] cmd ... cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] -p pid cpuset [-c] [-l cpu-list] [-n policy:domain-list] -C -p pid cpuset [-c] [-l cpu-list] [-n policy:domain-list] [-j jailid | -p pid | -t tid | -s setid | -x irq] cpuset -g [-cir] [-d domain | -j jailid | -p pid | -t tid | -s setid | -x = irq] cpuset -g --count -p pid By contrast, in my stable/13 context, so, showing the old behavior: # cpuset echo "-text" -text =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Wed Feb 15 07:08:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGq1b2rtRz3rPWW for ; Wed, 15 Feb 2023 07:08:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (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 4PGq1b0h3Tz3kRQ for ; Wed, 15 Feb 2023 07:08:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-16ab8581837so21815414fac.4 for ; Tue, 14 Feb 2023 23:08:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=70mnbeQrIObF72Ptp8OmlyUJ+ouvrrWr5ILcFWgAk9A=; b=E2PovoAUzIPjgvPCTY1gfxhMYdkCLlshtlcIJr06eZjQXZ5+6J4l78PBMu5hARhkVL TujEHvIfktdPHSc1bj0oR90OuVKLZyDcQ0kx9GfVeCIpXH0W/m1Z8VJJncleOy/xoJ9d vp7nS9uVsCV8aeoUKm8UbgbhHP0Epr4Y0EeiC4fN15xTPXkw1L43o/bnl1Fj0qewbQFq BLSRH9idRyqzzDQsE72t31YwIetZslgKn0gKTYhAZp4Is/HrH1uLSx86V/xD5/8yaHX4 fj289rbJ5kurZsAYcgX+hLZVnkHhACs1oqblA0H9qsVOZl+9gZLor86gu7eaJgjyv6jL KyKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=70mnbeQrIObF72Ptp8OmlyUJ+ouvrrWr5ILcFWgAk9A=; b=jWMXdrl31pstTCwT4XcRbG5w56n1giw8FsTvthQqndQX6I1qaybEaeFPiv/rNC5HGg fv1yJAP5YvGK8laBPxEpzcW8AICFZJm/y7JwsXXuLEr1ijo7x5YZ4RgWyASlmbqu2IpX rJRUc4Km8m9p4XatXXqaUdaEKgNELrOn0PZqPYiQCVpCDBMUF6CoJj07OfAz0kEFapWq m0l701wZvu9dBTRSiV00pb96OaFjjVuVqIN6e0QDOWjYoseCt0SEXNl0ujDmojHoawdI 8SpYMNrIh9/x18ZUgjYQtjYJQD5q+0QIk8icaCqWCthdgpon4iUK/S97BO0fxR5jho1r QXdA== X-Gm-Message-State: AO0yUKU8IgejWq3asinG0p7lAPU2g03UqPtMPti9HhiY7/+uYaKgHX7A 2cQWblhgWS5QAsNM+Wk1wm7ktbj325xc5mpAHCk= X-Google-Smtp-Source: AK7set8qw9F1ASrZLUWoVe46eMqQJB2wKpN1A/8Aa0Cyfsku859c+FhUZSuc0urQ2QiRFKnz8sHRFjwUu1m+q+8XYz8= X-Received: by 2002:a05:6870:f907:b0:15f:1d8a:8860 with SMTP id ao7-20020a056870f90700b0015f1d8a8860mr138920oac.153.1676444929301; Tue, 14 Feb 2023 23:08:49 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:a8a:1a0c:0:b0:49c:b071:b1e3 with HTTP; Tue, 14 Feb 2023 23:08:48 -0800 (PST) In-Reply-To: References: From: Mateusz Guzik Date: Wed, 15 Feb 2023 08:08:48 +0100 Message-ID: Subject: Re: git: d9d5f2c042a5 - main - cpuset: add --count [changed/broken command line parsing] To: Mark Millard Cc: dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4PGq1b0h3Tz3kRQ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 2/15/23, Mark Millard wrote: > Mateusz Guzik wrote on > Date: Sat, 04 Feb 2023 17:51:27 UTC : > >> The branch main has been updated by mjg: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483 >> >> commit d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483 >> Author: Mateusz Guzik >> AuthorDate: 2023-02-04 17:47:41 +0000 >> Commit: Mateusz Guzik >> CommitDate: 2023-02-04 17:50:41 +0000 >> >> cpuset: add --count >> >> Can be used to count the number of hardware threads in the cpu set. >> >> For example: >> $ cpuset -g -p $$ >> pid 2440 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, >> 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, >> 35, 36, 37, 38, 39 >> pid 2440 domain policy: first-touch mask: 0, 1 >> $ cpuset -g --count -p $$ >> 40 >> >> The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus which >> can be found in the tree, which are not adequate given existence of >> cpusets. >> >> Right now only -g -p combination is supported to reduce complexity. >> As anything else errors out, this can be expanded later as needed. >> >> Differential Revision: https://reviews.freebsd.org/D36351 > > This broke long standing commands sequences in some makefiles > that I use to build and run some benchmarks, the commands > at issue involve use of cpuset. > > However I can show the oddity in a much simpler context: > > # cpuset echo "text" > text > > # cpuset echo "-text" > usage: cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] cmd ... > cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] -p pid > cpuset [-c] [-l cpu-list] [-n policy:domain-list] -C -p pid > cpuset [-c] [-l cpu-list] [-n policy:domain-list] > [-j jailid | -p pid | -t tid | -s setid | -x irq] > cpuset -g [-cir] > [-d domain | -j jailid | -p pid | -t tid | -s setid | -x irq] > cpuset -g --count -p pid > > > By contrast, in my stable/13 context, so, showing the old behavior: > > # cpuset echo "-text" > -text > the idiomatic way to pass progs to spawn is to denote the end of any opts with -- so in particular you would: cpuset -- echo -text the fact that previous version worked without it is kind of a bug -- Mateusz Guzik From nobody Wed Feb 15 07:45:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGqr22Rbhz3rRr9 for ; Wed, 15 Feb 2023 07:45:38 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic310-20.consmr.mail.gq1.yahoo.com (sonic310-20.consmr.mail.gq1.yahoo.com [98.137.69.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGqr16bnvz3nk2 for ; Wed, 15 Feb 2023 07:45:37 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676447135; bh=FMT3eFS+4KM+C40qAAJttTrpCoKt+0Lb3Il6A12HN1I=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=Hn+URmM8eOdK8aeXCxclqOtejUFvXU/sWDsJgHt4SbaHjDr/7qLJVHKuF4yNXkQFXLewLqaKa+CAUx+z1OtSvbCPJDSZQrbfST8V1A5gAxQsSYZg7wGjFwwVpINY0AktB2jEERTdthviaYCk1j2pW+e8yxHSKY6lvq9dAdZK5YyrIoktDnJXVxpFbaVcMPjUNmkzRKaFt+5yZrTbNzcJFmQxrhyypSU1I+rQu+NqzJOTVgdqlzxyquZ3bZoSJ1ovGPzXeqlZQ+qsT7bHVVRfd5MLkiKhVov4HhQs56WfEED+6B3TwIv7q7Vkp5KIw4YVs4lHJqONdbdhjRCh3hwjCA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676447135; bh=yt2G7oD5OUUKlF+VXgt+y04GVU4RGWPcI0tUeGU6b1x=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=My5GsimhZv2xRJdHJ75sE4I66w6esMc0YnuIO8jCW8CsKzQH+/CyAfZk8OvlRe3s3+Oy2llMBth67leKbqWtmRmUIX+wTo0YhqILGldUgog3YUtyYnhNj9Bb2LbO+coKT6qC/NRrSOJ6GkL1bHMqz7rJN+UZoFSqkcmOagGF3a/LwYvkBcHnkZ4LtuX2ql0iEH3y4+TNnTvOqnWlEWfdHQm2TpV5OI5CWLk+S68whscakJ5vu/8lQj7P8qo6882omIQZkBBKUwIzf45pd02JoaZ5Mrb6wAMURGIHq9/nos8hIdmd8cych4Ni/YwWwZqjf+Jlww9Tu8rWWZxqu5qyEw== X-YMail-OSG: 0tKC3c0VM1mCcEI3Z_BLcuNee_DUV338_Srf0yHniPeGwmg1x.xQICoEf7.hH4. QfVuNAHIsa.6VJYTUAyiD4D62XSgJ9Q6Uc5I8eAlECPLAS2Hd56wKz1IjkFTP8wUKqnlM5ofLgm. QZ.rGjaC5OxYtkfErVJIs_HdM5G2lcnNz.Ij3ih3.M6jSyJuIkScRxJFjhUU1LdW8.ywAeuz7Bcy kI1oDBByUf7lEjWE8q1fJ76o9ODWm2R_4x9yA9l.zTe17pz8CDw_Ht3GU6WgCZIl1rc0qFEDIDLr gZ4hqcJpI_zWz8JypcrdkbMHpHlAjYrvVQ21IbW2ouFrnR99P1JPbOukpso6t21ejpYjy5ZHUkFk Wl0GJWMfBH5QnRdXPBtfY_B1BZ.V59Abb7rMbyGql8.8.ftwg913ZnkglMH3Truy0_x5n3M2vj8z ZyUiLEPuxYlKpu6sgLMU7dUzA89suuZgI5xY_gCzlm4PZRB5ssNkRcalDUC4FqXmh_koanjBkjQ7 71HYYf6OrNyE.0vfEQI9gaxCBWuAT5Fz4erRRXxUzr8bqKzBzn3BruQ8QL88iamLJraerRPI7Lda ooAAYXUTaM7TjYvHq4fvanJ0K4fageIhjX.wI29bqqNzDrJNXfnyCLCcy_20D469QRtZVJxY7Btj d8OeMo3RDUkl9MBbWry2efT7t6TdLKqy93lVW.22ZVZWUp3vsxtAjm6hQMr5uNoLA5tlh3rNLjp0 PZJfkYEnx2DoPaUNfqPLB7C5CZaCP12Sp_GonmCVDom7sEn0dq5Xqn6pMaTmVWkfOZqnBF1Zd0ra SKw72lBHdFXcYyPBh6rjAAoSCb9Wwho3ShpLXsSuPTIz5PlQ2OKaVN1vs1e4du5ztWfq43ts9e1D lLCJF3xt8BVB6SCaEzpLgcW2g.JRjBbmyd9mJrxeYOULbUD7H78RwV_Pl5s6lItyQZLm6DlnJEq1 XdE73e0QqGZ46T2kElaS2GS8u32uX2eMxmcbY0Ax.Xpp6OuRyGVl32BV2b5Pk.DmGMpqJ_mzXW05 iTI8tAaIFkhUFFRyeqngL8hr7thfz1OCUASLWxmIWPZUASlG1yGGccsjZqGqsF6swaaedUOeVqvG FfRoJrztQBd3IN0E0j8mUTuCe2BNA6msyAK3cdp_jUTfLrrYKaZxTrPxD..J35I3FCitDeE9I0Fe kxfgR0AjGcOl.uqww2ITaA8vMMJ8VitGkKE2PH26Gf5aByZdDKUWb8orrGK93y39qDcS9fthUsC3 eTfrX.Z0SPaMYP4.UhcYQvfqb2y6N.uKC.gzEiI2TZx7Netx2IeEz1gCuA5f2MuPUTBxuqgwVw7v uH2VWI77Ewlb2q_twt_xBEUMsem3hafiE2.111E9ZeKK8Ras7IW2Wxd4uP96zheeaavCkRSmdZH. TyD9n7MoZk7cVY7SJK8SgX3GPvMRTQvGm3YiCUFTyQyyyBuqCTZk0jpFlHwaWngLl1h8lvVZcp3T v8ZEk.p3x2WAcD8hx1ePKNjdNp04Mvgnq3I6_jKb.EYuJ81yBOggAm6Q141kACOyLFYTIr1Ce8e7 JfqtmoBBx0ieUEisan_DKnSHy9qwHEW57Uhsda1rHTkKNO359xZp6sWX1roqWIjH6YsW.dtIVkoC YNeGGcs7ItTMzJ6iO4J850HHUemNh6BfgR_ndqV1kt9V58V3v9epZAAJY0VSQc8yCnyr_WjFaFAE Gg.ztLomtHJ6gfJZJbecLgBSHtDR01.fSsHgJavdRv..b8H66j6Hq7MYoRiAcTY8GnwGKZxCASuy ugssQHMf6lSqYqBu62hYVtmcpDDjgU2hW2T7oSw3rUjw3v.nFHKB1rvEuQJw1kw0TsAGwN4EZVIg Oe9AHhzwS_zWKiqXwrqIvh4maKDU6gxEG3I08HUxXPZF_lfaPxl7qcKyjEsPK9Cg8gDustmsgIiz rca7tOUL9ifXfvmxsas4CpI20f0qeveZa8Yj8JAKaj_lxWFEdo1AG6k38JV6sbtR32YknaxslqZM 4dcqXu44y4DGwvOxBrrH5aSH2pxmEdyp81d7pVao8orYNuPYmWXh4pqBllbo4o4scM9gDVeKm2Cu P2A030Krkxtb6pDLT4CaeRKAPX2fKGIDI9cR102J4EQEO_Cj4PQdQ3beqGA0diE6cH6YuDr6p9Hj v_dj75z7K_70s3KBLGvptXdESYc7Umg0pKUfdnHosvpe.OMPyCP9pmzuvFId.Ne753TrnhOjEVw8 ExjR0HnuNWaC4.98PMibuS1AP144N5USYUZB9NdgLMJXhzUk8WPmHMkPTZebejsf0HHhXfEPKC9c - X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.gq1.yahoo.com with HTTP; Wed, 15 Feb 2023 07:45:35 +0000 Received: by hermes--production-ne1-746bc6c6c4-7ksjp (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 5bf78bc3ad6a4c8f4bfe54dc2c3fe5f9; Wed, 15 Feb 2023 07:45:29 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: d9d5f2c042a5 - main - cpuset: add --count [changed/broken command line parsing] From: Mark Millard In-Reply-To: Date: Tue, 14 Feb 2023 23:45:17 -0800 Cc: dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Mateusz Guzik X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Rspamd-Queue-Id: 4PGqr16bnvz3nk2 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Feb 14, 2023, at 23:08, Mateusz Guzik wrote: > On 2/15/23, Mark Millard wrote: >> Mateusz Guzik wrote on >> Date: Sat, 04 Feb 2023 17:51:27 UTC : >>=20 >>> The branch main has been updated by mjg: >>>=20 >>> URL: >>> = https://cgit.FreeBSD.org/src/commit/?id=3Dd9d5f2c042a51a9f0dd69eb1fc349efd= 81ffa483 >>>=20 >>> commit d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483 >>> Author: Mateusz Guzik >>> AuthorDate: 2023-02-04 17:47:41 +0000 >>> Commit: Mateusz Guzik >>> CommitDate: 2023-02-04 17:50:41 +0000 >>>=20 >>> cpuset: add --count >>>=20 >>> Can be used to count the number of hardware threads in the cpu set. >>>=20 >>> For example: >>> $ cpuset -g -p $$ >>> pid 2440 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, = 16, >>> 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, = 34, >>> 35, 36, 37, 38, 39 >>> pid 2440 domain policy: first-touch mask: 0, 1 >>> $ cpuset -g --count -p $$ >>> 40 >>>=20 >>> The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus = which >>> can be found in the tree, which are not adequate given existence of >>> cpusets. >>>=20 >>> Right now only -g -p combination is supported to reduce complexity. >>> As anything else errors out, this can be expanded later as needed. >>>=20 >>> Differential Revision: https://reviews.freebsd.org/D36351 >>=20 >> This broke long standing commands sequences in some makefiles >> that I use to build and run some benchmarks, the commands >> at issue involve use of cpuset. >>=20 >> However I can show the oddity in a much simpler context: >>=20 >> # cpuset echo "text" >> text >>=20 >> # cpuset echo "-text" >> usage: cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] cmd = ... >> cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] -p pid >> cpuset [-c] [-l cpu-list] [-n policy:domain-list] -C -p pid >> cpuset [-c] [-l cpu-list] [-n policy:domain-list] >> [-j jailid | -p pid | -t tid | -s setid | -x irq] >> cpuset -g [-cir] >> [-d domain | -j jailid | -p pid | -t tid | -s setid | -x = irq] >> cpuset -g --count -p pid >>=20 >>=20 >> By contrast, in my stable/13 context, so, showing the old behavior: >>=20 >> # cpuset echo "-text" >> -text FYI: the use of quotes was in my original text for other reasons. I should not have duplicated them into the above examples. (Same results without quotes.) > the idiomatic way to pass progs to spawn is to denote the end of any > opts with -- The cpuset man page gives no indication that it requires such notation. Programs with that requirement normally document it explicitly. (Programs that do not require the ntoation often allow the notation without documenting it.) There may be a consideration of how long it has allowed such a lack of use of "--" and how many things might break because it worked before. Lots of programs taking commands do not require such. For example: "time echo -text", "truss echo -text", and "ktrace echo -text". These have not and are not being changed to require such. They do allow the "--" notation. If it stays as it is, the change should probably be in UPDATING or other such place(s) that note where changes are required to keep things working. > so in particular you would: > cpuset -- echo -text Yep. > the fact that previous version worked without it is kind of a bug I disagree with that last statement, given the many programs that do not require such. Some programs have some specific notational complication lead to making it required. But, from what I've seen, most of the others do not make "--" required. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Wed Feb 15 09:23:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGt126qpWz3rXj9; Wed, 15 Feb 2023 09:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGt1261n4z3xX2; Wed, 15 Feb 2023 09:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676453014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oDkUEL0E2PiEEabf7z5WMp6xjM3qEhiN/GHMKYmTYgc=; b=XCLqf+Yd2V/H1n8VDKxu+sr5jIoVIM/QtdBOczMB+AvWL7OXg6WYT1HzaTaIQB1j/7iZh7 ZYRnO5rxKr03QdH8lF0IPePlAjyxL/WyD2TqT1poMM55Wz1sp4LUWGCjK9GJqzB4ZSbjEL 2KZRqPzGce6HO4amNAGQd9E3HCTcqo2pQaLaZUMmPpjKh91M1vWbxhQg7VYl5Ksu4UzRdp Y0qxJV7JM6uFFNvVaM5qNg5dpvp438DechSMYNmDROfjzwukKjlXzqkyHj3N5hGXNNy/XD F8AwyFi6TDIJXUAENsrk9BCgveOu6dTHcB/JKJetpDc3VZYEDtBvbJK9WMs1jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676453014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oDkUEL0E2PiEEabf7z5WMp6xjM3qEhiN/GHMKYmTYgc=; b=Y2hEUGGoz3GWctk5knxkXj5zuWdABjNKxb/ZZIhjg4aX/xGyf31mSfDNYzn/R+BpajpTs3 mA7bohJgEoFIptSJaCx49m/ajIZXTvsQ+1mlhNQTax/vKshl75+tz5kMZelf62p2V7VUwS Xo8khwI7O0g0KYpxv4bCaVMA57FXDF2GPLUuTz8Nq/oE+v+zwCYUvMwYViQG0exB1xTSMY q1wMEomV96XCPfOCamFse5qqha6KtTqtWcIbuN2Ul7If9mPRTJRPLrlQbX4nmlJcNKnxu7 llWb4qXCCl9B9t7Utv6xhT3DH89BGZoFpWVdVmg1VC2QJf/cynkLD2PThhtw0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676453014; a=rsa-sha256; cv=none; b=qpY+W/KqIU/axW+uN3/imxWhRj8e7aPuACCT+qfAXtueAkLXi4P/f3p+G/VXhUnzlP7O6V 8D7/S62k6XlbUrl42C0QTaqpHSmCSwtpaV9EtqsdiOqpDvOYAeOzfWBii9VElbqSw0QrqK sRCEnrUcCW+3PgRB3Hmb1WJuhWvLfKvOxhKCsRe9L/r++0eMUjY0wKfP+QUPKNq/41tM2f k3AefwBs8nkTLVg7EiiKyQN9D0bWyAI1VW3bifaADVke3zNeO1rTaSXTWEYK3pKDqwfdnl 6MuHh18PV4a9NTHHgEzmJXqAdciclpNfGpi+uVWcAQAtGOR595yZxlM/zG1yUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGt12559vzJq4; Wed, 15 Feb 2023 09:23: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 31F9NYBL075269; Wed, 15 Feb 2023 09:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31F9NYBv075268; Wed, 15 Feb 2023 09:23:34 GMT (envelope-from git) Date: Wed, 15 Feb 2023 09:23:34 GMT Message-Id: <202302150923.31F9NYBv075268@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: cbc32e4c5e84 - main - cpuset: Add compat shim to the sched_affinity functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: cbc32e4c5e8427e0f1032d9d3aa5863dd1538c11 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=cbc32e4c5e8427e0f1032d9d3aa5863dd1538c11 commit cbc32e4c5e8427e0f1032d9d3aa5863dd1538c11 Author: Dmitry Chagin AuthorDate: 2023-02-15 09:23:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-15 09:23:15 +0000 cpuset: Add compat shim to the sched_affinity functions To allow to run a newer world on a pre-1400079 kernel a compat shims to the sched_affinity functions has beed added. Reported by: antoine Tested by: antoine Reviewed by: kib Differential revision: https://reviews.freebsd.org/D38555 MFC after: 3 days --- lib/libc/gen/sched_getaffinity.c | 15 ++++++++++++++- lib/libc/gen/sched_setaffinity.c | 14 +++++++++++++- lib/libc/include/libc_private.h | 6 ++++++ sys/sys/param.h | 1 + 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/sched_getaffinity.c b/lib/libc/gen/sched_getaffinity.c index 95145a1eb019..fce47fbfc0d2 100644 --- a/lib/libc/gen/sched_getaffinity.c +++ b/lib/libc/gen/sched_getaffinity.c @@ -26,16 +26,29 @@ * SUCH DAMAGE. */ +#define _WANT_P_OSREL +#include #include #include #include +#include "libc_private.h" + int sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset) { + cpuwhich_t which; int error; - error = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TIDPID, + if (__getosreldate() < P_OSREL_TIDPID) { + if (pid == 0 || pid > _PID_MAX) + which = CPU_WHICH_TID; + else + which = CPU_WHICH_PID; + } else + which = CPU_WHICH_TIDPID; + + error = cpuset_getaffinity(CPU_LEVEL_WHICH, which, pid == 0 ? -1 : pid, cpusetsz, cpuset); if (error == -1 && errno == ERANGE) errno = EINVAL; diff --git a/lib/libc/gen/sched_setaffinity.c b/lib/libc/gen/sched_setaffinity.c index 36ed0f45d417..b878e1affc41 100644 --- a/lib/libc/gen/sched_setaffinity.c +++ b/lib/libc/gen/sched_setaffinity.c @@ -26,20 +26,32 @@ * SUCH DAMAGE. */ +#define _WANT_P_OSREL #include #include #include #include #include +#include "libc_private.h" + int sched_setaffinity(pid_t pid, size_t cpusetsz, const cpuset_t *cpuset) { static int mp_maxid; + cpuwhich_t which; cpuset_t c; int error, lbs, cpu; size_t len, sz; + if (__getosreldate() < P_OSREL_TIDPID) { + if (pid == 0 || pid > _PID_MAX) + which = CPU_WHICH_TID; + else + which = CPU_WHICH_PID; + } else + which = CPU_WHICH_TIDPID; + sz = cpusetsz > sizeof(cpuset_t) ? sizeof(cpuset_t) : cpusetsz; memset(&c, 0, sizeof(c)); memcpy(&c, cpuset, sz); @@ -58,7 +70,7 @@ sched_setaffinity(pid_t pid, size_t cpusetsz, const cpuset_t *cpuset) if (cpu > mp_maxid) CPU_CLR(cpu, &c); } - error = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TIDPID, + error = cpuset_setaffinity(CPU_LEVEL_WHICH, which, pid == 0 ? -1 : pid, sizeof(cpuset_t), &c); if (error == -1 && errno == EDEADLK) errno = EINVAL; diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 641b9272c7fc..0a8e531e0c3c 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -39,6 +39,12 @@ #include #include +/* + * The kernel doesn't expose PID_MAX to the user space. Save it here + * to allow to run a newer world on a pre-1400079 kernel. + */ +#define _PID_MAX 99999 + /* * This global flag is non-zero when a process has created one * or more threads. It is used to avoid calling locking functions diff --git a/sys/sys/param.h b/sys/sys/param.h index 2d5edf9a0b90..e0808609447d 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -107,6 +107,7 @@ #define P_OSREL_CK_SUPERBLOCK 1300000 #define P_OSREL_CK_INODE 1300005 #define P_OSREL_POWERPC_NEW_AUX_ARGS 1300070 +#define P_OSREL_TIDPID 1400079 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif From nobody Wed Feb 15 09:31:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGtBc1xfWz3rY0h; Wed, 15 Feb 2023 09:31:52 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher 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 "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGtBZ4Y5Tz3yv4; Wed, 15 Feb 2023 09:31:50 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=FLkaRBrX; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com; dmarc=pass (policy=none) header.from=bidouilliste.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1676453502; 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=JjuL/tkuDtocShAhi6RdF0l+5JVmj6PdbC/rUuQJTZM=; b=FLkaRBrXtYjrapDQq7hK016pVlMV5JzBlGNO2kxSzkYoPevin5yo8vtRoiC6d4GbSRMiyw UcxU3vKNH95dYcqdt90a8KyQL1s1wpUfGCfrwixFazjg8SlL35+tqSYwA+t6mSNxuqW7GF b31rXwsOneiu6FUOwZBaNXuyqkQcUk8= Received: from skull.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 8f9cf688 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 15 Feb 2023 09:31:42 +0000 (UTC) Date: Wed, 15 Feb 2023 10:31:39 +0100 From: Emmanuel Vadot To: Alan Somers Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7919c76dbdd2 - main - bsdinstall: use gpt/efiboot0 label in /etc/fstab Message-Id: <20230215103139.c66c65a80b9be787deaa36a2@bidouilliste.com> In-Reply-To: <202205241917.24OJHipu099732@gitrepo.freebsd.org> References: <202205241917.24OJHipu099732@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; R_SPF_ALLOW(-0.20)[+ip4:212.83.155.74/32]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@FreeBSD.org,dev-commits-src-all@FreeBSD.org]; DKIM_TRACE(0.00)[bidouilliste.com:+]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[manu]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4PGtBZ4Y5Tz3yv4 X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Hello Alan, On Tue, 24 May 2022 19:17:44 GMT Alan Somers wrote: > The branch main has been updated by asomers: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7919c76dbdd20161247d1bfb647110d87ca5ee0f > > commit 7919c76dbdd20161247d1bfb647110d87ca5ee0f > Author: Alan Somers > AuthorDate: 2022-05-24 18:24:12 +0000 > Commit: Alan Somers > CommitDate: 2022-05-24 19:17:10 +0000 > > bsdinstall: use gpt/efiboot0 label in /etc/fstab > > Otherwise, boot will hang if the numbering of disks has changed since > initial install. > > MFC after: 2 weeks > Sponsored by: Axcient > Reviewed by: brd > Differential Revision: https://reviews.freebsd.org/D35309 So, I understand the initial problem but this causes a new one. efibootmgr is now confused when you ask to print the unix path of the ESP because the device resolved is still ada0p1 (for example) and since it's not mounted anymore as the label is used we can't discover the path to the mounted ESP. Since it's now in 13.2 we've just noticed that at work. We will parse glabel but it's really horrible to parse and it be good to have efibootmgr -E -p working again on a fresh install. Cheers, -- Emmanuel Vadot From nobody Wed Feb 15 11:39:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGx1z3LqCz3pxby; Wed, 15 Feb 2023 11:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGx1z2tT8z49cg; Wed, 15 Feb 2023 11:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676461175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9t+wZD2ojdtQsQaqAyvPutI2iNaXws2LHfOmAYfKbGg=; b=T4qqKedz18NYTqStGml4ZxXExb9iqAFHreCdi97Gr1RHGyEt3kXYPSP5AnZ+3JQNlDMcMr Npbb0/17uBzqZVVEs/fenqPOYxj5eXSwbsOpIo7bzuH2MAIS0zf7+S6ERhYt7NL2cwG1rS QKkM5IHiyNULGk7JkGRcyuR9tmLX6UAOlSB4AQ/hwdn0N/FqtdiF57GiaJGB6H/pir+Vdx q1ZGv7PqueEOVP5Nu8uBU6KZJQedxMiu38zfQCcdEjXcrcx6rV3XJ0CD8Vdg+jeuiiDnCo IuN6datHW0LEPcnFgv3Nr0v+36my7WHBnA9moX1d65rJJPBo9BkETwzQ/rTQ+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676461175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9t+wZD2ojdtQsQaqAyvPutI2iNaXws2LHfOmAYfKbGg=; b=Ja2+kO/yzMsj/aFRPIIY7sEjnzOs7gvs9eVrfx3vXaGN1g/d4Zn628+h3J/zibBFntiSQV i1vu7tRwdFrgLBUvnDPOXw1Gi+8ee1cacKHHj7qxX1wLloZ0G42TKEVbjI7vWwEMVLNUZ8 6wFIVEfIdM718MohFZ2C7mBFxjpt/PFtCVEQ8HH2udCAwdZa4hR+y/ilJr5xg5zh6bFYdG g+2U4LizUYClIZOcKCoqX3iufhaFvh0KNRohiihYlHysOQJc8RU2XQEVdtTlUaOzeZzpqP Jf9eLxSVlrXqoSt4Mao73oxCDKAP6VBDBvPXzqsMSU+TxG3hd21V8uJMLezCKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676461175; a=rsa-sha256; cv=none; b=Lq37vz6hOzxdIs208Ln02Y3wxXFT4uHWRHdx4mG9YZPS0F5gHd+KY6kfllmOc9MbGtkO1l 8eqzdQ1jYx/EOQhQc4fqiYJFOP9plKLONn2kjMeabPwUwgUuO9/0AJxzocX+Hs/c7p5MZz cOVMw7l9G6j6gIA2917bIO+ubxOiK6hBXO/tN/AUpBldJ6npbeZiBzGti8HB/tCMUVGIYj /NHLzM72qXjthgLOw15xsTNzM0Av15JI0cAMnFpCRKk2VokonBvx+bockmFQJxQha0WYpc rUnTD+2OZ/FghKxK1QV69zGD6GiAD5jOHiCcjqCeZfHsgeizcx4UHXuIvk2dpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGx1z1yj8zN2S; Wed, 15 Feb 2023 11:39: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 31FBdZLr060587; Wed, 15 Feb 2023 11:39:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FBdZ2J060586; Wed, 15 Feb 2023 11:39:35 GMT (envelope-from git) Date: Wed, 15 Feb 2023 11:39:35 GMT Message-Id: <202302151139.31FBdZ2J060586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: fe01817876a0 - main - Add an example using /etc/rc.conf syntax List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe01817876a08309becc9ba4f46187a613845049 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=fe01817876a08309becc9ba4f46187a613845049 commit fe01817876a08309becc9ba4f46187a613845049 Author: Poul-Henning Kamp AuthorDate: 2023-02-15 11:39:15 +0000 Commit: Poul-Henning Kamp CommitDate: 2023-02-15 11:39:15 +0000 Add an example using /etc/rc.conf syntax --- share/man/man4/lagg.4 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/man/man4/lagg.4 b/share/man/man4/lagg.4 index b46566120050..f3c7d9a5f713 100644 --- a/share/man/man4/lagg.4 +++ b/share/man/man4/lagg.4 @@ -214,6 +214,15 @@ The following example shows how to create an infiniband failover interface. # ifconfig lagg0 laggproto failover laggport ib0 laggport ib1 \e 1.1.1.1 netmask 255.255.255.0 .Ed +.Pp +Configure two ethernets for failover and static IP in /etc/rc.conf: +.Bd -literal -offset indent +cloned_interfaces="lagg0" +ifconfig_lagg0="laggproto failover laggport bge0 laggport bge1 \e + 10.1.29.21/24" +ifconfig_bge0="up" +ifconfig_bge1="up" +.Ed .Sh SEE ALSO .Xr ng_one2many 4 , .Xr ifconfig 8 , From nobody Wed Feb 15 13:32:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGzXS36tKz3q5Pf; Wed, 15 Feb 2023 13:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGzXS2X8qz4MxM; Wed, 15 Feb 2023 13:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676467960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hnniLCkkjX2Jh84JksN5RCV1OW4v6+yUCqLsniKhYd8=; b=Z0iRatGPg1lmpAMOknM4Z9+yX+HHKSfx+ySrtgew+o5sH+njxb0GOqgFLwvmUfu63DyPnx dlqQoYj6O07//MXzGEkAB66J5swbQJjPeB05t32jqBaGbVl1YdgH36uFncelL9iPWE5QVu Upt8KrajmNIGBigOdwb9aQQOaOakFD5OPOshlOc5a4L0cLwNMDy59/DeFTmGJq64FjWFN7 4FPC2b/by4IaB89z4ZzLLJBIFCs5U+njZ9tr/Fk/Cg2Y3rB6N/hhQM45yjVSCo7eUebQD3 IWEptiksnCL2ac5Ah9fojBgjwrdxvbZETmEo+x57F3eOXWw9mes3Tfmna/rVWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676467960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hnniLCkkjX2Jh84JksN5RCV1OW4v6+yUCqLsniKhYd8=; b=KhoMvD5GQlut0dP6kw7JeiJz2m5QB5w8myQhmJwcJJN/ACV9EjlSzskzR18PAXB4Zon0/U rXlQ/2ZOcH6DRJTK0omWS7WofcN5ZzNe5TI6mLtSD+sOO/p603sNq0es944U6ZRUvNUUCQ 1YRTbqH6x5WLOh/zZxh+NInM2fFlKGNOrg4adynLagKvDdM08yB5gU0UfyF0R1BoikLH6c cyVa/iKIbrffqQ4KFN+Fz9OtaPlpk1sXRE6C3PAdeMqAIeEvlfMismr9Ccwlu7DMikCtut 8YMnaznM3FoWo3W7fcp4IEbFRc120/uFd4zNgORIk5Xycn14vVdoX5lEOIFmlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676467960; a=rsa-sha256; cv=none; b=ezSAktkXUumGGhVienNyWmlgJaQvQWTGoqFBU23dkGijsFc/TRpHSrskU50iJNizbSyJWO TVcyolhjyEbYmZyygu+0X/6yBdTNvCA+XAafzET/jLhLqFPj2eEHkgQX8zpLETQ1/wpld4 LFyuEfl+9CD0oayl/IRAoEdsFvt3u0w+ilfXAL6oWHwct0cJi0UsDeajq0hswK/+c7IPBY UaujppJ97kG35A1Uae8jkVsqUqyCMZr5kbFQpuJD5QL/8Ki570F+1PWq9QGrJTSDdnYHpd yMGLOMJHO2ciu821Awd6yeYNRKt1kMAGIh5Olbqo18d37hW3zZGpFt+W3F697Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PGzXS1cnwzQpy; Wed, 15 Feb 2023 13:32: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 31FDWeKc030630; Wed, 15 Feb 2023 13:32:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FDWeBC030629; Wed, 15 Feb 2023 13:32:40 GMT (envelope-from git) Date: Wed, 15 Feb 2023 13:32:40 GMT Message-Id: <202302151332.31FDWeBC030629@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: c3821149f425 - main - Drop space in "vm object" lock name to improve wchan List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3821149f4252f087ba5133e20896ae4274f4da1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c3821149f4252f087ba5133e20896ae4274f4da1 commit c3821149f4252f087ba5133e20896ae4274f4da1 Author: Ed Maste AuthorDate: 2023-02-15 13:31:17 +0000 Commit: Ed Maste CommitDate: 2023-02-15 13:31:17 +0000 Drop space in "vm object" lock name to improve wchan Lock names are shown in top as a `*` followed by the first five characters of the name. `*vmobj` a little more obvious and easier to search for than `*vm ob`. Differential Revision: https://reviews.freebsd.org/D36264 --- sys/vm/vm_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 341c8aaec01a..be81ad4942a4 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -216,7 +216,7 @@ vm_object_zinit(void *mem, int size, int flags) vm_object_t object; object = (vm_object_t)mem; - rw_init_flags(&object->lock, "vm object", RW_DUPOK | RW_NEW); + rw_init_flags(&object->lock, "vmobject", RW_DUPOK | RW_NEW); /* These are true for any object that has been freed */ object->type = OBJT_DEAD; From nobody Wed Feb 15 13:43:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGzmR1rf8z3q5kX; Wed, 15 Feb 2023 13:43:03 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGzmQ6nfxz4Nn6; Wed, 15 Feb 2023 13:43:02 +0000 (UTC) (envelope-from mike@karels.net) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.16.1/8.16.1) with ESMTP id 31FDh1xV076540; Wed, 15 Feb 2023 07:43:01 -0600 (CST) (envelope-from mike@karels.net) Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id NKqvLWXh7GP6KgEAs/W3XQ (envelope-from ); Wed, 15 Feb 2023 07:43:01 -0600 From: Mike Karels To: Poul-Henning Kamp Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: fe01817876a0 - main - Add an example using /etc/rc.conf syntax Date: Wed, 15 Feb 2023 07:43:01 -0600 X-Mailer: MailMate (1.14r5937) Message-ID: In-Reply-To: <202302151139.31FBdZ2J060586@gitrepo.freebsd.org> References: <202302151139.31FBdZ2J060586@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PGzmQ6nfxz4Nn6 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 15 Feb 2023, at 5:39, Poul-Henning Kamp wrote: > The branch main has been updated by phk: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dfe01817876a08309becc9ba4= f46187a613845049 > > commit fe01817876a08309becc9ba4f46187a613845049 > Author: Poul-Henning Kamp > AuthorDate: 2023-02-15 11:39:15 +0000 > Commit: Poul-Henning Kamp > CommitDate: 2023-02-15 11:39:15 +0000 > > Add an example using /etc/rc.conf syntax > --- > share/man/man4/lagg.4 | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/share/man/man4/lagg.4 b/share/man/man4/lagg.4 > index b46566120050..f3c7d9a5f713 100644 > --- a/share/man/man4/lagg.4 > +++ b/share/man/man4/lagg.4 > @@ -214,6 +214,15 @@ The following example shows how to create an infin= iband failover interface. > # ifconfig lagg0 laggproto failover laggport ib0 laggport ib1 \e > 1.1.1.1 netmask 255.255.255.0 > .Ed > +.Pp > +Configure two ethernets for failover and static IP in /etc/rc.conf: That should be =E2=80=9C.Pa /etc/rc.conf :=E2=80=9D. You should probably also add rc.conf(5) to the SEE ALSO section. Mike > +.Bd -literal -offset indent > +cloned_interfaces=3D"lagg0" > +ifconfig_lagg0=3D"laggproto failover laggport bge0 laggport bge1 \e > + 10.1.29.21/24" > +ifconfig_bge0=3D"up" > +ifconfig_bge1=3D"up" > +.Ed > .Sh SEE ALSO > .Xr ng_one2many 4 , > .Xr ifconfig 8 , From nobody Wed Feb 15 13:59:52 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH07r6LMvz3q6ZF; Wed, 15 Feb 2023 13:59: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 4PH07r5r1tz4PSV; Wed, 15 Feb 2023 13:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676469592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vuhmZcyUFlybO35urzA3kpnruQ49FEHt1UYJ5YftFzk=; b=L6D73l2wuVmb0yGZgMzjSkD2DxdCgm1nYE0fYgVIS/tdZM81KkbqBB4Rt5pNwPHvHDF3VX CqkemcgGe9AcS6L9TU8A35utTOgUFwHi/gSsBwoNhQUTsjT/oNcA/0tRA8dGPex4wexYUg ZEQ+FFu3aoIFuVvZooTlCChrFohQagw3EtnZPmLQiJfhUJAohPAfiu6CPUQWYVVGnvqUHG 8AGCQ/XPmUtb21NB8zJUCAAlPmwZWvbgvu8gelx6LI0TcvyNFWjQCNfpf8E2veVj0gigo9 eAn7c0gFfWli3TAjy0cVkl4XIrwmoKW6e8sd0MNH3we7ONRcuC5/3mMYnpsxuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676469592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vuhmZcyUFlybO35urzA3kpnruQ49FEHt1UYJ5YftFzk=; b=kGvTdQk/NLuU8H/I1sDGfkDlxYLHqYVAwWh56lQ/wD2TG96FBBsb3IuFERQcii11JgI1eM AVFAd+MLtE/1W+c3aXB61f+abIrZr6q97oEDh1OoMaEB/rPXISIP1zerE9MRVnZq+M/rPq BdXd/7oONSaBNQsI+gUX8s3ne+GSgQUlV7r6+ISa5hLXdqq6LI0w9MZUoPvFVQYQyg7jot aTyiR52hdXHhtpjFa9gMk+ogbt1OVCCq/nBZDE6NLR2yeyz1X8ih9J0MiYraHwqjmWxH93 W5H5mSfqdEaAPoFPGeaXTIFawWltete5QOJFVxiFiHSuG724QNol3vLPGkGJRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676469592; a=rsa-sha256; cv=none; b=Ej5kfUUvREX3U+7buwWQajKjxWAo5zTcaPrxhbVf/x0KVKptn+Wko0eQlOIUjxhwo3EHb1 ZvFWuUHSsBNmEU/uuagAeHaGgjMNqgayrJjT/cjkPqi51xC9pAAr9379iiSObNEwimE3hY WBC81pUB9qD8MdL4ES98D6XiR/rb7WBAoAVEqnC4KUb9AipfrimJkEPHyG2/nkCRKDgxnR FCIHTNK5/4pBZW3Fm+9pueuQbvJPgF2vz7GIF2VOfic5UKKajGDhMrPVs/XA2471uhrh8y K+rWPd6SbSXyNb2lxGhqyqMnrwgbxem2OGNiTs+fZkrLWnYirbjZfb24AcAg9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PH07r4tb4zR4q; Wed, 15 Feb 2023 13:59: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 31FDxqN8059363; Wed, 15 Feb 2023 13:59:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FDxqIN059362; Wed, 15 Feb 2023 13:59:52 GMT (envelope-from git) Date: Wed, 15 Feb 2023 13:59:52 GMT Message-Id: <202302151359.31FDxqIN059362@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: 6444662a563b - main - krpc: Add macros so that rpc.tlsservd can run in vnet prison List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6444662a563ba714fed8563645764262c6f5e90f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6444662a563ba714fed8563645764262c6f5e90f commit 6444662a563ba714fed8563645764262c6f5e90f Author: Rick Macklem AuthorDate: 2023-02-15 13:58:21 +0000 Commit: Rick Macklem CommitDate: 2023-02-15 13:58:21 +0000 krpc: Add macros so that rpc.tlsservd can run in vnet prison Commit 7344856e3a6d added a lot of macros that will front end vnet macros so that nfsd(8) can run in vnet prison. This patch adds similar macros named KRPC_VNETxxx so that the rpc.tlsservd(8) daemon can run in a vnet prison, once the macros front end the vnet ones. For now, they are null macros. MFC after: 3 months --- sys/rpc/rpcsec_tls.h | 18 +++++ sys/rpc/rpcsec_tls/rpctls_impl.c | 164 +++++++++++++++++++++++++-------------- 2 files changed, 125 insertions(+), 57 deletions(-) diff --git a/sys/rpc/rpcsec_tls.h b/sys/rpc/rpcsec_tls.h index 6c49f9577cc8..ac2fee1b09fc 100644 --- a/sys/rpc/rpcsec_tls.h +++ b/sys/rpc/rpcsec_tls.h @@ -76,6 +76,9 @@ enum clnt_stat rpctls_srv_disconnect(uint64_t sec, uint64_t usec, /* Initialization function for rpcsec_tls. */ int rpctls_init(void); +/* Cleanup function for rpcsec_tls. */ +void rpctls_cleanup(void); + /* Get TLS information function. */ bool rpctls_getinfo(u_int *maxlen, bool rpctlscd_run, bool rpctlssd_run); @@ -86,6 +89,21 @@ bool rpctls_getinfo(u_int *maxlen, bool rpctlscd_run, /* ssl refno value to indicate TLS handshake being done. */ #define RPCTLS_REFNO_HANDSHAKE 0xFFFFFFFFFFFFFFFFULL +/* Macros for VIMAGE. */ +/* Define the KRPC_VNET macros similar to !VIMAGE. */ +#define KRPC_VNET_NAME(n) n +#define KRPC_VNET_DECLARE(t, n) extern t n +#define KRPC_VNET_DEFINE(t, n) t n +#define KRPC_VNET_DEFINE_STATIC(t, n) static t n +#define KRPC_VNET(n) (n) + +#define CTLFLAG_KRPC_VNET 0 + +#define KRPC_CURVNET_SET(n) +#define KRPC_CURVNET_SET_QUIET(n) +#define KRPC_CURVNET_RESTORE() +#define KRPC_TD_TO_VNET(n) NULL + #endif /* _KERNEL */ #endif /* _RPC_RPCSEC_TLS_H_ */ diff --git a/sys/rpc/rpcsec_tls/rpctls_impl.c b/sys/rpc/rpcsec_tls/rpctls_impl.c index 9d7f686af768..4e9d52bf5d48 100644 --- a/sys/rpc/rpcsec_tls/rpctls_impl.c +++ b/sys/rpc/rpcsec_tls/rpctls_impl.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -51,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -74,15 +77,16 @@ static CLIENT *rpctls_connect_handle; static struct mtx rpctls_connect_lock; static struct socket *rpctls_connect_so = NULL; static CLIENT *rpctls_connect_cl = NULL; -static CLIENT *rpctls_server_handle[RPCTLS_SRV_MAXNPROCS]; static struct mtx rpctls_server_lock; -static struct socket *rpctls_server_so = NULL; -static SVCXPRT *rpctls_server_xprt = NULL; -static bool rpctls_srv_newdaemon = false; -static int rpctls_srv_prevproc = 0; -static bool rpctls_server_busy[RPCTLS_SRV_MAXNPROCS]; static struct opaque_auth rpctls_null_verf; +KRPC_VNET_DEFINE_STATIC(CLIENT **, rpctls_server_handle); +KRPC_VNET_DEFINE_STATIC(struct socket *, rpctls_server_so) = NULL; +KRPC_VNET_DEFINE_STATIC(SVCXPRT *, rpctls_server_xprt) = NULL; +KRPC_VNET_DEFINE_STATIC(bool, rpctls_srv_newdaemon) = false; +KRPC_VNET_DEFINE_STATIC(int, rpctls_srv_prevproc) = 0; +KRPC_VNET_DEFINE_STATIC(bool *, rpctls_server_busy); + static CLIENT *rpctls_connect_client(void); static CLIENT *rpctls_server_client(int procpos); static enum clnt_stat rpctls_server(SVCXPRT *xprt, struct socket *so, @@ -90,10 +94,25 @@ static enum clnt_stat rpctls_server(SVCXPRT *xprt, struct socket *so, uid_t *uid, int *ngrps, gid_t **gids, int *procposp); +static void +rpctls_vnetinit(const void *unused __unused) +{ + int i; + + KRPC_VNET(rpctls_server_handle) = malloc(sizeof(CLIENT *) * + RPCTLS_SRV_MAXNPROCS, M_RPC, M_WAITOK | M_ZERO); + KRPC_VNET(rpctls_server_busy) = malloc(sizeof(bool) * + RPCTLS_SRV_MAXNPROCS, M_RPC, M_WAITOK | M_ZERO); + for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) + KRPC_VNET(rpctls_server_busy)[i] = false; +} +SYSINIT(rpctls_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, + rpctls_vnetinit, NULL); + int rpctls_init(void) { - int error, i; + int error; error = syscall_helper_register(rpctls_syscalls, SY_THR_STATIC_KLD); if (error != 0) { @@ -107,8 +126,6 @@ rpctls_init(void) rpctls_null_verf.oa_flavor = AUTH_NULL; rpctls_null_verf.oa_base = RPCTLS_START_STRING; rpctls_null_verf.oa_length = strlen(RPCTLS_START_STRING); - for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) - rpctls_server_busy[i] = false; return (0); } @@ -133,27 +150,36 @@ sys_rpctls_syscall(struct thread *td, struct rpctls_syscall_args *uap) if (error != 0) return (error); + KRPC_CURVNET_SET(KRPC_TD_TO_VNET(td)); switch (uap->op) { case RPCTLS_SYSC_SRVSTARTUP: - /* Get rid of all old CLIENTs. */ - mtx_lock(&rpctls_server_lock); - for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) { - oldcl[i] = rpctls_server_handle[i]; - rpctls_server_handle[i] = NULL; - rpctls_server_busy[i] = false; - } - rpctls_srv_newdaemon = true; - rpctls_srv_prevproc = 0; - mtx_unlock(&rpctls_server_lock); - for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) { - if (oldcl[i] != NULL) { - CLNT_CLOSE(oldcl[i]); - CLNT_RELEASE(oldcl[i]); + if (jailed(curthread->td_ucred) && + !prison_check_nfsd(curthread->td_ucred)) + error = EPERM; + if (error == 0) { + /* Get rid of all old CLIENTs. */ + mtx_lock(&rpctls_server_lock); + for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) { + oldcl[i] = KRPC_VNET(rpctls_server_handle)[i]; + KRPC_VNET(rpctls_server_handle)[i] = NULL; + KRPC_VNET(rpctls_server_busy)[i] = false; + } + KRPC_VNET(rpctls_srv_newdaemon) = true; + KRPC_VNET(rpctls_srv_prevproc) = 0; + mtx_unlock(&rpctls_server_lock); + for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) { + if (oldcl[i] != NULL) { + CLNT_CLOSE(oldcl[i]); + CLNT_RELEASE(oldcl[i]); + } } } break; case RPCTLS_SYSC_CLSETPATH: - error = copyinstr(uap->path, path, sizeof(path), NULL); + if (jailed(curthread->td_ucred)) + error = EPERM; + if (error == 0) + error = copyinstr(uap->path, path, sizeof(path), NULL); if (error == 0) { error = ENXIO; #ifdef KERN_TLS @@ -209,7 +235,11 @@ sys_rpctls_syscall(struct thread *td, struct rpctls_syscall_args *uap) } break; case RPCTLS_SYSC_SRVSETPATH: - error = copyinstr(uap->path, path, sizeof(path), NULL); + if (jailed(curthread->td_ucred) && + !prison_check_nfsd(curthread->td_ucred)) + error = EPERM; + if (error == 0) + error = copyinstr(uap->path, path, sizeof(path), NULL); if (error == 0) { error = ENXIO; #ifdef KERN_TLS @@ -254,14 +284,14 @@ sys_rpctls_syscall(struct thread *td, struct rpctls_syscall_args *uap) for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) oldcl[i] = NULL; mtx_lock(&rpctls_server_lock); - if (rpctls_srv_newdaemon) { + if (KRPC_VNET(rpctls_srv_newdaemon)) { /* * For a new daemon, the rpctls_srv_handles have * already been cleaned up by RPCTLS_SYSC_SRVSTARTUP. * Scan for an available array entry to use. */ for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) { - if (rpctls_server_handle[i] == NULL) + if (KRPC_VNET(rpctls_server_handle)[i] == NULL) break; } if (i == RPCTLS_SRV_MAXNPROCS && error == 0) @@ -269,14 +299,14 @@ sys_rpctls_syscall(struct thread *td, struct rpctls_syscall_args *uap) } else { /* For an old daemon, clear out old CLIENTs. */ for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) { - oldcl[i] = rpctls_server_handle[i]; - rpctls_server_handle[i] = NULL; - rpctls_server_busy[i] = false; + oldcl[i] = KRPC_VNET(rpctls_server_handle)[i]; + KRPC_VNET(rpctls_server_handle)[i] = NULL; + KRPC_VNET(rpctls_server_busy)[i] = false; } i = 0; /* Set to use rpctls_server_handle[0]. */ } if (error == 0) - rpctls_server_handle[i] = cl; + KRPC_VNET(rpctls_server_handle)[i] = cl; mtx_unlock(&rpctls_server_lock); for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) { @@ -300,10 +330,10 @@ sys_rpctls_syscall(struct thread *td, struct rpctls_syscall_args *uap) case RPCTLS_SYSC_SRVSHUTDOWN: mtx_lock(&rpctls_server_lock); for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) { - oldcl[i] = rpctls_server_handle[i]; - rpctls_server_handle[i] = NULL; + oldcl[i] = KRPC_VNET(rpctls_server_handle)[i]; + KRPC_VNET(rpctls_server_handle)[i] = NULL; } - rpctls_srv_newdaemon = false; + KRPC_VNET(rpctls_srv_newdaemon) = false; mtx_unlock(&rpctls_server_lock); for (i = 0; i < RPCTLS_SRV_MAXNPROCS; i++) { @@ -342,10 +372,10 @@ sys_rpctls_syscall(struct thread *td, struct rpctls_syscall_args *uap) break; case RPCTLS_SYSC_SRVSOCKET: mtx_lock(&rpctls_server_lock); - so = rpctls_server_so; - rpctls_server_so = NULL; - xprt = rpctls_server_xprt; - rpctls_server_xprt = NULL; + so = KRPC_VNET(rpctls_server_so); + KRPC_VNET(rpctls_server_so) = NULL; + xprt = KRPC_VNET(rpctls_server_xprt); + KRPC_VNET(rpctls_server_xprt) = NULL; mtx_unlock(&rpctls_server_lock); if (so != NULL) { error = falloc(td, &fp, &fd, 0); @@ -370,6 +400,7 @@ sys_rpctls_syscall(struct thread *td, struct rpctls_syscall_args *uap) default: error = EINVAL; } + KRPC_CURVNET_RESTORE(); return (error); } @@ -400,11 +431,13 @@ rpctls_server_client(int procpos) { CLIENT *cl; + KRPC_CURVNET_SET_QUIET(KRPC_TD_TO_VNET(curthread)); mtx_lock(&rpctls_server_lock); - cl = rpctls_server_handle[procpos]; + cl = KRPC_VNET(rpctls_server_handle)[procpos]; if (cl != NULL) CLNT_ACQUIRE(cl); mtx_unlock(&rpctls_server_lock); + KRPC_CURVNET_RESTORE(); return (cl); } @@ -611,33 +644,37 @@ rpctls_server(SVCXPRT *xprt, struct socket *so, uint32_t *flags, uint64_t *sslp, uint32_t *gidv; int i, procpos; + KRPC_CURVNET_SET_QUIET(KRPC_TD_TO_VNET(curthread)); cl = NULL; procpos = -1; mtx_lock(&rpctls_server_lock); - for (i = (rpctls_srv_prevproc + 1) % RPCTLS_SRV_MAXNPROCS; - i != rpctls_srv_prevproc; i = (i + 1) % RPCTLS_SRV_MAXNPROCS) { - if (rpctls_server_handle[i] != NULL) + for (i = (KRPC_VNET(rpctls_srv_prevproc) + 1) % RPCTLS_SRV_MAXNPROCS; + i != KRPC_VNET(rpctls_srv_prevproc); + i = (i + 1) % RPCTLS_SRV_MAXNPROCS) { + if (KRPC_VNET(rpctls_server_handle)[i] != NULL) break; } - if (i == rpctls_srv_prevproc) { - if (rpctls_server_handle[i] != NULL) + if (i == KRPC_VNET(rpctls_srv_prevproc)) { + if (KRPC_VNET(rpctls_server_handle)[i] != NULL) procpos = i; } else - rpctls_srv_prevproc = procpos = i; + KRPC_VNET(rpctls_srv_prevproc) = procpos = i; mtx_unlock(&rpctls_server_lock); if (procpos >= 0) cl = rpctls_server_client(procpos); - if (cl == NULL) + if (cl == NULL) { + KRPC_CURVNET_RESTORE(); return (RPC_SYSTEMERROR); + } /* Serialize the server upcalls. */ mtx_lock(&rpctls_server_lock); - while (rpctls_server_busy[procpos]) - msleep(&rpctls_server_busy[procpos], &rpctls_server_lock, PVFS, - "rtlssn", 0); - rpctls_server_busy[procpos] = true; - rpctls_server_so = so; - rpctls_server_xprt = xprt; + while (KRPC_VNET(rpctls_server_busy)[procpos]) + msleep(&KRPC_VNET(rpctls_server_busy)[procpos], + &rpctls_server_lock, PVFS, "rtlssn", 0); + KRPC_VNET(rpctls_server_busy)[procpos] = true; + KRPC_VNET(rpctls_server_so) = so; + KRPC_VNET(rpctls_server_xprt) = xprt; mtx_unlock(&rpctls_server_lock); /* Do the server upcall. */ @@ -672,11 +709,12 @@ rpctls_server(SVCXPRT *xprt, struct socket *so, uint32_t *flags, uint64_t *sslp, /* Once the upcall is done, the daemon is done with the fp and so. */ mtx_lock(&rpctls_server_lock); - rpctls_server_so = NULL; - rpctls_server_xprt = NULL; - rpctls_server_busy[procpos] = false; - wakeup(&rpctls_server_busy[procpos]); + KRPC_VNET(rpctls_server_so) = NULL; + KRPC_VNET(rpctls_server_xprt) = NULL; + KRPC_VNET(rpctls_server_busy)[procpos] = false; + wakeup(&KRPC_VNET(rpctls_server_busy)[procpos]); mtx_unlock(&rpctls_server_lock); + KRPC_CURVNET_RESTORE(); return (stat); } @@ -795,9 +833,21 @@ rpctls_getinfo(u_int *maxlenp, bool rpctlscd_run, bool rpctlssd_run) return (false); if (rpctlscd_run && rpctls_connect_handle == NULL) return (false); - if (rpctlssd_run && rpctls_server_handle[0] == NULL) + KRPC_CURVNET_SET_QUIET(KRPC_TD_TO_VNET(curthread)); + if (rpctlssd_run && KRPC_VNET(rpctls_server_handle)[0] == NULL) { + KRPC_CURVNET_RESTORE(); return (false); + } + KRPC_CURVNET_RESTORE(); *maxlenp = maxlen; return (enable); } +void +rpctls_cleanup(void) +{ + + free(KRPC_VNET(rpctls_server_handle), M_RPC); + free(KRPC_VNET(rpctls_server_busy), M_RPC); +} + From nobody Wed Feb 15 14:43:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH1665TSfz3qPRK; Wed, 15 Feb 2023 14:43: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 4PH1664wjQz3JPT; Wed, 15 Feb 2023 14:43:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676472206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nn3dvEpgEwySnCwX9fC+u1JKF+C4MWdwvINymhV77wE=; b=PKQA0Tm+0/ttQTdooxmkQGVNmnUDqD0MAotmAqbYsh/BuWYGGwYkDPMPH69uRzOyyyqKei BhL6uI00hUYtNro9wRt9J1SD6ZxKLmssrq/zMCPtgpYbYN1/gE6uoFMZ5FNHcDoHBzZhRw NCjZOXE5wNECBnO+MS+snf24vMCCDDur1S9VfH52AdVC/dTUEZL0gzVFkL5XdMnHXcQQ19 ATDiEmSk67YSsMv9aHjyNtDUzXO3YG4LFN4uF15DQWL4WrbKn8iY+ykfdhhr0WnIArx+8d y2bI2ZJoY28YnWd87aTjgwhmgCYiBnW4M85pcw5KtLyVHRm46giKhqUUevF7hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676472206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nn3dvEpgEwySnCwX9fC+u1JKF+C4MWdwvINymhV77wE=; b=bxEhYI23fOdS3uhDNGkfQVkVJGBuRezqH1n1kIAYN33+MPXyk1U4lcjLMF/4jgTBN8M97M WRyukpBZG5/Myw9PKcq0lT6fkuDSR4SPP3cuwnil5xgKFRUq3n32hLvrreCCX1ARYJYpsH dk/+NTfmmotxAhMdLOU2gIn7m+Af3d41+Q36XPX7XtPUU7bIeK+oJ+169PuozJEBzWwfw/ EaAry9MhF2QpvzoTzJutWjPqzs1+Xk2O6FOZEWUhTQWXlMIVa6JihKEUTWGlOf3+ylCMqq N6d3XS7tYR2a3gO3HfIvEXmL2pdSeA+4P6UE+RT0AIigXhdVIuhGV7uHHJ4G2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676472206; a=rsa-sha256; cv=none; b=Ue5mc9sQPHr5kzc2sjPgfg57yJ8XgmspbNJTEe78KUsRr1ldSOr003uJSCeeg5p/IoCfnp +zsAcOAlPLb0rdYM+m7UCWLVjnHfkeNruUerKJQruMUEWM/FJXmUDoqAnYib0qpzzwfXw9 JKNnxMnr29w+0yRxE9NFGDzIjKd5xfO1LqP+ILq+0y66HbLIURkB7VvXgYClwYwsf83gIE SkTtoRp1T1LH9RwdBhwuSpE1HcxNeS6FcyBhvCxWWOsQdToIHEVPNz3h7DadFjxcr6DMIL kIiojxj/vmEygnAuhkh0suKkvLQMEz1ngFCvYRvopUPXEmWRouv6saoZLRpjmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PH1663vtLzSRn; Wed, 15 Feb 2023 14:43: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 31FEhQVK030246; Wed, 15 Feb 2023 14:43:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FEhQxr030245; Wed, 15 Feb 2023 14:43:26 GMT (envelope-from git) Date: Wed, 15 Feb 2023 14:43:26 GMT Message-Id: <202302151443.31FEhQxr030245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 5dc00f00b747 - main - Mechanically convert mlx5en(4) to IfAPI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5dc00f00b74775ee70a13048c2393f1246555452 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=5dc00f00b74775ee70a13048c2393f1246555452 commit 5dc00f00b74775ee70a13048c2393f1246555452 Author: Justin Hibbits AuthorDate: 2022-09-19 20:58:00 +0000 Commit: Justin Hibbits CommitDate: 2023-02-15 14:32:41 +0000 Mechanically convert mlx5en(4) to IfAPI Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38595 --- sys/dev/mlx5/mlx5_en/en.h | 18 +- sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c | 2 +- sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c | 38 ++--- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c | 6 +- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c | 8 +- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 268 +++++++++++++++--------------- sys/dev/mlx5/mlx5_en/mlx5_en_rl.c | 6 +- sys/dev/mlx5/mlx5_en/mlx5_en_rx.c | 14 +- sys/dev/mlx5/mlx5_en/mlx5_en_tx.c | 16 +- sys/dev/mlx5/mlx5_ib/mlx5_ib.h | 2 +- sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 56 ++++--- 11 files changed, 221 insertions(+), 213 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h index d24383f4c927..f4a048a6d2ca 100644 --- a/sys/dev/mlx5/mlx5_en/en.h +++ b/sys/dev/mlx5/mlx5_en/en.h @@ -770,7 +770,7 @@ struct mlx5e_rq { u32 wqe_sz; u32 nsegs; struct mlx5e_rq_mbuf *mbuf; - struct ifnet *ifp; + if_t ifp; struct mlx5e_cq cq; struct lro_ctrl lro; volatile int enabled; @@ -1114,7 +1114,7 @@ struct mlx5e_priv { struct work_struct set_rx_mode_work; MLX5_DECLARE_DOORBELL_LOCK(doorbell_lock) - struct ifnet *ifp; + if_t ifp; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_ifnet; struct sysctl_oid *sysctl_hw; @@ -1200,10 +1200,10 @@ struct mlx5e_eeprom { bool mlx5e_do_send_cqe(struct mlx5e_sq *); int mlx5e_get_full_header_size(const struct mbuf *, const struct tcphdr **); -int mlx5e_xmit(struct ifnet *, struct mbuf *); +int mlx5e_xmit(if_t, struct mbuf *); -int mlx5e_open_locked(struct ifnet *); -int mlx5e_close_locked(struct ifnet *); +int mlx5e_open_locked(if_t); +int mlx5e_close_locked(if_t); void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, int event); void mlx5e_dump_err_cqe(struct mlx5e_cq *, u32, const struct mlx5_err_cqe *); @@ -1221,14 +1221,14 @@ int mlx5e_open_flow_rules(struct mlx5e_priv *priv); void mlx5e_close_flow_rules(struct mlx5e_priv *priv); void mlx5e_set_rx_mode_work(struct work_struct *work); -void mlx5e_vlan_rx_add_vid(void *, struct ifnet *, u16); -void mlx5e_vlan_rx_kill_vid(void *, struct ifnet *, u16); +void mlx5e_vlan_rx_add_vid(void *, if_t, u16); +void mlx5e_vlan_rx_kill_vid(void *, if_t, u16); void mlx5e_enable_vlan_filter(struct mlx5e_priv *priv); void mlx5e_disable_vlan_filter(struct mlx5e_priv *priv); -void mlx5e_vxlan_start(void *arg, struct ifnet *ifp, sa_family_t family, +void mlx5e_vxlan_start(void *arg, if_t ifp, sa_family_t family, u_int port); -void mlx5e_vxlan_stop(void *arg, struct ifnet *ifp, sa_family_t family, +void mlx5e_vxlan_stop(void *arg, if_t ifp, sa_family_t family, u_int port); int mlx5e_add_all_vxlan_rules(struct mlx5e_priv *priv); void mlx5e_del_all_vxlan_rules(struct mlx5e_priv *priv); diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c index f57d70080a46..59a8cbc56bbb 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c @@ -1133,7 +1133,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) MLX5_CAP_ETH(priv->mdev, lro_cap)) { priv->params_ethtool.hw_lro = 1; /* check if feature should actually be enabled */ - if (priv->ifp->if_capenable & IFCAP_LRO) { + if (if_getcapenable(priv->ifp) & IFCAP_LRO) { priv->params.hw_lro_en = true; } else { priv->params.hw_lro_en = false; diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c index 5607aad50da5..aec2bb646644 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c @@ -722,7 +722,7 @@ add_main_vxlan_rules_out: static int mlx5e_vport_context_update_vlans(struct mlx5e_priv *priv) { - struct ifnet *ifp = priv->ifp; + if_t ifp = priv->ifp; int max_list_size; int list_size; u16 *vlans; @@ -914,7 +914,7 @@ mlx5e_enable_vlan_filter(struct mlx5e_priv *priv) { if (priv->vlan.filter_disabled) { priv->vlan.filter_disabled = false; - if (priv->ifp->if_flags & IFF_PROMISC) + if (if_getflags(priv->ifp) & IFF_PROMISC) return; if (test_bit(MLX5E_STATE_FLOW_RULES_READY, &priv->state)) mlx5e_del_any_vid_rules(priv); @@ -926,7 +926,7 @@ mlx5e_disable_vlan_filter(struct mlx5e_priv *priv) { if (!priv->vlan.filter_disabled) { priv->vlan.filter_disabled = true; - if (priv->ifp->if_flags & IFF_PROMISC) + if (if_getflags(priv->ifp) & IFF_PROMISC) return; if (test_bit(MLX5E_STATE_FLOW_RULES_READY, &priv->state)) mlx5e_add_any_vid_rules(priv); @@ -934,7 +934,7 @@ mlx5e_disable_vlan_filter(struct mlx5e_priv *priv) } void -mlx5e_vlan_rx_add_vid(void *arg, struct ifnet *ifp, u16 vid) +mlx5e_vlan_rx_add_vid(void *arg, if_t ifp, u16 vid) { struct mlx5e_priv *priv = arg; @@ -949,7 +949,7 @@ mlx5e_vlan_rx_add_vid(void *arg, struct ifnet *ifp, u16 vid) } void -mlx5e_vlan_rx_kill_vid(void *arg, struct ifnet *ifp, u16 vid) +mlx5e_vlan_rx_kill_vid(void *arg, if_t ifp, u16 vid) { struct mlx5e_priv *priv = arg; @@ -1087,7 +1087,7 @@ mlx5e_sync_ifp_addr(struct mlx5e_priv *priv) struct mlx5e_eth_addr_hash_head head_uc; struct mlx5e_eth_addr_hash_head head_mc; struct mlx5e_eth_addr_hash_node *hn; - struct ifnet *ifp = priv->ifp; + if_t ifp = priv->ifp; size_t x; size_t num; @@ -1110,8 +1110,7 @@ retry: hn = mlx5e_move_hn(&head_free, &head_uc); MPASS(hn != NULL); - ether_addr_copy(hn->ai.addr, - LLADDR((struct sockaddr_dl *)(ifp->if_addr->ifa_addr))); + ether_addr_copy(hn->ai.addr, if_getlladdr(ifp)); ctx.free = &head_free; ctx.fill = &head_uc; @@ -1158,7 +1157,7 @@ static void mlx5e_fill_addr_array(struct mlx5e_priv *priv, int list_type, u8 addr_array[][ETH_ALEN], int size) { bool is_uc = (list_type == MLX5_NIC_VPORT_LIST_TYPE_UC); - struct ifnet *ifp = priv->ifp; + if_t ifp = priv->ifp; struct mlx5e_eth_addr_hash_node *hn; struct mlx5e_eth_addr_hash_head *addr_list; struct mlx5e_eth_addr_hash_node *tmp; @@ -1168,12 +1167,12 @@ static void mlx5e_fill_addr_array(struct mlx5e_priv *priv, int list_type, addr_list = is_uc ? priv->eth_addr.if_uc : priv->eth_addr.if_mc; if (is_uc) /* Make sure our own address is pushed first */ - ether_addr_copy(addr_array[i++], IF_LLADDR(ifp)); + ether_addr_copy(addr_array[i++], if_getlladdr(ifp)); else if (priv->eth_addr.broadcast_enabled) - ether_addr_copy(addr_array[i++], ifp->if_broadcastaddr); + ether_addr_copy(addr_array[i++], if_getbroadcastaddr(ifp)); mlx5e_for_each_hash_node(hn, tmp, addr_list, hi) { - if (ether_addr_equal(IF_LLADDR(ifp), hn->ai.addr)) + if (ether_addr_equal(if_getlladdr(ifp), hn->ai.addr)) continue; if (i >= size) break; @@ -1275,10 +1274,11 @@ static void mlx5e_set_rx_mode_core(struct mlx5e_priv *priv, bool rx_mode_enable) { struct mlx5e_eth_addr_db *ea = &priv->eth_addr; - struct ifnet *ndev = priv->ifp; + if_t ndev = priv->ifp; + int ndev_flags = if_getflags(ndev); - bool promisc_enabled = rx_mode_enable && (ndev->if_flags & IFF_PROMISC); - bool allmulti_enabled = rx_mode_enable && (ndev->if_flags & IFF_ALLMULTI); + bool promisc_enabled = rx_mode_enable && (ndev_flags & IFF_PROMISC); + bool allmulti_enabled = rx_mode_enable && (ndev_flags & IFF_ALLMULTI); bool broadcast_enabled = rx_mode_enable; bool enable_promisc = !ea->promisc_enabled && promisc_enabled; @@ -1290,7 +1290,7 @@ mlx5e_set_rx_mode_core(struct mlx5e_priv *priv, bool rx_mode_enable) /* update broadcast address */ ether_addr_copy(priv->eth_addr.broadcast.addr, - priv->ifp->if_broadcastaddr); + if_getbroadcastaddr(priv->ifp)); if (enable_promisc) { mlx5e_add_eth_addr_rule(priv, &ea->promisc, MLX5E_PROMISC); @@ -1894,7 +1894,7 @@ mlx5e_add_vxlan_rule(struct mlx5e_priv *priv, sa_family_t family, u_int port) } el = mlx5e_vxlan_alloc_db_el(priv, proto, port); - if ((priv->ifp->if_capenable & IFCAP_VXLAN_HWCSUM) != 0) { + if ((if_getcapenable(priv->ifp) & IFCAP_VXLAN_HWCSUM) != 0) { err = mlx5e_add_vxlan_rule_from_db(priv, el); if (err == 0) el->installed = true; @@ -2023,7 +2023,7 @@ mlx5e_del_vxlan_catchall_rule(struct mlx5e_priv *priv) } void -mlx5e_vxlan_start(void *arg, struct ifnet *ifp __unused, sa_family_t family, +mlx5e_vxlan_start(void *arg, if_t ifp __unused, sa_family_t family, u_int port) { struct mlx5e_priv *priv = arg; @@ -2037,7 +2037,7 @@ mlx5e_vxlan_start(void *arg, struct ifnet *ifp __unused, sa_family_t family, } void -mlx5e_vxlan_stop(void *arg, struct ifnet *ifp __unused, sa_family_t family, +mlx5e_vxlan_stop(void *arg, if_t ifp __unused, sa_family_t family, u_int port) { struct mlx5e_priv *priv = arg; diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c index e6b4759aeb7a..b99a7c98500c 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c @@ -309,7 +309,7 @@ mlx5e_tls_set_params(void *ctx, const struct tls_session_params *en) CTASSERT(MLX5E_TLS_ST_INIT == 0); int -mlx5e_tls_snd_tag_alloc(struct ifnet *ifp, +mlx5e_tls_snd_tag_alloc(if_t ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **ppmt) { @@ -320,7 +320,7 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp, const struct tls_session_params *en; int error; - priv = ifp->if_softc; + priv = if_getsoftc(ifp); if (priv->gone != 0 || priv->tls.init == 0) return (EOPNOTSUPP); @@ -489,7 +489,7 @@ mlx5e_tls_snd_tag_free(struct m_snd_tag *pmt) ptag->state = MLX5E_TLS_ST_RELEASE; MLX5E_TLS_TAG_UNLOCK(ptag); - priv = ptag->tag.ifp->if_softc; + priv = if_getsoftc(ptag->tag.ifp); queue_work(priv->tls.wq, &ptag->work); } diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c index 356962cfad99..576eea1d7660 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c @@ -654,7 +654,7 @@ CTASSERT(MLX5E_TLS_RX_ST_INIT == 0); * Returns zero on success else an error happened. */ int -mlx5e_tls_rx_snd_tag_alloc(struct ifnet *ifp, +mlx5e_tls_rx_snd_tag_alloc(if_t ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **ppmt) { @@ -666,7 +666,7 @@ mlx5e_tls_rx_snd_tag_alloc(struct ifnet *ifp, uint32_t value; int error; - priv = ifp->if_softc; + priv = if_getsoftc(ifp); if (unlikely(priv->gone != 0 || priv->tls_rx.init == 0 || params->hdr.flowtype == M_HASHTYPE_NONE)) @@ -801,7 +801,7 @@ mlx5e_tls_rx_snd_tag_alloc(struct ifnet *ifp, goto cleanup; } - if (ifp->if_pcp != IFNET_PCP_NONE || params->tls_rx.vlan_id != 0) { + if (if_getpcp(ifp) != IFNET_PCP_NONE || params->tls_rx.vlan_id != 0) { /* create flow rule for TLS RX traffic (tagged) */ flow_rule = mlx5e_accel_fs_add_inpcb(priv, params->tls_rx.inp, ptag->tirn, MLX5_FS_DEFAULT_FLOW_TAG, params->tls_rx.vlan_id); @@ -996,7 +996,7 @@ mlx5e_tls_rx_snd_tag_free(struct m_snd_tag *pmt) ptag->state = MLX5E_TLS_RX_ST_RELEASE; MLX5E_TLS_RX_TAG_UNLOCK(ptag); - priv = ptag->tag.ifp->if_softc; + priv = if_getsoftc(ptag->tag.ifp); queue_work(priv->tls_rx.wq, &ptag->work); } diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 04e3c302005b..84adef8398bb 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -391,7 +391,7 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) MLX5_PTYS_EN, 1); if (error) { priv->media_active_last = IFM_ETHER; - priv->ifp->if_baudrate = 1; + if_setbaudrate(priv->ifp, 1); mlx5_en_err(priv->ifp, "query port ptys failed: 0x%x\n", error); return; @@ -449,15 +449,15 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) break; } priv->media_active_last = media_entry.subtype | IFM_ETHER | IFM_FDX; - priv->ifp->if_baudrate = media_entry.baudrate; + if_setbaudrate(priv->ifp, media_entry.baudrate); if_link_state_change(priv->ifp, LINK_STATE_UP); } static void -mlx5e_media_status(struct ifnet *dev, struct ifmediareq *ifmr) +mlx5e_media_status(if_t dev, struct ifmediareq *ifmr) { - struct mlx5e_priv *priv = dev->if_softc; + struct mlx5e_priv *priv = if_getsoftc(dev); ifmr->ifm_status = priv->media_status_last; ifmr->ifm_current = ifmr->ifm_active = priv->media_active_last | @@ -530,9 +530,9 @@ mlx5e_set_port_pfc(struct mlx5e_priv *priv) } static int -mlx5e_media_change(struct ifnet *dev) +mlx5e_media_change(if_t dev) { - struct mlx5e_priv *priv = dev->if_softc; + struct mlx5e_priv *priv = if_getsoftc(dev); struct mlx5_core_dev *mdev = priv->mdev; u32 eth_proto_cap; u32 link_mode; @@ -2332,7 +2332,7 @@ mlx5e_get_wqe_sz(struct mlx5e_priv *priv, u32 *wqe_sz, u32 *nsegs) u32 r, n; r = priv->params.hw_lro_en ? priv->params.lro_wqe_sz : - MLX5E_SW2MB_MTU(priv->ifp->if_mtu); + MLX5E_SW2MB_MTU(if_getmtu(priv->ifp)); if (r > MJUM16BYTES) return (-ENOMEM); @@ -3207,9 +3207,9 @@ mlx5e_close_tirs(struct mlx5e_priv *priv) * HW MTU includes all headers and checksums. */ static int -mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) +mlx5e_set_dev_port_mtu(if_t ifp, int sw_mtu) { - struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_priv *priv = if_getsoftc(ifp); struct mlx5_core_dev *mdev = priv->mdev; int hw_mtu; int err; @@ -3231,7 +3231,7 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) err); } - ifp->if_mtu = sw_mtu; + if_setmtu(ifp, sw_mtu); err = mlx5_query_vport_mtu(mdev, &hw_mtu); if (err || !hw_mtu) { @@ -3264,9 +3264,9 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) } int -mlx5e_open_locked(struct ifnet *ifp) +mlx5e_open_locked(if_t ifp) { - struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_priv *priv = if_getsoftc(ifp); int err; u16 set_id; @@ -3338,14 +3338,14 @@ mlx5e_open(void *arg) "Setting port status to up failed\n"); mlx5e_open_locked(priv->ifp); - priv->ifp->if_drv_flags |= IFF_DRV_RUNNING; + if_setdrvflagbits(priv->ifp, IFF_DRV_RUNNING, 0); PRIV_UNLOCK(priv); } int -mlx5e_close_locked(struct ifnet *ifp) +mlx5e_close_locked(if_t ifp) { - struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_priv *priv = if_getsoftc(ifp); /* check if already closed */ if (test_bit(MLX5E_STATE_OPENED, &priv->state) == 0) @@ -3365,9 +3365,9 @@ mlx5e_close_locked(struct ifnet *ifp) } static uint64_t -mlx5e_get_counter(struct ifnet *ifp, ift_counter cnt) +mlx5e_get_counter(if_t ifp, ift_counter cnt) { - struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_priv *priv = if_getsoftc(ifp); u64 retval; /* PRIV_LOCK(priv); XXX not allowed */ @@ -3418,15 +3418,15 @@ mlx5e_get_counter(struct ifnet *ifp, ift_counter cnt) } static void -mlx5e_set_rx_mode(struct ifnet *ifp) +mlx5e_set_rx_mode(if_t ifp) { - struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_priv *priv = if_getsoftc(ifp); queue_work(priv->wq, &priv->set_rx_mode_work); } static int -mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +mlx5e_ioctl(if_t ifp, u_long command, caddr_t data) { struct mlx5e_priv *priv; struct ifreq *ifr; @@ -3443,7 +3443,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) int max_mtu; uint8_t read_addr; - priv = ifp->if_softc; + priv = if_getsoftc(ifp); /* check if detaching */ if (priv == NULL || priv->gone != 0) @@ -3478,27 +3478,27 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) PRIV_UNLOCK(priv); break; case SIOCSIFFLAGS: - if ((ifp->if_flags & IFF_UP) && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if ((if_getflags(ifp) & IFF_UP) && + (if_getdrvflags(ifp) & IFF_DRV_RUNNING)) { mlx5e_set_rx_mode(ifp); break; } PRIV_LOCK(priv); - if (ifp->if_flags & IFF_UP) { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + if (if_getflags(ifp) & IFF_UP) { + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) { if (test_bit(MLX5E_STATE_OPENED, &priv->state) == 0) mlx5e_open_locked(ifp); - ifp->if_drv_flags |= IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0); mlx5_set_port_status(priv->mdev, MLX5_PORT_UP); } } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { mlx5_set_port_status(priv->mdev, MLX5_PORT_DOWN); if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0) mlx5e_close_locked(ifp); mlx5e_update_carrier(priv); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); } } PRIV_UNLOCK(priv); @@ -3521,98 +3521,98 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) drv_ioctl_data = &drv_ioctl_data_d; drv_ioctl_data->reqcap = ifr->ifr_reqcap; PRIV_LOCK(priv); - drv_ioctl_data->reqcap2 = ifp->if_capenable2; + drv_ioctl_data->reqcap2 = if_getcapenable2(ifp); drv_ioctl_data->nvcap = NULL; goto siocsifcap_driver; case SIOCSIFCAPNV: drv_ioctl_data = (struct siocsifcapnv_driver_data *)data; PRIV_LOCK(priv); siocsifcap_driver: - mask = drv_ioctl_data->reqcap ^ ifp->if_capenable; + mask = drv_ioctl_data->reqcap ^ if_getcapenable(ifp); if (mask & IFCAP_TXCSUM) { - ifp->if_capenable ^= IFCAP_TXCSUM; - ifp->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP); + if_togglecapenable(ifp, IFCAP_TXCSUM); + if_togglehwassist(ifp, (CSUM_TCP | CSUM_UDP | CSUM_IP)); - if (IFCAP_TSO4 & ifp->if_capenable && - !(IFCAP_TXCSUM & ifp->if_capenable)) { + if (IFCAP_TSO4 & if_getcapenable(ifp) && + !(IFCAP_TXCSUM & if_getcapenable(ifp))) { mask &= ~IFCAP_TSO4; - ifp->if_capenable &= ~IFCAP_TSO4; - ifp->if_hwassist &= ~CSUM_IP_TSO; + if_setcapenablebit(ifp, 0, IFCAP_TSO4); + if_sethwassistbits(ifp, 0, CSUM_IP_TSO); mlx5_en_err(ifp, "tso4 disabled due to -txcsum.\n"); } } if (mask & IFCAP_TXCSUM_IPV6) { - ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; - ifp->if_hwassist ^= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6); + if_togglecapenable(ifp, IFCAP_TXCSUM_IPV6); + if_togglehwassist(ifp, (CSUM_UDP_IPV6 | CSUM_TCP_IPV6)); - if (IFCAP_TSO6 & ifp->if_capenable && - !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + if (IFCAP_TSO6 & if_getcapenable(ifp) && + !(IFCAP_TXCSUM_IPV6 & if_getcapenable(ifp))) { mask &= ~IFCAP_TSO6; - ifp->if_capenable &= ~IFCAP_TSO6; - ifp->if_hwassist &= ~CSUM_IP6_TSO; + if_setcapenablebit(ifp, 0, IFCAP_TSO6); + if_sethwassistbits(ifp, 0, CSUM_IP6_TSO); mlx5_en_err(ifp, "tso6 disabled due to -txcsum6.\n"); } } if (mask & IFCAP_MEXTPG) - ifp->if_capenable ^= IFCAP_MEXTPG; + if_togglecapenable(ifp, IFCAP_MEXTPG); if (mask & IFCAP_TXTLS4) - ifp->if_capenable ^= IFCAP_TXTLS4; + if_togglecapenable(ifp, IFCAP_TXTLS4); if (mask & IFCAP_TXTLS6) - ifp->if_capenable ^= IFCAP_TXTLS6; + if_togglecapenable(ifp, IFCAP_TXTLS6); #ifdef RATELIMIT if (mask & IFCAP_TXTLS_RTLMT) - ifp->if_capenable ^= IFCAP_TXTLS_RTLMT; + if_togglecapenable(ifp, IFCAP_TXTLS_RTLMT); #endif if (mask & IFCAP_RXCSUM) - ifp->if_capenable ^= IFCAP_RXCSUM; + if_togglecapenable(ifp, IFCAP_RXCSUM); if (mask & IFCAP_RXCSUM_IPV6) - ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; + if_togglecapenable(ifp, IFCAP_RXCSUM_IPV6); if (mask & IFCAP_TSO4) { - if (!(IFCAP_TSO4 & ifp->if_capenable) && - !(IFCAP_TXCSUM & ifp->if_capenable)) { + if (!(IFCAP_TSO4 & if_getcapenable(ifp)) && + !(IFCAP_TXCSUM & if_getcapenable(ifp))) { mlx5_en_err(ifp, "enable txcsum first.\n"); error = EAGAIN; goto out; } - ifp->if_capenable ^= IFCAP_TSO4; - ifp->if_hwassist ^= CSUM_IP_TSO; + if_togglecapenable(ifp, IFCAP_TSO4); + if_togglehwassist(ifp, CSUM_IP_TSO); } if (mask & IFCAP_TSO6) { - if (!(IFCAP_TSO6 & ifp->if_capenable) && - !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + if (!(IFCAP_TSO6 & if_getcapenable(ifp)) && + !(IFCAP_TXCSUM_IPV6 & if_getcapenable(ifp))) { mlx5_en_err(ifp, "enable txcsum6 first.\n"); error = EAGAIN; goto out; } - ifp->if_capenable ^= IFCAP_TSO6; - ifp->if_hwassist ^= CSUM_IP6_TSO; + if_togglecapenable(ifp, IFCAP_TSO6); + if_togglehwassist(ifp, CSUM_IP6_TSO); } if (mask & IFCAP_VLAN_HWTSO) - ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if_togglecapenable(ifp, IFCAP_VLAN_HWTSO); if (mask & IFCAP_VLAN_HWFILTER) { - if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) + if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) mlx5e_disable_vlan_filter(priv); else mlx5e_enable_vlan_filter(priv); - ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; + if_togglecapenable(ifp, IFCAP_VLAN_HWFILTER); } if (mask & IFCAP_VLAN_HWTAGGING) - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if_togglecapenable(ifp, IFCAP_VLAN_HWTAGGING); if (mask & IFCAP_WOL_MAGIC) - ifp->if_capenable ^= IFCAP_WOL_MAGIC; + if_togglecapenable(ifp, IFCAP_WOL_MAGIC); if (mask & IFCAP_VXLAN_HWCSUM) { const bool was_enabled = - (ifp->if_capenable & IFCAP_VXLAN_HWCSUM) != 0; + (if_getcapenable(ifp) & IFCAP_VXLAN_HWCSUM) != 0; if (was_enabled) mlx5e_del_all_vxlan_rules(priv); - ifp->if_capenable ^= IFCAP_VXLAN_HWCSUM; - ifp->if_hwassist ^= CSUM_INNER_IP | CSUM_INNER_IP_UDP | + if_togglecapenable(ifp, IFCAP_VXLAN_HWCSUM); + if_togglehwassist(ifp, CSUM_INNER_IP | CSUM_INNER_IP_UDP | CSUM_INNER_IP_TCP | CSUM_INNER_IP6_UDP | - CSUM_INNER_IP6_TCP; + CSUM_INNER_IP6_TCP); if (!was_enabled) { int err = mlx5e_add_all_vxlan_rules(priv); if (err != 0) { @@ -3622,9 +3622,9 @@ siocsifcap_driver: } } if (mask & IFCAP_VXLAN_HWTSO) { - ifp->if_capenable ^= IFCAP_VXLAN_HWTSO; - ifp->if_hwassist ^= CSUM_INNER_IP_TSO | - CSUM_INNER_IP6_TSO; + if_togglecapenable(ifp, IFCAP_VXLAN_HWTSO); + if_togglehwassist(ifp, CSUM_INNER_IP_TSO | + CSUM_INNER_IP6_TSO); } VLAN_CAPABILITIES(ifp); @@ -3633,10 +3633,10 @@ siocsifcap_driver: int was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); bool need_restart = false; - ifp->if_capenable ^= IFCAP_LRO; + if_togglecapenable(ifp, IFCAP_LRO); /* figure out if updating HW LRO is needed */ - if (!(ifp->if_capenable & IFCAP_LRO)) { + if (!(if_getcapenable(ifp) & IFCAP_LRO)) { if (priv->params.hw_lro_en) { priv->params.hw_lro_en = false; need_restart = true; @@ -3654,8 +3654,8 @@ siocsifcap_driver: } } if (mask & IFCAP_HWRXTSTMP) { - ifp->if_capenable ^= IFCAP_HWRXTSTMP; - if (ifp->if_capenable & IFCAP_HWRXTSTMP) { + if_togglecapenable(ifp, IFCAP_HWRXTSTMP); + if (if_getcapenable(ifp) & IFCAP_HWRXTSTMP) { if (priv->clbr_done == 0) mlx5e_reset_calibration_callout(priv); } else { @@ -3663,11 +3663,11 @@ siocsifcap_driver: priv->clbr_done = 0; } } - mask = drv_ioctl_data->reqcap2 ^ ifp->if_capenable2; + mask = drv_ioctl_data->reqcap2 ^ if_getcapenable2(ifp); if ((mask & IFCAP2_BIT(IFCAP2_RXTLS4)) != 0) - ifp->if_capenable2 ^= IFCAP2_BIT(IFCAP2_RXTLS4); + if_togglecapenable2(ifp, IFCAP2_BIT(IFCAP2_RXTLS4)); if ((mask & IFCAP2_BIT(IFCAP2_RXTLS6)) != 0) - ifp->if_capenable2 ^= IFCAP2_BIT(IFCAP2_RXTLS6); + if_togglecapenable2(ifp, IFCAP2_BIT(IFCAP2_RXTLS6)); out: PRIV_UNLOCK(priv); break; @@ -3911,7 +3911,7 @@ static int mlx5e_create_mkey(struct mlx5e_priv *priv, u32 pdn, struct mlx5_core_mkey *mkey) { - struct ifnet *ifp = priv->ifp; + if_t ifp = priv->ifp; struct mlx5_core_dev *mdev = priv->mdev; int inlen = MLX5_ST_SZ_BYTES(create_mkey_in); void *mkc; @@ -4332,14 +4332,14 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv) } static int -mlx5e_ul_snd_tag_alloc(struct ifnet *ifp, +mlx5e_ul_snd_tag_alloc(if_t ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **ppmt) { struct mlx5e_priv *priv; struct mlx5e_channel *pch; - priv = ifp->if_softc; + priv = if_getsoftc(ifp); if (unlikely(priv->gone || params->hdr.flowtype == M_HASHTYPE_NONE)) { return (EOPNOTSUPP); @@ -4394,7 +4394,7 @@ mlx5e_ul_snd_tag_free(struct m_snd_tag *pmt) } static int -mlx5e_snd_tag_alloc(struct ifnet *ifp, +mlx5e_snd_tag_alloc(if_t ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **ppmt) { @@ -4440,7 +4440,7 @@ static const uint64_t adapter_rates_mlx[NUM_HDWR_RATES_MLX] = { }; static void -mlx5e_ratelimit_query(struct ifnet *ifp __unused, struct if_ratelimit_query_results *q) +mlx5e_ratelimit_query(if_t ifp __unused, struct if_ratelimit_query_results *q) { /* * This function needs updating by the driver maintainer! @@ -4485,7 +4485,7 @@ mlx5e_ifm_add(struct mlx5e_priv *priv, int type) static void * mlx5e_create_ifp(struct mlx5_core_dev *mdev) { - struct ifnet *ifp; + if_t ifp; struct mlx5e_priv *priv; u8 dev_addr[ETHER_ADDR_LEN] __aligned(4); struct sysctl_oid_list *child; @@ -4522,71 +4522,71 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) goto err_free_ifp; } - ifp->if_softc = priv; + if_setsoftc(ifp, priv); if_initname(ifp, "mce", device_get_unit(mdev->pdev->dev.bsddev)); - ifp->if_mtu = ETHERMTU; - ifp->if_init = mlx5e_open; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | - IFF_KNOWSEPOCH; - ifp->if_ioctl = mlx5e_ioctl; - ifp->if_transmit = mlx5e_xmit; - ifp->if_qflush = if_qflush; - ifp->if_get_counter = mlx5e_get_counter; - ifp->if_snd.ifq_maxlen = ifqmaxlen; + if_setmtu(ifp, ETHERMTU); + if_setinitfn(ifp, mlx5e_open); + if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | + IFF_KNOWSEPOCH); + if_setioctlfn(ifp, mlx5e_ioctl); + if_settransmitfn(ifp, mlx5e_xmit); + if_setqflushfn(ifp, if_qflush); + if_setgetcounterfn(ifp, mlx5e_get_counter); + if_setsendqlen(ifp, ifqmaxlen); /* * Set driver features */ - ifp->if_capabilities |= IFCAP_NV; - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6; - ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; - ifp->if_capabilities |= IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWFILTER; - ifp->if_capabilities |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU; - ifp->if_capabilities |= IFCAP_LRO; - ifp->if_capabilities |= IFCAP_TSO | IFCAP_VLAN_HWTSO; - ifp->if_capabilities |= IFCAP_HWSTATS | IFCAP_HWRXTSTMP; - ifp->if_capabilities |= IFCAP_MEXTPG; - ifp->if_capabilities |= IFCAP_TXTLS4 | IFCAP_TXTLS6; + if_setcapabilities(ifp, IFCAP_NV); + if_setcapabilitiesbit(ifp, IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6, 0); + if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING, 0); + if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWFILTER, 0); + if_setcapabilitiesbit(ifp, IFCAP_LINKSTATE | IFCAP_JUMBO_MTU, 0); + if_setcapabilitiesbit(ifp, IFCAP_LRO, 0); + if_setcapabilitiesbit(ifp, IFCAP_TSO | IFCAP_VLAN_HWTSO, 0); + if_setcapabilitiesbit(ifp, IFCAP_HWSTATS | IFCAP_HWRXTSTMP, 0); + if_setcapabilitiesbit(ifp, IFCAP_MEXTPG, 0); + if_setcapabilitiesbit(ifp, IFCAP_TXTLS4 | IFCAP_TXTLS6, 0); #ifdef RATELIMIT - ifp->if_capabilities |= IFCAP_TXRTLMT | IFCAP_TXTLS_RTLMT; + if_setcapabilitiesbit(ifp, IFCAP_TXRTLMT | IFCAP_TXTLS_RTLMT, 0); #endif - ifp->if_capabilities |= IFCAP_VXLAN_HWCSUM | IFCAP_VXLAN_HWTSO; - ifp->if_capabilities2 |= IFCAP2_BIT(IFCAP2_RXTLS4) | - IFCAP2_BIT(IFCAP2_RXTLS6); - ifp->if_snd_tag_alloc = mlx5e_snd_tag_alloc; + if_setcapabilitiesbit(ifp, IFCAP_VXLAN_HWCSUM | IFCAP_VXLAN_HWTSO, 0); + if_setcapabilities2bit(ifp, IFCAP2_BIT(IFCAP2_RXTLS4) | + IFCAP2_BIT(IFCAP2_RXTLS6), 0); + if_setsndtagallocfn(ifp, mlx5e_snd_tag_alloc); #ifdef RATELIMIT - ifp->if_ratelimit_query = mlx5e_ratelimit_query; + if_setratelimitqueryfn(ifp, mlx5e_ratelimit_query); #endif /* set TSO limits so that we don't have to drop TX packets */ - ifp->if_hw_tsomax = MLX5E_MAX_TX_PAYLOAD_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); - ifp->if_hw_tsomaxsegcount = MLX5E_MAX_TX_MBUF_FRAGS - 1 /* hdr */; - ifp->if_hw_tsomaxsegsize = MLX5E_MAX_TX_MBUF_SIZE; - - ifp->if_capenable = ifp->if_capabilities; - ifp->if_capenable2 = ifp->if_capabilities2; - ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TSO) - ifp->if_hwassist |= CSUM_TSO; - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP | CSUM_IP); - if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) - ifp->if_hwassist |= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6); - if (ifp->if_capabilities & IFCAP_VXLAN_HWCSUM) - ifp->if_hwassist |= CSUM_INNER_IP6_UDP | CSUM_INNER_IP6_TCP | + if_sethwtsomax(ifp, MLX5E_MAX_TX_PAYLOAD_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); + if_sethwtsomaxsegcount(ifp, MLX5E_MAX_TX_MBUF_FRAGS - 1 /* hdr */); + if_sethwtsomaxsegsize(ifp, MLX5E_MAX_TX_MBUF_SIZE); + + if_setcapenable(ifp, if_getcapabilities(ifp)); + if_setcapenable2(ifp, if_getcapabilities2(ifp)); + if_sethwassist(ifp, 0); + if (if_getcapenable(ifp) & IFCAP_TSO) + if_sethwassistbits(ifp, CSUM_TSO, 0); + if (if_getcapenable(ifp) & IFCAP_TXCSUM) + if_sethwassistbits(ifp, (CSUM_TCP | CSUM_UDP | CSUM_IP), 0); + if (if_getcapenable(ifp) & IFCAP_TXCSUM_IPV6) + if_sethwassistbits(ifp, (CSUM_UDP_IPV6 | CSUM_TCP_IPV6), 0); + if (if_getcapabilities(ifp) & IFCAP_VXLAN_HWCSUM) + if_sethwassistbits(ifp, CSUM_INNER_IP6_UDP | CSUM_INNER_IP6_TCP | CSUM_INNER_IP | CSUM_INNER_IP_UDP | CSUM_INNER_IP_TCP | - CSUM_ENCAP_VXLAN; - if (ifp->if_capabilities & IFCAP_VXLAN_HWTSO) - ifp->if_hwassist |= CSUM_INNER_IP6_TSO | CSUM_INNER_IP_TSO; + CSUM_ENCAP_VXLAN, 0); + if (if_getcapabilities(ifp) & IFCAP_VXLAN_HWTSO) + if_sethwassistbits(ifp, CSUM_INNER_IP6_TSO | CSUM_INNER_IP_TSO, 0); /* ifnet sysctl tree */ sysctl_ctx_init(&priv->sysctl_ctx); priv->sysctl_ifnet = SYSCTL_ADD_NODE(&priv->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_dev), - OID_AUTO, ifp->if_dname, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + OID_AUTO, if_getdname(ifp), CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "MLX5 ethernet - interface name"); if (priv->sysctl_ifnet == NULL) { mlx5_core_err(mdev, "SYSCTL_ADD_NODE() failed\n"); goto err_free_sysctl; } - snprintf(unit, sizeof(unit), "%d", ifp->if_dunit); + snprintf(unit, sizeof(unit), "%d", if_getdunit(ifp)); priv->sysctl_ifnet = SYSCTL_ADD_NODE(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, unit, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "MLX5 ethernet - interface unit"); @@ -4682,7 +4682,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) } /* set default MTU */ - mlx5e_set_dev_port_mtu(ifp, ifp->if_mtu); + mlx5e_set_dev_port_mtu(ifp, if_getmtu(ifp)); /* Set default media status */ priv->media_status_last = IFM_AVALID; @@ -4805,7 +4805,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) pa.pa_version = PFIL_VERSION; pa.pa_flags = PFIL_IN; pa.pa_type = PFIL_TYPE_ETHERNET; - pa.pa_headname = ifp->if_xname; + pa.pa_headname = if_name(ifp); priv->pfil = pfil_head_register(&pa); PRIV_LOCK(priv); @@ -4866,7 +4866,7 @@ static void mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vpriv) { struct mlx5e_priv *priv = vpriv; - struct ifnet *ifp = priv->ifp; + if_t ifp = priv->ifp; /* don't allow more IOCTLs */ priv->gone = 1; @@ -4964,7 +4964,7 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vpriv) #ifdef DEBUGNET static void -mlx5_en_debugnet_init(struct ifnet *dev, int *nrxr, int *ncl, int *clsize) +mlx5_en_debugnet_init(if_t dev, int *nrxr, int *ncl, int *clsize) { struct mlx5e_priv *priv = if_getsoftc(dev); @@ -4976,12 +4976,12 @@ mlx5_en_debugnet_init(struct ifnet *dev, int *nrxr, int *ncl, int *clsize) } static void -mlx5_en_debugnet_event(struct ifnet *dev, enum debugnet_ev event) +mlx5_en_debugnet_event(if_t dev, enum debugnet_ev event) { } static int -mlx5_en_debugnet_transmit(struct ifnet *dev, struct mbuf *m) +mlx5_en_debugnet_transmit(if_t dev, struct mbuf *m) { struct mlx5e_priv *priv = if_getsoftc(dev); struct mlx5e_sq *sq; @@ -5011,7 +5011,7 @@ mlx5_en_debugnet_transmit(struct ifnet *dev, struct mbuf *m) } static int -mlx5_en_debugnet_poll(struct ifnet *dev, int count) +mlx5_en_debugnet_poll(if_t dev, int count) { struct mlx5e_priv *priv = if_getsoftc(dev); diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c index d00e99fce1d4..e4f6c0bdf979 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c @@ -515,7 +515,7 @@ mlx5e_rlw_channel_set_rate_locked(struct mlx5e_rl_worker *rlw, /* get current burst size in bytes */ temp = rl->param.tx_burst_size * - MLX5E_SW2HW_MTU(rlw->priv->ifp->if_mtu); + MLX5E_SW2HW_MTU(if_getmtu(rlw->priv->ifp)); /* limit burst size to 64K currently */ if (temp > 65535) @@ -1202,7 +1202,7 @@ mlx5e_find_available_tx_ring_index(struct mlx5e_rl_worker *rlw, } int -mlx5e_rl_snd_tag_alloc(struct ifnet *ifp, +mlx5e_rl_snd_tag_alloc(if_t ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **ppmt) { @@ -1211,7 +1211,7 @@ mlx5e_rl_snd_tag_alloc(struct ifnet *ifp, struct mlx5e_priv *priv; int error; - priv = ifp->if_softc; + priv = if_getsoftc(ifp); /* check if there is support for packet pacing or if device is going away */ if (!MLX5_CAP_GEN(priv->mdev, qos) || diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c index 4b1fb25e0f82..28a49ec98fb2 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c @@ -279,7 +279,7 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, struct mlx5e_rq *rq, struct mbuf *mb, u32 cqe_bcnt) { - struct ifnet *ifp = rq->ifp; + if_t ifp = rq->ifp; struct mlx5e_channel *c; struct mbuf *mb_head; int lro_num_seg; /* HW LRO session aggregated packets counter */ @@ -375,7 +375,7 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, } else { rq->stats.csum_none++; } - } else if (likely((ifp->if_capenable & (IFCAP_RXCSUM | + } else if (likely((if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) != 0) && ((cqe->hds_ip_ext & (CQE_L2_OK | CQE_L3_OK | CQE_L4_OK)) == (CQE_L2_OK | CQE_L3_OK | CQE_L4_OK))) { @@ -501,7 +501,7 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) struct pfil_head *pfil; int i, rv; - CURVNET_SET_QUIET(rq->ifp->if_vnet); + CURVNET_SET_QUIET(if_getvnet(rq->ifp)); pfil = rq->channel->priv->pfil; for (i = 0; i < budget; i++) { struct mlx5e_rx_wqe *wqe; @@ -586,17 +586,17 @@ rx_common: rq->stats.bytes += byte_cnt; rq->stats.packets++; #ifdef NUMA - mb->m_pkthdr.numa_domain = rq->ifp->if_numa_domain; + mb->m_pkthdr.numa_domain = if_getnumadomain(rq->ifp); #endif #if !defined(HAVE_TCP_LRO_RX) tcp_lro_queue_mbuf(&rq->lro, mb); #else if (mb->m_pkthdr.csum_flags == 0 || - (rq->ifp->if_capenable & IFCAP_LRO) == 0 || + (if_getcapenable(rq->ifp) & IFCAP_LRO) == 0 || rq->lro.lro_cnt == 0 || *** 228 LINES SKIPPED *** From nobody Wed Feb 15 15:11:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH1kw3Dxwz3qRKB; Wed, 15 Feb 2023 15:11:52 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher 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 "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PH1kt4LSqz3MPF; Wed, 15 Feb 2023 15:11:50 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=DRHp5UjO; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com; dmarc=pass (policy=none) header.from=bidouilliste.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1676473907; 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=uQ2rDm8R8B3zk/+1R9C3UOrfkESIS8IZxlk282KSa78=; b=DRHp5UjOCpUqKJHKiB/JLusMYOMp4zZgWGMeg2tF06XF+lOhmPE07k6uHOvnE6vEt/uUhu AlMFZTT9XKQawFAjcQNHv0c4z+Eb6vV9auuk8VEDj0vF9s9d7SIWHbeXYCtSL6uJnevASf pqVzhoF+mTO03BfgwPDt4Rxz3pc375o= Received: from skull.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id ff68eec8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 15 Feb 2023 15:11:47 +0000 (UTC) Date: Wed, 15 Feb 2023 16:11:43 +0100 From: Emmanuel Vadot To: Alan Somers Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7919c76dbdd2 - main - bsdinstall: use gpt/efiboot0 label in /etc/fstab Message-Id: <20230215161143.246cfa8146b0777b24bdb491@bidouilliste.com> In-Reply-To: <20230215103139.c66c65a80b9be787deaa36a2@bidouilliste.com> References: <202205241917.24OJHipu099732@gitrepo.freebsd.org> <20230215103139.c66c65a80b9be787deaa36a2@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; R_SPF_ALLOW(-0.20)[+ip4:212.83.155.74/32]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; DKIM_TRACE(0.00)[bidouilliste.com:+]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[manu]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4PH1kt4LSqz3MPF X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On Wed, 15 Feb 2023 10:31:39 +0100 Emmanuel Vadot wrote: > > Hello Alan, > > On Tue, 24 May 2022 19:17:44 GMT > Alan Somers wrote: > > > The branch main has been updated by asomers: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=7919c76dbdd20161247d1bfb647110d87ca5ee0f > > > > commit 7919c76dbdd20161247d1bfb647110d87ca5ee0f > > Author: Alan Somers > > AuthorDate: 2022-05-24 18:24:12 +0000 > > Commit: Alan Somers > > CommitDate: 2022-05-24 19:17:10 +0000 > > > > bsdinstall: use gpt/efiboot0 label in /etc/fstab > > > > Otherwise, boot will hang if the numbering of disks has changed since > > initial install. > > > > MFC after: 2 weeks > > Sponsored by: Axcient > > Reviewed by: brd > > Differential Revision: https://reviews.freebsd.org/D35309 > > So, I understand the initial problem but this causes a new one. > efibootmgr is now confused when you ask to print the unix path of the > ESP because the device resolved is still ada0p1 (for example) and since > it's not mounted anymore as the label is used we can't discover the > path to the mounted ESP. > Since it's now in 13.2 we've just noticed that at work. > We will parse glabel but it's really horrible to parse and it be good > to have efibootmgr -E -p working again on a fresh install. > > Cheers, corvink@ created a bug entry for this : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269564 It also break efibootmgr to install new boot entries. -- Emmanuel Vadot From nobody Wed Feb 15 16:34:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH3Zz1RgKz3qWsc; Wed, 15 Feb 2023 16:35:07 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) (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 4PH3Zy6VVTz3mSl; Wed, 15 Feb 2023 16:35:06 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-vk1-f172.google.com with SMTP id n22so6027060vkm.11; Wed, 15 Feb 2023 08:35:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1676478906; 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=Y2qLFpQ+fagAlZozY6/gZ1eVXvOOOJtkO+FgSl5EGBo=; b=B/qSt29gIPshaiJmKrGn2QFCpGTZIkZtZHe8n0CUvKQbMnMFzc0sSTS7ZBDCfwRSuw +CZLplnkbV1pP0VAmeQWtmH8pCpJsHqBgZ56MTcz7Lqgwo9jzOlai4EmN8o0DyKF4+Nh dTUArvLG3x5vRZxPDWiDO2Onr3JVIYkE0k05URf3rDwbfSyhZwe7VpqLamwnFjLTw9yu +RjAJDaBjCzrJWRjnZ4RL5hxIqjtSc4MbMIyhYEyBIq7RYlsz2vVevYe5NGG9ARB+3D0 0KGmCNM/tRYZwjZXHmNMN6HlAypq0ejI/OY/eLPER4jhgBlqKkhKZqfQHTdBeTaZA3k5 +2Og== X-Gm-Message-State: AO0yUKUgsLR+Ew5SFVM7WddgdrI2XMjxlcVlQGL++ASbQyIGPPWVT9pb FITrqaEnzAOUKU/KFeRryLy4iLjglnbO6sjjVR32v32A X-Google-Smtp-Source: AK7set+uLtYqTIR//bsSZDRE3CDlGk9XRhYib1cfTFB5gP+5IGCfAHcKvcpXle9fx+A6vL3bYBeBx6K1xeleYbwiCs8= X-Received: by 2002:a05:6122:1436:b0:3e1:f8b0:e35d with SMTP id o22-20020a056122143600b003e1f8b0e35dmr413190vkp.35.1676478905691; Wed, 15 Feb 2023 08:35:05 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202205241917.24OJHipu099732@gitrepo.freebsd.org> <20230215103139.c66c65a80b9be787deaa36a2@bidouilliste.com> In-Reply-To: <20230215103139.c66c65a80b9be787deaa36a2@bidouilliste.com> From: Alan Somers Date: Wed, 15 Feb 2023 09:34:53 -0700 Message-ID: Subject: Re: git: 7919c76dbdd2 - main - bsdinstall: use gpt/efiboot0 label in /etc/fstab To: Emmanuel Vadot 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-Rspamd-Queue-Id: 4PH3Zy6VVTz3mSl 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 Wed, Feb 15, 2023 at 2:31 AM Emmanuel Vadot wrote: > > > Hello Alan, > > On Tue, 24 May 2022 19:17:44 GMT > Alan Somers wrote: > > > The branch main has been updated by asomers: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=7919c76dbdd20161247d1bfb647110d87ca5ee0f > > > > commit 7919c76dbdd20161247d1bfb647110d87ca5ee0f > > Author: Alan Somers > > AuthorDate: 2022-05-24 18:24:12 +0000 > > Commit: Alan Somers > > CommitDate: 2022-05-24 19:17:10 +0000 > > > > bsdinstall: use gpt/efiboot0 label in /etc/fstab > > > > Otherwise, boot will hang if the numbering of disks has changed since > > initial install. > > > > MFC after: 2 weeks > > Sponsored by: Axcient > > Reviewed by: brd > > Differential Revision: https://reviews.freebsd.org/D35309 > > So, I understand the initial problem but this causes a new one. > efibootmgr is now confused when you ask to print the unix path of the > ESP because the device resolved is still ada0p1 (for example) and since > it's not mounted anymore as the label is used we can't discover the > path to the mounted ESP. > Since it's now in 13.2 we've just noticed that at work. > We will parse glabel but it's really horrible to parse and it be good > to have efibootmgr -E -p working again on a fresh install. > > Cheers, > > -- > Emmanuel Vadot Annoying. Could you please open a bugzilla PR so we don't lose track of this? From nobody Wed Feb 15 16:48:42 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH3tt3pcPz3qY9j for ; Wed, 15 Feb 2023 16:48:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (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 4PH3tt3MpJz3r9k for ; Wed, 15 Feb 2023 16:48:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x533.google.com with SMTP id cq19so20449926edb.5 for ; Wed, 15 Feb 2023 08:48:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=f9HHNSj0BJ9JJz02WdH58PNIqR0yq8mvHeKrTOnr3UM=; b=l/BS+zbuxy8h7kw10/QUitLsuuhQPjo7db2BtzdEmIouaC6pOSqM5BMeDONgYrb0Gy VOuY1qOBe64Gh8Wej6r2b4M41WegTTZBMrJKe83PvtJfhekwdiD+mXd7TS9e7XJKbyYb 7aOQuDaWDinRDNxOfARImdfWtoErE6Xz0iolYbBOUUAlvLQib+RkU8z6tIftJDLdOOW1 ooAmxs47cNLfnA+ad+4VGok8fsug9oUP7e4Qxhk47lXbQmmhZG3hANA7Eq0l09b0ScLt BojbwgQNQZ3RTk+DZgr4er7+LH/2Vf409pFXR3x8oezMpx4Lbsmvn1ltclZd6era1B5J JMDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=f9HHNSj0BJ9JJz02WdH58PNIqR0yq8mvHeKrTOnr3UM=; b=DCQHtfQ/urA/E82xRhB7gjnXPcC8oVuldpucxDWKawTQG/AWJov+pt0fqglJGWycNP JfVlxz+U0JGeqoRK7Bq0wsBIU7iGQIF5DTFEjtQsS5pUdPe5KKyBO7vjWUYeo26Ci6n9 ienFvE51zV7CtTc+HSSYK8clUWgK+952lQ0iacMVKGFIWQ6eUT9TkR2xTG/Eg+B1Mqix B2IqAHTg+yMfeowK8TRidXihhPDcWnZRmu8dW9sw05DFnmW7bofYRMwxZZrSrdI16H5H Cr+0dHMkpY5bvIFfplwwqU1I/8zpn9fCDlgD/c75w580ZRqoIPu0ZJZ4a+g8sxF+AUir g9aQ== X-Gm-Message-State: AO0yUKW1n8RwWQtgRwreJbJC19mcstS2rwwOr7BQEAlKa/Aq6byiR3HV VU6W4XMO9c0JnionsD7zzXg45BdMsh83PnNon1lUDg== X-Google-Smtp-Source: AK7set/wwQhLk4T1b+YQO9iy1D1+t1fW+CrZvk3uMGjcWmAFCh+J9r+z0lsgsFzjygKRQbhDOqAv+4kFMIhTjoLH/kY= X-Received: by 2002:a17:906:a409:b0:8b1:2d36:a58e with SMTP id l9-20020a170906a40900b008b12d36a58emr1435934ejz.2.1676479733296; Wed, 15 Feb 2023 08:48:53 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202205241917.24OJHipu099732@gitrepo.freebsd.org> <20230215103139.c66c65a80b9be787deaa36a2@bidouilliste.com> In-Reply-To: From: Warner Losh Date: Wed, 15 Feb 2023 09:48:42 -0700 Message-ID: Subject: Re: git: 7919c76dbdd2 - main - bsdinstall: use gpt/efiboot0 label in /etc/fstab To: Alan Somers Cc: Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000fa048e05f4bfda11" X-Rspamd-Queue-Id: 4PH3tt3MpJz3r9k 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 --000000000000fa048e05f4bfda11 Content-Type: text/plain; charset="UTF-8" On Wed, Feb 15, 2023 at 9:35 AM Alan Somers wrote: > On Wed, Feb 15, 2023 at 2:31 AM Emmanuel Vadot > wrote: > > > > > > Hello Alan, > > > > On Tue, 24 May 2022 19:17:44 GMT > > Alan Somers wrote: > > > > > The branch main has been updated by asomers: > > > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=7919c76dbdd20161247d1bfb647110d87ca5ee0f > > > > > > commit 7919c76dbdd20161247d1bfb647110d87ca5ee0f > > > Author: Alan Somers > > > AuthorDate: 2022-05-24 18:24:12 +0000 > > > Commit: Alan Somers > > > CommitDate: 2022-05-24 19:17:10 +0000 > > > > > > bsdinstall: use gpt/efiboot0 label in /etc/fstab > > > > > > Otherwise, boot will hang if the numbering of disks has changed > since > > > initial install. > > > > > > MFC after: 2 weeks > > > Sponsored by: Axcient > > > Reviewed by: brd > > > Differential Revision: https://reviews.freebsd.org/D35309 > > > > So, I understand the initial problem but this causes a new one. > > efibootmgr is now confused when you ask to print the unix path of the > > ESP because the device resolved is still ada0p1 (for example) and since > > it's not mounted anymore as the label is used we can't discover the > > path to the mounted ESP. > > Since it's now in 13.2 we've just noticed that at work. > > We will parse glabel but it's really horrible to parse and it be good > > to have efibootmgr -E -p working again on a fresh install. > > > > Cheers, > > > > -- > > Emmanuel Vadot > > Annoying. Could you please open a bugzilla PR so we don't lose track of > this? > Yea, when I wrote the code I kinda gave up after needing to walk backwards in the geom mesh for places there were no back pointers. I've left more details on the bug that corvind@ filled. Likely a little brute force is all that's needed to find what we need... Warner --000000000000fa048e05f4bfda11 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Feb 15, 2023 at 9:35 AM Alan = Somers <asomers@freebsd.org&g= t; wrote:
On Wed= , Feb 15, 2023 at 2:31 AM Emmanuel Vadot <manu@bidouilliste.com> wrote:
>
>
>=C2=A0 Hello Alan,
>
> On Tue, 24 May 2022 19:17:44 GMT
> Alan Somers <asomers@FreeBSD.org> wrote:
>
> > The branch main has been updated by asomers:
> >
> > URL: htt= ps://cgit.FreeBSD.org/src/commit/?id=3D7919c76dbdd20161247d1bfb647110d87ca5= ee0f
> >
> > commit 7919c76dbdd20161247d1bfb647110d87ca5ee0f
> > Author:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@FreeBSD.org>= ;
> > AuthorDate: 2022-05-24 18:24:12 +0000
> > Commit:=C2=A0 =C2=A0 =C2=A0Alan Somers <asomers@FreeBSD.org>= ;
> > CommitDate: 2022-05-24 19:17:10 +0000
> >
> >=C2=A0 =C2=A0 =C2=A0bsdinstall: use gpt/efiboot0 label in /etc/fst= ab
> >
> >=C2=A0 =C2=A0 =C2=A0Otherwise, boot will hang if the numbering of = disks has changed since
> >=C2=A0 =C2=A0 =C2=A0initial install.
> >
> >=C2=A0 =C2=A0 =C2=A0MFC after:=C2=A0 =C2=A0 =C2=A0 2 weeks
> >=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Axcient
> >=C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 brd
> >=C2=A0 =C2=A0 =C2=A0Differential Revision: https://review= s.freebsd.org/D35309
>
>=C2=A0 So, I understand the initial problem but this causes a new one.<= br> >=C2=A0 efibootmgr is now confused when you ask to print the unix path o= f the
> ESP because the device resolved is still ada0p1 (for example) and sinc= e
> it's not mounted anymore as the label is used we can't discove= r the
> path to the mounted ESP.
>=C2=A0 Since it's now in 13.2 we've just noticed that at work.<= br> >=C2=A0 We will parse glabel but it's really horrible to parse and i= t be good
> to have efibootmgr -E -p working again on a fresh install.
>
>=C2=A0 Cheers,
>
> --
> Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>

Annoying.=C2=A0 Could you please open a bugzilla PR so we don't lose tr= ack of this?

Yea, when I wrote the code= I kinda gave up after needing to walk backwards in
the geom mesh= for places there were no back pointers. I've left more details on the<= /div>
bug that corvind@ filled. Likely a little brute force is all that= 's needed to find what
we need...

Wa= rner
--000000000000fa048e05f4bfda11-- From nobody Wed Feb 15 18:30:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH68Q2gcfz3r9QF; Wed, 15 Feb 2023 18:30: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 4PH68Q2FGLz46rJ; Wed, 15 Feb 2023 18:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676485846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uj1hrVdNocxhYJnprfviHUNXfecL32fld4w6LNYPnj0=; b=D3BTk4Q/RDgG96YrDP2cgvlsAY62rNcvBgubF9vCkZWy2Umqm7DHgBAfeoB9HZ1Jh0lX6F wRVZFVkBZfw+sSGf5lR95k2kd0UexA3INM853LqbhwFnCuRX4D9bKFzvxYpts7XflKlcKS HCEiVt1wZ5q3yK/vWAE8so0cRTNYOLpGq49I/R/KWKQXGRqzX4Z3rcem7tGEZeh+BuDu7V NMqzICNsfKVmxu2xi0vPp13BjTScfDjtoNLGkZLhMgPw0EGk4v1CUBVlGOhbfxFPIQJtUR sK6r6mpBSJU8I5Rvw2p2du5EVRd4o4EqJ2hHWS7zgct56zkeziv+JXGob11bCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676485846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uj1hrVdNocxhYJnprfviHUNXfecL32fld4w6LNYPnj0=; b=sQIde9t4ROSQl6aP2MP16AJFWUS8kMIknKk9Kuh+UAtJfX9y1RBedGNx9Z2s0Mt0INhDHI 6O0iJDHtNpf/WdraasoH0I9BrLvq2y/SqzZH7xlnzaFXXO/SEhwL6MUItJP+nHCkcQ5sAt 4GlFFHyOn8gcieLhWIvnqiky0XUNgTeb9Av73kjOyUM3xWZSERUES09lV9XC8Fm7YdSbr2 BpteOFzYSMlde4OhoAqgshF/zmomhYw0+ObLmgG2ljzUF+mQVXVnDY1KBSd5B7YuNKTwfG t1XXn7N6gxWBqBYGWiCtSvTV2HlqYK0tpYXpalGPjtxwbFLWGNoHapVGN+lh6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676485846; a=rsa-sha256; cv=none; b=gHsGAB9qN07yHcCtw8XjaQbw7eK4fApmHCXIiSpi6YFRwvnaHA10yr/KLqWMZOxLeMsrH1 kwxJuMvPr87ntOm2otZYjvLn4ZWOpANXbPmew7XKYwVTbyaRhyOAp/B2k87QNZKDmMmMCQ gZxDwcLaVX7kXYNdJTuULuH99mfDKWAYDyBkcfROZS91vD+OmWs7mKUjLqG+zH7czQwIss Hd7cJ5pFnsiJZtNLWmoTlyw7+PUSzK7Vo9p/OnUwYKWXxxO+Osu18UX7WqQfF+Pe8JvaNr luTMU4GHRk03Owsu7QtfZuYFUqkinWZkkX3tvXyAJ8nzEutXgKd+tn9kBAAuPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PH68Q1JGvzZPG; Wed, 15 Feb 2023 18:30: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 31FIUkp1055876; Wed, 15 Feb 2023 18:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FIUk9m055875; Wed, 15 Feb 2023 18:30:46 GMT (envelope-from git) Date: Wed, 15 Feb 2023 18:30:46 GMT Message-Id: <202302151830.31FIUk9m055875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 96871af01382 - main - inpcb: use family specific sockaddr argument for bind functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96871af01382ecaec59ccbf6999ba8ad76a5f9e9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=96871af01382ecaec59ccbf6999ba8ad76a5f9e9 commit 96871af01382ecaec59ccbf6999ba8ad76a5f9e9 Author: Gleb Smirnoff AuthorDate: 2023-02-15 18:30:16 +0000 Commit: Gleb Smirnoff CommitDate: 2023-02-15 18:30:16 +0000 inpcb: use family specific sockaddr argument for bind functions Do the cast from sockaddr to either IPv4 or IPv6 sockaddr in the protocol's pr_bind method and from there on go down the call stack with family specific argument. Reviewed by: zlei, melifaro, markj Differential Revision: https://reviews.freebsd.org/D38601 --- sys/netinet/in_pcb.c | 22 ++++++++++------------ sys/netinet/in_pcb.h | 4 ++-- sys/netinet/tcp_usrreq.c | 7 +++---- sys/netinet/udp_usrreq.c | 6 +++--- sys/netinet6/in6_pcb.c | 7 ++----- sys/netinet6/in6_pcb.h | 2 +- sys/netinet6/udp6_usrreq.c | 12 +++++------- 7 files changed, 26 insertions(+), 34 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index ad889f29de55..a23c89fe8033 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -655,21 +655,21 @@ out: #ifdef INET int -in_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) +in_pcbbind(struct inpcb *inp, struct sockaddr_in *sin, struct ucred *cred) { int anonport, error; - KASSERT(nam == NULL || nam->sa_family == AF_INET, - ("%s: invalid address family for %p", __func__, nam)); - KASSERT(nam == NULL || nam->sa_len == sizeof(struct sockaddr_in), - ("%s: invalid address length for %p", __func__, nam)); + KASSERT(sin == NULL || sin->sin_family == AF_INET, + ("%s: invalid address family for %p", __func__, sin)); + KASSERT(sin == NULL || sin->sin_len == sizeof(struct sockaddr_in), + ("%s: invalid address length for %p", __func__, sin)); INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo); if (inp->inp_lport != 0 || inp->inp_laddr.s_addr != INADDR_ANY) return (EINVAL); - anonport = nam == NULL || ((struct sockaddr_in *)nam)->sin_port == 0; - error = in_pcbbind_setup(inp, nam, &inp->inp_laddr.s_addr, + anonport = sin == NULL || sin->sin_port == 0; + error = in_pcbbind_setup(inp, sin, &inp->inp_laddr.s_addr, &inp->inp_lport, cred); if (error) return (error); @@ -901,11 +901,10 @@ in_pcbbind_check_bindmulti(const struct inpcb *ni, const struct inpcb *oi) * On error, the values of *laddrp and *lportp are not changed. */ int -in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, +in_pcbbind_setup(struct inpcb *inp, struct sockaddr_in *sin, in_addr_t *laddrp, u_short *lportp, struct ucred *cred) { struct socket *so = inp->inp_socket; - struct sockaddr_in *sin; struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct in_addr laddr; u_short lport = 0; @@ -925,15 +924,14 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, INP_HASH_LOCK_ASSERT(pcbinfo); laddr.s_addr = *laddrp; - if (nam != NULL && laddr.s_addr != INADDR_ANY) + if (sin != NULL && laddr.s_addr != INADDR_ANY) return (EINVAL); if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) lookupflags = INPLOOKUP_WILDCARD; - if (nam == NULL) { + if (sin == NULL) { if ((error = prison_local_ip4(cred, &laddr)) != 0) return (error); } else { - sin = (struct sockaddr_in *)nam; KASSERT(sin->sin_family == AF_INET, ("%s: invalid family for address %p", __func__, sin)); KASSERT(sin->sin_len == sizeof(*sin), diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index c450685affcb..f15fd0db4dfb 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -739,8 +739,8 @@ int in_pcbbind_check_bindmulti(const struct inpcb *ni, void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *); int in_pcballoc(struct socket *, struct inpcbinfo *); -int in_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *); -int in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *, +int in_pcbbind(struct inpcb *, struct sockaddr_in *, struct ucred *); +int in_pcbbind_setup(struct inpcb *, struct sockaddr_in *, in_addr_t *, u_short *, struct ucred *); int in_pcbconnect(struct inpcb *, struct sockaddr_in *, struct ucred *, bool); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 5c98e969c5ce..1dbf4659ad00 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -245,7 +245,7 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) tp = intotcpcb(inp); #endif INP_HASH_WLOCK(&V_tcbinfo); - error = in_pcbbind(inp, nam, td->td_ucred); + error = in_pcbbind(inp, sinp, td->td_ucred); INP_HASH_WUNLOCK(&V_tcbinfo); out: TCP_PROBE2(debug__user, tp, PRU_BIND); @@ -309,14 +309,13 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) } inp->inp_vflag |= INP_IPV4; inp->inp_vflag &= ~INP_IPV6; - error = in_pcbbind(inp, (struct sockaddr *)&sin, - td->td_ucred); + error = in_pcbbind(inp, &sin, td->td_ucred); INP_HASH_WUNLOCK(&V_tcbinfo); goto out; } } #endif - error = in6_pcbbind(inp, nam, td->td_ucred); + error = in6_pcbbind(inp, sin6, td->td_ucred); INP_HASH_WUNLOCK(&V_tcbinfo); out: if (error != 0) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index f911a79519b6..f039675b1e55 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1206,8 +1206,8 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, goto release; } INP_HASH_WLOCK(pcbinfo); - error = in_pcbbind_setup(inp, (struct sockaddr *)&src, - &laddr.s_addr, &lport, td->td_ucred); + error = in_pcbbind_setup(inp, &src, &laddr.s_addr, &lport, + td->td_ucred); INP_HASH_WUNLOCK(pcbinfo); if (error) goto release; @@ -1546,7 +1546,7 @@ udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td) INP_WLOCK(inp); INP_HASH_WLOCK(pcbinfo); - error = in_pcbbind(inp, nam, td->td_ucred); + error = in_pcbbind(inp, sinp, td->td_ucred); INP_HASH_WUNLOCK(pcbinfo); INP_WUNLOCK(inp); return (error); diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 2b8e48090f28..92a1ea840af2 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -153,11 +153,9 @@ in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred) } int -in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, - struct ucred *cred) +in6_pcbbind(struct inpcb *inp, struct sockaddr_in6 *sin6, struct ucred *cred) { struct socket *so = inp->inp_socket; - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)NULL; struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; u_short lport = 0; int error, lookupflags = 0; @@ -176,12 +174,11 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, return (EINVAL); if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) lookupflags = INPLOOKUP_WILDCARD; - if (nam == NULL) { + if (sin6 == NULL) { if ((error = prison_local_ip6(cred, &inp->in6p_laddr, ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0))) != 0) return (error); } else { - sin6 = (struct sockaddr_in6 *)nam; KASSERT(sin6->sin6_family == AF_INET6, ("%s: invalid address family for %p", __func__, sin6)); KASSERT(sin6->sin6_len == sizeof(*sin6), diff --git a/sys/netinet6/in6_pcb.h b/sys/netinet6/in6_pcb.h index 800d26e8b3d6..91131d1968bc 100644 --- a/sys/netinet6/in6_pcb.h +++ b/sys/netinet6/in6_pcb.h @@ -73,7 +73,7 @@ void in6_pcbpurgeif0(struct inpcbinfo *, struct ifnet *); void in6_losing(struct inpcb *); -int in6_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *); +int in6_pcbbind(struct inpcb *, struct sockaddr_in6 *, struct ucred *); int in6_pcbconnect(struct inpcb *, struct sockaddr_in6 *, struct ucred *, bool); void in6_pcbdisconnect(struct inpcb *); diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 3e6c57a8c6ff..8a95e1623f9c 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1020,6 +1020,7 @@ udp6_attach(struct socket *so, int proto, struct thread *td) static int udp6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { + struct sockaddr_in6 *sin6_p; struct inpcb *inp; struct inpcbinfo *pcbinfo; int error; @@ -1034,16 +1035,14 @@ udp6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) if (nam->sa_len != sizeof(struct sockaddr_in6)) return (EINVAL); + sin6_p = (struct sockaddr_in6 *)nam; + INP_WLOCK(inp); INP_HASH_WLOCK(pcbinfo); vflagsav = inp->inp_vflag; inp->inp_vflag &= ~INP_IPV4; inp->inp_vflag |= INP_IPV6; if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) { - struct sockaddr_in6 *sin6_p; - - sin6_p = (struct sockaddr_in6 *)nam; - if (IN6_IS_ADDR_UNSPECIFIED(&sin6_p->sin6_addr)) inp->inp_vflag |= INP_IPV4; #ifdef INET @@ -1053,14 +1052,13 @@ udp6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) in6_sin6_2_sin(&sin, sin6_p); inp->inp_vflag |= INP_IPV4; inp->inp_vflag &= ~INP_IPV6; - error = in_pcbbind(inp, (struct sockaddr *)&sin, - td->td_ucred); + error = in_pcbbind(inp, &sin, td->td_ucred); goto out; } #endif } - error = in6_pcbbind(inp, nam, td->td_ucred); + error = in6_pcbbind(inp, sin6_p, td->td_ucred); #ifdef INET out: #endif From nobody Wed Feb 15 18:57:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH6lY0cXSz3rC1P; Wed, 15 Feb 2023 18:57: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 4PH6lX74nnz49sP; Wed, 15 Feb 2023 18:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676487465; h=from:from:reply-to:subject:subject: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+fUdq0PDXwS+rTT6mo/7rmHZN86YpTM6hwj/DSlUNk=; b=qHIwjFHccWW5UrAjLkT3CvZoMPnGGiVlJqmrcQaYJRM0+741MH4zldIyGHngIzGJJ5fbUu s6sVVIaQBfDKlPtT6CnsaZY2Px4xsvF/hIDBS7EWQ1CXX3pN86cUJ1/caMrCk7ch0wEdnt MmlI5mfj5TZ1cr92wK9Ef5pYbcaMXNsb5+9hzm+zTPdyQEjKBW5khRsaaOxuvzdcgd9I4T bHxzD7XfBl44JvDdemIRR5wVKDjE2xBN5b5GK4Ejnu6I+Py6OknTBKV2KsQ20HdlH7iei9 vtTlX9Pz2CI7HT9tLxh5W2RLyRB3qDa/hH5UIpgnrN3IAhZhXMWBjhW8McJrZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676487465; h=from:from:reply-to:subject:subject: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+fUdq0PDXwS+rTT6mo/7rmHZN86YpTM6hwj/DSlUNk=; b=ZzD2g/OlREy+JduLjpZr5k6NbNosAfs9XPQ10QOXnR6rav4uLPABrReXopeiiVPxXEBXYk dkzTG8k8VZdwETfhH07xwt2h92lBPYbtCtWHDyrVxpjvI/VaHoxA2mMjtzbD3qNa2ZgO+q wT/FDvMcI4xDxsuOWbqlB88fWIt0rMU54a4owbwci3pFTZ8ZIhp/UCwWWOxPnOIXB5njqU gOEQ6uesD6Jr5+inxIs2eCmaJwNhBM03S9E5VWfcoHI9cdoV6XJ9qi5Gk9J+pmosDu+eu+ IbsWl6V3CHjcJvhkgGD24p65omJDEB9xNXihy3Ib0OKYuIxbEi5x8tLwdc08uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676487465; a=rsa-sha256; cv=none; b=GuD29hBL7KXK/CRM6wrrbwDuoLbPRExpiT2HbN4U7luOn/0bsBCcYyC+DCgSNXC1KQX5tD bDR71WhpEuLu6C/r0bjyGSKveMiouS40cT2cGLBD31CMVLUi2w5kg/KWA8uwea2h+u3Weg FUmmyA4AkflS1nmEMcs4GindIzCscmad6v1ku7czIYLbiNWp4hKvrcvA10cKcBxee1s8Ka aNed6Uj4vP3WGQUgxelyAGtch4p2jWZTyIc+fN7CvbWrV36mSpl1e7BcT1pjLap2J8mgab QlPnIN3XX9eI2PFO6q1o1sG9JoBgIgSt+Fc33La7uwCMlkQinM7BvrQ+nALvyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PH6lX61z6zZmr; Wed, 15 Feb 2023 18:57: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 31FIvi7b088712; Wed, 15 Feb 2023 18:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FIviE9088711; Wed, 15 Feb 2023 18:57:44 GMT (envelope-from git) Date: Wed, 15 Feb 2023 18:57:44 GMT Message-Id: <202302151857.31FIviE9088711@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: 40734fc57ec0 - main - aio: Fix a test and set race in aio_biowakeup. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40734fc57ec0158690e9f03284229553b050b8ea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=40734fc57ec0158690e9f03284229553b050b8ea commit 40734fc57ec0158690e9f03284229553b050b8ea Author: Keith Reynolds AuthorDate: 2023-02-15 18:56:39 +0000 Commit: John Baldwin CommitDate: 2023-02-15 18:56:39 +0000 aio: Fix a test and set race in aio_biowakeup. Use atomic_fetchadd in place of separate atomic_subtract / atomic_load. Reviewed by: markj Sponsored by: HPE TidalScale Differential Revision: https://reviews.freebsd.org/D38559 --- sys/kern/vfs_aio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 43e54e1ad9bf..34671f67191f 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -2493,10 +2493,9 @@ aio_biowakeup(struct bio *bp) atomic_add_int(&job->outblock, nblks); else atomic_add_int(&job->inblock, nblks); - atomic_subtract_int(&job->nbio, 1); - if (atomic_load_int(&job->nbio) == 0) { + if (atomic_fetchadd_int(&job->nbio, -1) == 1) { if (atomic_load_int(&job->error)) aio_complete(job, -1, job->error); else From nobody Wed Feb 15 18:57:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH6lZ0f8xz3rBdS; Wed, 15 Feb 2023 18:57: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 4PH6lZ0CtMz4B43; Wed, 15 Feb 2023 18:57:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676487466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CmqW5SEbTScAZusDpbVDDs/4/GSLr8zbqmXPxAU3j8g=; b=QWHFnYmFt6uSnDxFzcSOxavnjiMapvehwMx6dxzeXbf3sbWbgYw2lJuhTw2GI+M6SB0Mki puu1KWYyVgkuBNrc7ACofbF06YAgZmpkSsJ2AYU4Q8+FIn7THZocJzycbAiDkqVVndPBQt hUd6p7+7KJ+iqGCNtWRpg4TQ5gHLxGdYImcOevoHLyaelAnGotDm5mHAQDbpnWijhbsNm3 E2cZaWinoojRCGjCmpSpStSS88yVQWeBs6nFr1J1N2nL4rGQNFQmLWAUpicenoX6EpVhos OMSmIa3M/R6Ynbq40zs0/D/NY7USXWfwK7ZgqEDQXOQi3h4aTokA/eQVPfPiIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676487466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CmqW5SEbTScAZusDpbVDDs/4/GSLr8zbqmXPxAU3j8g=; b=tvZZunj5RFZ7+/DkZZynVy8d48wSrNURwosIx3KKNuBWTH15HTai+/tvX/ff0UoBZYs+f5 eIM7conqmGgL0Kkhidsuj+uGsuSWMW9AqYC3EH689fxjvf+BPCJlX73Vmex1k0Y5aizwGA o36Ke75X3xMvGLggHB0rKvKbzSogaao8RRUicd/DgzVSNG/E2w9p6/4zQXGUgvHAMe6UNu ZH69hqhO54VvLlKAmFu31430NfR7cIpV8HWNyfr+CvzotPdB5zFh77z+Pik/9ELt/doPhu af0c0p34mP0i26Ba2bxuEX05MVdDMA38IDEBOt4jYeY8thQ8SPLpJ2XTJsjA8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676487466; a=rsa-sha256; cv=none; b=UdMEhBLxUq8Nq3PAgqHG014EnDkL1up90mJFEJDJhwAr4HTUGeOBuxjtthZ8icr69ot3Mp 2XybFPFKWnSNleFMvzv7HF/jMQ8+voBRubWVOrR4/wGz17MKjA8pbaHSW0l+etvSIfLMfC VhfR7rEMjQ8KBAsj+UvLobwC7QUESYX1HNPV+8VDR28Sd1f7p53LRnv/WhX4mBOkGZHdOh +IoU0+omkH6BUa9Ft47YsdaaDQ1Jdvfm29jjoTMwpncdwF1N1mc63cgBlujVHxUOiLdItg gghgsDlsJKB5iy5QS1pv0UoSMAF6Kb6s/urAgJM5zmKwpfoLAA8TsxZgbD85pQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PH6lY68M4zZr7; Wed, 15 Feb 2023 18:57: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 31FIvjsD088741; Wed, 15 Feb 2023 18:57:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FIvjsM088740; Wed, 15 Feb 2023 18:57:45 GMT (envelope-from git) Date: Wed, 15 Feb 2023 18:57:45 GMT Message-Id: <202302151857.31FIvjsM088740@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: cca6d6160f14 - main - aio_biowakeup: Various style fixes. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cca6d6160f14a6a8dcb1e3caa0759ddbd0f68555 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cca6d6160f14a6a8dcb1e3caa0759ddbd0f68555 commit cca6d6160f14a6a8dcb1e3caa0759ddbd0f68555 Author: John Baldwin AuthorDate: 2023-02-15 18:57:08 +0000 Commit: John Baldwin CommitDate: 2023-02-15 18:57:08 +0000 aio_biowakeup: Various style fixes. --- sys/kern/vfs_aio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 34671f67191f..9868b8770747 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -2480,9 +2480,10 @@ aio_biowakeup(struct bio *bp) aio_biocleanup(bp); - nbytes =bcount - resid; + nbytes = bcount - resid; atomic_add_acq_long(&job->nbytes, nbytes); nblks = btodb(nbytes); + /* * If multiple bios experienced an error, the job will reflect the * error of whichever failed bio completed last. @@ -2494,7 +2495,6 @@ aio_biowakeup(struct bio *bp) else atomic_add_int(&job->inblock, nblks); - if (atomic_fetchadd_int(&job->nbio, -1) == 1) { if (atomic_load_int(&job->error)) aio_complete(job, -1, job->error); From nobody Wed Feb 15 19:45:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH7pp6gXQz3rGBt; Wed, 15 Feb 2023 19:45: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 4PH7pp65c2z4LQ6; Wed, 15 Feb 2023 19:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676490338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JR6yln5Y09vkYtpZBV1qUwD/1hwPJiS30EMU7Yi+U9E=; b=j2YSrru1t5pGtUtUBAKZi0DbV3BRgLb4/myQJMojUmxNbr8QXbnEVuRcCMbXQgUKgQCSKw M0pzUbs4l/uZVmul87Mdmy6RkmhOwkDuRsHjzjKL5M0DioUoV55c4HjuhYbVU+HpD5lBlY tiyRXpA8Zm7onlmGOrW3A4CO4ytRVbReNxDvq14PzVIPb6ib7N4rER8/zcJm1qz93+DYdN /OjHGjEymBUtBELlaMzguNQtncPdY0nXb1XY8zzj7emC5Rb1NiVvC/r7mQpSUTbCqVjVi/ HZ4SkhE0gXXEn5W+4vOFC0DHClbtdQFJ0ug/J8fGU3iRa3xm8Ahg2wuVFJZYmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676490338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JR6yln5Y09vkYtpZBV1qUwD/1hwPJiS30EMU7Yi+U9E=; b=ctnHyXuLAO+O0Eemj5JDzw02so41k/PxpTNHXYtaS+YUIDdTEciE5sv3M4/cO0eo03tg0W KZCh9ouCbvljp4Dgns0+T+AAHDZkdtXTIcqIg1h+T6UUC6MFQDrdHORJVTFfCk1ojgVOI5 DINkEO8U9UqWAkQe91oHJBFvkNFGURYDuDfxH0tkN7kFTOKyZSNB89RUpZqatbrBRYcFI2 J63RAP9tDZDHlmRpj/Y2P3lC/uSHMoJzK7uM4IlulBTvou+I8yJWLWgE4qovSzsejow964 Pj4wMS+xzEi5pa7uNZk2vnttBCvhkMobFgrrWzDnGyXsr8A1MJ6zPMC12fJaQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676490338; a=rsa-sha256; cv=none; b=m7SmZ7Cu08FpqSQp+H1iZbxUCAipvGaqL7f3ZTcH0wsf7YgFppqATf75/xNUDdaSAdwMrU tnf2nyroiN97Yy/wf5GRYy5cueimnh3elO+dwe0fJS6k9AZLtUVf/ttb/WjvpBl1ZzIuf3 7hv0w6FYbmXIupdckoMp5LVLuw51A20Thhok8nDTAL6j7v3Wa0of+B7xQs0VwH1cFwz5bS /KZoNPexj04huLgT77reK7/dbkuPNhmaOJKommBreJ+gJG4TdifHDE6gFF3QegJEi8NidF tBx8GY37iLa+C+kfdc772RA/WaXY65U21GWNc+1b3yZf6pdzlTnyb6pdqFpFMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PH7pp56gFzc8B; Wed, 15 Feb 2023 19:45: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 31FJjc5G061668; Wed, 15 Feb 2023 19:45:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FJjccV061667; Wed, 15 Feb 2023 19:45:38 GMT (envelope-from git) Date: Wed, 15 Feb 2023 19:45:38 GMT Message-Id: <202302151945.31FJjccV061667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5f044c4e055a - main - profil(2): profil(II) was in the v3 sources List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f044c4e055a387e4db5a899ea17705cc1a542e2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5f044c4e055a387e4db5a899ea17705cc1a542e2 commit 5f044c4e055a387e4db5a899ea17705cc1a542e2 Author: Warner Losh AuthorDate: 2023-01-04 16:41:16 +0000 Commit: Warner Losh CommitDate: 2023-02-15 19:44:32 +0000 profil(2): profil(II) was in the v3 sources profil(II) is in the scanned 3rd edition manual that we have. We don't have the 3rd edition sources, nor do we have the 4th edition souces. We have a mostly complete (missing pipes) 4th edition C rewrite where profil system call number is reserved, but it's not implemented (it's in the manx section for things that apeared to have been in 3rd edition but weren't yet part of the reimplemented 4th edition). The 5th edition sources we have do have it, however. For other items that have appeared in earlier manuals, we've added the simple verbage to the manual and relegated the rest of the data for that file to the commit message. --- lib/libc/sys/profil.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/sys/profil.2 b/lib/libc/sys/profil.2 index cdaa32a7f939..b2d1d9663ad8 100644 --- a/lib/libc/sys/profil.2 +++ b/lib/libc/sys/profil.2 @@ -108,8 +108,8 @@ contains an invalid address. .Sh HISTORY The .Fn profil -function appeared in -.At v6 . +functionality first appeared in +.At v3 . .Sh BUGS This routine should be named .Fn profile . From nobody Wed Feb 15 20:30:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH8pR4mMcz3rJSn; Wed, 15 Feb 2023 20:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PH8pR2xYqz3F0s; Wed, 15 Feb 2023 20:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676493023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DnrPyMGSSjqbXC4tAGTD4BaU3Cvmh7o9VLQpXeIOd+M=; b=RTPYuYIIzPN3j4tXAPXK1n009607TgBblppdZRK4UJ12xwWHF1SkKG+68pXT0xbzbvkhCa 3ufy1jP/yvedmfsOm8fllLFeRvJDmmeG1vDhPxoTaJOx83/ZPKYVWk5otR80A6U0qGlhoF wE5jJPv3KyXjaXj6azbJ03tJWwXH487wQTAjWzn0/QtLeG7QYedQ2SZP7h0BRIbMuMB5Kq 9/7H4BL4exOWWAcyvJ5l0jzwWIpJ7Q0L+IymFP8dli+TlANx1Sa1oDuf2Ce4MTZJpBYsas +2ucMDQMoh+xyp5ksm6mbhf/xY2MKtvXK1toVj4Dw2a96GehK7zN6/On3eGDfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676493023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DnrPyMGSSjqbXC4tAGTD4BaU3Cvmh7o9VLQpXeIOd+M=; b=gV19yWGwSYzVG4irevwKMGLRXPKcm0hrMDrDLRIfZUuXjfovvI+juLjk1kzmqc0vmuGAS/ YoJ/hP+9dUuIbKrUMCQalybz5wjY3H6KAb9ezC/NeLDn3syYl4Sghfldsu6EpK0717hFRU HokCQQeACL5dPtJGfV6ooIxYSW2k2aTdwBOeESmwvhawHGczK5b+5A9I/cPq0ICB9VFDAF go2bMM5z9+pWtTufHWOaTOTKNxQE0ekuUMcyxQnaqAZ/06h+TJCbX5zQL8pLXV+i65ceVf +TX2sr+46/CV7DfxB3cdK3Z5Za9Fb8DuhF0QmwOgdYj3GW5aHuDUgtQni+21Sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676493023; a=rsa-sha256; cv=none; b=xj23gk3YchwutASpLefMNhX0LZglNImf8yYZxx+8kjAQMURXmw0if4R71fjuTqiZtZybRH BJBcHnnUMLBX7c7c6/Qs16mK+V0UM7dLqev4zyPJM6wr6ZCKrmugqAyQjvod/WhVPLKvGr Y+sKJJv2meQqt0y8hYLCSCNdC5RlzCW91Q8dqF6GhA9Q3ItTLXhAv3n3pyGuuDwOoJfYi0 7oQYUs/9krCf9D0XlW7qJ3rIrwlqmi7N8jYPYEVd7n/8qFlJu53s7DHmTLL9cH4ImANmks QjA4kM1LYTij78QTlgwT3P8IPWWmWK+ubtg6SeGxPtRib2b2Ahax1QmKPqHbsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PH8pR21LTzd6v; Wed, 15 Feb 2023 20:30: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 31FKUNLu027802; Wed, 15 Feb 2023 20:30:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FKUN21027801; Wed, 15 Feb 2023 20:30:23 GMT (envelope-from git) Date: Wed, 15 Feb 2023 20:30:23 GMT Message-Id: <202302152030.31FKUN21027801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 5dd48f718433 - main - netlink: use ifmedia to provide vlan interface operstate. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5dd48f718433959c283a8a4d6e46512426f1e200 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=5dd48f718433959c283a8a4d6e46512426f1e200 commit 5dd48f718433959c283a8a4d6e46512426f1e200 Author: Alexander V. Chernikov AuthorDate: 2023-02-15 20:22:47 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-15 20:22:47 +0000 netlink: use ifmedia to provide vlan interface operstate. Netlink customers rely on admin and operational state when working with interfaces. The current implementation retuns "unknown" operstate for all interface types except IFT_ETHER and IFT_LOOP. This change updates the code to fetch vlan operstate in the same way as for the ether interfaces. For the rest of the interface types, operstate is now mapped to the admin state. Reported by: Marek Zarychta MFC after: 3 days --- sys/netlink/route/iface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index f4936bb2c35b..9cd7e6e80f3c 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -174,9 +174,11 @@ get_operstate(struct ifnet *ifp, struct if_state *pstate) switch (ifp->if_type) { case IFT_ETHER: + case IFT_L2VLAN: get_operstate_ether(ifp, pstate); break; - case IFT_LOOP: + default: + /* Map admin state to the operstate */ if (ifp->if_flags & IFF_UP) { pstate->ifla_operstate = IF_OPER_UP; pstate->ifla_carrier = 1; From nobody Wed Feb 15 20:44:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PH96P0ywbz3rKCW; Wed, 15 Feb 2023 20:44: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 4PH96P0Sywz3GkR; Wed, 15 Feb 2023 20:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676493853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9vny/ySr7G3LJXKzURhLbB7R8lez6wZ3qKv5i49ddkU=; b=sOpNAYnhTdr0SZXq64EkvU1TCGSGmo33UbqL6wF+g4IuoeH+TYxzwfWvTgcAXyu0ja/HIl YTbfsmKLouPfjdZ4sDQCrQtRwyK60Wee1u0xOBQevKoM4VXsx+ar6XCBWU/sIsZbQuD9FB pE2/O2Y6jnzZSx7yFHYYHSj/r4BRSq07MsWexxKVZ89G/YZF8gfhe4Pbje8mvqwxH9EHab zwnUF6mX5sw6VS20El/OUeL57dH/hygFx8mcwp18XlDEQEs76oQpbQZlN5GCaalEFuY+sl 3L3FuGK2m29L0v5MhqFBfSt+7adn9VadLslbQN4MyqqDtmOM8clBvTDgBhDkJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676493853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9vny/ySr7G3LJXKzURhLbB7R8lez6wZ3qKv5i49ddkU=; b=pq59MOcBnhB/qSmX430Iwn2CkqhTYJDGZ46sLyOoG/9KTU5Jt9A/y+im+/Hnbi6nt344nY YsVAsPHoDHEnK9TdqICi39wZfEqEm45CdstJnfijleED+FO0fsFoisVfR2d2/kgqydwOUg dRsOLDHg5Amk7bkudDPbVD/Dn7a+Bi3cJdVV7DLQrS1jFpic+hDzPuNMHl2RSyWwc53c2K uJo05oCqxvs1/UT39kDSFJt7I1OCu7YNR3SkWdIPxo8ncws0RpKXSCsjpkDPHdy2rG4Wgo 5DySa+c4E8RzlhZogZ4K5EPSE34/bX4a28MIhSa1hFo3pdEgBjogh3KmzpOI3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676493853; a=rsa-sha256; cv=none; b=Wvx/lu5i4n3Acr5AkOM/pby66NXcKm7J09RNtmt6LpYlCn7GDTx9NtIdZ6MjeX8EBqxM0Q X0U3Ld6BbeJawaNRPOq2OqwZwFAlUEl3s4qiS8pi2nUU7gXqQG2Ey/SbcsnUCnoAQOVHRb 0jFVyEyjNuak22qQ4qN5t4x60feMaNAtHc7SK1cco2kcXZMXhR6aJGa+x1dATU7JxufccX 44sVeyU72OC/I9wPMgvsWXakxvLLJSKy/O2hkJlNmEIFAyxMQWTFBq3+5xIU5k87EPVljN glLpiMEvZSS8EevXwbN1Gt2CHpSIAr6E9ULUg7odxBB8O2EG5L8Dpu2yAVaSaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PH96N6dqnzdYt; Wed, 15 Feb 2023 20:44: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 31FKiCbs047983; Wed, 15 Feb 2023 20:44:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FKiCCa047982; Wed, 15 Feb 2023 20:44:12 GMT (envelope-from git) Date: Wed, 15 Feb 2023 20:44:12 GMT Message-Id: <202302152044.31FKiCCa047982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 059320b8c8de - main - nproc: denote an incompatiblity with Linux List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 059320b8c8de73a90514879cd1e2da397584cfde Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=059320b8c8de73a90514879cd1e2da397584cfde commit 059320b8c8de73a90514879cd1e2da397584cfde Author: Mateusz Guzik AuthorDate: 2023-02-15 20:17:27 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-15 20:43:46 +0000 nproc: denote an incompatiblity with Linux On Linux _NPROCESSORS_CONF reports CPU threads disabled by the kernel, while it does not on FreeBSD. Flip _NPROCESSORS_ONLN to _NPROCESSORS_CONF. While it keeps reporting the same value, it will automagically unbreak should someone change the above. --- bin/nproc/nproc.1 | 7 ++++++- bin/nproc/nproc.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/nproc/nproc.1 b/bin/nproc/nproc.1 index 91a87b1ca048..8ebe94a21049 100644 --- a/bin/nproc/nproc.1 +++ b/bin/nproc/nproc.1 @@ -3,7 +3,7 @@ .\" .\" * SPDX-License-Identifier: BSD-2-Clause .\" -.Dd February 5, 2023 +.Dd February 15, 2023 .Dt NPROC 1 .Os .Sh NAME @@ -40,6 +40,11 @@ Print usage information and exit. .El .Sh COMPATIBILITY This program is intended to be compatible with nproc as found in GNU coreutils. +.Sh BUGS +If HyperThreading is enabled in BIOS and disabled in the kernel, the +.Fl -all +option on Linux will still report all possible CPU threads. +On FreeBSD only active threads will be reported. .Sh SEE ALSO .Xr cpuset 1 .Sh HISTORY diff --git a/bin/nproc/nproc.c b/bin/nproc/nproc.c index 9037c74dbfff..c2ab75826ce1 100644 --- a/bin/nproc/nproc.c +++ b/bin/nproc/nproc.c @@ -110,7 +110,7 @@ main(int argc, char *argv[]) usage(); if (all_flag) { - cpus = sysconf(_SC_NPROCESSORS_ONLN); + cpus = sysconf(_SC_NPROCESSORS_CONF); if (cpus == -1) err(1, "sysconf"); } else { From nobody Wed Feb 15 21:33:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHBBy3CVMz3rMf1; Wed, 15 Feb 2023 21:33: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 4PHBBy2kYLz3LjT; Wed, 15 Feb 2023 21:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676496794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7SIOT1vHEXkBjnhdvFssQGMMEuAV7YlOZXu+wwvOP+A=; b=ItsT8Imn40Bi8HuAcwiEDR3l1WonpWd7zPfgAUvFDwBb5q+0Bn1E8g5oqrVgZ070wOl381 EH3vB4FHmqnDglAJB8QFjKbUEhRgX8kuA1v5Ssy6GIXf/ro1acFgpDiUBgZz1n/1SgGQVC gKwVdN3ZlkLfw08p8qY6RDvq1UXFqasvD1dvm98iD1xPloM46o6ZIj/KMK4Cp8ePKJzCON ksar7LX5vSl+L1Vrz8Q9SswjliBnWwiZmoIztjzdtc2Vgej3lcBVTKJkvhOufOd5YkscV1 nYwiApB2A1PRDS4iACQslJp16YkxY+eJyu7c7JLsOZbEc9EpB2omTjUky1Ff2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676496794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7SIOT1vHEXkBjnhdvFssQGMMEuAV7YlOZXu+wwvOP+A=; b=GzP0CmaBwZeD4QC64YmaUfCwg5zsq0ZNiNq6gj0E40T5yY/xWKFnB3gp59YdNx3GGZuqm1 8WcKXcqtrn1EmsenPQMFal8lTYhyLFL7ddJSJ3LiF6R3lrKWyAIAfgbRZLcdIFKt8ugA2g XKj7kxhe6wTOCoNG+e1TBgoYbDvThXY6OqePupo4MR1/r149kCz2/kvqwuwvGKQ7WGM4nl yrtDXGrKF3yresktzqRZ6Pn1nSMa3iv/IKneTNn0ycjrvFISXkAUoWyhQgDIOxecQvBnJ7 jA1vqxsKuSFbsLFHF3mdvkogwyro961+AZo7WgjckeV/QTlteE1Agg2I6KJXmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676496794; a=rsa-sha256; cv=none; b=L9dmD6mgcS71muMuJZL2hbNgXdXPnWjWPW5IoFVxuZ4h9hAZ6xFw+jfWqtuPoGjHtoEq+R /BKC4LvDm+tcLeEkWxVPz19cwEm+g74WhREXstGZBLVuf3J5/HULL8BzMwCD8Uo0bev8Nu 9y6VOuGak9d5B6gDl5MlHg3iiGYqa0Z5+HxvPtoWTRPLP5f4Ae3L8NNMCI62eKWTQBzJTx EIB9huRVARIRbG5CZIuFgLba3xnwyYNoEFUdd4U7wKLj7ZplZ9p14729nMLbebJOpkV9EQ gJhwt6YliGfq7GNrpbACD/spmFdapl1Zoy9ppXuBV83smb4OLlQXutdenSaDQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHBBy1n4MzfgF; Wed, 15 Feb 2023 21:33: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 31FLXErE021522; Wed, 15 Feb 2023 21:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FLXEep021521; Wed, 15 Feb 2023 21:33:14 GMT (envelope-from git) Date: Wed, 15 Feb 2023 21:33:14 GMT Message-Id: <202302152133.31FLXEep021521@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: 98844e99d40a - main - aio: Fix more synchronization issues in aio_biowakeup. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98844e99d40a90ae89d84762e07150af3a8f89bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=98844e99d40a90ae89d84762e07150af3a8f89bd commit 98844e99d40a90ae89d84762e07150af3a8f89bd Author: John Baldwin AuthorDate: 2023-02-15 21:32:52 +0000 Commit: John Baldwin CommitDate: 2023-02-15 21:32:52 +0000 aio: Fix more synchronization issues in aio_biowakeup. - Use atomic_store to set job->error. atomic_set does an or operation, not assignment. - Use refcount_* to manage job->nbio. This ensures proper memory barriers are present so that the last bio won't see a possibly stale value of job->error. - Don't re-read job->error after reading it via atomic_load. Reported by: markj (1) Reviewed by: mjg, markj Differential Revision: https://reviews.freebsd.org/D38611 --- sys/kern/vfs_aio.c | 11 ++++++----- sys/sys/aio.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 9868b8770747..d32e6fea15ca 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1281,7 +1281,7 @@ aio_qbio(struct proc *p, struct kaiocb *job) } bios = malloc(sizeof(struct bio *) * iovcnt, M_TEMP, M_WAITOK); - atomic_store_int(&job->nbio, iovcnt); + refcount_init(&job->nbio, iovcnt); for (i = 0; i < iovcnt; i++) { struct vm_page** pages; struct bio *bp; @@ -2489,15 +2489,16 @@ aio_biowakeup(struct bio *bp) * error of whichever failed bio completed last. */ if (flags & BIO_ERROR) - atomic_set_int(&job->error, bio_error); + atomic_store_int(&job->error, bio_error); if (opcode & LIO_WRITE) atomic_add_int(&job->outblock, nblks); else atomic_add_int(&job->inblock, nblks); - if (atomic_fetchadd_int(&job->nbio, -1) == 1) { - if (atomic_load_int(&job->error)) - aio_complete(job, -1, job->error); + if (refcount_release(&job->nbio)) { + bio_error = atomic_load_int(&job->error); + if (bio_error != 0) + aio_complete(job, -1, bio_error); else aio_complete(job, atomic_load_long(&job->nbytes), 0); } diff --git a/sys/sys/aio.h b/sys/sys/aio.h index 7b931d04febc..272132acf91e 100644 --- a/sys/sys/aio.h +++ b/sys/sys/aio.h @@ -151,7 +151,7 @@ struct kaiocb { aio_handle_fn_t *handle_fn; /* (c) backend handle function */ union { /* Backend-specific data fields */ struct { /* BIO backend */ - int nbio; /* Number of remaining bios */ + volatile u_int nbio; /* Number of remaining bios */ int error; /* Worst error of all bios */ long nbytes; /* Bytes completed so far */ }; From nobody Wed Feb 15 21:41:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHBNz2tZFz3rMhd; Wed, 15 Feb 2023 21:41:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHBNz2QBxz3Mtk; Wed, 15 Feb 2023 21:41:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676497315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o8YidbFYu6UlCk8WJSpCuTtRlJ69yXLkx6W85XDqUFI=; b=sMnge4jM96YCZqGI6A2c5VnVezCIxGOGR5uT0QACWj367A1UH75HZylqs6k9HF+XMSB8Tm /uX/k8a/pY/qH32uTlbmEstX4z0W2MHpnaJJpqvvpTfSll1AfxnjgBtXWOIKpxY34T5qpi kxJXGTkdFCbxeadC/Y31xqPb6NMhQpiTcEE4jBuTbWm9tkGGhOOB3hdUUM6lINysF3tnRG m+Wd8CB9ZBrJ0EgsqGGkXusU1dCeB4AJakhWH1NY5BqeodDaFsqAU7Bn03IXnWgmWvOfAJ fbsMXncF4eopPHBQpwNkelhXjJnkHgZXW9KrKcR7MCrCi1qMSb4UWiNVWotXig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676497315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o8YidbFYu6UlCk8WJSpCuTtRlJ69yXLkx6W85XDqUFI=; b=darTdEYc0NDyQJyl38Zj1GBtyLJAv88HzLNUTQ5CURhAmk5OVTSP1QTuAc929wAIlM3AgN sG4qy1SJ5bQiFiCfmMPmWjOQSYtZEvnGTj/ALXiBY5p/3HLo1kj+bo2MFl/1VuhpxsY1V/ AbAMOzRRA29G4y7tNZwESmDnNlUeCUMvisgb7J6rbqAWKIxtpi+6fVCe81VEtu8qJ/B7WC Q2dxEVebkKAJGxGPeLIdNuS78Rd9N6FE51J07Xc8qWF2upOhJKCnenSzLbYSGzounuFQt2 dor3VIKZ7FYW+3s/6/1TVEY1vWahjLdnRMIxaAUCX3jYrIXq1+T+92rlX3s3rQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676497315; a=rsa-sha256; cv=none; b=tJ7ea3opTTbZSJxEJOprglys8MOh5cai8HKLWCRHOawm1tDBSQRIqO8c543baugMRoPJZK pv5g92gn5pgJhC+vOMBwQICoFwKD5p4PE8boP44qOmkEQL2z06pv5HsaUQdnvXeMmDw1I0 cAV8Luf3b32RcNj5l4D0gVHMy7cO5dhmQJCET6l1AVOhQark+KAwmJRMpVYpl26HsxowvQ GFthp0o2XR9kfuDjprn+ZrOYiypXIvSpa3QSn/57YX2bhtAWQGhMxMzMlkXNYulEj4Y/uH Ke+u5CN4/2ASsHeE2+VX71pSJszWiIXFBS+zlXFitT8dj01Fg/J/EwtyjV5ZPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHBNz1TTszfwd; Wed, 15 Feb 2023 21:41:55 +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 31FLfths035124; Wed, 15 Feb 2023 21:41:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FLft1Q035122; Wed, 15 Feb 2023 21:41:55 GMT (envelope-from git) Date: Wed, 15 Feb 2023 21:41:55 GMT Message-Id: <202302152141.31FLft1Q035122@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: d2070e5fa983 - main - cxgbe: Don't leak memory resource if t4iov attach fails. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2070e5fa983281e94a338d6e87eb29c7dd28505 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d2070e5fa983281e94a338d6e87eb29c7dd28505 commit d2070e5fa983281e94a338d6e87eb29c7dd28505 Author: John Baldwin AuthorDate: 2023-02-15 21:34:00 +0000 Commit: John Baldwin CommitDate: 2023-02-15 21:34:00 +0000 cxgbe: Don't leak memory resource if t4iov attach fails. Co-authored by: np Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D38580 --- sys/dev/cxgbe/t4_iov.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/t4_iov.c b/sys/dev/cxgbe/t4_iov.c index d3796d300947..ce9a97c69ed4 100644 --- a/sys/dev/cxgbe/t4_iov.c +++ b/sys/dev/cxgbe/t4_iov.c @@ -194,6 +194,7 @@ t4iov_attach(device_t dev) { struct t4iov_softc *sc; uint32_t pl_rev, whoami; + int error; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -217,10 +218,18 @@ t4iov_attach(device_t dev) sc->sc_main = pci_find_dbsf(pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), 4); - if (sc->sc_main == NULL) + if (sc->sc_main == NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, sc->regs_rid, + sc->regs_res); return (ENXIO); - if (T4_IS_MAIN_READY(sc->sc_main) == 0) - return (t4iov_attach_child(dev)); + } + if (T4_IS_MAIN_READY(sc->sc_main) == 0) { + error = t4iov_attach_child(dev); + if (error != 0) + bus_release_resource(dev, SYS_RES_MEMORY, sc->regs_rid, + sc->regs_res); + return (error); + } return (0); } From nobody Wed Feb 15 21:42:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHBPN3Xmzz3rNGY for ; Wed, 15 Feb 2023 21:42:16 +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 4PHBPM1YD1z3NL4; Wed, 15 Feb 2023 21:42:14 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of dchagin@heemeyer.club has no SPF policy when checking 195.93.173.158) smtp.mailfrom=dchagin@heemeyer.club; dmarc=none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.1/8.16.1) with ESMTP id 31FLgC1x089312; Thu, 16 Feb 2023 00:42:12 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 31FLgCf1089311; Thu, 16 Feb 2023 00:42:12 +0300 (MSK) (envelope-from dchagin) Date: Thu, 16 Feb 2023 00:42:12 +0300 From: Dmitry Chagin To: Mark Millard Cc: antoine@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c21b080f3dc2 - main - cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. (Just a fixed TO: address.) Message-ID: References: <18263DB1-D79D-420A-9F24-EE8C8E071C15@yahoo.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [-2.10 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FREEMAIL_TO(0.00)[yahoo.com]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU]; MIME_TRACE(0.00)[0:+]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; FREEFALL_USER(0.00)[dchagin]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[heemeyer.club]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4PHBPM1YD1z3NL4 X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Mon, Feb 13, 2023 at 04:47:04PM -0800, Mark Millard wrote: > On Feb 12, 2023, at 22:05, Mark Millard wrote: > > > [Just a fixed TO: address.] > > > >>> On Sun, Feb 12, 2023 at 07:58:07PM +0000, Antoine Brodin wrote: > >>>> On Sun, Feb 12, 2023 at 11:13 AM Dmitry Chagin wrote: > >>>>> > >>>>> On Sun, Feb 12, 2023 at 01:40:59PM +0300, Dmitry Chagin wrote: > >>>>>> On Sun, Feb 12, 2023 at 09:47:15AM +0000, Antoine Brodin wrote: > >>>>>>> On Sun, Jan 29, 2023 at 1:18 PM Dmitry Chagin wrote: > >>>>>>>> > >>>>>>>> The branch main has been updated by dchagin: > >>>>>>>> > >>>>>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > >>>>>>>> > >>>>>>>> commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b > >>>>>>>> Author: Dmitry Chagin > >>>>>>>> AuthorDate: 2023-01-29 13:17:33 +0000 > >>>>>>>> Commit: Dmitry Chagin > >>>>>>>> CommitDate: 2023-01-29 13:17:33 +0000 > >>>>>>>> > >>>>>>>> cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux. > >>>>>>>> > >>>>>>>> Under Linux to sched_[g|s]etaffinity() functions the value returned from a call > >>>>>>>> to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 > >>>>>>>> will set the attribute for the calling thread, and passing the value returned > >>>>>>>> from a call to getpid(2) (process id) will set the attribute for the main thread > >>>>>>>> of the thread group. > >>>>>>>> > >>>>>>>> Native cpuset(2) family of system calls has "which" argument to determine how > >>>>>>>> the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass > >>>>>>>> a thread id and CPU_WHICH_PID - to pass a process id. > >>>>>>>> > >>>>>>>> For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" > >>>>>>>> CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this > >>>>>>>> adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. > >>>>>>>> > >>>>>>>> Reviewed by: kib > >>>>>>>> Differential Revision: https://reviews.freebsd.org/D38209 > >>>>>>>> MFC after: 1 week > >>>>>>>> --- > >>>>>>>> lib/libc/gen/sched_getaffinity.c | 2 +- > >>>>>>>> lib/libc/gen/sched_setaffinity.c | 2 +- > >>>>>>>> lib/libc/sys/cpuset.2 | 4 +++- > >>>>>>>> sys/kern/kern_cpuset.c | 42 +++++++++++++++++++++++++++++++++++++++- > >>>>>>>> sys/sys/cpuset.h | 1 + > >>>>>>>> 5 files changed, 47 insertions(+), 4 deletions(-) > >>>>>>> > >>>>>>> > >>>>>>> Hello, > >>>>>>> > >>>>>>> This broke math/py-numpy on main and stable/13 > >>>>>>> > >>>>>>> https://pkg-status.freebsd.org/gohan03/data/main-amd64-default-baseline/p52768539d46f_scd3193f640/logs/errors/py39-numpy-1.24.1,1.log > > > > Well, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running a > > 1400079 [2023-02-08..2023-02-10] jail that is using new KBI > > material not in the older kernel (CPU_WHICH_TIDPID) have problems? : > > > > =>> Building math/py-numpy > > build started at Fri Feb 10 11:40:51 UTC 2023 > > port directory: /usr/ports/math/py-numpy > > package name: py39-numpy-1.24.1,1 > > building for: FreeBSD main-amd64-default-baseline-job-04 14.0-CURRENT FreeBSD 14.0-CURRENT 1400079 amd64 > > maintained by: python@FreeBSD.org > > Makefile ident: > > Poudriere version: 3.2.8-23-ga7f8d188 > > Host OSVERSION: 1400073 > > Jail OSVERSION: 1400079 > > Job Id: 04 > > > > !!! Jail is newer than host. (Jail: 1400079, Host: 1400073) !!! > > !!! This is not supported. !!! > > !!! Host kernel must be same or newer than jail. !!! > > !!! Expect build failures. !!! > > > > > >>>>>>> https://pkg-status.freebsd.org/gohan02/data/13stable-amd64-quarterly-baseline/841610d9bfc6/logs/errors/py39-numpy-1.23.5_1,1.log > > > > Similarly, can a 1400073 [2022-10-17..2022-12-09] HOST kernel running a > > 13.2-PRERELEASE 1301511 [2023-01-10..2023-02-10] jail that is using new > > KBI material not in the older kernel (CPU_WHICH_TIDPID) have problems? : > > > > =>> Building math/py-numpy > > build started at Fri Feb 10 10:36:27 UTC 2023 > > port directory: /usr/ports/math/py-numpy > > package name: py39-numpy-1.23.5_1,1 > > building for: FreeBSD 13stable-amd64-quarterly-baseline-job-01 13.2-PRERELEASE FreeBSD 13.2-PRERELEASE 1301511 amd64 > > maintained by: python@FreeBSD.org > > Makefile ident: > > Poudriere version: 3.2.8-23-ga7f8d188 > > Host OSVERSION: 1400073 > > Jail OSVERSION: 1301511 > > > > > > > > (Looks to me like CPU_WHICH_TIDPID use for 13.* has to > > require 13.2+ .) > > (I should have used "some CPU_WHICH_TIDPID use" and the > like in various places.) > > I got my environment to be 140079 (everywhere) with ports > updated to be have py39-numpy be at 1.24.1,1 . My > poudriere-devel build result was: > > [00:25:52] [01] [00:00:00] Building math/py-numpy@py39 | py39-numpy-1.24.1,1 > [00:28:39] [01] [00:02:47] Finished math/py-numpy@py39 | py39-numpy-1.24.1,1: Success > > (It built 47 other ports first to get ready for that.) > > FYI: > > # uname -apKU > FreeBSD amd64_ZFS 14.0-CURRENT FreeBSD 14.0-CURRENT #60 main-n260797-dc1b8c9a846e-dirty: Thu Feb 9 22:17:26 PST 2023 root@amd64_ZFS:/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG amd64 amd64 1400079 1400079 > > Looks to me like, if the ABI incompatibilities are to > stay as they are, then the FreeBSD build servers need an > update for HOST OSVERSION to be more modern in order to > avoid having odd problems with building some ports. > > compat shim commited to main branch, MFC after 3 days From nobody Wed Feb 15 22:05:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHBw40hgsz3rPbW; Wed, 15 Feb 2023 22:05:24 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHBw35h0Zz3h1g; Wed, 15 Feb 2023 22:05:23 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-vs1-f52.google.com with SMTP id g8so21477045vso.3; Wed, 15 Feb 2023 14:05:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=sh/3W2j3Vi3xwdCuH6FBvuLI2LBw4t/ud6xTLE4HBAE=; b=G6EJVT4YaUTNX9gqZTggyknq91BhXTqoCiqA0DUs7gOuAFyBiDJg4k70Nl4OMQkThI U3SbvCi2bS96oLAAX3XlZFa0iXvLSsAnGe2rq/3GJvCqKBu1UlirC2J6Y0/ykC/RMr5k MSMjQ2FerdKhOV6/JFwnOHRA2L3MkDBsbHnMek5KoHRgDED7HNNsFLhCsoxJtMv30FVj WwMRKr5+P3nye8iTTtqD5TLfUWoPIigqbqRbQdMiAna2k3q0t8Xe8d67AmZXDjR3r0RE 0YLG7YA5YkEgMK9d5ivfTjSZ/q+O9pRVvenEoKOsM/k78YoZcCIwwIj/nhAPqUWR0gmj 2UNw== X-Gm-Message-State: AO0yUKVQAetqZGDQHVtuyiFV69hmdKZgz9xlrXeFgpLzfd0MDSqsrFjN JvSKGYIcpuNJVthRYocDpdIkCBfQuBnL0IXKFU1APBH9 X-Google-Smtp-Source: AK7set/TE2g/d9xiTWhudo3ZChi0/FXh1yvOn1h46sUkndx2iaeCRGXUI8FtF9gUAk//GufEztOKoEnP96x+RbGq44k= X-Received: by 2002:a05:6102:20c1:b0:3f7:93c4:9e56 with SMTP id i1-20020a05610220c100b003f793c49e56mr733110vsr.85.1676498722539; Wed, 15 Feb 2023 14:05:22 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202302152133.31FLXEep021521@gitrepo.freebsd.org> In-Reply-To: <202302152133.31FLXEep021521@gitrepo.freebsd.org> From: Alan Somers Date: Wed, 15 Feb 2023 15:05:11 -0700 Message-ID: Subject: Re: git: 98844e99d40a - main - aio: Fix more synchronization issues in aio_biowakeup. To: John Baldwin 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-Rspamd-Queue-Id: 4PHBw35h0Zz3h1g 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 Wed, Feb 15, 2023 at 2:33 PM John Baldwin wrote: > > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=98844e99d40a90ae89d84762e07150af3a8f89bd > > commit 98844e99d40a90ae89d84762e07150af3a8f89bd > Author: John Baldwin > AuthorDate: 2023-02-15 21:32:52 +0000 > Commit: John Baldwin > CommitDate: 2023-02-15 21:32:52 +0000 > > aio: Fix more synchronization issues in aio_biowakeup. > > - Use atomic_store to set job->error. atomic_set does an or > operation, not assignment. > > - Use refcount_* to manage job->nbio. > > This ensures proper memory barriers are present so that the last bio > won't see a possibly stale value of job->error. > > - Don't re-read job->error after reading it via atomic_load. > > Reported by: markj (1) > Reviewed by: mjg, markj > Differential Revision: https://reviews.freebsd.org/D38611 Thanks for fixing these subtle problems in aio_(read|write)v. Will you MFC too? From nobody Wed Feb 15 22:26:25 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHCNK6w03z3rQj3; Wed, 15 Feb 2023 22: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 4PHCNK6SZYz3kV9; Wed, 15 Feb 2023 22: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=1676499985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2CAi60OeKdx+6hBFgBwb0Tdjl2tQx0C+SfS3cwCU6Zw=; b=HBxnc4XC2Ia4mc5113c7OVtHOxLElsokLHUwbQwcEHE8kStvewyxSKfacFvorYA7CQzEqe 3MZKeAHyLQRLOZE3OmCQVolZokxRCP+2TifBwbfJOnRAvvAn6wwpw+kQhinoWeLpOtueZT RKqt+KDYpkp3zUEBkUnRqn5gpJ+jLKr7v2ORwl2MFAeTmrtiDOrKu6nTe2DQE7pK0m9lnj ct8BrKNorfeVqWsUPcMuHCA0i5G0pKX5a2+KnL0MxcyAM6GTxPUBQZgh9wdZLuQ0wWJ2tl 4e9J/hmHWMW6B6ihydjXS1LTks8AFBfgyod3sQxnlcjSu/NarYxo0P+tz7ER9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676499985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2CAi60OeKdx+6hBFgBwb0Tdjl2tQx0C+SfS3cwCU6Zw=; b=K4zWb8RX0i3H6FQYvFxOf+19XXP8hpr6yQ86tknNPIuWYIDytR9YXdqyXrw5SOttYFU7N0 wlY7+VlfYmNJ8NWLcAElMiq7JcQnJI8o7J1ce0+yZaaqbU07gtpuiRdNsFBJcxEhvoEqGt PgGg8JX3/BxnNQa7MtCzJH72BBiSvINcH+5oV37GKkbgiPFlWMxjXoJD5YWFIAkhmmQ7NS 7loDtVBn0t9rJhGGFhem3JhgW4WrdRwKP6m2oKAvZrorsMLfMxk4slGDK+w6Jt8YzZYhGe AQQyw7rqhh0Fe2/5pPN1oT+Qcc0SLqofatx32UDeG96iJ06J/bSwgx8wg1Kyfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676499985; a=rsa-sha256; cv=none; b=FDdDSH3asDRLurJsCFwDhoHcEvfLtsS4bMGquJ8ZHuUDwUms7cqoRnhNFmjj0MCtKnlGna 6BrBo5yKNUdpozKqoTzvry8SzdqKLkANiw+WzVa+ApGnLTIpliHmxG0ZPAMYDQcJnFgOeC U8ApSmCm35Z1B/uhUewm+mDfGrI2n9LSJEnCDxeHgKhbO5lBa/oUkn9nQKBRPhrkn/Rdj7 sDbdE+BCjzcR+fsBKIBdcgrEVRFB0xDfZIeDOuUr62REftvHMK2QdHDA0NZvnHpyXWvKa4 QsTWZKAY1GhPUzAmh+gnbk3mmRpm8gN43MbyhvXPRYZXgQVpvT18oBlH0SIP0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHCNK5QX5zh8j; Wed, 15 Feb 2023 22:26: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 31FMQPMd093687; Wed, 15 Feb 2023 22:26:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FMQPQc093686; Wed, 15 Feb 2023 22:26:25 GMT (envelope-from git) Date: Wed, 15 Feb 2023 22:26:25 GMT Message-Id: <202302152226.31FMQPQc093686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 4dac88cd150b - main - linuxkpi: Define `debugfs_initialized()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4dac88cd150b444cf67a09f7c0c8af795e9c1bd6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4dac88cd150b444cf67a09f7c0c8af795e9c1bd6 commit 4dac88cd150b444cf67a09f7c0c8af795e9c1bd6 Author: Jean-Sébastien Pédron AuthorDate: 2023-02-14 23:38:59 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-15 22:19:41 +0000 linuxkpi: Define `debugfs_initialized()` It always return true on FreeBSD, at least for now, because all DRM drivers using it depend on lindebugfs. Reviewed by: manu Approved by: manu --- sys/compat/linuxkpi/common/include/linux/debugfs.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/debugfs.h b/sys/compat/linuxkpi/common/include/linux/debugfs.h index abda2d149582..734682cd7013 100644 --- a/sys/compat/linuxkpi/common/include/linux/debugfs.h +++ b/sys/compat/linuxkpi/common/include/linux/debugfs.h @@ -52,6 +52,13 @@ struct debugfs_blob_wrapper { size_t size; }; +static inline bool +debugfs_initialized(void) +{ + + return (true); +} + struct dentry *debugfs_create_file(const char *name, umode_t mode, struct dentry *parent, void *data, const struct file_operations *fops); From nobody Wed Feb 15 22:26:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHCNM0p0xz3rQc0; Wed, 15 Feb 2023 22:26: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 4PHCNM08Wbz3kpG; Wed, 15 Feb 2023 22:26:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676499987; h=from:from:reply-to:subject:subject: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/WqZF17giMwnTnoYvUj9M9y716r8kAlqjMu+eBKI8c=; b=es+5OPijLI9r+U34WU7IweEm7LhpQjkHR9v3y/sNZ9t//ayEUaYDYQNSbNcLNV9cARTPJV XG35ZoxWyFS4Hcu22VD6Nsdtm3N5C+c4C5ADin55r4fGRpRI+hE6lC5wsdbPdiaumTkkkS Prg03CZLxlMIxlVp1os8lA9iOSlZH6cv197bolJmeQya57/idmFrITUPcD8Nrr+QJ53qcU bdX7V3fJvCc4lu/KSQKd9/Kj6H1gYHYBwfTHbYMsTy8su8+qgfJkPyppB7nmSKcE2K67sX 0MhiblttwXpQ1G8OpQvLP0RWjO3DLqTWjqd+laebb1Z956Aql5hDl8P3/LItFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676499987; h=from:from:reply-to:subject:subject: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/WqZF17giMwnTnoYvUj9M9y716r8kAlqjMu+eBKI8c=; b=QgAtEFU31kfNpeLrtQw1QHpk1MilcaL2E1CmIGZeq6IHrY8dHwhMkFHsKtCLtblX//2Ghp fX7DLGPar4Yglz/nHISlWElkKTuu+SvfWpEbCoaQvwrBmpFNYnstmwHbDIayDUtcQdhxTv o62/6a7lKXIVLdmf8lrHXrUb0wpP/t9bYwCutC/Wt5BdMz8C49BZTNd3Pkb+yzS/Bb+D6G Kpj69mtAPCkYGuAvSfoFLriS3ZYZufwQNfukARp1SdukOwSYgJo4lDd05xlokvr987regB ay4K6yIjvRR57V8zesNMcuANsYov9E2mb2pJ6WO75fBZ/Wq1u7a7OZugbb04tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676499987; a=rsa-sha256; cv=none; b=oSd8LjWrizG+9AwQzsFbrp623QKkDhReyU3i8oWlWozDCuIVdBcc671nRW8krwzOpWmPnJ dodeSYjoD8QO/9YfLsHVd4g/tPKNOuk6gU+ZToE9LTR8eouwOmE+W8qNps5OoAX0PEWF8+ 5u0OvghhLYqK7W3ed/jJafMJMEfnZopU3xzK9uCEp89skGgbq51kNa9TXqXCfP4hkl4l+s wdUzxdGqN7tZ5kWXvlZCetPA+HIcVCTRKw7lFW8+yHKoNBPrtwJvgkTZzKl7v6ZuRE1/KY e0MyGHIxdp4ByLRkpuBTE8xN/YvCEK1QKxI0xA6depi5wlpQFdaEpCWZNUVPLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHCNL6KzQzh1j; Wed, 15 Feb 2023 22:26: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 31FMQQAG093716; Wed, 15 Feb 2023 22:26:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FMQQV8093715; Wed, 15 Feb 2023 22:26:26 GMT (envelope-from git) Date: Wed, 15 Feb 2023 22:26:26 GMT Message-Id: <202302152226.31FMQQV8093715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: b1a9e570fe2d - main - linuxkpi: Add `strscpy_pad()` to List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1a9e570fe2da0a43c41327d7ce21b27bf8257b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b1a9e570fe2da0a43c41327d7ce21b27bf8257b8 commit b1a9e570fe2da0a43c41327d7ce21b27bf8257b8 Author: Jean-Sébastien Pédron AuthorDate: 2023-02-14 23:46:13 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-15 22:19:41 +0000 linuxkpi: Add `strscpy_pad()` to It's the same as `strscpy()` except that it fills the rest of the destination buffer with zeroes if the source buffer is shorter. Reviewed by: manu Approved by: manu --- sys/compat/linuxkpi/common/include/linux/string.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index 65422cac629c..20c3729aaf12 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -207,6 +207,15 @@ strscpy(char* dst, const char* src, size_t len) return (-E2BIG); } +static inline ssize_t +strscpy_pad(char* dst, const char* src, size_t len) +{ + + bzero(dst, len); + + return (strscpy(dst, src, len)); +} + static inline void * memset32(uint32_t *b, uint32_t c, size_t len) { From nobody Wed Feb 15 22:27:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHCPf10dGz3rQwL for ; Wed, 15 Feb 2023 22:27:34 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 4PHCPd6L7Lz3l9w for ; Wed, 15 Feb 2023 22:27:33 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f51.google.com with SMTP id k3so164193wrv.5 for ; Wed, 15 Feb 2023 14:27:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=uBWELykY8nj6srXchoZCxtuuR0AKu8bKtGkyKn8igsY=; b=zCn7h4MRZgXkGMpJ0vgRfy6oOWL2XtJB54YwzmUUxe0Cqz6CwBbkW85BtgD7AG+//c AE4pSqoc5HGS7GZrC7aU0wBOsqsAR2xhQjAMhFbb1+E7mA0CIND7sEPUjoYUVTH95j/o pIvrqYbac7qyOZvxDcLf5HlnNpuFA9dC6PmWZRIVGo4qjDC42+0d0m5YWm0KuCme7kQa /716pJAHh3cZW+ZA46C0UhKQiaFZpt8t0+77YB9JOkBpamE3KbFJvrzcGRWa2o/dxZ9j LRE/yzuM13F/hfc4IG4WIsDL0ScNidcQA4KP2Tt0wls6eBK/urmb1VDmYegEZhmEwfAG 3C7g== X-Gm-Message-State: AO0yUKX6OfvkIYYmdvPqN7icl+sx7JjROU0XrbCnwlpEFFYvHwUtbVRy +OcFLnT9FPiwOLv+knXqNVU3pA== X-Google-Smtp-Source: AK7set/0NXORV0jtdvI76ykIc3grsDSlkrDnjz2Ytb0J9f0AHunD07eH85wDcTMdWv8JEi8+Md7cVA== X-Received: by 2002:a05:6000:1152:b0:2c5:52f5:c63b with SMTP id d18-20020a056000115200b002c552f5c63bmr3047283wrx.11.1676500052370; Wed, 15 Feb 2023 14:27:32 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id b17-20020a5d4b91000000b002c55de1c72bsm7304016wrt.62.2023.02.15.14.27.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Feb 2023 14:27:31 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: b1a9e570fe2d - main - linuxkpi: Add `strscpy_pad()` to From: Jessica Clarke In-Reply-To: <202302152226.31FMQQV8093715@gitrepo.freebsd.org> Date: Wed, 15 Feb 2023 22:27:31 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202302152226.31FMQQV8093715@gitrepo.freebsd.org> To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PHCPd6L7Lz3l9w 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 15 Feb 2023, at 22:26, Jean-S=C3=A9bastien P=C3=A9dron = wrote: >=20 > The branch main has been updated by dumbbell (ports committer): >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Db1a9e570fe2da0a43c41327d7ce21b27= bf8257b8 >=20 > commit b1a9e570fe2da0a43c41327d7ce21b27bf8257b8 > Author: Jean-S=C3=A9bastien P=C3=A9dron > AuthorDate: 2023-02-14 23:46:13 +0000 > Commit: Jean-S=C3=A9bastien P=C3=A9dron > CommitDate: 2023-02-15 22:19:41 +0000 >=20 > linuxkpi: Add `strscpy_pad()` to >=20 > It's the same as `strscpy()` except that it fills the rest of the > destination buffer with zeroes if the source buffer is shorter. >=20 > Reviewed by: manu > Approved by: manu > --- > sys/compat/linuxkpi/common/include/linux/string.h | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/sys/compat/linuxkpi/common/include/linux/string.h = b/sys/compat/linuxkpi/common/include/linux/string.h > index 65422cac629c..20c3729aaf12 100644 > --- a/sys/compat/linuxkpi/common/include/linux/string.h > +++ b/sys/compat/linuxkpi/common/include/linux/string.h > @@ -207,6 +207,15 @@ strscpy(char* dst, const char* src, size_t len) > return (-E2BIG); > } >=20 > +static inline ssize_t > +strscpy_pad(char* dst, const char* src, size_t len) > +{ > + style(9) doesn=E2=80=99t need this blank line any more, please stop = including them in your commits. Jess > + bzero(dst, len); > + > + return (strscpy(dst, src, len)); > +} > + > static inline void * > memset32(uint32_t *b, uint32_t c, size_t len) > { From nobody Wed Feb 15 22:28:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHCRG2lbJz3rQnS for ; Wed, 15 Feb 2023 22:28:58 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from smtp-190b.mail.infomaniak.ch (smtp-190b.mail.infomaniak.ch [185.125.25.11]) (using TLSv1.3 with cipher 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 "relay.mail.infomaniak.ch", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHCRG00pvz3lRD for ; Wed, 15 Feb 2023 22:28:58 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received: from smtp-2-0000.mail.infomaniak.ch (unknown [10.5.36.107]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4PHCRC1MSSzMqZ4g; Wed, 15 Feb 2023 23:28:55 +0100 (CET) Received: from unknown by smtp-2-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4PHCRB6FjkzMs95b; Wed, 15 Feb 2023 23:28:54 +0100 (CET) Message-ID: Date: Wed, 15 Feb 2023 23:28:54 +0100 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: git: b1a9e570fe2d - main - linuxkpi: Add `strscpy_pad()` to To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202302152226.31FMQQV8093715@gitrepo.freebsd.org> Content-Language: en-US From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Organization: The FreeBSD Project In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha X-Rspamd-Queue-Id: 4PHCRG00pvz3lRD X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:29222, ipnet:185.125.24.0/22, country:CH] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 15/02/2023 23:27, Jessica Clarke wrote: >> +static inline ssize_t >> +strscpy_pad(char* dst, const char* src, size_t len) >> +{ >> + > > style(9) doesn’t need this blank line any more, please stop including > them in your commits. Thank you for the reminder, I will in the future! -- Jean-Sébastien Pédron The FreeBSD Project From nobody Wed Feb 15 22:34:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHCYz6yYjz3rRJr; Wed, 15 Feb 2023 22:34: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 4PHCYz6NTnz3nBF; Wed, 15 Feb 2023 22:34:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676500487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5CSapGXg9AIGPc2d+iR3StK8mnZsuY2m3wR+3IZgYw8=; b=EP5JKgNdJUUFyqHFul9YFWJyCaTW0GCmW5rCw9zMJrZzKtCBqqxzz8nfrsluNULtVnzz+I nGQAxzbLUDTFR4oQS4pl2JF1buepi5gAwss2xZD7PuLhXKdKfv4E3nNmE7k+jmkU6fSZIW 6VmbHXmVgz5ukMn6DVE8Y8rK93MQw8aDPgm3Y857C0z5ANcTYjrlSfPZ+xsfACIsmw6r// yfRJ7ozLKVRhUSLYppVGLGbBE+Xuxp2V633baShBHzMbgwy/Fx98E9rT1Dyko5i117MKne ky0xruJZnU86fxRZrdIWRSwr0an1afq4MB6SAPSo17/TX31rgv90reaTDNsm6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676500487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5CSapGXg9AIGPc2d+iR3StK8mnZsuY2m3wR+3IZgYw8=; b=fF72eyHgpzxjOU4LU7kmTiw4YZlwXnEcbBZi6Hkp+9pq7DFu6SaYegwa1clcBnTZMpbJpz cQRdVcMb9Is45va87MuN8tDvpvpSvEkOZXxpI2VSQPMI9VX0vx1iomQBER1O033FaBWEJH MNj+SCpMryRaVorv4QjaaKd3v2hlUa4EYiK5DybKesT2nnfb0g2WmjI7Fw5otYTbLnYXn+ G3NdnLl/NnSzKOIPWvKk4r934jbDXZEWNKG1SVVCeP4OBqJvu9oooiRd7OfrtibMVoi8Nj cBXbvOUCWsHFtVuqM/9pZfdrGMKugoZiff6Teqw+I3tB0IahMv/vlUdTsrIWmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676500487; a=rsa-sha256; cv=none; b=AXGcpe2P9SL28PkjRBK95L9MjGDYW8D1q7LGmfe3qMOGHS7nteE/Rw59VePB21puwLwvAd J05N7rRrDxOTWn4PW9qNP21Nicx5N54JDMSxH/5t5G8/DrqZjfRLPjovO97UQUFrqqf0Nf S8lZb9mPVQBRtbvjoBslqsP4mCqrEZhg/N+4gRR6sdVd0eYX+dl/4cf/F/kvUlbGJNSy7a DCAG6/iXKpUC2etsvaWctBaWBV7gaAKr+AVBw71XB1iHo3gnhHQ1myXlLwNNvveIA8uteS MvEr09vVgY/4hRAAyOyRygpi70CMm5uy6BkYzgroVSGKLJ9DZK/78GddFCMHYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHCYz5GTtzgr3; Wed, 15 Feb 2023 22:34: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 31FMYlWa007748; Wed, 15 Feb 2023 22:34:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FMYlsT007747; Wed, 15 Feb 2023 22:34:47 GMT (envelope-from git) Date: Wed, 15 Feb 2023 22:34:47 GMT Message-Id: <202302152234.31FMYlsT007747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 1d02c6b1b859 - main - ixl(4): Fix MAC/VLAN filters accounting List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d02c6b1b859e9f611bc8fe27ca3d2c16ec128c1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=1d02c6b1b859e9f611bc8fe27ca3d2c16ec128c1 commit 1d02c6b1b859e9f611bc8fe27ca3d2c16ec128c1 Author: Krzysztof Galazka AuthorDate: 2023-02-15 22:28:01 +0000 Commit: Eric Joyner CommitDate: 2023-02-15 22:34:25 +0000 ixl(4): Fix MAC/VLAN filters accounting - Account for a filter required to enable reception of untagged frames while registering and unregistering VLANs to avoid trying to add more filters than HW supports - While adding MAC/VLAN filters, pre-set matching method field in the Admin Queue Command response buffer to expected error value to work around an issue with some FW versions, which do not update that field if operation fails, and be able correctly track which filters were configured in HW. - Remove unused IXL_MAX_FILTERS macro definition - Update number of available MAC/VLAN filters as in newer FW versions it was decreased by one. - Simplify i40e_dma_mem structure Signed-off-by: Krzysztof Galazka Signed-off-by: Eric Joyner Reviewed by: erj@ Tested by: Gowtham Kumar Ks MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D37457 --- sys/dev/ixl/i40e_osdep.c | 1 - sys/dev/ixl/i40e_osdep.h | 3 --- sys/dev/ixl/if_ixl.c | 7 ++++--- sys/dev/ixl/ixl.h | 5 +---- sys/dev/ixl/ixl_pf_main.c | 5 +++++ 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/dev/ixl/i40e_osdep.c b/sys/dev/ixl/i40e_osdep.c index 20eb02c85d67..b3fd53af9e23 100644 --- a/sys/dev/ixl/i40e_osdep.c +++ b/sys/dev/ixl/i40e_osdep.c @@ -109,7 +109,6 @@ i40e_allocate_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem, "error %u\n", err); goto fail_2; } - mem->nseg = 1; mem->size = size; bus_dmamap_sync(mem->tag, mem->map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); diff --git a/sys/dev/ixl/i40e_osdep.h b/sys/dev/ixl/i40e_osdep.h index e7a1c1226a0e..1146ece279b5 100644 --- a/sys/dev/ixl/i40e_osdep.h +++ b/sys/dev/ixl/i40e_osdep.h @@ -160,10 +160,7 @@ struct i40e_dma_mem { u64 pa; bus_dma_tag_t tag; bus_dmamap_t map; - bus_dma_segment_t seg; bus_size_t size; - int nseg; - int flags; }; struct i40e_virt_mem { diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 8b7d132db7b7..ca71edd9bd9e 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -49,7 +49,7 @@ *********************************************************************/ #define IXL_DRIVER_VERSION_MAJOR 2 #define IXL_DRIVER_VERSION_MINOR 3 -#define IXL_DRIVER_VERSION_BUILD 2 +#define IXL_DRIVER_VERSION_BUILD 3 #define IXL_DRIVER_VERSION_STRING \ __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ @@ -1720,9 +1720,10 @@ ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag) if ((if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) == 0) return; - if (vsi->num_vlans < IXL_MAX_VLAN_FILTERS) + /* One filter is used for untagged frames */ + if (vsi->num_vlans < IXL_MAX_VLAN_FILTERS - 1) ixl_del_filter(vsi, hw->mac.addr, vtag); - else if (vsi->num_vlans == IXL_MAX_VLAN_FILTERS) { + else if (vsi->num_vlans == IXL_MAX_VLAN_FILTERS - 1) { ixl_del_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); ixl_add_vlan_filters(vsi, hw->mac.addr); } diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 6b94732fd44e..30e8ce40126b 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -164,9 +164,6 @@ #define IXL_VF_MAX_HDR_BUFFER 0x840 #define IXL_VF_MAX_FRAME 0x3FFF -/* ERJ: hardware can support ~2k (SW5+) filters between all functions */ -#define IXL_MAX_FILTERS 256 - #define IXL_NVM_VERSION_LO_SHIFT 0 #define IXL_NVM_VERSION_LO_MASK (0xff << IXL_NVM_VERSION_LO_SHIFT) #define IXL_NVM_VERSION_HI_SHIFT 12 @@ -195,7 +192,7 @@ #define IXL_VLAN_ANY -1 /* Maximum number of MAC/VLAN filters supported by HW */ -#define IXL_MAX_VLAN_FILTERS 256 +#define IXL_MAX_VLAN_FILTERS 255 #define CSUM_OFFLOAD_IPV4 (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) #define CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6|CSUM_UDP_IPV6|CSUM_SCTP_IPV6) diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 7e9ad20b157b..25ced54e79e1 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -1396,6 +1396,11 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, struct ixl_ftl_head *to_add, int cnt) b->flags = 0; } b->flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH; + /* Some FW versions do not set match method + * when adding filters fails. Initialize it with + * expected error value to allow detection which + * filters were not added */ + b->match_method = I40E_AQC_MM_ERR_NO_RES; ixl_dbg_filter(pf, "ADD: " MAC_FORMAT "\n", MAC_FORMAT_ARGS(f->macaddr)); From nobody Wed Feb 15 22:41:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHCjZ0V3pz3rRTw; Wed, 15 Feb 2023 22:41: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 4PHCjY53bkz3nvj; Wed, 15 Feb 2023 22:41:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676500881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ax2pTv67IRLMyboB+1nrwK30bdilsgbyn2ALAP8N7wM=; b=Dcz8FiBRYHRajyoed/0pe/zlJz7z2S7ewNhOVF4/EXOnvKCOaf0kwL24aHN25OgES8byN2 jpcFm7yeckhbEfBAT9NrJkyTSQibCCekkyF7Yn7IQbznmhOBrK9LJO9I9EZ1+UWaokDtjb X+6BBnGLMJlPZOwrcXdMhTDLM+tbmDVibPbyQqmdoazBsFcLlkxG7PFy3LxeyfHTylk3k9 mpz91Z5thZLMGTbFYOB9zAYRdKhLKjP6hhT4KorgSOOIIG3vOPjVouavyb61gp+euxFvHE CHH2j/S3GcmehtPTNPzuV1jDgSTcLkOR+GEH3i6ndztqc/QLpw7bR7wZxoWxZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676500881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ax2pTv67IRLMyboB+1nrwK30bdilsgbyn2ALAP8N7wM=; b=aTFFqt95bEsf7KFc6gpY9b2Hf9rMuspJpfIKGgk+8/DURT4JD0/oGLyXxuvNrBca+p3imt qrsAN0d+3OIJEMgJ0c4bAaiIOHikzeXExrzPgeDG4bNPSnjvr5cAmQuX7m+/93m6o45xgc SdpnK6rcjrwWWRK8hNrTzooH3/5tSM0whKCw/K7iSlxRFUYI++UCDSpjU7xjIgZLq47aGb 400r5CN4m/JyjF5uyjV3A5iGa5iLiBpAu3/vWV53avoGlKdkIXseZ7RSnU4mL0ks2f+oMM zQQB9GNhlKvHdQNNSOC41yfUf72cxHgAsv9eiajcBJr3FUQ5hxfAE8UZEJRvpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676500881; a=rsa-sha256; cv=none; b=oRUxZlR4lG9/ck/KU8sETiNkWl9u4jmHWUlJjl1OPSY1YLDDh8YUymAP3Q/AVnEQEWymIk 7GhF2Kia+B0RigOXUb/kOCm0WuTSwo4S2q3UvrYoq2CeGdLNhurUbYdg3ARzl3i6kZi1lA Z8/JoxzrlkNIrMJb5zOyH3QRNYirGwGs/WyV0/QEMUiDBiuYowdpmULJm6IjYvW9BAQakL yeEuxo0G9air8ONWgY3g9loxTRgvV0pXP1EX+NXbOBcuo+Q+ZNswzplzW+zvCDXRYKgoWW yJSkDo+9z5ZtnU8K/flMGXatS/G1L1IdIMuZMfBqXuDa+ofWx4jvWIO315/L/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 4PHCjY46JXzh39; Wed, 15 Feb 2023 22:41:21 +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 31FMfLv2017010; Wed, 15 Feb 2023 22:41:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FMfLJ5017009; Wed, 15 Feb 2023 22:41:21 GMT (envelope-from git) Date: Wed, 15 Feb 2023 22:41:21 GMT Message-Id: <202302152241.31FMfLJ5017009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 04a5e6d7cadd - main - ixgbe(4): Filter out spurious link up indication List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04a5e6d7cadd06b10169c3c3a560649e7dc7444c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=04a5e6d7cadd06b10169c3c3a560649e7dc7444c commit 04a5e6d7cadd06b10169c3c3a560649e7dc7444c Author: Krzysztof Galazka AuthorDate: 2023-02-15 22:35:40 +0000 Commit: Eric Joyner CommitDate: 2023-02-15 22:38:05 +0000 ixgbe(4): Filter out spurious link up indication Extend SFP+ cage crosstalk fix by re-checking link state after 5ms delay to filter out spurious link up indication by transceiver with no fiber cable connected. Signed-off-by: Krzysztof Galazka Signed-off-by: Eric Joyner Reviewed by: erj@ Tested by: Gowtham Kumar Ks MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38395 --- sys/dev/ixgbe/ixgbe_common.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 3f38f5e27123..86301dab80ed 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4232,10 +4232,25 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed, links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); } } else { - if (links_reg & IXGBE_LINKS_UP) + if (links_reg & IXGBE_LINKS_UP) { + if (ixgbe_need_crosstalk_fix(hw)) { + /* Check the link state again after a delay + * to filter out spurious link up + * notifications. + */ + msec_delay(5); + links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); + if (!(links_reg & IXGBE_LINKS_UP)) { + *link_up = false; + *speed = IXGBE_LINK_SPEED_UNKNOWN; + return IXGBE_SUCCESS; + } + + } *link_up = true; - else + } else { *link_up = false; + } } switch (links_reg & IXGBE_LINKS_SPEED_82599) { From nobody Wed Feb 15 23:04:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHDDG3bLPz3rSjM; Wed, 15 Feb 2023 23:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHDDG34Yfz3rGq; Wed, 15 Feb 2023 23:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676502270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yIqfe075wQc8ZC7A1C2GRVcHnNlMqzKFY8Ww7k1RVJ0=; b=FudkN5fdMaUJZvJSqalYUZlrJew68upuPRG1FBKJlnXVpNkeuuOOn7PFAy6WKbH8AmJdlL V3MHiNtwBjDSOJr/hI3jtFf6xQZ4ID60wRbQeYYXg8q96weJ8g31hlKg3AufKFmuw3bf3o 1gjqb29MN9Rv4W9vHisJEKESmS85LRR9VjXqYY2Kpha/9I1VHV2fji/BRwLpJDxhBbJ0Or T8KJ2aVLgZLjruah1+r6L5FQKVpLxGgsDpQq4xBhoZlADx0BlgbuGWWQpZbnX9L+YYgc24 o7WDwhViwJGbqPvB/vCTfMpxAVYbudrN2QHQkzTgOkOZYOTG8BtHKamNyZDzfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676502270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yIqfe075wQc8ZC7A1C2GRVcHnNlMqzKFY8Ww7k1RVJ0=; b=tP1od5B+bX4bpdWI8aB509QTo+oo9FekyTeCS2Y223a40scOHNy3KR2m6Kguwlj4B/5BW1 gnY9DQRdQqQynvmnLeIVzK4OcwYjnAd4MhnBELPw0TzG7cguXwaBlNH/E7t9uWRakf53lY gM6y1zsrAcSTOxZRfVMyOXSXzguzSJ7LARysCAaOZR1S52K2/6suF1t2ceRZJjq01oqwsi GiSYO6PDRsjaZ3E0GFNpRywsoEI2S7IUUy9hhlyX275wWOi0OgUGUXhXdjDEv1KtbV20kH vNSobhORw/2pC/TdNPNORrsWYHP3T7CHvP94kIzZXrd8ZAGVTR3D34wq9/SVAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676502270; a=rsa-sha256; cv=none; b=b9skrFyTcCMBHBCATI2DkqkMf5JY9T5sorB4ceL7PRkyGvpZUL67zUmMw/FgQ6U62c9Mqp HG+fUuJxLZ6VQwDFJShep5RVf6/8sxL4+ZEEfZ9R6kpXcS51RnJboRx2KF2GRbAznK8+ea I1mvI57LsuyqTgSUBL+zOhKCh45gypwRJ6d08eqScrb0XI2olUvC2DIVACcmotijCkgZDt f7OZtdmXrkPcpoZA79JumGgx3h2qOJZ18S5JkzBEnGNW1eHRF0dsDIEMxcdrmb58jqrjjv r+WqjJQckUyjBsmbX9bJx33yuG9rNGjj6nq15/7SeA0m8gfOi7tmjc0EVMspgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHDDG26Hzzhcv; Wed, 15 Feb 2023 23:04:30 +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 31FN4UJ7051286; Wed, 15 Feb 2023 23:04:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FN4USG051285; Wed, 15 Feb 2023 23:04:30 GMT (envelope-from git) Date: Wed, 15 Feb 2023 23:04:30 GMT Message-Id: <202302152304.31FN4USG051285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 942815c54820 - main - libefivar: Add note about extra compiler flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 942815c54820783d3d4f7f6faa71ab7919b5f0e5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=942815c54820783d3d4f7f6faa71ab7919b5f0e5 commit 942815c54820783d3d4f7f6faa71ab7919b5f0e5 Author: Warner Losh AuthorDate: 2023-02-15 23:02:56 +0000 Commit: Warner Losh CommitDate: 2023-02-15 23:03:54 +0000 libefivar: Add note about extra compiler flags Add a note about why we need these extra compiler flags to suppress warnings. EDK2 upstream code is being used verbatim and as of the last update these issuse persist, but are benign. Sponsored by: Netflix Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D38613 --- lib/libefivar/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libefivar/Makefile b/lib/libefivar/Makefile index 5a6077d4b8f8..d38d7906af20 100644 --- a/lib/libefivar/Makefile +++ b/lib/libefivar/Makefile @@ -64,9 +64,10 @@ WARNS?= 9 .include +# We use UEFI parsing and formatting code from upstream EDK2 project. +# They still have issues that require us to susppress some warnings. CWARNFLAGS+= -Wno-cast-align CWARNFLAGS+= -Wno-unused-parameter - .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 130000 CWARNFLAGS+= -Wno-unused-but-set-variable .endif From nobody Wed Feb 15 23:04:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHDDH4f0Mz3rSjQ; Wed, 15 Feb 2023 23:04: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 4PHDDH3w2Gz3r9k; Wed, 15 Feb 2023 23:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676502271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlt4Zkeshkf+IIUF9JjJuRhlMLa9P5lmgceraV2BzLk=; b=yc/NgdfVaxJyww1MrMy6NJG1vU+lt2xDUwdV+NlzvV8AVQZxq0l8ycohXirA1Y+WUE97r4 BrdOdtGDiwudWZr+AS2tgnXi7vn+bd86vLBckiBLEYtwdnDtsHDESEDiCEq/ewa0wfUBDx 22GlhJlf/ZvWeUpvxQyb8LtuAeh1OdH8akIr+dmxHIQgfhsGtcJ+LQBxlChBy2NDD8zy8J faiF8sRJnhnDUqi5EsEQDi5KZ5/V9zk2tJNqNC90ZQPUxIeoDzsR+g4BRHUC9csRgteFTm xVoCer1tTBpG+KZOUQKqRBCnioHmw0RzWWleGX8vQ+41FIqgfRxflfzBpgTf8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676502271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlt4Zkeshkf+IIUF9JjJuRhlMLa9P5lmgceraV2BzLk=; b=awVIjRijNCLbmvZcdi+6sF1ixoSaRkciNzLC6rye4iumWl9cOorjFD44/7H4fBbnYaeqpW /uP4kDUmHNntewX2jn9InZcpU61mQdKK5G9tjTVDbKo0yMZEx1+JaEe3lmTn1UWED561Ze qomnr3E4OW+sPm0wYIPWyW0KHhmiIWJXJQ7S/k55nRhMPDjV8qwvBQDjaDFL/QjRiWPDPf Ep0ofxfgj4xmJAcoaIgy8rNlBENqWwyiMxjQPNiitn/eWSh/ktkT0a8RYffMHYYOkFPWZj bqXrA5j7Rq4AI1KNZ26yMQPJgbLnOVgPJyiJA6Rs+ZBUP0vrREzfsl+BJN2ovA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676502271; a=rsa-sha256; cv=none; b=xzx1oGJtx/kDXL2Q2NI3eJwvqv6y0SNFm00nG75dqxXNkStI5rJ+hTVIyPDRZv/GvH3Mue 8uHVM7hV+VVhPEH3wTtvDY0DR3ztKXlQcfF87aneVOxNu7XDJwppa/C80+kMeQZ3pwJ2mQ u/xl1nEFuNwXcMLeoHCJPcIp/RPcuvh3GXvjeFTO6sEOcn0s2thcOcSpyNF+g3Vu5W0w3/ m2MAukI805bsn30CygdBaw4WiK8hhDPiYB7knzgs7TN3gXFtTD3tsmWRxRpg8tXOURuVuT 9BA260YKK37e7L5QZKQV2rVE+3YelIFcAUHAEx+LAQ7Rb5ZetmRfOBSSMvMi/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 4PHDDH2rbmzhRG; Wed, 15 Feb 2023 23:04: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 31FN4VkU051315; Wed, 15 Feb 2023 23:04:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FN4VgX051314; Wed, 15 Feb 2023 23:04:31 GMT (envelope-from git) Date: Wed, 15 Feb 2023 23:04:31 GMT Message-Id: <202302152304.31FN4VgX051314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 547fb1426cec - main - efidp: Remove write only variable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 547fb1426cecf097a7eae023eb8a0fbde733178b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=547fb1426cecf097a7eae023eb8a0fbde733178b commit 547fb1426cecf097a7eae023eb8a0fbde733178b Author: Warner Losh AuthorDate: 2023-02-15 23:03:02 +0000 Commit: Warner Losh CommitDate: 2023-02-15 23:03:54 +0000 efidp: Remove write only variable Sponsored by: Netflix --- usr.sbin/efidp/efidp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/efidp/efidp.c b/usr.sbin/efidp/efidp.c index aef154112d66..967694024380 100644 --- a/usr.sbin/efidp/efidp.c +++ b/usr.sbin/efidp/efidp.c @@ -169,14 +169,13 @@ efi_to_unix(void) char buffer[MAXSIZE]; char dpbuf[MAXSIZE]; efidp dp; - size_t dplen; char *walker, *dev, *relpath, *abspath; int rv; dp = (efidp)dpbuf; while (fgets(buffer, sizeof(buffer), stdin)) { walker= trim(buffer); - dplen = efidp_parse_device_path(walker, dp, sizeof(dpbuf)); + efidp_parse_device_path(walker, dp, sizeof(dpbuf)); rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath); if (rv == 0) printf("%s:%s %s\n", dev, relpath, abspath); From nobody Wed Feb 15 23:20:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHDZv0prpz3rTPl; Wed, 15 Feb 2023 23:20: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 4PHDZv0bf4z3sSM; Wed, 15 Feb 2023 23:20:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676503239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LpBAXJdm+jp592nWcSxgc/RntHB5RbSSrXvh13iCYOk=; b=KUuPKE4mBfpu17WKQPwrsYfo8SJzDUUTtnzEZntQR5pDgclTZj4G6DDHAcIhke1F7fzhCe A1QBcIZs7lKpx87Wc5yWOMvu1zxB9l6KTTR9gfMlBMtmf49wYeSf9PZ3dDvF03/WPhzED1 oy8WJt1xZbR3NamaNlVuecdG0MXgQt2SHLtyYb4NyaJN8kXTxT8ef60cgJA7FUujkaX7XO qL9eYLM2Qr4Mfyy2Xv6hKj28duz8sBwUtz3/SCEX41l9/8Zo/0bHW/Rt41cBkB2BPsM5ci I4KSh4dbyUK8INVrVwwbtBioGnGPMHDAsuTLTbLhDm4RChS7ukeUVNw/lY6sdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676503239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LpBAXJdm+jp592nWcSxgc/RntHB5RbSSrXvh13iCYOk=; b=lLPOHQfZz2ZG5Pgzy8pgvNJAk3aicGFUGumTPNdzx4lm1Rycv8eZWktFEjRI0drrm7AQ9Y 1T9nKDInO+6UmWhnXv5mTsHMl3jBzk3mrVAbcZwwqPbn+Md+zjRLf2Vs9ZA6ZSo6boqY7r g7lwRmFTrqXxjumRGgYNxWweE5PXSIXKqIqqN/675Y+zYY+ypmV0WWsBVk5cXGNgWWLms8 cycnz9nVp09Z4IsRQZyOcCS1lBapn5m85kubYt7vFBlJq4ULJZ5gBp518dkOeK8gzni/Xu gBekBxdhkm3II9dTAYlm7oD/VuY+RP25iiMc98Ly1M342a4f5QvXBV7dHsOo3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676503239; a=rsa-sha256; cv=none; b=B9OY0nefQ1jy6rXeUfi5/8/OUsfsqGmeYDIS1/BBAqOKKkHeYvR3HT2jLqhl4ud2EVxaoy UgmmfQqAPGtvZW70vrtmemPjq3OGNP2iDrlKLwGEFMB9A6Y5Yld13sbB055VGs6agAtkXX IMgTR0BrG74ks5YdB87a9f0hPkiiFkCKAUA4UbiOtA3eOb+0JclwSBOBoMRsibv8ZmCfdB rvmKaR76Dc8kbUjLXFDFvThbsbGfoBdiA+xqsEPh7pj+XUSgeN5wOjsfDzteiHKWN6y0/F VHvV4ylIhTTVOZ3Bkfkud87P/blOzpA3Dz+y3DRnKAyLj7cUKEeZllXWPf9lwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHDZt6mc2zhrp; Wed, 15 Feb 2023 23:20: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 31FNKc4n074262; Wed, 15 Feb 2023 23:20:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31FNKcg6074261; Wed, 15 Feb 2023 23:20:38 GMT (envelope-from git) Date: Wed, 15 Feb 2023 23:20:38 GMT Message-Id: <202302152320.31FNKcg6074261@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: 2894c8c96b9b - main - kgssapi: Add macros so that gssd(8) can run in vnet prison List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2894c8c96b9b94f35aaa27ee5ef3ac11c276fe3f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2894c8c96b9b94f35aaa27ee5ef3ac11c276fe3f commit 2894c8c96b9b94f35aaa27ee5ef3ac11c276fe3f Author: Rick Macklem AuthorDate: 2023-02-15 23:18:46 +0000 Commit: Rick Macklem CommitDate: 2023-02-15 23:18:46 +0000 kgssapi: Add macros so that gssd(8) can run in vnet prison Commit 7344856e3a6d added a lot of macros that will front end vnet macros so that nfsd(8) can run in vnet prison. This patch adds similar macros named KGSS_VNETxxx so that the gssd(8) daemon can run in a vnet prison, once the macros front end the vnet ones. For now, they are null macros. This is the last commit that adds macros. The next step is to change the macros to front end the vnet ones. MFC after: 3 months --- sys/kgssapi/gss_delete_sec_context.c | 7 ++- sys/kgssapi/gss_impl.c | 23 ++++++--- sys/kgssapi/gss_release_cred.c | 7 ++- sys/kgssapi/gss_release_name.c | 7 ++- sys/kgssapi/gssapi_impl.h | 16 +++++- sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 94 +++++++++++++++++++++--------------- 6 files changed, 104 insertions(+), 50 deletions(-) diff --git a/sys/kgssapi/gss_delete_sec_context.c b/sys/kgssapi/gss_delete_sec_context.c index 4d520feb71b9..82f9e6b8f370 100644 --- a/sys/kgssapi/gss_delete_sec_context.c +++ b/sys/kgssapi/gss_delete_sec_context.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -54,8 +55,12 @@ gss_delete_sec_context(OM_uint32 *minor_status, gss_ctx_id_t *context_handle, *minor_status = 0; - if (!kgss_gssd_handle) + KGSS_CURVNET_SET_QUIET(KGSS_TD_TO_VNET(curthread)); + if (!KGSS_VNET(kgss_gssd_handle)) { + KGSS_CURVNET_RESTORE(); return (GSS_S_FAILURE); + } + KGSS_CURVNET_RESTORE(); if (*context_handle) { ctx = *context_handle; diff --git a/sys/kgssapi/gss_impl.c b/sys/kgssapi/gss_impl.c index 9b1277298e32..aa882d9f333b 100644 --- a/sys/kgssapi/gss_impl.c +++ b/sys/kgssapi/gss_impl.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -38,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -62,9 +64,10 @@ static struct syscall_helper_data gssd_syscalls[] = { }; struct kgss_mech_list kgss_mechs; -CLIENT *kgss_gssd_handle; struct mtx kgss_gssd_lock; +KGSS_VNET_DEFINE(CLIENT *, kgss_gssd_handle) = NULL; + static int kgss_load(void) { @@ -134,10 +137,12 @@ sys_gssd_syscall(struct thread *td, struct gssd_syscall_args *uap) } else cl = NULL; + KGSS_CURVNET_SET_QUIET(KGSS_TD_TO_VNET(curthread)); mtx_lock(&kgss_gssd_lock); - oldcl = kgss_gssd_handle; - kgss_gssd_handle = cl; + oldcl = KGSS_VNET(kgss_gssd_handle); + KGSS_VNET(kgss_gssd_handle) = cl; mtx_unlock(&kgss_gssd_lock); + KGSS_CURVNET_RESTORE(); if (oldcl != NULL) { CLNT_CLOSE(oldcl); @@ -249,12 +254,16 @@ kgss_transfer_context(gss_ctx_id_t ctx) enum clnt_stat stat; OM_uint32 maj_stat; - if (!kgss_gssd_handle) + KGSS_CURVNET_SET_QUIET(KGSS_TD_TO_VNET(curthread)); + if (!KGSS_VNET(kgss_gssd_handle)) { + KGSS_CURVNET_RESTORE(); return (GSS_S_FAILURE); + } args.ctx = ctx->handle; bzero(&res, sizeof(res)); - stat = gssd_export_sec_context_1(&args, &res, kgss_gssd_handle); + stat = gssd_export_sec_context_1(&args, &res, KGSS_VNET(kgss_gssd_handle)); + KGSS_CURVNET_RESTORE(); if (stat != RPC_SUCCESS) { return (GSS_S_FAILURE); } @@ -288,11 +297,13 @@ kgss_gssd_client(void) { CLIENT *cl; + KGSS_CURVNET_SET_QUIET(KGSS_TD_TO_VNET(curthread)); mtx_lock(&kgss_gssd_lock); - cl = kgss_gssd_handle; + cl = KGSS_VNET(kgss_gssd_handle); if (cl != NULL) CLNT_ACQUIRE(cl); mtx_unlock(&kgss_gssd_lock); + KGSS_CURVNET_RESTORE(); return (cl); } diff --git a/sys/kgssapi/gss_release_cred.c b/sys/kgssapi/gss_release_cred.c index 70dd3a058ad3..dfd4322a1a33 100644 --- a/sys/kgssapi/gss_release_cred.c +++ b/sys/kgssapi/gss_release_cred.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -52,8 +53,12 @@ gss_release_cred(OM_uint32 *minor_status, gss_cred_id_t *cred_handle) *minor_status = 0; - if (!kgss_gssd_handle) + KGSS_CURVNET_SET_QUIET(KGSS_TD_TO_VNET(curthread)); + if (!KGSS_VNET(kgss_gssd_handle)) { + KGSS_CURVNET_RESTORE(); return (GSS_S_FAILURE); + } + KGSS_CURVNET_RESTORE(); if (*cred_handle) { args.cred = (*cred_handle)->handle; diff --git a/sys/kgssapi/gss_release_name.c b/sys/kgssapi/gss_release_name.c index 16050226cc8c..4f7e8db5ae9f 100644 --- a/sys/kgssapi/gss_release_name.c +++ b/sys/kgssapi/gss_release_name.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -53,8 +54,12 @@ gss_release_name(OM_uint32 *minor_status, gss_name_t *input_name) *minor_status = 0; - if (!kgss_gssd_handle) + KGSS_CURVNET_SET_QUIET(KGSS_TD_TO_VNET(curthread)); + if (!KGSS_VNET(kgss_gssd_handle)) { + KGSS_CURVNET_RESTORE(); return (GSS_S_FAILURE); + } + KGSS_CURVNET_RESTORE(); if (*input_name) { name = *input_name; diff --git a/sys/kgssapi/gssapi_impl.h b/sys/kgssapi/gssapi_impl.h index 1b8fb2ff6c30..72f379de4ebf 100644 --- a/sys/kgssapi/gssapi_impl.h +++ b/sys/kgssapi/gssapi_impl.h @@ -54,10 +54,24 @@ struct kgss_mech { }; LIST_HEAD(kgss_mech_list, kgss_mech); -extern CLIENT *kgss_gssd_handle; +/* Macros for VIMAGE. */ +/* Define the KGSS_VNET macros similar to !VIMAGE. */ +#define KGSS_VNET_NAME(n) n +#define KGSS_VNET_DECLARE(t, n) extern t n +#define KGSS_VNET_DEFINE(t, n) t n +#define KGSS_VNET_DEFINE_STATIC(t, n) static t n +#define KGSS_VNET(n) (n) + +#define KGSS_CURVNET_SET(n) +#define KGSS_CURVNET_SET_QUIET(n) +#define KGSS_CURVNET_RESTORE() +#define KGSS_TD_TO_VNET(n) NULL + extern struct mtx kgss_gssd_lock; extern struct kgss_mech_list kgss_mechs; +KGSS_VNET_DECLARE(CLIENT *, kgss_gssd_handle); + CLIENT *kgss_gssd_client(void); int kgss_oid_equal(const gss_OID oid1, const gss_OID oid2); extern void kgss_install_mech(gss_OID mech_type, const char *name, diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c index f375a184d1cc..d01ca1260a67 100644 --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c @@ -102,8 +102,9 @@ struct svc_rpc_gss_callback { SLIST_ENTRY(svc_rpc_gss_callback) cb_link; rpc_gss_callback_t cb_callback; }; -static SLIST_HEAD(svc_rpc_gss_callback_list, svc_rpc_gss_callback) - svc_rpc_gss_callbacks = SLIST_HEAD_INITIALIZER(svc_rpc_gss_callbacks); +SLIST_HEAD(svc_rpc_gss_callback_list, svc_rpc_gss_callback); +KGSS_VNET_DEFINE_STATIC(struct svc_rpc_gss_callback_list, + svc_rpc_gss_callbacks) = SLIST_HEAD_INITIALIZER(svc_rpc_gss_callbacks); struct svc_rpc_gss_svc_name { SLIST_ENTRY(svc_rpc_gss_svc_name) sn_link; @@ -114,8 +115,9 @@ struct svc_rpc_gss_svc_name { u_int sn_program; u_int sn_version; }; -static SLIST_HEAD(svc_rpc_gss_svc_name_list, svc_rpc_gss_svc_name) - svc_rpc_gss_svc_names = SLIST_HEAD_INITIALIZER(svc_rpc_gss_svc_names); +SLIST_HEAD(svc_rpc_gss_svc_name_list, svc_rpc_gss_svc_name); +KGSS_VNET_DEFINE_STATIC(struct svc_rpc_gss_svc_name_list, + svc_rpc_gss_svc_names) = SLIST_HEAD_INITIALIZER(svc_rpc_gss_svc_names); enum svc_rpc_gss_client_state { CLIENT_NEW, /* still authenticating */ @@ -197,23 +199,28 @@ SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_count, CTLFLAG_RD, &svc_rpc_gss_client_count, 0, "Number of rpc-gss clients"); -struct svc_rpc_gss_client_list *svc_rpc_gss_client_hash; -struct svc_rpc_gss_client_list svc_rpc_gss_clients; -static uint32_t svc_rpc_gss_next_clientid = 1; +KGSS_VNET_DEFINE(struct svc_rpc_gss_client_list *, svc_rpc_gss_client_hash); +KGSS_VNET_DEFINE(struct svc_rpc_gss_client_list, svc_rpc_gss_clients); +KGSS_VNET_DEFINE_STATIC(uint32_t, svc_rpc_gss_next_clientid) = 1; static void svc_rpc_gss_init(void *arg) { int i; - svc_rpc_gss_client_hash = mem_alloc(sizeof(struct svc_rpc_gss_client_list) * svc_rpc_gss_client_hash_size); + KGSS_VNET(svc_rpc_gss_client_hash) = mem_alloc( + sizeof(struct svc_rpc_gss_client_list) * + svc_rpc_gss_client_hash_size); for (i = 0; i < svc_rpc_gss_client_hash_size; i++) - TAILQ_INIT(&svc_rpc_gss_client_hash[i]); - TAILQ_INIT(&svc_rpc_gss_clients); - svc_auth_reg(RPCSEC_GSS, svc_rpc_gss, rpc_gss_svc_getcred); - sx_init(&svc_rpc_gss_lock, "gsslock"); + TAILQ_INIT(&KGSS_VNET(svc_rpc_gss_client_hash)[i]); + TAILQ_INIT(&KGSS_VNET(svc_rpc_gss_clients)); + if (IS_DEFAULT_VNET(curvnet)) { + svc_auth_reg(RPCSEC_GSS, svc_rpc_gss, rpc_gss_svc_getcred); + sx_init(&svc_rpc_gss_lock, "gsslock"); + } } -SYSINIT(svc_rpc_gss_init, SI_SUB_KMEM, SI_ORDER_ANY, svc_rpc_gss_init, NULL); +SYSINIT(svc_rpc_gss_init, SI_SUB_VNET_DONE, SI_ORDER_ANY, + svc_rpc_gss_init, NULL); bool_t rpc_gss_set_callback(rpc_gss_callback_t *cb) @@ -227,7 +234,7 @@ rpc_gss_set_callback(rpc_gss_callback_t *cb) } scb->cb_callback = *cb; sx_xlock(&svc_rpc_gss_lock); - SLIST_INSERT_HEAD(&svc_rpc_gss_callbacks, scb, cb_link); + SLIST_INSERT_HEAD(&KGSS_VNET(svc_rpc_gss_callbacks), scb, cb_link); sx_xunlock(&svc_rpc_gss_lock); return (TRUE); @@ -239,11 +246,11 @@ rpc_gss_clear_callback(rpc_gss_callback_t *cb) struct svc_rpc_gss_callback *scb; sx_xlock(&svc_rpc_gss_lock); - SLIST_FOREACH(scb, &svc_rpc_gss_callbacks, cb_link) { + SLIST_FOREACH(scb, &KGSS_VNET(svc_rpc_gss_callbacks), cb_link) { if (scb->cb_callback.program == cb->program && scb->cb_callback.version == cb->version && scb->cb_callback.callback == cb->callback) { - SLIST_REMOVE(&svc_rpc_gss_callbacks, scb, + SLIST_REMOVE(&KGSS_VNET(svc_rpc_gss_callbacks), scb, svc_rpc_gss_callback, cb_link); sx_xunlock(&svc_rpc_gss_lock); mem_free(scb, sizeof(*scb)); @@ -314,7 +321,7 @@ rpc_gss_set_svc_name(const char *principal, const char *mechanism, } sx_xlock(&svc_rpc_gss_lock); - SLIST_INSERT_HEAD(&svc_rpc_gss_svc_names, sname, sn_link); + SLIST_INSERT_HEAD(&KGSS_VNET(svc_rpc_gss_svc_names), sname, sn_link); sx_xunlock(&svc_rpc_gss_lock); return (TRUE); @@ -327,10 +334,10 @@ rpc_gss_clear_svc_name(u_int program, u_int version) struct svc_rpc_gss_svc_name *sname; sx_xlock(&svc_rpc_gss_lock); - SLIST_FOREACH(sname, &svc_rpc_gss_svc_names, sn_link) { + SLIST_FOREACH(sname, &KGSS_VNET(svc_rpc_gss_svc_names), sn_link) { if (sname->sn_program == program && sname->sn_version == version) { - SLIST_REMOVE(&svc_rpc_gss_svc_names, sname, + SLIST_REMOVE(&KGSS_VNET(svc_rpc_gss_svc_names), sname, svc_rpc_gss_svc_name, sn_link); sx_xunlock(&svc_rpc_gss_lock); gss_release_cred(&min_stat, &sname->sn_cred); @@ -478,12 +485,7 @@ rpc_gss_svc_getcred(struct svc_req *req, struct ucred **crp, int *flavorp) cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; cr->cr_rgid = cr->cr_svgid = uc->gid; crsetgroups(cr, uc->gidlen, uc->gidlist); -#ifdef VNET_NFSD - if (jailed(curthread->td_ucred)) - cr->cr_prison = curthread->td_ucred->cr_prison; - else -#endif - cr->cr_prison = &prison0; + cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp = crhold(cr); @@ -548,7 +550,8 @@ svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *id) if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) return (NULL); - list = &svc_rpc_gss_client_hash[id->ci_id % svc_rpc_gss_client_hash_size]; + list = &KGSS_VNET(svc_rpc_gss_client_hash) + [id->ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(&svc_rpc_gss_lock); TAILQ_FOREACH(client, list, cl_link) { if (client->cl_id.ci_id == id->ci_id) { @@ -556,9 +559,10 @@ svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *id) * Move this client to the front of the LRU * list. */ - TAILQ_REMOVE(&svc_rpc_gss_clients, client, cl_alllink); - TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, + TAILQ_REMOVE(&KGSS_VNET(svc_rpc_gss_clients), client, cl_alllink); + TAILQ_INSERT_HEAD(&KGSS_VNET(svc_rpc_gss_clients), + client, cl_alllink); refcount_acquire(&client->cl_refs); break; } @@ -591,7 +595,7 @@ svc_rpc_gss_create_client(void) client->cl_id.ci_hostid = hostid; getboottime(&boottime); client->cl_id.ci_boottime = boottime.tv_sec; - client->cl_id.ci_id = svc_rpc_gss_next_clientid++; + client->cl_id.ci_id = KGSS_VNET(svc_rpc_gss_next_clientid)++; /* * Start the client off with a short expiration time. We will @@ -601,10 +605,11 @@ svc_rpc_gss_create_client(void) client->cl_locked = FALSE; client->cl_expiration = time_uptime + 5*60; - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; + list = &KGSS_VNET(svc_rpc_gss_client_hash) + [client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(&svc_rpc_gss_lock); TAILQ_INSERT_HEAD(list, client, cl_link); - TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink); + TAILQ_INSERT_HEAD(&KGSS_VNET(svc_rpc_gss_clients), client, cl_alllink); svc_rpc_gss_client_count++; sx_xunlock(&svc_rpc_gss_lock); return (client); @@ -658,9 +663,10 @@ svc_rpc_gss_forget_client_locked(struct svc_rpc_gss_client *client) struct svc_rpc_gss_client_list *list; sx_assert(&svc_rpc_gss_lock, SX_XLOCKED); - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; + list = &KGSS_VNET(svc_rpc_gss_client_hash) + [client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; TAILQ_REMOVE(list, client, cl_link); - TAILQ_REMOVE(&svc_rpc_gss_clients, client, cl_alllink); + TAILQ_REMOVE(&KGSS_VNET(svc_rpc_gss_clients), client, cl_alllink); svc_rpc_gss_client_count--; } @@ -673,7 +679,8 @@ svc_rpc_gss_forget_client(struct svc_rpc_gss_client *client) struct svc_rpc_gss_client_list *list; struct svc_rpc_gss_client *tclient; - list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; + list = &KGSS_VNET(svc_rpc_gss_client_hash) + [client->cl_id.ci_id % svc_rpc_gss_client_hash_size]; sx_xlock(&svc_rpc_gss_lock); TAILQ_FOREACH(tclient, list, cl_link) { /* @@ -704,17 +711,18 @@ svc_rpc_gss_timeout_clients(void) * svc_rpc_gss_clients in LRU order. */ sx_xlock(&svc_rpc_gss_lock); - client = TAILQ_LAST(&svc_rpc_gss_clients, svc_rpc_gss_client_list); + client = TAILQ_LAST(&KGSS_VNET(svc_rpc_gss_clients), + svc_rpc_gss_client_list); while (svc_rpc_gss_client_count > svc_rpc_gss_client_max && client != NULL) { svc_rpc_gss_forget_client_locked(client); sx_xunlock(&svc_rpc_gss_lock); svc_rpc_gss_release_client(client); sx_xlock(&svc_rpc_gss_lock); - client = TAILQ_LAST(&svc_rpc_gss_clients, + client = TAILQ_LAST(&KGSS_VNET(svc_rpc_gss_clients), svc_rpc_gss_client_list); } again: - TAILQ_FOREACH(client, &svc_rpc_gss_clients, cl_alllink) { + TAILQ_FOREACH(client, &KGSS_VNET(svc_rpc_gss_clients), cl_alllink) { if (client->cl_state == CLIENT_STALE || now > client->cl_expiration) { svc_rpc_gss_forget_client_locked(client); @@ -883,7 +891,8 @@ svc_rpc_gss_accept_sec_context(struct svc_rpc_gss_client *client, */ sx_xlock(&svc_rpc_gss_lock); if (!client->cl_sname) { - SLIST_FOREACH(sname, &svc_rpc_gss_svc_names, sn_link) { + SLIST_FOREACH(sname, &KGSS_VNET(svc_rpc_gss_svc_names), + sn_link) { if (sname->sn_program == rqst->rq_prog && sname->sn_version == rqst->rq_vers) { retry: @@ -1137,7 +1146,7 @@ svc_rpc_gss_callback(struct svc_rpc_gss_client *client, struct svc_req *rqst) * See if we have a callback for this guy. */ result = TRUE; - SLIST_FOREACH(scb, &svc_rpc_gss_callbacks, cb_link) { + SLIST_FOREACH(scb, &KGSS_VNET(svc_rpc_gss_callbacks), cb_link) { if (scb->cb_callback.program == rqst->rq_prog && scb->cb_callback.version == rqst->rq_vers) { /* @@ -1273,6 +1282,7 @@ svc_rpc_gss(struct svc_req *rqst, struct rpc_msg *msg) int call_stat; enum auth_stat result; + KGSS_CURVNET_SET_QUIET(KGSS_TD_TO_VNET(curthread)); rpc_gss_log_debug("in svc_rpc_gss()"); /* Garbage collect old clients. */ @@ -1282,8 +1292,10 @@ svc_rpc_gss(struct svc_req *rqst, struct rpc_msg *msg) rqst->rq_verf = _null_auth; /* Deserialize client credentials. */ - if (rqst->rq_cred.oa_length <= 0) + if (rqst->rq_cred.oa_length <= 0) { + KGSS_CURVNET_RESTORE(); return (AUTH_BADCRED); + } memset(&gc, 0, sizeof(gc)); @@ -1292,6 +1304,7 @@ svc_rpc_gss(struct svc_req *rqst, struct rpc_msg *msg) if (!xdr_rpc_gss_cred(&xdrs, &gc)) { XDR_DESTROY(&xdrs); + KGSS_CURVNET_RESTORE(); return (AUTH_BADCRED); } XDR_DESTROY(&xdrs); @@ -1527,6 +1540,7 @@ out: svc_rpc_gss_release_client(client); xdr_free((xdrproc_t) xdr_rpc_gss_cred, (char *) &gc); + KGSS_CURVNET_RESTORE(); return (result); } From nobody Thu Feb 16 00:08:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHFfm6M8Cz3rXWT for ; Thu, 16 Feb 2023 00:09:04 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-25.consmr.mail.gq1.yahoo.com (sonic303-25.consmr.mail.gq1.yahoo.com [98.137.64.206]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHFfl48S4z3yDb for ; Thu, 16 Feb 2023 00:09:03 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b="MRQbGm/U"; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.206 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676506141; bh=OTw6jWnIRCg76f4iHt4tzlImIwZB7OZpxQ2tnHUILOY=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=MRQbGm/UgtLjQMMsYEgEPY+Oyv8jsK8vGVshLjJENkYPtDkQJMYocCHLutTBm/L4gjpDrfOwbEiPD6yYTYYbkr7clKTDokKe4b94ROHmEBBPy/txc+lwaBjeUjG3vobyDeUBaCUODC3A+hVTE7wp8AB7t8j6RxKbjVl1JqfaCvHEgQhApu7ggHxtkdQfz8RVAceM1iXc99qnjWapgZMh9lYvhInlFGIrFmNDG7ZdJGI7zEDiu7kGYWyEDlLnpu8o4IKm6+Mn1WRm06oMwVb7EX3ealTZSSi/yT1I0SkY854VZEHyo73YcTBXz/jLVtpkfIAUcVZEnvTcjEVxLHes6Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676506141; bh=OJGmVF8u9JmylKXoJuSe8Jjbpswm4vMxJ2xaYUyp9C2=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=MfoWtikrWOJSpRNJKtQ/TTgovvwCcKPbWwRlAZk/yDFfSEmEIC1NERrhUT2KIg7e9veTKTV5zwOL63qXDQO+/J8vMZNxOfjFYbcFHzlRatpMrPIstap3Em0LNA88YUQ83qHy+zcULpOy/nViMis3l1dFpQYuR+eY9KnL/jtOkciNjTkNrhEOKOKbgd23Nx10bMUuFVBUdS1vONtYEgGScwRr5+6SRRmu8gzSrS69Qtfoqu2dsbYnyJ01Nom6RUIouM6yOZx0RaWZ1ead1UXrDZ9erPGI8M4aTUatOdQJjDzlkDUwC4d/Or1ndLoiWQ15d3lWlmSCADQ6VM6lnLCjpQ== X-YMail-OSG: Y6pxpekVM1mbaAILdBBmIJ.LO.2FgGPcaDdtczRBWDwqsrZI5McPZRYXiJHxptC wGnyPDH95h8dkULIllVnUfGzyqOXmvXEOBjMgA_iT5G_S68tVoxuKpdeG7l2nEAUgdVXpZdsQnmm zZOKFEct6H8D60LzSqJ3x..d6FKgaQ8Su0OBEPxhgDOmbv_1KuQKxugZ36SDeleJld6EkGjn2JEH IN9ZOpOqT3eSztpmvzmueOA92NpCMRzK2PJbfFh1spp719KGtyFFgpspJf3Xr0gXjys3PY2T2uDb sRH3uRsgIDNCjjOKMAp77bCfoNrgcZcp6UZkyY9igOWTJPSlHGaBtIQSVvah1WT.A9GLLV.VqyDx kFMsjuk0WrrMmZdeVMILl5rchDenvRzWVq7kpSSAc9NaISQcVdCjV2JEMFlbp.CJNjkFQbOSCv_L FBMPPF5C2hG4C3aKYS.dxFWQvnqanMAcaH.RUwRpHYY3kKdNfdypNdvT936vV5LFUGE_FqhOtcs5 _cJFm0qfdXwsOREGTLHaOLLh7l5wGrRqUqvoic3BNvvcynIYztB5TmOHU3D6dulZoL_IPrJCgxoW ft59rbUig5X7xDEu6RgJCCOZ.WRLVseUtr29UkNewTeV0lfbjDRz3FzxnZpSf3IILf5f89hoao01 _g6hBsc5JJZDx4TB.3RYpxzYg0GSWkyBi37vGqgHLEVcyD6CMyDuiu_whGTuTqQ_i_d47jFRxZlE zpFqGozbUupRXEeRDmqwfaJ8jAyYMxiDdSyTec0LFTXjFm_v5muuC4i1yqOV1dvnHBu71Ksc7J8u sG.HBbFXeVSBr2nChNKsFdPtjN3iyg8MVuCHUASc1LApu6omjVn.sNSci6eiMAqau6bFoMuv4Unn 0F0OFlT2Qb85wlYGYVz.lwYSBt8lHbz20BjGAPanru0_vTDIjXeonxmU0GMViwa7g6XmOfu95bDL WPlhNDfBE.AGRJFdnvQRi8WwbslZjyJh0q11vowpugdYNx.q5xAep7GwAEE9z8O_aSTDdJZpOFO5 0eTNj8VNjH_3qMLBisYBzPkQBovtBMdurlcRyXdWwN3PFCrXc9xVXe2r08oYwBxWeEneqRXcDfFo a.9AYggw71Tq.lgYY8Vv1CTdSZl3d.RPdte76U9229sN7jvpcAU_YlXduAj_OvUYJL4AipIYooTF AwNrsvaHEyBEV97Y1QE7olZXbPdmV67Fa6_Yg21LYvg45fO44mwlwjQTPNCj1AcsojDXTpYF1MmV Lq9G.WbggWrMEUcG2OT99po2IQfS5ZG3_Che7ixxW2YKbNrVUsqvNj75EGaMMYqQBDeQ.njO8wFn k4b5.b3csjljVLlONuUDS09XtDRFVWUzK8BZqjxs6ZeQdaMc_sighfnhqD.rv2pVOwz.FPuFhu6k 9Fmp0Ilmmxv8JG1tfn3yHKCjr3S_HZeSCR1Rkhk8OxFpK3kuXyJnalsNvipoQLHwsVHdmnyU.TVA sTN4XVE9Vz7rXGEAg2f7NbTUcPDmM_5EPKPAV9TrAo.1MKhhpVqI16fDKtx_41zTtem3ZyFPnkjw _Fz7eo5yvy5j9NPsiJi0jqQMPsa7vlEbMgyY6.JC5FzYQBc6fLE0mvMESvnjWZD03GSUIAQof1Ok giY2bEgPaPLmeV.34yf4bermCXKKDOgKXngz..wiSvJ8sF_8SMGYomti1PVL2VtssdepAv4ZHkvQ RNWVjFE5zRO9._qbJC4HxucbhpI9915YekD3d6dD3YfGp6_rBbtMmMCq5v03gAfWWyajn9DhWazn XzgceTE.3eeoVCNhgVECpT3HRRSI_JbM0Xwwm9uzFfxq6g4UT7GgfBjXRwxj81TTVjv20lgIJg3m kQCC4kDZSQ68ONZ.vtDlNXYlDY2natSBwXDzT1YSWU6RsMbSW0hayt63cfEtpCOyAPDqkzxbFAvp Z751YKVfILlPG4IuCtHAkhz3jn0uRSVpxUdxRaGJk6Sz1rEg8_7WJbc9qNVoN3wSej4fjb33jaJJ rXGmHooDP2G80.19OmV5WWZ9JCckqxvvdWOUY5R3Gocd89BcYCCZBkbB5_jMa6.mVr.3Z14l9RjJ X5.nDBdu9n1abCbrY1W1zlqG2rH81LDHzTtEiPanQbln8nGKLBu_eqeXikVSxrCwAniTsAnO9EXN Cjxt275oeb4H0ZPecVHXIKMUUfI2sXccRon7_bQS8i3yh1FnKV4u8tCQGl3AbUJAik6R_qQ_mx8D AO1S6mHejVBLdmAUbW4MiI.AzmvXSMKIwFTc0iDg.fJx32Ss9TVNRj3kca7WoZ.1HtlFwkTnYAqy D X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Thu, 16 Feb 2023 00:09:01 +0000 Received: by hermes--production-bf1-57c96c66f6-7l94f (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 8fd4965d3555d202b3e8b986700ee75b; Thu, 16 Feb 2023 00:08:58 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: RE: git: 6926e2699ae5 - main - arm: Add support for using VFP in kernel Message-Id: <3A143148-895F-472B-9AFB-5F1AA0FD1FA0@yahoo.com> Date: Wed, 15 Feb 2023 16:08:46 -0800 To: "kd@freebsd.org" , "wma@freebsd.org" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.300.101.1.3) References: <3A143148-895F-472B-9AFB-5F1AA0FD1FA0.ref@yahoo.com> X-Spamd-Result: default: False [-3.28 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.78)[-0.782]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.206:from]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org] X-Rspamd-Queue-Id: 4PHFfl48S4z3yDb X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Kornel Dul=C4=99ba wrote on Date: Sat, 04 Feb 2023 19:22:23 UTC : > The branch main has been updated by kd: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6926e2699ae55080f860488895a2a9aa= 6e6d9b4d >=20 > commit 6926e2699ae55080f860488895a2a9aa6e6d9b4d > Author: Kornel Dul=C4=99ba > AuthorDate: 2023-02-04 12:59:30 +0000 > Commit: Kornel Dul=C4=99ba > CommitDate: 2023-02-04 19:21:43 +0000 >=20 > arm: Add support for using VFP in kernel >=20 > Add missing logic to allow in-kernel VFP usage for ARMv7 NEON. > The implementation is strongly based on arm64 code. > It introduces a family of fpu_kern_* functions to enable the usage > of VFP instructions in kernel. > Apart from that the existing armv7 VFP logic was modified, > taking into account that the state of the VFP registers can now > be modified in the kernel. >=20 > Co-developed by: Wojciech Macek > Sponsored by: Stormshield > Obtained from: Semihalf > Reviewed by: andrew > Differential Revision: https://reviews.freebsd.org/D37419 > --- > lib/libthread_db/arch/arm/libpthread_md.c | 21 ++-- > sys/arm/arm/exec_machdep.c | 49 ++++---- > sys/arm/arm/machdep.c | 1 + > sys/arm/arm/machdep_kdb.c | 31 ++++- > sys/arm/arm/swtch-v6.S | 8 +- > sys/arm/arm/swtch.S | 8 +- > sys/arm/arm/vfp.c | 182 +++++++++++++++++++++++++++++- > sys/arm/arm/vm_machdep.c | 6 +- > sys/arm/include/fpu.h | 7 ++ > sys/arm/include/pcb.h | 5 + > sys/arm/include/reg.h | 12 +- > sys/arm/include/vfp.h | 17 +++ > 12 files changed, 293 insertions(+), 54 deletions(-) [This is a somewhat adjusted version of a note replying to a Warner note about a panic someone got during a process coredump that was happening.] Just a possible point, given recent kernel floating point work: I tried to do a typical build and test of some benchmark programs that I sometimes use that involve floating point in some of the programs, some use with multithreading involved. (As FreeBSD and g++ progress I tend to do this once and a while, not as often on armv7 as on aarch64.) On armv7, I now usually get a message about a failure of an internal cross-check, which also leads to the program being stopped early. The messaging from run to run varies what the failure is, but the runs should not vary and should not fail the cross-checks --and previously did not, including when I last tried armv7. (Not recently.) For the specific example failures, the initial serial (single thread) test with float involved works but the following multi-thread test in the same program fails and causes the program to stop when it notices there is a problem. (On occasion the cross-check does does not detect a problem.) The programs that do not test floating point do not fail. (Same algorithm on integral types.) These can involve floating point outside the algorithm benchmarked, but with no multi-threading involved for such and no floating point based cross-checks involved. At this point it is far from obvious to me how I would trackdown the specifics of what leads to the failed cross-checks. But the above is suggestive of there being problems for armv7 handling of saving and restoring floating point context for multi-threading in a process, at least. I've no clue if such are strictly limited to the floating point values that show up vs. if there might be wider memory handling problems that result in the process. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Thu Feb 16 00:41:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHGN93WRKz3rZ4C; Thu, 16 Feb 2023 00:41: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 4PHGN930khz43X5; Thu, 16 Feb 2023 00:41:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676508089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DSBz0BL1/kPq0qnXqnWZ8boKsZgq/i9c4UMUNZbeIjY=; b=TRe+V0cVbIoxG07JNGHiu7GnXkLMpzidAbe+ZIYuLO7oqI88SWWHNq/eNjWORTQ91oN9jM 0QsK8XsRBFw3fwHWKTDchz4LFf1a9IAGBdpIYq6BOS2F+pBk8vZiwnxbJgppLCrPVem2K4 vsDLtutm0vWfxxIososa4ERgw45JAxr2Sxz3Z5GxsPwAm/S5OrEl5v5Lv1BP3hviNZvBUM Fbkd8lAkFVYfS8qVhIQKqFPnEDErxVhRluavtqnVdn8W8BwuMbcHquOX8vf+E1HGWJGBfG k0WRA3X8HXMikQBmKGPryGHFT+6jo+O6TY/IVzPO1YARM61Ka0t9Y/ViHF0LwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676508089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DSBz0BL1/kPq0qnXqnWZ8boKsZgq/i9c4UMUNZbeIjY=; b=STPnY8EtiRUAlWyDK7SZlHiNethbH9CEb7EMtUS9lh/TblpCSywABZhwE6ltsUFsPYB1sK 5VD4w7dnrBxnQsZsonN02LHgD0FROzAvZamga3R1s4U0d5UfskDQfRqHL/c8uXEb9gx2ZH z+qkl3ZpRDazn1lxo6Id0TW8BKpsMMcGpOQUx4kC1Z6zriTint+KLrBbkK1mL7MU7KbzpK zq4f7wmgBammszInWWBZDIecM+qCRQh8P4cz0J7LbCc2pNPb0fbGAWlqrw9xOFTeZFz2xi 5CUzI2N7TKVbeG/nAvvAiq3DWo/JFNYNab9H7QNb4cQsEMZGqKwU1YLp1IdSRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676508089; a=rsa-sha256; cv=none; b=hF3aWqDXDtQ/7uAW4Kgi9JLVSkc64EoIikxtp/X1YXoNu/SM3Qm1h3SXtAI1C4ahFhMAoQ Mlq1N86S8JlJK3IeWiVeOAH3q7+f6n93nnGhxtEme8HtEZa3F4K2WwpWWNFTgVFuwWGwIs unOwDfJanfL68J/wl87IiZJ83jZWwu9HfSWAjtGXExbe9rxsOExFBNh/wNHSGSV6TPuPTO PvE4j7k2D5a9Mw/IC9LOZnNmlUMNfuYldS+EkCBdQcr2Qck9yiygtS/z7lAYviama/URWJ Aqf8ktvx0eKUmWHBt8Py4KSSac9tdyWTJg/7womeuYAP9g4agc+benRL8h1pwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHGN924W8zlFx; Thu, 16 Feb 2023 00:41: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 31G0fTH4098138; Thu, 16 Feb 2023 00:41:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G0fTRE098137; Thu, 16 Feb 2023 00:41:29 GMT (envelope-from git) Date: Thu, 16 Feb 2023 00:41:29 GMT Message-Id: <202302160041.31G0fTRE098137@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: bf84156b24ff - main - tarfs: Use a separate debug bit for bounce buffer usage. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf84156b24ffd167b93980a91904fafe84ac7c49 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=bf84156b24ffd167b93980a91904fafe84ac7c49 commit bf84156b24ffd167b93980a91904fafe84ac7c49 Author: Dag-Erling Smørgrav AuthorDate: 2023-02-16 00:40:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-16 00:40:45 +0000 tarfs: Use a separate debug bit for bounce buffer usage. Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38588 --- share/man/man5/tarfs.5 | 3 ++- sys/fs/tarfs/tarfs_dbg.h | 1 + sys/fs/tarfs/tarfs_io.c | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/share/man/man5/tarfs.5 b/share/man/man5/tarfs.5 index e431e5d1fa1c..29999b8066f7 100644 --- a/share/man/man5/tarfs.5 +++ b/share/man/man5/tarfs.5 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 2, 2023 +.Dd February 14, 2023 .Dt TARFS 5 .Os .Sh NAME @@ -81,6 +81,7 @@ by adding together the relevant values from the table below. .It 0x40 Ta Decompression .It 0x80 Ta Decompression index .It 0x100 Ta Sparse file mapping +.It 0x200 Ta Bounce buffer usage .El .Sh SEE ALSO .Xr tar 1 , diff --git a/sys/fs/tarfs/tarfs_dbg.h b/sys/fs/tarfs/tarfs_dbg.h index 45d11d679719..bedb94b3d602 100644 --- a/sys/fs/tarfs/tarfs_dbg.h +++ b/sys/fs/tarfs/tarfs_dbg.h @@ -45,6 +45,7 @@ extern int tarfs_debug; #define TARFS_DEBUG_ZIO 0x40 #define TARFS_DEBUG_ZIDX 0x80 #define TARFS_DEBUG_MAP 0x100 +#define TARFS_DEBUG_BOUNCE 0x200 #define TARFS_DPF(category, fmt, ...) \ do { \ diff --git a/sys/fs/tarfs/tarfs_io.c b/sys/fs/tarfs/tarfs_io.c index 8837681ac5f0..58f3e7eab03f 100644 --- a/sys/fs/tarfs/tarfs_io.c +++ b/sys/fs/tarfs/tarfs_io.c @@ -391,7 +391,7 @@ tarfs_zread_zstd(struct tarfs_zio *zio, struct uio *uiop) if (uiop->uio_segflg == UIO_SYSSPACE) { zob.dst = uiop->uio_iov->iov_base; } else { - TARFS_DPF(ALLOC, "%s: allocating %zu-byte bounce buffer\n", + TARFS_DPF(BOUNCE, "%s: allocating %zu-byte bounce buffer\n", __func__, len); zob.dst = obuf = malloc(len, M_TEMP, M_WAITOK); } @@ -488,7 +488,7 @@ fail_unlocked: if (uiop->uio_segflg == UIO_SYSSPACE) { uiop->uio_resid = resid; } else if (len > resid) { - TARFS_DPF(ALLOC, "%s: bounced %zu bytes\n", __func__, + TARFS_DPF(BOUNCE, "%s: bounced %zu bytes\n", __func__, len - resid); error = uiomove(obuf, len - resid, uiop); #ifdef TARFS_DEBUG @@ -497,7 +497,7 @@ fail_unlocked: } } if (obuf != NULL) { - TARFS_DPF(ALLOC, "%s: freeing bounce buffer\n", __func__); + TARFS_DPF(BOUNCE, "%s: freeing bounce buffer\n", __func__); free(obuf, M_TEMP); } if (rl != NULL) From nobody Thu Feb 16 00:41:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHGNB514Gz3rZ4H; Thu, 16 Feb 2023 00:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHGNB49CSz43jT; Thu, 16 Feb 2023 00:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676508090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ThiVv9UPwgEJqTxUFmX8ltfigjH91dSH/OAfOVnrJH4=; b=wUCTd8IbSklk7QEprCwLYfrEkyS58CZhhb2Buog6tF8u2sbLwNTwpD2kL16i1iVaIedqBH 9WOrGIuCb4vuJ+jc4WuH6p85zY1rChEiV4QZHf6hDTLEf9xFngd7FQop3fEJQ6oQH/YYs5 N7sRsw3M7SGda2iDdIBnwN+K6UgW3azIQveMx8N3GLXWGmrBouFm9LEbOaeZx6XOwc3ing Gcmojowd5js/YnOF60yD6OUTWQbXGomcWyqQihPjcRHxP9ywe6H1oHiTGbPTsCf3VwEK3w 97FvLlWTjvv3f+VXdA+oipS2SrLuedsmJV7RxVCC02mSm8dg3A0RfoSGr18FvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676508090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ThiVv9UPwgEJqTxUFmX8ltfigjH91dSH/OAfOVnrJH4=; b=xT29iIJ6mPsFgGuAOhr4I+hmnF7sIXIHa0IKBU6f2T0qXzteY9kpEwFPluask345l4n9ML i78vtRRowKDnPIjFpy/6PriQZSoQA2zQJzOr6tl2fiYVNyxDB+OMYOFODRr61jMnxR8Zpz awgekJcaOybz51gVUGdSrD68W21+4cIfgCD1tTuCWudsft0Y0HBIUMnjjvCCkhgZrxoXFa 7XyFZk7R9a8HGJQHrDYm815HAP3fmjw6HUOY4b5lUt1ZXENjHCZqD2C9MSTrgRyp1OJulP UMszqpZUlSdltIciH+iT08yOsdkrD0kJ4vQV2ZpaSwweuO7J6mF16f1IXPVenA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676508090; a=rsa-sha256; cv=none; b=hpqwDpljLXY7ZaPhi1eSfejhmaTiXS/gMmsOkZpSCdPzhgGYqomis4QBaItBrsN9izg7Yq 0uwD00V9BeYXKBgztZlzUhI+E/foM7TPa2f9/9m9thJ2H61IPz0CNsIimZDVQsnQ1nI7hh kExZbLjJDvpe9sttbnjgimTKhwykSnoqu4ZlXxzOlEUAaj58EGgbB3Ymh5Hz96+xbewMhp ZHY064gOSIdzqiyt5ulCHGsxrGiwi9jjFv3ip5ueVd232rDMROZfAHXdoZooNJ2YkQHKYU TaA4JSyYebFrUzRnZwKEShLY9svN4pVvcXtjsIArXEpEzPnH7s9CJ47QDxxjlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHGNB2wLXzkfV; Thu, 16 Feb 2023 00:41:30 +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 31G0fUT8098167; Thu, 16 Feb 2023 00:41:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G0fUi7098166; Thu, 16 Feb 2023 00:41:30 GMT (envelope-from git) Date: Thu, 16 Feb 2023 00:41:30 GMT Message-Id: <202302160041.31G0fUi7098166@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: 5c870e1b4894 - main - wc: Improve test coverage. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c870e1b48948a283c963ecb88780e4e0406ac1e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5c870e1b48948a283c963ecb88780e4e0406ac1e commit 5c870e1b48948a283c963ecb88780e4e0406ac1e Author: Dag-Erling Smørgrav AuthorDate: 2023-02-16 00:40:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-16 00:40:45 +0000 wc: Improve test coverage. * Add a test that causes mbrtowc() to return 0. * Add a test that causes mbrtowc() to return -2. Sponsored by: Klara, Inc. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38605 --- usr.bin/wc/tests/wc_test.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/usr.bin/wc/tests/wc_test.sh b/usr.bin/wc/tests/wc_test.sh index 574f2daacaca..70eb5f5a2b37 100755 --- a/usr.bin/wc/tests/wc_test.sh +++ b/usr.bin/wc/tests/wc_test.sh @@ -11,6 +11,11 @@ export LC_CTYPE=C.UTF-8 export LC_MESSAGES=C +# +# Size of wc's read buffer. +# +MAXBSIZE=65536 + # # Sample text containing multibyte characters # @@ -136,6 +141,50 @@ multiline_repeated_body() atf_check_wc foo $((tvl*c)) $((tvw*c)) $((tvc*c)) $((tvm*c)) } +atf_test_case nul +nul_head() +{ + atf_set "descr" "Input containing NUL" +} +nul_body() +{ + printf "a\0b\n" >foo + atf_check_wc foo 1 1 4 +} + +atf_test_case poop +poop_head() +{ + atf_set "descr" "Multibyte sequence across buffer boundary" +} +poop_body() +{ + local l=0 w=0 c=0 m=0 + # The code below produces a stream of 4-byte UTF-8 sequences + # aligned on 5-byte boundaries, ensuring that the first full + # read of length MAXBSIZE will end in a partial sequence — + # unless MAXBSIZE is a multiple of 5 (not possible since it's + # a power of 2) or one less than a multiple of 5 (e.g. 2^18 = + # 262,144 = (52429 * 5) - 1) in which case we prepend a single + # newline to push our sequence out of phase. + atf_check_not_equal 0 $((MAXBSIZE % 5)) + :>foo + if [ $((MAXBSIZE % 5)) -eq 4 ] ; then + printf "\n" + l=$((l + 1)) + c=$((c + 1)) + m=$((m + 1)) + fi >>foo + while [ $c -le $MAXBSIZE ] ; do + printf "💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩.💩\n" + l=$((l + 1)) + w=$((w + 1)) + c=$((c + 80)) # 80 bytes + m=$((m + 32)) # 32 multibyte characters + done >>foo + atf_check_wc foo $l $w $c $m +} + atf_test_case total total_head() { @@ -190,6 +239,8 @@ atf_init_test_cases() atf_add_test_case invalid atf_add_test_case multiline atf_add_test_case multiline_repeated + atf_add_test_case nul + atf_add_test_case poop atf_add_test_case total atf_add_test_case unterminated atf_add_test_case usage From nobody Thu Feb 16 00:41:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHGNC5XzHz3rYw4; Thu, 16 Feb 2023 00:41: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 4PHGNC4tW2z43jv; Thu, 16 Feb 2023 00:41:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676508091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=125znxd02kJM4vpCBoWESOV0NX1uE7Wx+MI3kA6h0+c=; b=x2SHJgLZKC/5XsDpGPwbi7SKCimyaQhC4KxEOPm2MYOPIlJs4om0yEkBMOXNO+WXnEJCpF h/Dxvy6OMg9bn4bnUBYqk3fnslZ+nP1fLfapLA/amObNQ1EBUxr/rRHp1enhl0wkXQxZ2T etfkQOUVCxYra/kIwQH0iJnTVhBGv0KWrx3b4+Go5WiAT87j4r8h5GzmKNWrtUIedieVVN 5UkwYaCfzohpri7AGAU2sZRJQAhO/Zi4LYEgjxrKRe4RkMhoYKBAWSNjtb2dZoXkIhTwtF zG8pPBHsI29ShndFfVhdfIWiVhIMq9IlkN+uDTOzdOCeJNOkcbj+EIl2GgpMOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676508091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=125znxd02kJM4vpCBoWESOV0NX1uE7Wx+MI3kA6h0+c=; b=BtFGcPm7/ORX/VasVYZO0kOcGBMDIM0v1wLcKjHvHKlIuJ0K7LayYuMf+lPBx1k6YZOzlE nyg5t3g7UufI5r//njMAuYOAzJHyJ32Zb7jzcjDhbCHTnppg2qz6/Cv3OTpBbr2iXyb0VD fSEKx/7FuWXeHYMBopvOJG0WsPfCVZjpminNVyCHo4Nbug2jFKQ9tlqBHIsckWPfdKGTg8 pzLCLH2GaRZnZSSeQallFeom+aRe2vHn8uVHGiYgVzKrRWuUvYqeZZ1wS/VUfoH0ghmwv7 APcvEnhjQwgdlJCI5TQU+6UJSgLYo8G/megHO2RGUIy9bipFcp3gValHUDoPhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676508091; a=rsa-sha256; cv=none; b=wKSagzo4ISsunXeAQTEryPvORRIpkzCGjCaD47cQDbFyKhV6GMm0LXdr7oaxvLC1q+kZwK UHVo37rXxAI7cQ1O8f2cAN4u7J2RqGlwg8G+0nzKomYYk+jvc8tAl4Ey6IpQaBtjXknu/2 sKQvO4ANROjSllXIuxaAQakOpxg6P2+tLxjV1YOIardTsCmcluNHLkz5eUrLoWOXqWsfg5 woQnnOL/HfJjGLAUE/l70ddjMOVgkXUsPYRX052EqllTSFwweRPq9YRIXwFBw22umqtq1p uzQK6xkf+DD8LT/sIjd6HPefitsZP2QQ+lcC8NIGjjACwK9Wd4wHzGLqi3Y2tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHGNC3spqzkfW; Thu, 16 Feb 2023 00:41: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 31G0fV5s098196; Thu, 16 Feb 2023 00:41:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G0fVIa098195; Thu, 16 Feb 2023 00:41:31 GMT (envelope-from git) Date: Thu, 16 Feb 2023 00:41:31 GMT Message-Id: <202302160041.31G0fVIa098195@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: 5016d112ad8b - main - wc: Make the read buffer static. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5016d112ad8b259047920f3a2f749c369982de37 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5016d112ad8b259047920f3a2f749c369982de37 commit 5016d112ad8b259047920f3a2f749c369982de37 Author: Dag-Erling Smørgrav AuthorDate: 2023-02-16 00:40:30 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-16 00:40:45 +0000 wc: Make the read buffer static. The read buffer in cnt() is 64 kB, which is a bit excessive for a stack variable. MAXBSIZE has grown since this code was originally written, and it might grow again in the future. Since the program is single-threaded and cnt() does not recurse, we can safely make the buffer static. While there, constify p since it is only used to read. Sponsored by: Klara, Inc. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38608 --- usr.bin/wc/wc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c index 9c129917dd04..6ba827612e3d 100644 --- a/usr.bin/wc/wc.c +++ b/usr.bin/wc/wc.c @@ -214,9 +214,10 @@ show_cnt(const char *file, uintmax_t linect, uintmax_t wordct, static int cnt(const char *file) { - char buf[MAXBSIZE], *p; + static char buf[MAXBSIZE]; struct stat sb; mbstate_t mbs; + const char *p; uintmax_t linect, wordct, charct, llct, tmpll; ssize_t len; size_t clen; @@ -259,7 +260,7 @@ cnt(const char *file) * lines than to get words, since the word count requires locale * handling. */ - while ((len = read(fd, buf, sizeof(buf)))) { + while ((len = read(fd, buf, sizeof(buf))) != 0) { if (len < 0) { xo_warn("%s: read", file); (void)close(fd); From nobody Thu Feb 16 01:40:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHHh30r17z3rsTV; Thu, 16 Feb 2023 01:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHHh30dl2z49c2; Thu, 16 Feb 2023 01:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676511619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6V73aTGR/6ho7utMWG0gWbPDv+yRzj/MhQ0lHm/83F8=; b=lDezm9M4Amfs6g1CSfEL6Qvf35ZVQWKkc7xEDHdVKehxU8VM9odDbAGwNvzDjEhs7BD0yF V3BspFz6WVk8rQEAcyQhBkWUQr1b8VBT2RCNEtbucT4TBzDuh0QZd3BAwpV1EZ4Bhhd3+o InQ/hQTZb/ro4gpxkY8Si882+WiabyrGTzCdDDkQK3JxoFDnB29N7oJmBXTMl4qOb6Y+jx YKljVJAMo/kBiTjwTaYhDjO655H+DBTzSmaWxiTNL1Zk2+QnPbyThHjkQP0dR+MQAa/09I H1tyGG00tCjlx/1Zz5zmLk/7j9CJUeDQamqMelcz7n+70uMVkSCklH/gJNgn0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676511619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6V73aTGR/6ho7utMWG0gWbPDv+yRzj/MhQ0lHm/83F8=; b=AYtS5zsp7eBB4Ceesw/aR8I65eSkdEUAkz4i02wpXCK70/nNQJR8KBgCaqW3kRnpS2apry 4IUvxLT8x6Q97cpCJxs1EkbaPRjc8OdHKZa4zM9nod7HlwLUax+jMa4cIhTYQ1s6vEXvXg nDVId1DaaMFMf705fUb/rXxmJpVC85Cx569Oh4eQKYLH9g1wD92M/aU+eHn32hLK9aVxmu lf8ZQoBjfa+5+efQ05hftO+Xq8c65N2VldkbnKm3Dz2hxZsrbj2AutFmYGK50criu11D0J Iuv3sIq04JzeClSIuLAZruHRmhV/20x9DMgH+84S1VGXyeWI+SkNcGaTyiSMUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676511619; a=rsa-sha256; cv=none; b=EAMp/OxHFWlkEocdM9N08o7IFga+Av9UVsvZHGsW5DbVBMpx/XKq/LJUDuShTcAbCvxRIO csB8rNlsrBUWAF+tGYL0FGRe6HVd6cQ99Gy7oZsPt810MF4prOxEtDxtqmNx0pNVPgWHGp 8cVnHoa++icqLbS8lGjynuOBNqAgfbnEExOQ+m6sWhUNB3FsSja3+17d0K3NcqzKe8asH0 Q1n6h44g+mvLQ31SFXkC4Rs63KNESzfjEmZoSyEM/MIHyNPxm5rWKa0yS0fVRQRkRP/jkw FazTBuFy1XhSwaMcsVmgNdKdDPsPQ0NChaYjH9wuMlWP1CVdHHiJjRybww4lpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHHh26pD7zmTY; Thu, 16 Feb 2023 01:40: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 31G1eI1j080384; Thu, 16 Feb 2023 01:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G1eIEs080383; Thu, 16 Feb 2023 01:40:18 GMT (envelope-from git) Date: Thu, 16 Feb 2023 01:40:18 GMT Message-Id: <202302160140.31G1eIEs080383@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: b039ca077677 - main - nfsd: Wrap nfsstatsv1_p in the NFSD_VNET() macro List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b039ca0776774036a9e33aa45f50296a7f6ba547 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b039ca0776774036a9e33aa45f50296a7f6ba547 commit b039ca0776774036a9e33aa45f50296a7f6ba547 Author: Rick Macklem AuthorDate: 2023-02-16 01:39:07 +0000 Commit: Rick Macklem CommitDate: 2023-02-16 01:39:07 +0000 nfsd: Wrap nfsstatsv1_p in the NFSD_VNET() macro Commit 7344856e3a6d added a lot of macros that will front end vnet macros so that nfsd(8) can run in vnet prison. The nfsstatsv1_p variable got missed. This patch wraps all uses of nfsstatsv1_p with the NFSD_VNET() macro. The NFSD_VNET() macro is still a null macro. MFC after: 3 months --- sys/fs/nfs/nfs_commonkrpc.c | 12 +- sys/fs/nfs/nfs_commonport.c | 290 ++++++++++++++++++++------------------ sys/fs/nfsserver/nfs_nfsdcache.c | 30 ++-- sys/fs/nfsserver/nfs_nfsdport.c | 4 +- sys/fs/nfsserver/nfs_nfsdsocket.c | 25 ++-- sys/fs/nfsserver/nfs_nfsdstate.c | 48 +++---- 6 files changed, 214 insertions(+), 195 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index bf0a9e6e53ef..0d2cb9ec279a 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -783,7 +783,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp, procnum = NFSV4PROC_COMPOUND; if (nmp != NULL) { - NFSINCRGLOBAL(nfsstatsv1_p->rpcrequests); + NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1_p)->rpcrequests); /* Map the procnum to the old NFSv2 one, as required. */ if ((nd->nd_flag & ND_NFSV2) != 0) { @@ -918,13 +918,13 @@ tryagain: if (stat == RPC_SUCCESS) { error = 0; } else if (stat == RPC_TIMEDOUT) { - NFSINCRGLOBAL(nfsstatsv1_p->rpctimeouts); + NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1_p)->rpctimeouts); error = ETIMEDOUT; } else if (stat == RPC_VERSMISMATCH) { - NFSINCRGLOBAL(nfsstatsv1_p->rpcinvalid); + NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1_p)->rpcinvalid); error = EOPNOTSUPP; } else if (stat == RPC_PROGVERSMISMATCH) { - NFSINCRGLOBAL(nfsstatsv1_p->rpcinvalid); + NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1_p)->rpcinvalid); error = EPROTONOSUPPORT; } else if (stat == RPC_CANTSEND || stat == RPC_CANTRECV || stat == RPC_SYSTEMERROR || stat == RPC_INTR) { @@ -958,11 +958,11 @@ tryagain: if (stat == RPC_INTR) error = EINTR; else { - NFSINCRGLOBAL(nfsstatsv1_p->rpcinvalid); + NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1_p)->rpcinvalid); error = ENXIO; } } else { - NFSINCRGLOBAL(nfsstatsv1_p->rpcinvalid); + NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1_p)->rpcinvalid); error = EACCES; } if (error) { diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 2a2869641d25..3a1f53340cd4 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -478,87 +478,105 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred) if ((uap->flag & NFSSVC_NEWSTRUCT) == 0) { /* Copy fields to the old ext_nfsstat structure. */ oldnfsstats.attrcache_hits = - nfsstatsv1_p->attrcache_hits; + NFSD_VNET(nfsstatsv1_p)->attrcache_hits; oldnfsstats.attrcache_misses = - nfsstatsv1_p->attrcache_misses; + NFSD_VNET(nfsstatsv1_p)->attrcache_misses; oldnfsstats.lookupcache_hits = - nfsstatsv1_p->lookupcache_hits; + NFSD_VNET(nfsstatsv1_p)->lookupcache_hits; oldnfsstats.lookupcache_misses = - nfsstatsv1_p->lookupcache_misses; + NFSD_VNET(nfsstatsv1_p)->lookupcache_misses; oldnfsstats.direofcache_hits = - nfsstatsv1_p->direofcache_hits; + NFSD_VNET(nfsstatsv1_p)->direofcache_hits; oldnfsstats.direofcache_misses = - nfsstatsv1_p->direofcache_misses; + NFSD_VNET(nfsstatsv1_p)->direofcache_misses; oldnfsstats.accesscache_hits = - nfsstatsv1_p->accesscache_hits; + NFSD_VNET(nfsstatsv1_p)->accesscache_hits; oldnfsstats.accesscache_misses = - nfsstatsv1_p->accesscache_misses; + NFSD_VNET(nfsstatsv1_p)->accesscache_misses; oldnfsstats.biocache_reads = - nfsstatsv1_p->biocache_reads; + NFSD_VNET(nfsstatsv1_p)->biocache_reads; oldnfsstats.read_bios = - nfsstatsv1_p->read_bios; + NFSD_VNET(nfsstatsv1_p)->read_bios; oldnfsstats.read_physios = - nfsstatsv1_p->read_physios; + NFSD_VNET(nfsstatsv1_p)->read_physios; oldnfsstats.biocache_writes = - nfsstatsv1_p->biocache_writes; + NFSD_VNET(nfsstatsv1_p)->biocache_writes; oldnfsstats.write_bios = - nfsstatsv1_p->write_bios; + NFSD_VNET(nfsstatsv1_p)->write_bios; oldnfsstats.write_physios = - nfsstatsv1_p->write_physios; + NFSD_VNET(nfsstatsv1_p)->write_physios; oldnfsstats.biocache_readlinks = - nfsstatsv1_p->biocache_readlinks; + NFSD_VNET(nfsstatsv1_p)->biocache_readlinks; oldnfsstats.readlink_bios = - nfsstatsv1_p->readlink_bios; + NFSD_VNET(nfsstatsv1_p)->readlink_bios; oldnfsstats.biocache_readdirs = - nfsstatsv1_p->biocache_readdirs; + NFSD_VNET(nfsstatsv1_p)->biocache_readdirs; oldnfsstats.readdir_bios = - nfsstatsv1_p->readdir_bios; + NFSD_VNET(nfsstatsv1_p)->readdir_bios; for (i = 0; i < NFSV4_NPROCS; i++) - oldnfsstats.rpccnt[i] = nfsstatsv1_p->rpccnt[i]; - oldnfsstats.rpcretries = nfsstatsv1_p->rpcretries; + oldnfsstats.rpccnt[i] = + NFSD_VNET(nfsstatsv1_p)->rpccnt[i]; + oldnfsstats.rpcretries = + NFSD_VNET(nfsstatsv1_p)->rpcretries; for (i = 0; i < NFSV4OP_NOPS; i++) oldnfsstats.srvrpccnt[i] = - nfsstatsv1_p->srvrpccnt[i]; + NFSD_VNET(nfsstatsv1_p)->srvrpccnt[i]; for (i = NFSV42_NOPS, j = NFSV4OP_NOPS; i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++) oldnfsstats.srvrpccnt[j] = - nfsstatsv1_p->srvrpccnt[i]; + NFSD_VNET(nfsstatsv1_p)->srvrpccnt[i]; oldnfsstats.reserved_0 = 0; oldnfsstats.reserved_1 = 0; - oldnfsstats.rpcrequests = nfsstatsv1_p->rpcrequests; - oldnfsstats.rpctimeouts = nfsstatsv1_p->rpctimeouts; - oldnfsstats.rpcunexpected = nfsstatsv1_p->rpcunexpected; - oldnfsstats.rpcinvalid = nfsstatsv1_p->rpcinvalid; + oldnfsstats.rpcrequests = + NFSD_VNET(nfsstatsv1_p)->rpcrequests; + oldnfsstats.rpctimeouts = + NFSD_VNET(nfsstatsv1_p)->rpctimeouts; + oldnfsstats.rpcunexpected = + NFSD_VNET(nfsstatsv1_p)->rpcunexpected; + oldnfsstats.rpcinvalid = + NFSD_VNET(nfsstatsv1_p)->rpcinvalid; oldnfsstats.srvcache_inproghits = - nfsstatsv1_p->srvcache_inproghits; + NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits; oldnfsstats.reserved_2 = 0; oldnfsstats.srvcache_nonidemdonehits = - nfsstatsv1_p->srvcache_nonidemdonehits; + NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits; oldnfsstats.srvcache_misses = - nfsstatsv1_p->srvcache_misses; + NFSD_VNET(nfsstatsv1_p)->srvcache_misses; oldnfsstats.srvcache_tcppeak = - nfsstatsv1_p->srvcache_tcppeak; - oldnfsstats.srvcache_size = nfsstatsv1_p->srvcache_size; - oldnfsstats.srvclients = nfsstatsv1_p->srvclients; - oldnfsstats.srvopenowners = nfsstatsv1_p->srvopenowners; - oldnfsstats.srvopens = nfsstatsv1_p->srvopens; - oldnfsstats.srvlockowners = nfsstatsv1_p->srvlockowners; - oldnfsstats.srvlocks = nfsstatsv1_p->srvlocks; - oldnfsstats.srvdelegates = nfsstatsv1_p->srvdelegates; + NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak; + oldnfsstats.srvcache_size = + NFSD_VNET(nfsstatsv1_p)->srvcache_size; + oldnfsstats.srvclients = + NFSD_VNET(nfsstatsv1_p)->srvclients; + oldnfsstats.srvopenowners = + NFSD_VNET(nfsstatsv1_p)->srvopenowners; + oldnfsstats.srvopens = + NFSD_VNET(nfsstatsv1_p)->srvopens; + oldnfsstats.srvlockowners = + NFSD_VNET(nfsstatsv1_p)->srvlockowners; + oldnfsstats.srvlocks = + NFSD_VNET(nfsstatsv1_p)->srvlocks; + oldnfsstats.srvdelegates = + NFSD_VNET(nfsstatsv1_p)->srvdelegates; for (i = 0; i < NFSV4OP_CBNOPS; i++) oldnfsstats.cbrpccnt[i] = - nfsstatsv1_p->cbrpccnt[i]; - oldnfsstats.clopenowners = nfsstatsv1_p->clopenowners; - oldnfsstats.clopens = nfsstatsv1_p->clopens; - oldnfsstats.cllockowners = nfsstatsv1_p->cllockowners; - oldnfsstats.cllocks = nfsstatsv1_p->cllocks; - oldnfsstats.cldelegates = nfsstatsv1_p->cldelegates; + NFSD_VNET(nfsstatsv1_p)->cbrpccnt[i]; + oldnfsstats.clopenowners = + NFSD_VNET(nfsstatsv1_p)->clopenowners; + oldnfsstats.clopens = NFSD_VNET(nfsstatsv1_p)->clopens; + oldnfsstats.cllockowners = + NFSD_VNET(nfsstatsv1_p)->cllockowners; + oldnfsstats.cllocks = NFSD_VNET(nfsstatsv1_p)->cllocks; + oldnfsstats.cldelegates = + NFSD_VNET(nfsstatsv1_p)->cldelegates; oldnfsstats.cllocalopenowners = - nfsstatsv1_p->cllocalopenowners; - oldnfsstats.cllocalopens = nfsstatsv1_p->cllocalopens; + NFSD_VNET(nfsstatsv1_p)->cllocalopenowners; + oldnfsstats.cllocalopens = + NFSD_VNET(nfsstatsv1_p)->cllocalopens; oldnfsstats.cllocallockowners = - nfsstatsv1_p->cllocallockowners; - oldnfsstats.cllocallocks = nfsstatsv1_p->cllocallocks; + NFSD_VNET(nfsstatsv1_p)->cllocallockowners; + oldnfsstats.cllocallocks = + NFSD_VNET(nfsstatsv1_p)->cllocallocks; error = copyout(&oldnfsstats, uap->argp, sizeof (oldnfsstats)); } else { @@ -568,174 +586,174 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred) if (nfsstatver.vers == NFSSTATS_OV1) { /* Copy nfsstatsv1 to nfsstatsov1. */ nfsstatsov1.attrcache_hits = - nfsstatsv1_p->attrcache_hits; + NFSD_VNET(nfsstatsv1_p)->attrcache_hits; nfsstatsov1.attrcache_misses = - nfsstatsv1_p->attrcache_misses; + NFSD_VNET(nfsstatsv1_p)->attrcache_misses; nfsstatsov1.lookupcache_hits = - nfsstatsv1_p->lookupcache_hits; + NFSD_VNET(nfsstatsv1_p)->lookupcache_hits; nfsstatsov1.lookupcache_misses = - nfsstatsv1_p->lookupcache_misses; + NFSD_VNET(nfsstatsv1_p)->lookupcache_misses; nfsstatsov1.direofcache_hits = - nfsstatsv1_p->direofcache_hits; + NFSD_VNET(nfsstatsv1_p)->direofcache_hits; nfsstatsov1.direofcache_misses = - nfsstatsv1_p->direofcache_misses; + NFSD_VNET(nfsstatsv1_p)->direofcache_misses; nfsstatsov1.accesscache_hits = - nfsstatsv1_p->accesscache_hits; + NFSD_VNET(nfsstatsv1_p)->accesscache_hits; nfsstatsov1.accesscache_misses = - nfsstatsv1_p->accesscache_misses; + NFSD_VNET(nfsstatsv1_p)->accesscache_misses; nfsstatsov1.biocache_reads = - nfsstatsv1_p->biocache_reads; + NFSD_VNET(nfsstatsv1_p)->biocache_reads; nfsstatsov1.read_bios = - nfsstatsv1_p->read_bios; + NFSD_VNET(nfsstatsv1_p)->read_bios; nfsstatsov1.read_physios = - nfsstatsv1_p->read_physios; + NFSD_VNET(nfsstatsv1_p)->read_physios; nfsstatsov1.biocache_writes = - nfsstatsv1_p->biocache_writes; + NFSD_VNET(nfsstatsv1_p)->biocache_writes; nfsstatsov1.write_bios = - nfsstatsv1_p->write_bios; + NFSD_VNET(nfsstatsv1_p)->write_bios; nfsstatsov1.write_physios = - nfsstatsv1_p->write_physios; + NFSD_VNET(nfsstatsv1_p)->write_physios; nfsstatsov1.biocache_readlinks = - nfsstatsv1_p->biocache_readlinks; + NFSD_VNET(nfsstatsv1_p)->biocache_readlinks; nfsstatsov1.readlink_bios = - nfsstatsv1_p->readlink_bios; + NFSD_VNET(nfsstatsv1_p)->readlink_bios; nfsstatsov1.biocache_readdirs = - nfsstatsv1_p->biocache_readdirs; + NFSD_VNET(nfsstatsv1_p)->biocache_readdirs; nfsstatsov1.readdir_bios = - nfsstatsv1_p->readdir_bios; + NFSD_VNET(nfsstatsv1_p)->readdir_bios; for (i = 0; i < NFSV42_OLDNPROCS; i++) nfsstatsov1.rpccnt[i] = - nfsstatsv1_p->rpccnt[i]; + NFSD_VNET(nfsstatsv1_p)->rpccnt[i]; nfsstatsov1.rpcretries = - nfsstatsv1_p->rpcretries; + NFSD_VNET(nfsstatsv1_p)->rpcretries; for (i = 0; i < NFSV42_PURENOPS; i++) nfsstatsov1.srvrpccnt[i] = - nfsstatsv1_p->srvrpccnt[i]; + NFSD_VNET(nfsstatsv1_p)->srvrpccnt[i]; for (i = NFSV42_NOPS, j = NFSV42_PURENOPS; i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++) nfsstatsov1.srvrpccnt[j] = - nfsstatsv1_p->srvrpccnt[i]; + NFSD_VNET(nfsstatsv1_p)->srvrpccnt[i]; nfsstatsov1.reserved_0 = 0; nfsstatsov1.reserved_1 = 0; nfsstatsov1.rpcrequests = - nfsstatsv1_p->rpcrequests; + NFSD_VNET(nfsstatsv1_p)->rpcrequests; nfsstatsov1.rpctimeouts = - nfsstatsv1_p->rpctimeouts; + NFSD_VNET(nfsstatsv1_p)->rpctimeouts; nfsstatsov1.rpcunexpected = - nfsstatsv1_p->rpcunexpected; + NFSD_VNET(nfsstatsv1_p)->rpcunexpected; nfsstatsov1.rpcinvalid = - nfsstatsv1_p->rpcinvalid; + NFSD_VNET(nfsstatsv1_p)->rpcinvalid; nfsstatsov1.srvcache_inproghits = - nfsstatsv1_p->srvcache_inproghits; + NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits; nfsstatsov1.reserved_2 = 0; nfsstatsov1.srvcache_nonidemdonehits = - nfsstatsv1_p->srvcache_nonidemdonehits; + NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits; nfsstatsov1.srvcache_misses = - nfsstatsv1_p->srvcache_misses; + NFSD_VNET(nfsstatsv1_p)->srvcache_misses; nfsstatsov1.srvcache_tcppeak = - nfsstatsv1_p->srvcache_tcppeak; + NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak; nfsstatsov1.srvcache_size = - nfsstatsv1_p->srvcache_size; + NFSD_VNET(nfsstatsv1_p)->srvcache_size; nfsstatsov1.srvclients = - nfsstatsv1_p->srvclients; + NFSD_VNET(nfsstatsv1_p)->srvclients; nfsstatsov1.srvopenowners = - nfsstatsv1_p->srvopenowners; + NFSD_VNET(nfsstatsv1_p)->srvopenowners; nfsstatsov1.srvopens = - nfsstatsv1_p->srvopens; + NFSD_VNET(nfsstatsv1_p)->srvopens; nfsstatsov1.srvlockowners = - nfsstatsv1_p->srvlockowners; + NFSD_VNET(nfsstatsv1_p)->srvlockowners; nfsstatsov1.srvlocks = - nfsstatsv1_p->srvlocks; + NFSD_VNET(nfsstatsv1_p)->srvlocks; nfsstatsov1.srvdelegates = - nfsstatsv1_p->srvdelegates; + NFSD_VNET(nfsstatsv1_p)->srvdelegates; for (i = 0; i < NFSV42_CBNOPS; i++) nfsstatsov1.cbrpccnt[i] = - nfsstatsv1_p->cbrpccnt[i]; + NFSD_VNET(nfsstatsv1_p)->cbrpccnt[i]; nfsstatsov1.clopenowners = - nfsstatsv1_p->clopenowners; + NFSD_VNET(nfsstatsv1_p)->clopenowners; nfsstatsov1.clopens = - nfsstatsv1_p->clopens; + NFSD_VNET(nfsstatsv1_p)->clopens; nfsstatsov1.cllockowners = - nfsstatsv1_p->cllockowners; + NFSD_VNET(nfsstatsv1_p)->cllockowners; nfsstatsov1.cllocks = - nfsstatsv1_p->cllocks; + NFSD_VNET(nfsstatsv1_p)->cllocks; nfsstatsov1.cldelegates = - nfsstatsv1_p->cldelegates; + NFSD_VNET(nfsstatsv1_p)->cldelegates; nfsstatsov1.cllocalopenowners = - nfsstatsv1_p->cllocalopenowners; + NFSD_VNET(nfsstatsv1_p)->cllocalopenowners; nfsstatsov1.cllocalopens = - nfsstatsv1_p->cllocalopens; + NFSD_VNET(nfsstatsv1_p)->cllocalopens; nfsstatsov1.cllocallockowners = - nfsstatsv1_p->cllocallockowners; + NFSD_VNET(nfsstatsv1_p)->cllocallockowners; nfsstatsov1.cllocallocks = - nfsstatsv1_p->cllocallocks; + NFSD_VNET(nfsstatsv1_p)->cllocallocks; nfsstatsov1.srvstartcnt = - nfsstatsv1_p->srvstartcnt; + NFSD_VNET(nfsstatsv1_p)->srvstartcnt; nfsstatsov1.srvdonecnt = - nfsstatsv1_p->srvdonecnt; + NFSD_VNET(nfsstatsv1_p)->srvdonecnt; for (i = NFSV42_NOPS, j = NFSV42_PURENOPS; i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++) { nfsstatsov1.srvbytes[j] = - nfsstatsv1_p->srvbytes[i]; + NFSD_VNET(nfsstatsv1_p)->srvbytes[i]; nfsstatsov1.srvops[j] = - nfsstatsv1_p->srvops[i]; + NFSD_VNET(nfsstatsv1_p)->srvops[i]; nfsstatsov1.srvduration[j] = - nfsstatsv1_p->srvduration[i]; + NFSD_VNET(nfsstatsv1_p)->srvduration[i]; } nfsstatsov1.busyfrom = - nfsstatsv1_p->busyfrom; + NFSD_VNET(nfsstatsv1_p)->busyfrom; nfsstatsov1.busyfrom = - nfsstatsv1_p->busyfrom; + NFSD_VNET(nfsstatsv1_p)->busyfrom; error = copyout(&nfsstatsov1, uap->argp, sizeof(nfsstatsov1)); } else if (nfsstatver.vers != NFSSTATS_V1) error = EPERM; else - error = copyout(&nfsstatsv1, uap->argp, - sizeof(nfsstatsv1)); + error = copyout(NFSD_VNET(nfsstatsv1_p), + uap->argp, sizeof(nfsstatsv1)); } } if (error == 0) { if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) { - nfsstatsv1_p->attrcache_hits = 0; - nfsstatsv1_p->attrcache_misses = 0; - nfsstatsv1_p->lookupcache_hits = 0; - nfsstatsv1_p->lookupcache_misses = 0; - nfsstatsv1_p->direofcache_hits = 0; - nfsstatsv1_p->direofcache_misses = 0; - nfsstatsv1_p->accesscache_hits = 0; - nfsstatsv1_p->accesscache_misses = 0; - nfsstatsv1_p->biocache_reads = 0; - nfsstatsv1_p->read_bios = 0; - nfsstatsv1_p->read_physios = 0; - nfsstatsv1_p->biocache_writes = 0; - nfsstatsv1_p->write_bios = 0; - nfsstatsv1_p->write_physios = 0; - nfsstatsv1_p->biocache_readlinks = 0; - nfsstatsv1_p->readlink_bios = 0; - nfsstatsv1_p->biocache_readdirs = 0; - nfsstatsv1_p->readdir_bios = 0; - nfsstatsv1_p->rpcretries = 0; - nfsstatsv1_p->rpcrequests = 0; - nfsstatsv1_p->rpctimeouts = 0; - nfsstatsv1_p->rpcunexpected = 0; - nfsstatsv1_p->rpcinvalid = 0; - bzero(nfsstatsv1_p->rpccnt, - sizeof(nfsstatsv1_p->rpccnt)); + NFSD_VNET(nfsstatsv1_p)->attrcache_hits = 0; + NFSD_VNET(nfsstatsv1_p)->attrcache_misses = 0; + NFSD_VNET(nfsstatsv1_p)->lookupcache_hits = 0; + NFSD_VNET(nfsstatsv1_p)->lookupcache_misses = 0; + NFSD_VNET(nfsstatsv1_p)->direofcache_hits = 0; + NFSD_VNET(nfsstatsv1_p)->direofcache_misses = 0; + NFSD_VNET(nfsstatsv1_p)->accesscache_hits = 0; + NFSD_VNET(nfsstatsv1_p)->accesscache_misses = 0; + NFSD_VNET(nfsstatsv1_p)->biocache_reads = 0; + NFSD_VNET(nfsstatsv1_p)->read_bios = 0; + NFSD_VNET(nfsstatsv1_p)->read_physios = 0; + NFSD_VNET(nfsstatsv1_p)->biocache_writes = 0; + NFSD_VNET(nfsstatsv1_p)->write_bios = 0; + NFSD_VNET(nfsstatsv1_p)->write_physios = 0; + NFSD_VNET(nfsstatsv1_p)->biocache_readlinks = 0; + NFSD_VNET(nfsstatsv1_p)->readlink_bios = 0; + NFSD_VNET(nfsstatsv1_p)->biocache_readdirs = 0; + NFSD_VNET(nfsstatsv1_p)->readdir_bios = 0; + NFSD_VNET(nfsstatsv1_p)->rpcretries = 0; + NFSD_VNET(nfsstatsv1_p)->rpcrequests = 0; + NFSD_VNET(nfsstatsv1_p)->rpctimeouts = 0; + NFSD_VNET(nfsstatsv1_p)->rpcunexpected = 0; + NFSD_VNET(nfsstatsv1_p)->rpcinvalid = 0; + bzero(NFSD_VNET(nfsstatsv1_p)->rpccnt, + sizeof(NFSD_VNET(nfsstatsv1_p)->rpccnt)); } if ((uap->flag & NFSSVC_ZEROSRVSTATS) != 0) { - nfsstatsv1_p->srvcache_inproghits = 0; - nfsstatsv1_p->srvcache_nonidemdonehits = 0; - nfsstatsv1_p->srvcache_misses = 0; - nfsstatsv1_p->srvcache_tcppeak = 0; - bzero(nfsstatsv1_p->srvrpccnt, - sizeof(nfsstatsv1_p->srvrpccnt)); - bzero(nfsstatsv1_p->cbrpccnt, - sizeof(nfsstatsv1_p->cbrpccnt)); + NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits = 0; + NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits = 0; + NFSD_VNET(nfsstatsv1_p)->srvcache_misses = 0; + NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak = 0; + bzero(NFSD_VNET(nfsstatsv1_p)->srvrpccnt, + sizeof(NFSD_VNET(nfsstatsv1_p)->srvrpccnt)); + bzero(NFSD_VNET(nfsstatsv1_p)->cbrpccnt, + sizeof(NFSD_VNET(nfsstatsv1_p)->cbrpccnt)); } } goto out; diff --git a/sys/fs/nfsserver/nfs_nfsdcache.c b/sys/fs/nfsserver/nfs_nfsdcache.c index e94d58481286..2629c795802f 100644 --- a/sys/fs/nfsserver/nfs_nfsdcache.c +++ b/sys/fs/nfsserver/nfs_nfsdcache.c @@ -404,14 +404,14 @@ loop: TAILQ_REMOVE(&NFSD_VNET(nfsrvudplru), rp, rc_lru); TAILQ_INSERT_TAIL(&NFSD_VNET(nfsrvudplru), rp, rc_lru); if (rp->rc_flag & RC_INPROG) { - nfsstatsv1_p->srvcache_inproghits++; + NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits++; mtx_unlock(mutex); ret = RC_DROPIT; } else if (rp->rc_flag & RC_REPSTATUS) { /* * V2 only. */ - nfsstatsv1_p->srvcache_nonidemdonehits++; + NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++; mtx_unlock(mutex); nfsrvd_rephead(nd); *(nd->nd_errp) = rp->rc_status; @@ -419,7 +419,7 @@ loop: rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_UDPTIMEOUT; } else if (rp->rc_flag & RC_REPMBUF) { - nfsstatsv1_p->srvcache_nonidemdonehits++; + NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++; mtx_unlock(mutex); nd->nd_mreq = m_copym(rp->rc_reply, 0, M_COPYALL, M_WAITOK); @@ -434,8 +434,8 @@ loop: goto out; } } - nfsstatsv1_p->srvcache_misses++; - atomic_add_int(&nfsstatsv1_p->srvcache_size, 1); + NFSD_VNET(nfsstatsv1_p)->srvcache_misses++; + atomic_add_int(&NFSD_VNET(nfsstatsv1_p)->srvcache_size, 1); NFSD_VNET(nfsrc_udpcachesize)++; newrp->rc_flag |= RC_INPROG; @@ -489,7 +489,7 @@ nfsrvd_updatecache(struct nfsrv_descript *nd) * Reply from cache is a special case returned by nfsrv_checkseqid(). */ if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) { - nfsstatsv1_p->srvcache_nonidemdonehits++; + NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++; mtx_unlock(mutex); nd->nd_repstat = 0; if (nd->nd_mreq) @@ -529,8 +529,8 @@ nfsrvd_updatecache(struct nfsrv_descript *nd) atomic_add_int(&NFSD_VNET(nfsrc_tcpsavedreplies), 1); if (NFSD_VNET(nfsrc_tcpsavedreplies) > - nfsstatsv1_p->srvcache_tcppeak) - nfsstatsv1_p->srvcache_tcppeak = + NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak) + NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak = NFSD_VNET(nfsrc_tcpsavedreplies); } mtx_unlock(mutex); @@ -688,7 +688,7 @@ tryagain: panic("nfs tcp cache0"); rp->rc_flag |= RC_LOCKED; if (rp->rc_flag & RC_INPROG) { - nfsstatsv1_p->srvcache_inproghits++; + NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits++; mtx_unlock(mutex); if (newrp->rc_sockref == rp->rc_sockref) nfsrc_marksametcpconn(rp->rc_sockref); @@ -697,7 +697,7 @@ tryagain: /* * V2 only. */ - nfsstatsv1_p->srvcache_nonidemdonehits++; + NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++; mtx_unlock(mutex); if (newrp->rc_sockref == rp->rc_sockref) nfsrc_marksametcpconn(rp->rc_sockref); @@ -706,7 +706,7 @@ tryagain: *(nd->nd_errp) = rp->rc_status; rp->rc_timestamp = NFSD_MONOSEC + nfsrc_tcptimeout; } else if (rp->rc_flag & RC_REPMBUF) { - nfsstatsv1_p->srvcache_nonidemdonehits++; + NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++; mtx_unlock(mutex); if (newrp->rc_sockref == rp->rc_sockref) nfsrc_marksametcpconn(rp->rc_sockref); @@ -721,8 +721,8 @@ tryagain: free(newrp, M_NFSRVCACHE); goto out; } - nfsstatsv1_p->srvcache_misses++; - atomic_add_int(&nfsstatsv1_p->srvcache_size, 1); + NFSD_VNET(nfsstatsv1_p)->srvcache_misses++; + atomic_add_int(&NFSD_VNET(nfsstatsv1_p)->srvcache_size, 1); /* * For TCP, multiple entries for a key are allowed, so don't @@ -811,7 +811,7 @@ nfsrc_freecache(struct nfsrvcache *rp) atomic_add_int(&NFSD_VNET(nfsrc_tcpsavedreplies), -1); } free(rp, M_NFSRVCACHE); - atomic_add_int(&nfsstatsv1_p->srvcache_size, -1); + atomic_add_int(&NFSD_VNET(nfsstatsv1_p)->srvcache_size, -1); } /* @@ -837,7 +837,7 @@ nfsrvd_cleancache(void) nfsrc_freecache(rp); } } - nfsstatsv1_p->srvcache_size = 0; + NFSD_VNET(nfsstatsv1_p)->srvcache_size = 0; mtx_unlock(&nfsrc_udpmtx); NFSD_VNET(nfsrc_tcpsavedreplies) = 0; } diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 633d31ea6511..3912654515ef 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1034,7 +1034,7 @@ nfsvno_read(struct vnode *vp, off_t off, int cnt, struct ucred *cred, nh = nfsrv_sequential_heuristic(uiop, vp); ioflag |= nh->nh_seqcount << IO_SEQSHIFT; /* XXX KDM make this more systematic? */ - nfsstatsv1_p->srvbytes[NFSV4OP_READ] += uiop->uio_resid; + NFSD_VNET(nfsstatsv1_p)->srvbytes[NFSV4OP_READ] += uiop->uio_resid; error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred); free(iv, M_TEMP); if (error) { @@ -1159,7 +1159,7 @@ nfsvno_write(struct vnode *vp, off_t off, int retlen, int *stable, nh = nfsrv_sequential_heuristic(uiop, vp); ioflags |= nh->nh_seqcount << IO_SEQSHIFT; /* XXX KDM make this more systematic? */ - nfsstatsv1_p->srvbytes[NFSV4OP_WRITE] += uiop->uio_resid; + NFSD_VNET(nfsstatsv1_p)->srvbytes[NFSV4OP_WRITE] += uiop->uio_resid; error = VOP_WRITE(vp, uiop, ioflags, cred); if (error == 0) nh->nh_nextoff = uiop->uio_offset; diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index 40f3202af93c..6b64b3ff98eb 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -475,15 +475,16 @@ nfsrvd_statstart(int op, struct bintime *now) } mtx_lock(&nfsrvd_statmtx); - if (nfsstatsv1_p->srvstartcnt == nfsstatsv1_p->srvdonecnt) { + if (NFSD_VNET(nfsstatsv1_p)->srvstartcnt == + NFSD_VNET(nfsstatsv1_p)->srvdonecnt) { if (now != NULL) - nfsstatsv1_p->busyfrom = *now; + NFSD_VNET(nfsstatsv1_p)->busyfrom = *now; else - binuptime(&nfsstatsv1_p->busyfrom); + binuptime(&NFSD_VNET(nfsstatsv1_p)->busyfrom); } - nfsstatsv1_p->srvrpccnt[op]++; - nfsstatsv1_p->srvstartcnt++; + NFSD_VNET(nfsstatsv1_p)->srvrpccnt[op]++; + NFSD_VNET(nfsstatsv1_p)->srvstartcnt++; mtx_unlock(&nfsrvd_statmtx); } @@ -506,21 +507,21 @@ nfsrvd_statend(int op, uint64_t bytes, struct bintime *now, mtx_lock(&nfsrvd_statmtx); - nfsstatsv1_p->srvbytes[op] += bytes; - nfsstatsv1_p->srvops[op]++; + NFSD_VNET(nfsstatsv1_p)->srvbytes[op] += bytes; + NFSD_VNET(nfsstatsv1_p)->srvops[op]++; if (then != NULL) { dt = *now; bintime_sub(&dt, then); - bintime_add(&nfsstatsv1_p->srvduration[op], &dt); + bintime_add(&NFSD_VNET(nfsstatsv1_p)->srvduration[op], &dt); } dt = *now; - bintime_sub(&dt, &nfsstatsv1_p->busyfrom); - bintime_add(&nfsstatsv1_p->busytime, &dt); - nfsstatsv1_p->busyfrom = *now; + bintime_sub(&dt, &NFSD_VNET(nfsstatsv1_p)->busyfrom); + bintime_add(&NFSD_VNET(nfsstatsv1_p)->busytime, &dt); + NFSD_VNET(nfsstatsv1_p)->busyfrom = *now; - nfsstatsv1_p->srvdonecnt++; + NFSD_VNET(nfsstatsv1_p)->srvdonecnt++; mtx_unlock(&nfsrvd_statmtx); } diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 7a8527f57068..25fecdf1b2b7 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -363,7 +363,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, LIST_INIT(&new_clp->lc_stateid[i]); LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, lc_hash); - nfsstatsv1_p->srvclients++; + NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; NFSLOCKV4ROOTMUTEX(); @@ -492,7 +492,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, LIST_INIT(&new_clp->lc_session); LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, lc_hash); - nfsstatsv1_p->srvclients++; + NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; NFSLOCKV4ROOTMUTEX(); @@ -557,7 +557,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, LIST_INIT(&new_clp->lc_session); LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, lc_hash); - nfsstatsv1_p->srvclients++; + NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; } @@ -1404,7 +1404,7 @@ nfsrv_zapclient(struct nfsclient *clp, NFSPROC_T *p) free(clp->lc_stateid, M_NFSDCLIENT); free(clp, M_NFSDCLIENT); NFSLOCKSTATE(); - nfsstatsv1_p->srvclients--; + NFSD_VNET(nfsstatsv1_p)->srvclients--; nfsrv_openpluslock--; nfsrv_clients--; NFSUNLOCKSTATE(); @@ -1447,7 +1447,7 @@ nfsrv_freedeleg(struct nfsstate *stp) nfsv4_testlock(&lfp->lf_locallock_lck) == 0) nfsrv_freenfslockfile(lfp); free(stp, M_NFSDSTATE); - nfsstatsv1_p->srvdelegates--; + NFSD_VNET(nfsstatsv1_p)->srvdelegates--; nfsrv_openpluslock--; nfsrv_delegatecnt--; } @@ -1473,7 +1473,7 @@ nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p) if (stp->ls_op) nfsrvd_derefcache(stp->ls_op); free(stp, M_NFSDSTATE); - nfsstatsv1_p->srvopenowners--; + NFSD_VNET(nfsstatsv1_p)->srvopenowners--; nfsrv_openpluslock--; } @@ -1523,7 +1523,7 @@ nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p) if (cansleep != 0) NFSUNLOCKSTATE(); free(stp, M_NFSDSTATE); - nfsstatsv1_p->srvopens--; + NFSD_VNET(nfsstatsv1_p)->srvopens--; nfsrv_openpluslock--; return (ret); } @@ -1542,7 +1542,7 @@ nfsrv_freelockowner(struct nfsstate *stp, vnode_t vp, int cansleep, if (stp->ls_op) nfsrvd_derefcache(stp->ls_op); free(stp, M_NFSDSTATE); - nfsstatsv1_p->srvlockowners--; + NFSD_VNET(nfsstatsv1_p)->srvlockowners--; nfsrv_openpluslock--; } @@ -1618,7 +1618,7 @@ nfsrv_freenfslock(struct nfslock *lop) if (lop->lo_lckfile.le_prev != NULL) { LIST_REMOVE(lop, lo_lckfile); - nfsstatsv1_p->srvlocks--; + NFSD_VNET(nfsstatsv1_p)->srvlocks--; nfsrv_openpluslock--; } LIST_REMOVE(lop, lo_lckowner); @@ -2395,7 +2395,7 @@ tryagain: LIST_INSERT_HEAD(&stp->ls_open, new_stp, ls_list); *new_lopp = NULL; *new_stpp = NULL; - nfsstatsv1_p->srvlockowners++; + NFSD_VNET(nfsstatsv1_p)->srvlockowners++; nfsrv_openpluslock++; } if (filestruct_locked != 0) { @@ -3047,12 +3047,12 @@ tryagain: LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list); LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list); *new_stpp = NULL; - nfsstatsv1_p->srvopenowners++; + NFSD_VNET(nfsstatsv1_p)->srvopenowners++; nfsrv_openpluslock++; } openstp = new_open; new_open = NULL; - nfsstatsv1_p->srvopens++; + NFSD_VNET(nfsstatsv1_p)->srvopens++; nfsrv_openpluslock++; break; } @@ -3113,7 +3113,7 @@ tryagain: NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt) || !NFSVNO_DELEGOK(vp)) *rflagsp |= NFSV4OPEN_RECALL; - nfsstatsv1_p->srvdelegates++; + NFSD_VNET(nfsstatsv1_p)->srvdelegates++; nfsrv_openpluslock++; nfsrv_delegatecnt++; @@ -3153,12 +3153,12 @@ tryagain: LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list); LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list); *new_stpp = NULL; - nfsstatsv1_p->srvopenowners++; + NFSD_VNET(nfsstatsv1_p)->srvopenowners++; nfsrv_openpluslock++; } openstp = new_open; new_open = NULL; - nfsstatsv1_p->srvopens++; + NFSD_VNET(nfsstatsv1_p)->srvopens++; nfsrv_openpluslock++; } else { error = NFSERR_RECLAIMCONFLICT; @@ -3230,7 +3230,7 @@ tryagain: new_deleg->ls_stateid), new_deleg, ls_hash); LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list); new_deleg = NULL; - nfsstatsv1_p->srvdelegates++; + NFSD_VNET(nfsstatsv1_p)->srvdelegates++; nfsrv_openpluslock++; nfsrv_delegatecnt++; } @@ -3252,7 +3252,7 @@ tryagain: new_open, ls_hash); openstp = new_open; new_open = NULL; - nfsstatsv1_p->srvopens++; + NFSD_VNET(nfsstatsv1_p)->srvopens++; nfsrv_openpluslock++; /* @@ -3300,7 +3300,7 @@ tryagain: new_deleg->ls_stateid), new_deleg, ls_hash); LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list); new_deleg = NULL; - nfsstatsv1_p->srvdelegates++; + NFSD_VNET(nfsstatsv1_p)->srvdelegates++; nfsrv_openpluslock++; nfsrv_delegatecnt++; } @@ -3381,7 +3381,7 @@ tryagain: LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list); new_deleg = NULL; - nfsstatsv1_p->srvdelegates++; + NFSD_VNET(nfsstatsv1_p)->srvdelegates++; nfsrv_openpluslock++; nfsrv_delegatecnt++; } @@ -3409,9 +3409,9 @@ tryagain: openstp = new_open; new_open = NULL; *new_stpp = NULL; - nfsstatsv1_p->srvopens++; + NFSD_VNET(nfsstatsv1_p)->srvopens++; nfsrv_openpluslock++; - nfsstatsv1_p->srvopenowners++; + NFSD_VNET(nfsstatsv1_p)->srvopenowners++; nfsrv_openpluslock++; } if (!error) { @@ -3887,7 +3887,7 @@ nfsrv_insertlock(struct nfslock *new_lop, struct nfslock *insert_lop, else LIST_INSERT_AFTER(insert_lop, new_lop, lo_lckowner); if (stp != NULL) { - nfsstatsv1_p->srvlocks++; + NFSD_VNET(nfsstatsv1_p)->srvlocks++; nfsrv_openpluslock++; } } @@ -7455,7 +7455,7 @@ nfsrv_addlayout(struct nfsrv_descript *nd, struct nfslayout **lypp, /* Insert the new layout in the lists. */ *lypp = NULL; atomic_add_int(&nfsrv_layoutcnt, 1); - nfsstatsv1_p->srvlayouts++; + NFSD_VNET(nfsstatsv1_p)->srvlayouts++; NFSBCOPY(lyp->lay_xdr, layp, lyp->lay_layoutlen); *layoutlenp = lyp->lay_layoutlen; TAILQ_INSERT_HEAD(&lhyp->list, lyp, lay_list); @@ -7548,7 +7548,7 @@ nfsrv_freelayout(struct nfslayouthead *lhp, struct nfslayout *lyp) NFSD_DEBUG(4, "Freelayout=%p\n", lyp); atomic_add_int(&nfsrv_layoutcnt, -1); - nfsstatsv1_p->srvlayouts--; + NFSD_VNET(nfsstatsv1_p)->srvlayouts--; TAILQ_REMOVE(lhp, lyp, lay_list); free(lyp, M_NFSDSTATE); } From nobody Thu Feb 16 02:23:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHJdR4FGkz3rvyl; Thu, 16 Feb 2023 02:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHJdR2Jgyz4H0R; Thu, 16 Feb 2023 02:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676514187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Zn4U+gj2df5y8wE1Ok93E85+rilgIJh+sfT9w8PEVM=; b=Cgu/7z+TILvlELvRMkJu87rNzPCKGZSMC3rUEVrwDTbwsiJLjlze/KonXkgfVVUiRPCW8W vV8Pi6CbCjvzQic7zNRonXckm+SJnkFh62wvG31hE6JIKIjFHCczvvS5bddRiotIocdQLc pFjjsCf7QpUhOED1Xq4dhV6vBOwF0QM4jO0efl+LC7Jq5YPQsfauSi+1lVxuiXXv+QRH2T 7aBZ4VHb7wpbMwzoHKglbo0gW+OdA719e+5w05NFdsaNT3VrhzDCUT/lOLAR7OzIh9ZfMW jO2hZmBsH5x6CCx6orKX6R5GrhCGeuU+P4XdMHIs8aZT0EIdX3w2oGNUrNm7Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676514187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Zn4U+gj2df5y8wE1Ok93E85+rilgIJh+sfT9w8PEVM=; b=CWOxPqjFHU4CPE+ZvNhHVeeo5aX+M1LuNzH2QPhlpntmqzG6pqNkKy1ogcN/ca+hQnJ6QG VWdgy//fhyOFXOvVdj3sVUaqwCmfwQwSA/aRaADrb7dwMsjny8iHtJ3C0YdSY5qd+A7sjn /UkQhEq/16vHOB5LDD9stMibIyB5pCIHVGKh6pA2C9uTaeUBc6I4EXRFh6PkauXcFvvP/d n9ddLgmPfONDMWmB/gjxnc+vfrb545FcQsJW9e5xRyWKvrWvAOC0kQ04hmSlxHBfaPecDF d2UGCj25e5i7xyYwGv1hfDJ/WZYp+aXVC7RrtYUBxMbl7GPo726OY8zEaGYG1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676514187; a=rsa-sha256; cv=none; b=FnQbnSUmPCWFf+wTieH0GUaflS27S1qDoQPAuDQdFVZtqmGviC6QXgRO1xVUbK3FbeDzqQ +I9yyCPPJWsfRLd6m63lZc7Xc8Y9X0v/wW/diTb4IK73WAEIbuzSTWc/xk9dThB62KitbG jWAEwUrYVHaL9jBA+0sJZx6FxVotXpggHZ75lJrT9do5EqYu1oaPW5u4oJ3PI0632DKICt VuCIa/wpRTJx1iuYReCegKFYdA/Mgs5CurF7UA91wXPaLgh4+l3nZedU2vVJiJAt8OKDqH y+De7+JmoTUC0eMBCF0dSgY4meFPY2xj5g6TgGhrDg+zj4baH6iMPsxPMBc4qQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHJdR1NWcznJD; Thu, 16 Feb 2023 02:23: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 31G2N7Lr042527; Thu, 16 Feb 2023 02:23:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G2N7Wl042526; Thu, 16 Feb 2023 02:23:07 GMT (envelope-from git) Date: Thu, 16 Feb 2023 02:23:07 GMT Message-Id: <202302160223.31G2N7Wl042526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: David Bright Subject: git: b086426bc210 - main - hyperv: Fix Coverity issues in the Hyper-V driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b086426bc210ea567422b7bedaa637f345ad2d7d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=b086426bc210ea567422b7bedaa637f345ad2d7d commit b086426bc210ea567422b7bedaa637f345ad2d7d Author: Robert Herndon AuthorDate: 2023-02-12 05:09:20 +0000 Commit: David Bright CommitDate: 2023-02-16 00:24:45 +0000 hyperv: Fix Coverity issues in the Hyper-V driver Summary: Coverity reports the use of two uninitialized variables in the hyperv driver. Examination shows the variables can be accessed while uninitialized in error cases. Fix both. CID: 1365235 CID: 1365236 Sponsored by: Dell Technologies MFC after: 1w Test Plan: Changes in use at $WORK Reviewers: robert.herndon_dell.com, vangyzen, bret_ketchum_dell.com Subscribers: imp, badger Differential Revision: https://reviews.freebsd.org/D38551 --- sys/dev/hyperv/utilities/vmbus_ic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/hyperv/utilities/vmbus_ic.c b/sys/dev/hyperv/utilities/vmbus_ic.c index 574670053918..f21a0242a44d 100644 --- a/sys/dev/hyperv/utilities/vmbus_ic.c +++ b/sys/dev/hyperv/utilities/vmbus_ic.c @@ -59,6 +59,9 @@ vmbus_ic_negomsg(struct vmbus_ic_softc *sc, void *data, int *dlen0, uint32_t sel_fw_ver, sel_msg_ver; bool has_fw_ver, has_msg_ver; + has_fw_ver = false; + has_msg_ver = false; + /* * Preliminary message verification. */ @@ -92,7 +95,6 @@ vmbus_ic_negomsg(struct vmbus_ic_softc *sc, void *data, int *dlen0, /* * Find the best match framework version. */ - has_fw_ver = false; for (i = 0; i < nego->ic_fwver_cnt; ++i) { if (VMBUS_ICVER_LE(nego->ic_ver[i], fw_ver)) { if (!has_fw_ver) { @@ -111,9 +113,8 @@ vmbus_ic_negomsg(struct vmbus_ic_softc *sc, void *data, int *dlen0, } /* - * Fine the best match message version. + * Find the best match message version. */ - has_msg_ver = false; for (i = nego->ic_fwver_cnt; i < nego->ic_fwver_cnt + nego->ic_msgver_cnt; ++i) { if (VMBUS_ICVER_LE(nego->ic_ver[i], msg_ver)) { From nobody Thu Feb 16 04:29:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHMRj4ZFCz3s3WN for ; Thu, 16 Feb 2023 04:29:53 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-25.consmr.mail.gq1.yahoo.com (sonic312-25.consmr.mail.gq1.yahoo.com [98.137.69.206]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHMRh2KFbz4RMY for ; Thu, 16 Feb 2023 04:29:52 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=YSE5m9Au; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.206 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676521790; bh=g3l1uIDvS96FGx1+6PtA5fpJD9Y7Jie50YwpxUQPNy0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=YSE5m9AuYLCjJYXMIPp44l+KHCBxeTBTphwyUe3wOMDJtOTrPpzHJn4b7ulJqH44HEU31ckT7vJILY4oAW4D208zhEU6Wc3uJZWxHcByniFLocvhJ8nM8z2elSpUqAVKTKiiIweg1BI7TMQadtSxkBfC6LufUVTI/WiXfIs1+c5Hgg9BHbQv0xO6XMvn/64AvK/iFMkBFBEbIUOeANdUyvpfQHgFroCs7eVqktv7AKqOxhY9abKEMuGiZwye9HucnekBtmTiy7cSRHofQpV0Wveqc+pMYWUnUt6cCby0WrNOWTVwjh/nkERXkf5d6B5ZyK7U/P0DPQMr/1IRHBitSQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676521790; bh=tFCtXiKitJzQhtfsDpE0s8R9rdomSZK1yrFU+Vp5whH=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=TRdwdRp7M/Ir0ro0UMZgdfIn5+wrXh7ta3eNF9s774Q0SPmA0e5qFjcuuNB89su/bksSQoCLWvS+ALZrCCiMLVB2ayJxGBEblrFFQK9WmfhLOApNRCxPlUJ3oau5O1N+233HWvUK0kd2OI/g2e8ygRUDDPKS2E62zgilsdx6k9P5NjO7pmd+mgQuM/TeWHzIg5bZMt9tBBXfjKJq3uoGku9IRXSfI1PcBYqSbi1R48ru1AXrb5j0gDnzLHI2Xc9Ng75Dj6m/nUEbVlNpgSJLYvf+YAsdbLOA0+1cNE7mHJhPXrNFv2pvxxERuToeMpIsAeHGJugLr+h3XT2FOjpuew== X-YMail-OSG: am5TBEsVM1lpzp8qGf7hX720ZfWolA0Im8.9MAzMyyDkvFk18cU0g7BkOKgBo5T CUwck8iqOu0tli_cVo6HKYTFvl56QDcP9vl1O3J3JzEB4zu69UZLfyGD7rDKi3Y38Yab7dobK6.Q iF8Bu6xYg7_5kpMurPj9QarBN3I6zIp0RjCiuf04TzMsrZ4fQRpcmme2BFC7JReY9V_AD0Qqnq4o ztGEHMQB4XjdKIBkLsOReE7gcSWHc8a51cC8viyFCoySOF8vm7Pj70hiXzT1.xGh5TUgPiRUk10J 0E54NTSOaQQXNZyFWFohTieD6j0fBaYJbRm3iSbz7mQ1zx_t44awYvKuIdfN.2USbJ8ZQo.C0_dh 9A.7oPy1OtvXO5yXdICzhiA7M353qXTyzenz9QE9b.rq9LIwpxn33lGE3onXdtSfAeIRNOHUcLoB w_zBsj2DaIxGjXKEvM5VKMpVOYYuyceeo7fAxw9r.Lzmq9zNwE0pv8C2JtbiKH84wpr2fZYt1MWG cuUuoGwW.EMj66NpnbBOBLCxN58.0JMGrwuQAJ3Lp.liMZOrw9.DCiuii64_f6CULJ0wXyCrs80a YjxzVli8Boy_7yipCqPzFSWa6GwiAUlvgeW1o3TWlQXQPgkclFlryZkJE3fsGTZAbBJcjCoTFkGf zkQCfwvaTbhDDxtBP__YtJq5vVHM8bBvoFlflzI8nwhvxG7CqyLPHtffMbKnNpr1asMdyxBCSrtR a.f1fquy9MNYCbIhqzt6xZWwjGIzaJSbB.cPv4LERQ1SEKkMX5lq.kGm35CMU3HJqF0_NDo8Ou4K CtxjaQg0BMtRLNnWXlJH.4GMOvIXwtnYeneRhonijgkns3KEpJdidliS9jCET48KXW1b6lCv4pd3 .YmcsJ5lFhewA7_kIdcy3Omka.4KviTTSUUrasycqNT.b61WIzRIIYzPXDP.NXvcuSPl8p1o01_q q9SEt5EgOOr3M5ivYeRpT.KiDViKUqIKPw0xlysJmEErNKDrF7LttmKH.Dg8eXtXn2Qq1lN1KyPf pScyI9p47oT6VuUQcn5UJTmnvRsj74ri3nIlJhPMkElYqDJkOws_9o4.7nuMHRNnsD6ZaPBygln0 CzHXJ6TcrtNhcuL3QG3KkkL706Ci4QQZPHZJReDVkpu9ckUwYI2Jrr5tWJhPFCO49DQgpv7GQjPP vjEG.MlNxta8y6nIFQZRuALcCNDq_9qswiTENcf0Uf5sypSYBS3245G_V9AWwzJvuLULtalVwCY6 sx1cbS1.LShWoVVc5UUtgiNWbCE990uAI9SVu1gkOGs6LnR7Dnilk3Lj7xqXBPD9ZOabsqCUyfMf qVWCWzSKeFHIJkh9WonesgIjiK80PAq4k9_LWaPHIbTB5ukkpaMwSFTCLNy1iUnAVG20UB28O0zY 5WcbM2y3FBYZ4sDHAT3cqStZXqkZMlfHbu_cYrZQxyXO1E9e.C_jb4tkmjZc8MEq_Gn4yktG7ot3 Sm92xRWWZzSzFjIOyCqn9suq.25JxYLyuEMuwKUv0HvZbPrywxU_JSyydOQJFoh4084o2NraH85U a84hReCoRsVdtxmEKUaUYJbLnbxpPyXQO3XD9Q73RJEyRtYcuo2matQR.d58hSbmbhZ0vtFm9j1. .EUGv8_nECm5CM2DKuvoDleeHf_j5TV7PVHC5S9h3MRRHhK8peQNA_czmLaqoNnlHVbo5bpA1Atb oWrOxb_f6aXAC0dL0U66mk6WKzJ1Up9V1PFvjjAx8o_O2QzswQrCtrIUNUOqtsXhW4fRVch5wWlG 9Y9MM4Biou5ISJFTwP1S7g6ljDGs25DksS9vsJn8b3qUyBXEkJgILLr7rCurs8Zgia1BdDF4y4q2 VcfYwGifuHVBeoH7IhA0tHKz9BuMxCitk4c7DyaMY_VWtJQzg9Ae4LFqa.FUDiGCchZz_Hoj3QZz puKg6w2NXER5.Zy918DiaZDG4e8Xdr.t.pxjhE6szulcKgLYh7xaTBUDNckqbV.cMOyfhkKuHXoh ZUoHz6IJCOyP7jS9XQutJlJKHbchgWAQaStTUYvPN6xYE9G4yRnz43l2a_aUoj2sIozadUuFj3sO m8xsHUgME6sDCO1pH_UtuRSIPJofVWbmPTurLMTIXtT_FRl4nwj.cP3PF5GD6ztqqh_XxSb.CqXQ c3Daj2ahs3iLcYW0gWmzAFHCPE6IzIXNoBySv8pqA3T_UipJyCE4c2UFv2SaYq4GcY27qgLCp.K9 vP.gruqkAyulMEMy9tY1nE5I7erDP9Mr6MEn00HvQt_7UfjcOQH2HQmvz19mxVryPXrBa4xE.VGx TLoidlhccLzk- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Thu, 16 Feb 2023 04:29:50 +0000 Received: by hermes--production-ne1-746bc6c6c4-z5pmw (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID de6643a0e32d270afe4dd9e851bf388c; Thu, 16 Feb 2023 04:29:47 +0000 (UTC) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: 6926e2699ae5 - main - arm: Add support for using VFP in kernel [td == curthread failed form of panic for bt in gdb] From: Mark Millard In-Reply-To: <3A143148-895F-472B-9AFB-5F1AA0FD1FA0@yahoo.com> Date: Wed, 15 Feb 2023 20:29:35 -0800 Cc: Warner Losh Content-Transfer-Encoding: quoted-printable Message-Id: <782B252E-60AC-4036-BD74-46B95A31B337@yahoo.com> References: <3A143148-895F-472B-9AFB-5F1AA0FD1FA0@yahoo.com> To: "kd@freebsd.org" , "wma@freebsd.org" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spamd-Result: default: False [-3.49 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.987]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.206:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.206:from] X-Rspamd-Queue-Id: 4PHMRh2KFbz4RMY X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On Feb 15, 2023, at 16:08, Mark Millard wrote: > Kornel Dul=C4=99ba wrote on > Date: Sat, 04 Feb 2023 19:22:23 UTC : >=20 >> The branch main has been updated by kd: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6926e2699ae55080f860488895a2a9aa= 6e6d9b4d >>=20 >> commit 6926e2699ae55080f860488895a2a9aa6e6d9b4d >> Author: Kornel Dul=C4=99ba >> AuthorDate: 2023-02-04 12:59:30 +0000 >> Commit: Kornel Dul=C4=99ba >> CommitDate: 2023-02-04 19:21:43 +0000 >>=20 >> arm: Add support for using VFP in kernel >>=20 >> Add missing logic to allow in-kernel VFP usage for ARMv7 NEON. >> The implementation is strongly based on arm64 code. >> It introduces a family of fpu_kern_* functions to enable the usage >> of VFP instructions in kernel. >> Apart from that the existing armv7 VFP logic was modified, >> taking into account that the state of the VFP registers can now >> be modified in the kernel. >>=20 >> Co-developed by: Wojciech Macek >> Sponsored by: Stormshield >> Obtained from: Semihalf >> Reviewed by: andrew >> Differential Revision: https://reviews.freebsd.org/D37419 >> --- >> lib/libthread_db/arch/arm/libpthread_md.c | 21 ++-- >> sys/arm/arm/exec_machdep.c | 49 ++++---- >> sys/arm/arm/machdep.c | 1 + >> sys/arm/arm/machdep_kdb.c | 31 ++++- >> sys/arm/arm/swtch-v6.S | 8 +- >> sys/arm/arm/swtch.S | 8 +- >> sys/arm/arm/vfp.c | 182 +++++++++++++++++++++++++++++- >> sys/arm/arm/vm_machdep.c | 6 +- >> sys/arm/include/fpu.h | 7 ++ >> sys/arm/include/pcb.h | 5 + >> sys/arm/include/reg.h | 12 +- >> sys/arm/include/vfp.h | 17 +++ >> 12 files changed, 293 insertions(+), 54 deletions(-) >=20 > [This is a somewhat adjusted version of a note replying > to a Warner note about a panic someone got during a > process coredump that was happening.] >=20 > Just a possible point, given recent kernel floating > point work: >=20 > I tried to do a typical build and test of some > benchmark programs that I sometimes use that involve > floating point in some of the programs, some use with > multithreading involved. (As FreeBSD and g++ progress > I tend to do this once and a while, not as often on > armv7 as on aarch64.) >=20 > On armv7, I now usually get a message about a failure > of an internal cross-check, which also leads to the > program being stopped early. The messaging from run > to run varies what the failure is, but the runs should > not vary and should not fail the cross-checks --and > previously did not, including when I last tried armv7. > (Not recently.) >=20 > For the specific example failures, the initial serial > (single thread) test with float involved works but the > following multi-thread test in the same program fails > and causes the program to stop when it notices there > is a problem. (On occasion the cross-check does does > not detect a problem.) >=20 > The programs that do not test floating point do not > fail. (Same algorithm on integral types.) These can > involve floating point outside the algorithm > benchmarked, but with no multi-threading involved for > such and no floating point based cross-checks involved. >=20 > At this point it is far from obvious to me how I > would trackdown the specifics of what leads to the > failed cross-checks. But the above is suggestive of > there being problems for armv7 handling of saving > and restoring floating point context for > multi-threading in a process, at least. I've no clue > if such are strictly limited to the floating point > values that show up vs. if there might be wider > memory handling problems that result in the process. >=20 Further runs of the benchmark program show that I also get cross-check failures for single-threaded (the first way it tests). But it turns out that, even for single treaded execution of the algorithm benchmarked, it is not run on the process's initial thread but instead on a created thread. Turns out that for a debug armv7 kernel (debug is not what I normally run) attempting a bt in gdb can lead to a kernel panic (td =3D=3D curthread failed) related to floating point handling: . . . (gdb) br serial_kernel_runner Breakpoint 1 at 0x1db34: serial_kernel_runner. (6 locations) (gdb) br parallel_kernel_runner Breakpoint 2 at 0x1b43c: parallel_kernel_runner. (6 locations) (gdb) run Starting program: = /root/acpphint/acpphint_kernelsamplers_main-OPi+2E-2048MiB-threads_4-ILP32= -FreeBSD_main_n260797_dc1b8c9a846e_32bit-g++_12_O3lto-libc++-cpulockdown=20= . . . Breakpoint 1, serial_kernel_runner = (clock_info=3D..., laps=3D3, memry=3D2, ki=3D...) at = acpphint_kernelrunners.cpp:69 69 static auto serial_kernel_runner (gdb) bt #0 serial_panic: Assertion td =3D=3D curthread failed at = /usr/main-src/sys/arm/arm/exec_machdep.c:103 cpuid =3D 3 time =3D 1676519530 KDB: stack backtrace: db_trace_self() at db_trace_self pc =3D 0xc05f04a0 lr =3D 0xc007ab0c = (db_trace_self_wrapper+0x30) sp =3D 0xe28ea960 fp =3D 0xe28eaa78 db_trace_self_wrapper() at db_trace_self_wrapper+0x30 pc =3D 0xc007ab0c lr =3D 0xc02ddc44 (vpanic+0x140) sp =3D 0xe28eaa80 fp =3D 0xe28eaaa0 r4 =3D 0x00000100 r5 =3D 0x00000000 r6 =3D 0xc0790bb4 r7 =3D 0xc0b1b930 vpanic() at vpanic+0x140 pc =3D 0xc02ddc44 lr =3D 0xc02dda28 (dump_savectx) sp =3D 0xe28eaaa8 fp =3D 0xe28eaaac r4 =3D 0xe28eaad0 r5 =3D 0xbfbfe150 r6 =3D 0xe28eaad0 r7 =3D 0xc076a096 r8 =3D 0xdb8a47f4 r9 =3D 0x00000016 r10 =3D 0x00000040 dump_savectx() at dump_savectx pc =3D 0xc02dda28 lr =3D 0xc05f3354 (get_vfpcontext+0xb8) sp =3D 0xe28eaab4 fp =3D 0xe28eaac8 get_vfpcontext() at get_vfpcontext+0xb8 pc =3D 0xc05f3354 lr =3D 0xc0611148 (cpu_ptrace+0x38) sp =3D 0xe28eaad0 fp =3D 0xe28eabe8 r4 =3D 0xdb75cba0 r5 =3D 0xbfbfe150 cpu_ptrace() at cpu_ptrace+0x38 pc =3D 0xc0611148 lr =3D 0xc0360f4c (kern_ptrace+0x810) sp =3D 0xe28eabf0 fp =3D 0xe28eac70 r4 =3D 0xe583dba0 r5 =3D 0x00000000 r6 =3D 0xdb8a47a8 r10 =3D 0x00000040 kern_ptrace() at kern_ptrace+0x810 pc =3D 0xc0360f4c lr =3D 0xc0360550 (sys_ptrace+0x1cc) sp =3D 0xe28eac78 fp =3D 0xe28eadc0 r4 =3D 0xe583de5c r5 =3D 0xe583dba0 r6 =3D 0xbfbfe150 r7 =3D 0x00000000 r8 =3D 0x00000000 r9 =3D 0xe583de50 r10 =3D 0xdb756730 sys_ptrace() at sys_ptrace+0x1cc pc =3D 0xc0360550 lr =3D 0xc0613b48 (swi_handler+0x170) sp =3D 0xe28eadc8 fp =3D 0xe28eae38 r4 =3D 0xe583dba0 r5 =3D 0x00000001 r6 =3D 0xc090b220 r7 =3D 0x00000000 r8 =3D 0x00000000 r9 =3D 0xe583de50 swi_handler() at swi_handler+0x170 pc =3D 0xc0613b48 lr =3D 0xc05f2d90 (swi_exit) sp =3D 0xe28eae40 fp =3D 0xbfbfe128 r4 =3D 0x00000042 r5 =3D 0x22e61c20 r6 =3D 0xbfbfe150 r7 =3D 0x0000001a r8 =3D 0x00424124 r9 =3D 0x00000108 r10 =3D 0x00000040 swi_exit() at swi_exit pc =3D 0xc05f2d90 lr =3D 0xc05f2d90 (swi_exit) sp =3D 0xe28eae40 fp =3D 0xbfbfe128 KDB: enter: panic [ thread pid 5438 tid 106943 ] Stopped at kdb_enter+0x54: ldrb r15, [r15, r15, ror r15]! Note: the code was built via g++12 but using libc++, not libstdc++. So I tried the b=3Dprogram variant that does not tryin to lock down which CPUs are used by the threads (a completely C++20 standard program variant, not FreeBSD specific for its used source code). Failure again . . . (gdb) br serial_kernel_runner Breakpoint 1 at 0x1c1bc: serial_kernel_runner. (6 locations) (gdb) br parallel_kernel_runner Breakpoint 2 at 0x19ac8: parallel_kernel_runner. (6 locations) (gdb) run Starting program: = /root/acpphint/acpphint_kernelsamplers_main-OPi+2E-2048MiB-threads_4-ILP32= -FreeBSD_main_n260797_dc1b8c9a846e_32bit-g++_12_O3lto-libc++=20 . . . Breakpoint 1, serial_kernel_runner = (clock_info=3D..., laps=3D3, memry=3D2, ki=3D...) at = acpphint_kernelrunners.cpp:69 69 static auto serial_kernel_runner (gdb) bt #0 serial_kernel_runner (clock_info=3D...,panic: = Assertion td =3D=3D curthread failed at = /usr/main-src/sys/arm/arm/exec_machdep.c:103 cpuid =3D 0 time =3D 1676520400 KDB: stack backtrace: db_trace_self() at db_trace_self pc =3D 0xc05f04a0 lr =3D 0xc007ab0c = (db_trace_self_wrapper+0x30) sp =3D 0xe2964960 fp =3D 0xe2964a78 db_trace_self_wrapper() at db_trace_self_wrapper+0x30 pc =3D 0xc007ab0c lr =3D 0xc02ddc44 (vpanic+0x140) sp =3D 0xe2964a80 fp =3D 0xe2964aa0 r4 =3D 0x00000100 r5 =3D 0x00000000 r6 =3D 0xc0790bb4 r7 =3D 0xc0b1b930 vpanic() at vpanic+0x140 pc =3D 0xc02ddc44 lr =3D 0xc02dda28 (dump_savectx) sp =3D 0xe2964aa8 fp =3D 0xe2964aac r4 =3D 0xe2964ad0 r5 =3D 0xbfbfe158 r6 =3D 0xe2964ad0 r7 =3D 0xc076a096 r8 =3D 0xdb7a511c r9 =3D 0x00000016 r10 =3D 0x00000040 dump_savectx() at dump_savectx pc =3D 0xc02dda28 lr =3D 0xc05f3354 (get_vfpcontext+0xb8) sp =3D 0xe2964ab4 fp =3D 0xe2964ac8 get_vfpcontext() at get_vfpcontext+0xb8 pc =3D 0xc05f3354 lr =3D 0xc0611148 (cpu_ptrace+0x38) sp =3D 0xe2964ad0 fp =3D 0xe2964be8 r4 =3D 0xdb7ca3e0 r5 =3D 0xbfbfe158 cpu_ptrace() at cpu_ptrace+0x38 pc =3D 0xc0611148 lr =3D 0xc0360f4c (kern_ptrace+0x810) sp =3D 0xe2964bf0 fp =3D 0xe2964c70 r4 =3D 0xdb76fba0 r5 =3D 0x00000000 r6 =3D 0xdb7a50d0 r10 =3D 0x00000040 kern_ptrace() at kern_ptrace+0x810 pc =3D 0xc0360f4c lr =3D 0xc0360550 (sys_ptrace+0x1cc) sp =3D 0xe2964c78 fp =3D 0xe2964dc0 r4 =3D 0xdb76fe5c r5 =3D 0xdb76fba0 r6 =3D 0xbfbfe158 r7 =3D 0x00000000 r8 =3D 0x00000000 r9 =3D 0xdb76fe50 r10 =3D 0xdb754000 sys_ptrace() at sys_ptrace+0x1cc pc =3D 0xc0360550 lr =3D 0xc0613b48 (swi_handler+0x170) sp =3D 0xe2964dc8 fp =3D 0xe2964e38 r4 =3D 0xdb76fba0 r5 =3D 0x00000001 r6 =3D 0xc090b220 r7 =3D 0x00000000 r8 =3D 0x00000000 r9 =3D 0xdb76fe50 swi_handler() at swi_handler+0x170 pc =3D 0xc0613b48 lr =3D 0xc05f2d90 (swi_exit) sp =3D 0xe2964e40 fp =3D 0xbfbfe130 r4 =3D 0x00000042 r5 =3D 0x22e61c20 r6 =3D 0xbfbfe158 r7 =3D 0x0000001a r8 =3D 0x00424124 r9 =3D 0x00000108 r10 =3D 0x00000040 swi_exit() at swi_exit pc =3D 0xc05f2d90 lr =3D 0xc05f2d90 (swi_exit) sp =3D 0xe2964e40 fp =3D 0xbfbfe130 KDB: enter: panic [ thread pid 1107 tid 100140 ] Stopped at kdb_enter+0x54: ldrb r15, [r15, r15, ror r15]! For reference (whitespace may not have been preserved): void get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) { struct pcb *pcb; =20 MPASS(td =3D=3D curthread); =20 pcb =3D td->td_pcb; if ((pcb->pcb_fpflags & PCB_FP_STARTED) !=3D 0) { critical_enter(); vfp_store(&pcb->pcb_vfpstate, false); critical_exit(); } KASSERT(pcb->pcb_vfpsaved =3D=3D &pcb->pcb_vfpstate, ("Called get_vfpcontext while the kernel is using the = VFP")); memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg, sizeof(vfp->mcv_reg)); vfp->mcv_fpscr =3D pcb->pcb_vfpstate.fpscr; } Unfortunately the benchmark program is far from being a minimalist/simple example. I'm not sure what FreeBSD might have around that would have floating point in use but be simple, and possibly standardly available, to see if a simpler context is available for analogous testing. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Thu Feb 16 07:15:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHR6P1lsYz3pGbK; Thu, 16 Feb 2023 07:15:09 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher 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 "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHR6N2tQzz3DhC; Thu, 16 Feb 2023 07:15:08 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1676531705; 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=lBeg3bRGOBPQJ33XTpCK/pt/ZEZZQQFl+ecnpBjs+tc=; b=WdMK31hkcvoBdlfrwaY45qxXJOEP3Kx1FiSnwIL7j/KUd3e4aXWZ9X+lqqjnsHgIm76mud evBXv7uu+yrM5iIU7+y9RNwJEzJRVJ5Iv2dExAKS/ZsmhXfiLla8lbJLaW0x7gUEJw6W1W KAew7LWZ6TjCQMJWKcFMDgp7/6Jee0o= Received: from skull.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 3cc80d8a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 16 Feb 2023 07:15:05 +0000 (UTC) Date: Thu, 16 Feb 2023 08:15:01 +0100 From: Emmanuel Vadot To: Jessica Clarke Cc: =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: b1a9e570fe2d - main - linuxkpi: Add `strscpy_pad()` to Message-Id: <20230216081501.506e86584558eeb315a9314f@bidouilliste.com> In-Reply-To: References: <202302152226.31FMQQV8093715@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PHR6N2tQzz3DhC X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Wed, 15 Feb 2023 22:27:31 +0000 Jessica Clarke wrote: > On 15 Feb 2023, at 22:26, Jean-S=E9bastien P=E9dron wrote: > >=20 > > The branch main has been updated by dumbbell (ports committer): > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Db1a9e570fe2da0a43c41327d= 7ce21b27bf8257b8 > >=20 > > commit b1a9e570fe2da0a43c41327d7ce21b27bf8257b8 > > Author: Jean-S=E9bastien P=E9dron > > AuthorDate: 2023-02-14 23:46:13 +0000 > > Commit: Jean-S=E9bastien P=E9dron > > CommitDate: 2023-02-15 22:19:41 +0000 > >=20 > > linuxkpi: Add `strscpy_pad()` to > >=20 > > It's the same as `strscpy()` except that it fills the rest of the > > destination buffer with zeroes if the source buffer is shorter. > >=20 > > Reviewed by: manu > > Approved by: manu > > --- > > sys/compat/linuxkpi/common/include/linux/string.h | 9 +++++++++ > > 1 file changed, 9 insertions(+) > >=20 > > diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/co= mpat/linuxkpi/common/include/linux/string.h > > index 65422cac629c..20c3729aaf12 100644 > > --- a/sys/compat/linuxkpi/common/include/linux/string.h > > +++ b/sys/compat/linuxkpi/common/include/linux/string.h > > @@ -207,6 +207,15 @@ strscpy(char* dst, const char* src, size_t len) > > return (-E2BIG); > > } > >=20 > > +static inline ssize_t > > +strscpy_pad(char* dst, const char* src, size_t len) > > +{ > > + >=20 > style(9) doesn?t need this blank line any more, please stop including > them in your commits. >=20 > Jess style(9) says that it's optional and we have them in a lot of files (including in some of the functions in this file). If you really hate them you should see how to update style(9) to say that we should never include a blank line. Making something optional is perfect to ensure that you will have both ways of doing thing in the code. > > + bzero(dst, len); > > + > > + return (strscpy(dst, src, len)); > > +} > > + > > static inline void * > > memset32(uint32_t *b, uint32_t c, size_t len) > > { >=20 --=20 Emmanuel Vadot From nobody Thu Feb 16 07:30:37 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHRSG0DyCz3pHcq; Thu, 16 Feb 2023 07:30: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 4PHRSF6vmSz3Gfq; Thu, 16 Feb 2023 07:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676532638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qDdr6QhOt62mlP1aq1K8YtwZkbO23B4EG92C1NSy3UU=; b=D/dRJAcrL/yX9zdvjlIY8j35V245qy5t0IehAzGmfvP7B2SL8Y7l8kcvHYQiqTbxOzhi+0 61eGEPjTnFPc6upLq0aHBWTKL7vfADakgeFP9edyGcAXAXx7s+HlYQO7K//OW5KiWJaLn/ WPbAeX15XcaJIj0+RwuuJp9xTcQMqbWu2ulQgWtbc4kFEYt5e7a9x4Nl6eM9eJ7so5rkB4 jS7HhFyN8sMpG7Raro6MupOSPt04+04pmESsYOe8+Sz0lOI0fdxc2uF92YXbLtEC/iVOJW CN/mhl9jR0hQdiumEF+zoMCSKPd+9kMUMYFyY38UBgSe7zs1/XaoPeXu4RLnnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676532638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qDdr6QhOt62mlP1aq1K8YtwZkbO23B4EG92C1NSy3UU=; b=Z+NJk7lq6e6SSgO698tTA7NHcHYFwURBFb21VLx10jF50qAq72aEa5Dw2HG8WUkgWzHUqq RsWUH64CU31me4rTCSDFLG+ohnoUuR2ynnnbCEQVWzRnyO5aIRC/hwbAC2q7jhf3oxZb7x VFKOaQPWzcW9XD3Acr5il026aofBoJrND5vr5M+5eCPBekE6y1hjqpfhgHdWzYrT60z6bq 1OQXT1T8Wo3U/IpDorToNd/FA+sdM4mnue28Dz1qJMSIz+AiomnIVfANjUeBO5ljFHxj6R Cgd0A3hvSbkbRIkby6dCMjDmrSngcvGXFJnUmsoY9j/WhWnDZRGWY/Ashfzq+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676532638; a=rsa-sha256; cv=none; b=Kvk16qL80u8mE9Xf+jtJKf1xEQMWmTIFLeUAYXFxsV6NsHmokH7bo8/Sjz6qm7Cqs5DRWz vOSdrEqJI6cM0rvDX9TX5io3/pEdp8p/fuEDpV7auRjmQRk53B0LOkFTs68Eqb56Dj92VN CtwkXhjiQRsDvEk8NB8bn5BtMkh02NUwWWvh49BSlV4rwOJsvHdQ5tYmio04lpdOQnKcSs vCEV+jB8hN/fkptuZDCYu5pFDWwJ/8eOQlv64e6GfebI/K8lWBZgReDgT7N21MVtl676Eb qXS72fs6pFIh90uHJPHpM7cjom3s/ibQlLnoUMJ5R4QHaY2LyVms3C9u6NR8mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHRSF5yPmzw4h; Thu, 16 Feb 2023 07:30: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 31G7Ubnc082244; Thu, 16 Feb 2023 07:30:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G7Ubpr082243; Thu, 16 Feb 2023 07:30:37 GMT (envelope-from git) Date: Thu, 16 Feb 2023 07:30:37 GMT Message-Id: <202302160730.31G7Ubpr082243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 6b9acd1bfba7 - main - Exclude MMCCAM kernels from make universe List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b9acd1bfba70c96ac89817fcf8d221d2387be60 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6b9acd1bfba70c96ac89817fcf8d221d2387be60 commit 6b9acd1bfba70c96ac89817fcf8d221d2387be60 Author: Mateusz Guzik AuthorDate: 2023-02-08 22:02:16 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-16 07:29:53 +0000 Exclude MMCCAM kernels from make universe They don't provide any value and are quite arbitrary. Note arm64 GENERIC-MMCCAM was already excluded, just not the NODEBUG variant. The option is already build-tested with arm64 LINT kernel. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D38458 --- sys/amd64/conf/GENERIC-MMCCAM | 2 ++ sys/arm/conf/GENERIC-MMCCAM | 2 ++ sys/arm64/conf/GENERIC-MMCCAM-NODEBUG | 2 ++ 3 files changed, 6 insertions(+) diff --git a/sys/amd64/conf/GENERIC-MMCCAM b/sys/amd64/conf/GENERIC-MMCCAM index 8a5bc7175d68..0aa7a7da1072 100644 --- a/sys/amd64/conf/GENERIC-MMCCAM +++ b/sys/amd64/conf/GENERIC-MMCCAM @@ -2,6 +2,8 @@ # and testing on bhyve # $FreeBSD$ +#NO_UNIVERSE + include MINIMAL ident GENERIC-MMCCAM diff --git a/sys/arm/conf/GENERIC-MMCCAM b/sys/arm/conf/GENERIC-MMCCAM index 20ca990d1c3e..0e36756d2241 100644 --- a/sys/arm/conf/GENERIC-MMCCAM +++ b/sys/arm/conf/GENERIC-MMCCAM @@ -5,6 +5,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include GENERIC ident GENERIC-MMCCAM diff --git a/sys/arm64/conf/GENERIC-MMCCAM-NODEBUG b/sys/arm64/conf/GENERIC-MMCCAM-NODEBUG index 803b5fd25416..319f31984dd2 100644 --- a/sys/arm64/conf/GENERIC-MMCCAM-NODEBUG +++ b/sys/arm64/conf/GENERIC-MMCCAM-NODEBUG @@ -7,6 +7,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include GENERIC-MMCCAM include "../../conf/std.nodebug" From nobody Thu Feb 16 07:33:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHRX62Z8hz3pJ6B; Thu, 16 Feb 2023 07:33: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 4PHRX61vbcz3Gyq; Thu, 16 Feb 2023 07:33:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676532838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lwgg6vJJMuJg43LWSg/aQjcXmDetQO9ScrojyUUCE6U=; b=QTwXrtXzq+g0TgXzZPGPKMmCw1CWALRov2mFpNqFMWhMSX9AHd0ZRf4qk2cKbQ74pFqSH9 I6pJNnpyS8SQ3rY/T0ZkvfFlJKIOai4Q1oV3MYniu1LoEwrzlalM5qQ0RzdiJgmNbc+kdx tfC6V2XsoFHbE9JTb8GNDCrvKDu8pMKflBqY2zoDAOTYX3hXVN0gyUKt8J0bQyOPa9Khlq yGVg5kykInB9movM9k5l2bKch4ZFW/+L/ljr4K8UpY26iq9TUwhdWxurqC3R6n9YbzhqG/ aY/ZfaRJXA2sPEgUR5B0Aop8wsl9rALwJrBXGWwgrMdeDgMXOl4Ya1Aoi/NjRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676532838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lwgg6vJJMuJg43LWSg/aQjcXmDetQO9ScrojyUUCE6U=; b=FyN1VIvhcLyVLy96XWUOCNVVMDH+2iY0EHokQNVX4aGra5Rk92D751K+6Z0j0jCALKKjp/ HzXYhnjw86ra3/tex/elAOa85A9ZBaTUhmMf9ZV1Dzf/XdsqEh4fFd3/ekSXXNewC7BeBd VjlczCp08qavasaxhhluRFr0ledAlafzmfc7y6AqeJxF//JcLXz7Fsq+qBBelrtJ4LBl8t xyfackXarxd16oqrnxN8CyD0MGy6dkjmj8nmqck1AfJHmh+lFK1hAoGKDRqbWx96Huo3OQ fQdfWp6VchN+h822rQk5lZ0e2UMh2C4qQjeKrcM6tBJRqB89M3s8PXD7f0gdWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676532838; a=rsa-sha256; cv=none; b=muEaNMjpoDsMASpYlO488fO/1w3bPdFgT3LtnRHAK9jS5kGHClilRIqNO0EHGzQA82ddtM 0MMuRgqK9ehrtTkrZnCuldpfDsu7Is9HbDBKrOKAXyEPpTj4Eg2nhf3evUm2Jkwre0LxoH trYiNEGJFYONztStYe2mpWEp0oPLLKpE+7Nbu/7Fu8j+QgkQ7XQbqkdDdx/8gRkVyo+tqs hPYWC8E1+6uDifF59zkBvnW+M8n31gvSInSHG7mS9BGHH5tzdbppViokl9PeebvMTmrWmy uRXsqtwO7zeCQAOwq+jVdn5SOwXrLv+xql4BEVsd8uNRIRwSQyfGgzYEqo9lyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHRX60zhDzwPr; Thu, 16 Feb 2023 07:33: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 31G7Xwca084575; Thu, 16 Feb 2023 07:33:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G7Xww1084574; Thu, 16 Feb 2023 07:33:58 GMT (envelope-from git) Date: Thu, 16 Feb 2023 07:33:58 GMT Message-Id: <202302160733.31G7Xww1084574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 889a9acc5475 - main - ipsec: only update lastused when it changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 889a9acc54758922b3529ea473a2dac159d85fd5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=889a9acc54758922b3529ea473a2dac159d85fd5 commit 889a9acc54758922b3529ea473a2dac159d85fd5 Author: Mateusz Guzik AuthorDate: 2023-02-08 09:53:05 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-16 07:33:51 +0000 ipsec: only update lastused when it changes to limit cache-line bouncing. Note that as there is no atomic_store we are hoping the compiler wont speculatively do the store. It is not employed because the size depends on target arch. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D38433 --- sys/netipsec/key.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 345c302c2a80..62aa99019437 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -917,6 +917,7 @@ key_allocsp(struct secpolicyindex *spidx, u_int dir) struct spdcache_entry *entry, *lastentry, *tmpentry; struct secpolicy *sp; uint32_t hashv; + time_t ts; int nb_entries; if (!SPDCACHE_ACTIVE()) { @@ -969,7 +970,9 @@ key_allocsp(struct secpolicyindex *spidx, u_int dir) out: if (sp != NULL) { /* found a SPD entry */ - sp->lastused = time_second; + ts = time_second; + if (__predict_false(sp->lastused != ts)) + sp->lastused = ts; KEYDBG(IPSEC_STAMP, printf("%s: return SP(%p)\n", __func__, sp)); KEYDBG(IPSEC_DATA, kdebug_secpolicy(sp)); From nobody Thu Feb 16 08:09:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHSKN6njMz3pLBY for ; Thu, 16 Feb 2023 08:09:44 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-23.consmr.mail.gq1.yahoo.com (sonic304-23.consmr.mail.gq1.yahoo.com [98.137.68.204]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHSKN0gGRz3KwC for ; Thu, 16 Feb 2023 08:09:44 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=eUoO4Yvu; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.68.204 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676534981; bh=oOYKSK1rE5isRvVk+U51MRf06ACA8ZOzxBemqx/oFsY=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=eUoO4YvuxaDfAbFskzThnobW19Dzupm3eC0hCMUzmkocSVx8jhijbAeLjPLINFT9cDOCfAnUaUeLlryrFCYo00nqRMUCtBySNoNGzgpk73O75Ln/epwgZ/VRpMt39wZN7LZ1NR4XklXlTZH6BDj1OO9CoFkQcS4hXvHH3g1BPCgYd2TsgO8zWFG4NWWh1R5DZlIy6pdCgfgywAYQ2bg+2ttO3zj2vEEQIbiKPxl3p9kjPz+/M4zckyKH+Q5ZduODS6gBE17yVHhLZ5SkDGP4hBmOxqOrJ+zRwe9YT2jWYzubQc5Hrx3LUtbn27o2PVHfMb0/kNthOY4yasLne1wS0A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676534981; bh=n9lzeYXMthixdUy9FzGSjmnI8nKgEFDGKziI0xwGbLQ=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=bsVCyVqOB10o56wFO3VyMco7+iwBY37vSdGgKAMJcttSpgHw6Yc4EQHUHwKhBGdD7KYZS21qRCbDdew0dp5F4bizTO91qbyEWK7Ct4VlQJolRufPKxNORqgFQIgfJvOEUC105ijhxez0xJuy3a9inRfuhv0WeVAQMBCBY3yfIHvAH6z7RCVRYhu3V45xwcHMrcBFMT+yGd2i2ju6gKI5bFS6E+UmZdS2Wcw6EbS90B09HUidvgUZOc+KR2J9KiYHH3eZqnbzgJ76/OXPfGqjdc3nmUCBHJ/rRLXMOrY/LJNQvU2OSXmay9ooAZNxhQwyvpEbTr1lM8lh/ZEruEuL/g== X-YMail-OSG: 1p328XwVM1kQ9HkYNX_cFFQSAPtsZEtdK2vP4nUbpe0ISSNJ4OY0pcD_OMl9esy 8UMxxW5HOJDk4Gw7TUyc5mpnQtPnpdKOpuTESqICvu4XikdwNQCDawwMBQWhtyoVCm_oXc9H8uR8 tLOTqU6A_Mc2og_VjneTW8c5rOUEvwYA.M27bfRCMjv0PdaALktybdZh5n6rizLlwQHTsitbbGr6 X0QbxCDDvEspD8xgSl9sAru6NR2GVHDqhTDBvjkc6ddJbMM4VqVtakSPLbendx551rC_16FNgqis PqB4aJxcT9kRw2u3S4ISt5gRTKS2u_1BtXNRmS07SOEG_S9vDP.zsN_X6z_eXe_Ln3hmKG8BALvj GdyOSadLlkokWpXnFO2kd.pkfWK6Vbyi0RE4ZBzc8OGcR5eqxqQZbcASEAD4iOlsUwzo9ysBwSlM VJCxP5v0EydJIkNC5bXv5rOeyc.0P_xH.bIfzz5QyimPpwhjUrBAbAOdsCPynRMWexqkGs6Jux5D ASPHS2y8PXavJrgDOr_FxMw6lNkTIcIdNEX7tqhdSBZkT1O9L71r64vDbpfhc3lEZf1aB7BSG5Ix iGTU7PW4KdFBGZ35Ms0PnJVd7_dGu4Wzwh79RwoVRIwKVO01jq25T01GXuGl8FpEDz_YfFta6i8b lYUqvT2zTT8rQECnK7eri1JMEUkx1YBimhubgU752tQA8cMpuLzpRrvDwZKkN507IWV.fe_F7xxQ gSayyMyD5Dh22HrG3WMrSyZxUv6.aQOOx5cDR4YXhwE_gn.EGC3gtA_Rg6GUCAh7kopVkBSqeT7E a74nJ0qOEpbLwA31vRwSxFlaPmsAOAdiiW0xVT0Uwcem9MoDTWuIYS5CbBAjbGOG2Dn73HTdzc4r aV0.lkAKB_Z_yg28MjMGDrYfcRcLzF8j4KI_Cc9FPChpa92vUz29Zj__VT_7I_IdiiQDn6uFfLoT VRLi06wmeHIhqQzTxkkQNmcpvexeji9OnwVnWgWyfcH4EVDi4Un4e9qWl9p05eE2xK7IB3A2eLc2 eZhkU7HAoB_PVEzRxOYxktAF1CNlEH52VgdcVcoYv9Rg8AEieETF3LPlVBHdWDvtnwQbVThERWwS yqgEwzyrtryNzZ6J3t6taFKlegFwUjnDxn_qbmHsfy3C7Vu5YZtwWLPE_3x9MEUlCr_Pbopb90VQ ct1y9VayO2Zlaq1ypdusjo4qtsi95.9grq8OFDIz5fze4rBn4KpTbne_S_0uwB.2O9SfL30q_YfT ckxjjzO8gNYfTsr6U6adLzcKC.cB5I4QSe76c76c6o4THotRrEBdrh.f4ZHnHeKZNJlHQjTbU2Cq o2Jo0FiPB6Zpx9oOWCHmlFuOmCgADJwMj8TmDyALujYI.wRIirHjpdxiTQ.nR472wVLWUTh.o1PB LV4hLU4HOgSvp12fuCAp3Nt344FwmzcJ4grtsm.1BthiRosJOpWri.T343kr2Y6e.rigvLMx9vbm VJIkBe.9NcmIK5p1tmkRGXEtZIIvNn3_2bHCshKwEonqP89pE2UvHYdmUzYMYy1aDZHNLFJC3MLz uDQTznNYNkpy0A_42_zpR5LzeF7hvfvlbAHZAi2Fu5hhOxOuAIHw94DZ_gMPyugKahdO0r1UCwCP aBW4GtwwGwOyKHogkfXllJDwPIUPw23QoM0.Ar7hRoNSMcGG18mCavONdNrgKbQN7S_sbspxMVv9 nssMdjxceobSLd1r5wLiA2Fk20w4CxMatwIRZZpYTMX5xcwxfke9bqO4ZVvF4LsQ01ysLIBbSxRs 3gTUAB9xpOuffn.no8xsZeex6fVXKE0oRaTb__jK0fZogq1wu0_DCHOvGWhYzYpTu22shjjBslI2 DT_N_4MOjPYPOSnZDEwAVMo7bBx.gy8iLj9tmqSRDfzHfEHy4fU0vYrzTXnVJATie4m7mkguslT2 ZEFzz3KfbipwMO__ToxbBN.bkKfRe_DqjDAy4N0TjvbbX6lt7ICVymEGQ3JxuL7dURhaZLfo9E3h 55k452T.27WNBAsvt_.LqTcrt8yMM1zinEQmgeN2JTzXCbla_4fp5vovZ7TqplUUrd3528OvFeWY BRqeU63bISYOQHP4lvwQz46l.rknGK7VdmUnFMLQfFPMwwugZImmC3YLqjLDaKRlFFGwfth50OPh tNbi4R1XFRK_8f9xlnLKRX7jy1LKiU2aquScZUQaR0RDlxvvH2swueQkipIvMyXOFVJl9t2DyZuc 8QYe5knGe76_joxzq58mx_1DRIbtCRv_uOj47VmKTq6BFCXRkqsBaLwkkQYevw8CmrY32ADbdCdi AV0UqE_Qmjww- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Thu, 16 Feb 2023 08:09:41 +0000 Received: by hermes--production-ne1-746bc6c6c4-z5pmw (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 63c00f088dc36bb07658408ae644663e; Thu, 16 Feb 2023 08:09:37 +0000 (UTC) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: 6926e2699ae5 - main - arm: Add support for using VFP in kernel [td == curthread failed form of panic for bt in gdb] From: Mark Millard In-Reply-To: <782B252E-60AC-4036-BD74-46B95A31B337@yahoo.com> Date: Thu, 16 Feb 2023 00:09:26 -0800 Cc: Warner Losh Content-Transfer-Encoding: quoted-printable Message-Id: <4F9A3687-9577-4419-AE1B-D02A4C9212ED@yahoo.com> References: <3A143148-895F-472B-9AFB-5F1AA0FD1FA0@yahoo.com> <782B252E-60AC-4036-BD74-46B95A31B337@yahoo.com> To: "kd@freebsd.org" , "wma@freebsd.org" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spamd-Result: default: False [-3.45 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.95)[-0.947]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.204:from]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org] X-Rspamd-Queue-Id: 4PHSKN0gGRz3KwC X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N [A very simple program gets the failure under gdb or lldb of example breakpoints.] On Feb 15, 2023, at 20:29, Mark Millard wrote: > On Feb 15, 2023, at 16:08, Mark Millard wrote: >=20 >> Kornel Dul=C4=99ba wrote on >> Date: Sat, 04 Feb 2023 19:22:23 UTC : >>=20 >>> The branch main has been updated by kd: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6926e2699ae55080f860488895a2a9aa= 6e6d9b4d >>>=20 >>> commit 6926e2699ae55080f860488895a2a9aa6e6d9b4d >>> Author: Kornel Dul=C4=99ba >>> AuthorDate: 2023-02-04 12:59:30 +0000 >>> Commit: Kornel Dul=C4=99ba >>> CommitDate: 2023-02-04 19:21:43 +0000 >>>=20 >>> arm: Add support for using VFP in kernel >>>=20 >>> Add missing logic to allow in-kernel VFP usage for ARMv7 NEON. >>> The implementation is strongly based on arm64 code. >>> It introduces a family of fpu_kern_* functions to enable the usage >>> of VFP instructions in kernel. >>> Apart from that the existing armv7 VFP logic was modified, >>> taking into account that the state of the VFP registers can now >>> be modified in the kernel. >>>=20 >>> Co-developed by: Wojciech Macek >>> Sponsored by: Stormshield >>> Obtained from: Semihalf >>> Reviewed by: andrew >>> Differential Revision: https://reviews.freebsd.org/D37419 >>> --- >>> lib/libthread_db/arch/arm/libpthread_md.c | 21 ++-- >>> sys/arm/arm/exec_machdep.c | 49 ++++---- >>> sys/arm/arm/machdep.c | 1 + >>> sys/arm/arm/machdep_kdb.c | 31 ++++- >>> sys/arm/arm/swtch-v6.S | 8 +- >>> sys/arm/arm/swtch.S | 8 +- >>> sys/arm/arm/vfp.c | 182 +++++++++++++++++++++++++++++- >>> sys/arm/arm/vm_machdep.c | 6 +- >>> sys/arm/include/fpu.h | 7 ++ >>> sys/arm/include/pcb.h | 5 + >>> sys/arm/include/reg.h | 12 +- >>> sys/arm/include/vfp.h | 17 +++ >>> 12 files changed, 293 insertions(+), 54 deletions(-) >>=20 >> [This is a somewhat adjusted version of a note replying >> to a Warner note about a panic someone got during a >> process coredump that was happening.] >>=20 >> Just a possible point, given recent kernel floating >> point work: >>=20 >> I tried to do a typical build and test of some >> benchmark programs that I sometimes use that involve >> floating point in some of the programs, some use with >> multithreading involved. (As FreeBSD and g++ progress >> I tend to do this once and a while, not as often on >> armv7 as on aarch64.) >>=20 >> On armv7, I now usually get a message about a failure >> of an internal cross-check, which also leads to the >> program being stopped early. The messaging from run >> to run varies what the failure is, but the runs should >> not vary and should not fail the cross-checks --and >> previously did not, including when I last tried armv7. >> (Not recently.) >>=20 >> For the specific example failures, the initial serial >> (single thread) test with float involved works but the >> following multi-thread test in the same program fails >> and causes the program to stop when it notices there >> is a problem. (On occasion the cross-check does does >> not detect a problem.) >>=20 >> The programs that do not test floating point do not >> fail. (Same algorithm on integral types.) These can >> involve floating point outside the algorithm >> benchmarked, but with no multi-threading involved for >> such and no floating point based cross-checks involved. >>=20 >> At this point it is far from obvious to me how I >> would trackdown the specifics of what leads to the >> failed cross-checks. But the above is suggestive of >> there being problems for armv7 handling of saving >> and restoring floating point context for >> multi-threading in a process, at least. I've no clue >> if such are strictly limited to the floating point >> values that show up vs. if there might be wider >> memory handling problems that result in the process. >>=20 >=20 > Further runs of the benchmark program show that I also > get cross-check failures for single-threaded (the first > way it tests). >=20 > But it turns out that, even for single treaded execution > of the algorithm benchmarked, it is not run on the > process's initial thread but instead on a created thread. >=20 > Turns out that for a debug armv7 kernel (debug is not > what I normally run) attempting a bt in gdb can lead to > a kernel panic (td =3D=3D curthread failed) related to > floating point handling: >=20 > . . . > (gdb) br serial_kernel_runner > Breakpoint 1 at 0x1db34: serial_kernel_runner. (6 locations) > (gdb) br parallel_kernel_runner > Breakpoint 2 at 0x1b43c: parallel_kernel_runner. (6 locations) > (gdb) run > Starting program: = /root/acpphint/acpphint_kernelsamplers_main-OPi+2E-2048MiB-threads_4-ILP32= -FreeBSD_main_n260797_dc1b8c9a846e_32bit-g++_12_O3lto-libc++-cpulockdown=20= > . . . >=20 > Breakpoint 1, serial_kernel_runner = (clock_info=3D..., laps=3D3, memry=3D2, ki=3D...) at = acpphint_kernelrunners.cpp:69 > 69 static auto serial_kernel_runner > (gdb) bt > #0 serial_panic: Assertion td =3D=3D curthread failed at = /usr/main-src/sys/arm/arm/exec_machdep.c:103 > cpuid =3D 3 > time =3D 1676519530 > KDB: stack backtrace: > db_trace_self() at db_trace_self > pc =3D 0xc05f04a0 lr =3D 0xc007ab0c = (db_trace_self_wrapper+0x30) > sp =3D 0xe28ea960 fp =3D 0xe28eaa78 > db_trace_self_wrapper() at db_trace_self_wrapper+0x30 > pc =3D 0xc007ab0c lr =3D 0xc02ddc44 (vpanic+0x140) > sp =3D 0xe28eaa80 fp =3D 0xe28eaaa0 > r4 =3D 0x00000100 r5 =3D 0x00000000 > r6 =3D 0xc0790bb4 r7 =3D 0xc0b1b930 > vpanic() at vpanic+0x140 > pc =3D 0xc02ddc44 lr =3D 0xc02dda28 (dump_savectx) > sp =3D 0xe28eaaa8 fp =3D 0xe28eaaac > r4 =3D 0xe28eaad0 r5 =3D 0xbfbfe150 > r6 =3D 0xe28eaad0 r7 =3D 0xc076a096 > r8 =3D 0xdb8a47f4 r9 =3D 0x00000016 > r10 =3D 0x00000040 > dump_savectx() at dump_savectx > pc =3D 0xc02dda28 lr =3D 0xc05f3354 (get_vfpcontext+0xb8) > sp =3D 0xe28eaab4 fp =3D 0xe28eaac8 > get_vfpcontext() at get_vfpcontext+0xb8 > pc =3D 0xc05f3354 lr =3D 0xc0611148 (cpu_ptrace+0x38) > sp =3D 0xe28eaad0 fp =3D 0xe28eabe8 > r4 =3D 0xdb75cba0 r5 =3D 0xbfbfe150 > cpu_ptrace() at cpu_ptrace+0x38 > pc =3D 0xc0611148 lr =3D 0xc0360f4c (kern_ptrace+0x810) > sp =3D 0xe28eabf0 fp =3D 0xe28eac70 > r4 =3D 0xe583dba0 r5 =3D 0x00000000 > r6 =3D 0xdb8a47a8 r10 =3D 0x00000040 > kern_ptrace() at kern_ptrace+0x810 > pc =3D 0xc0360f4c lr =3D 0xc0360550 (sys_ptrace+0x1cc) > sp =3D 0xe28eac78 fp =3D 0xe28eadc0 > r4 =3D 0xe583de5c r5 =3D 0xe583dba0 > r6 =3D 0xbfbfe150 r7 =3D 0x00000000 > r8 =3D 0x00000000 r9 =3D 0xe583de50 > r10 =3D 0xdb756730 > sys_ptrace() at sys_ptrace+0x1cc > pc =3D 0xc0360550 lr =3D 0xc0613b48 (swi_handler+0x170) > sp =3D 0xe28eadc8 fp =3D 0xe28eae38 > r4 =3D 0xe583dba0 r5 =3D 0x00000001 > r6 =3D 0xc090b220 r7 =3D 0x00000000 > r8 =3D 0x00000000 r9 =3D 0xe583de50 > swi_handler() at swi_handler+0x170 > pc =3D 0xc0613b48 lr =3D 0xc05f2d90 (swi_exit) > sp =3D 0xe28eae40 fp =3D 0xbfbfe128 > r4 =3D 0x00000042 r5 =3D 0x22e61c20 > r6 =3D 0xbfbfe150 r7 =3D 0x0000001a > r8 =3D 0x00424124 r9 =3D 0x00000108 > r10 =3D 0x00000040 > swi_exit() at swi_exit > pc =3D 0xc05f2d90 lr =3D 0xc05f2d90 (swi_exit) > sp =3D 0xe28eae40 fp =3D 0xbfbfe128 > KDB: enter: panic > [ thread pid 5438 tid 106943 ] > Stopped at kdb_enter+0x54: ldrb r15, [r15, r15, ror r15]! >=20 > Note: the code was built via g++12 but using libc++, > not libstdc++. >=20 > So I tried the b=3Dprogram variant that does not tryin to > lock down which CPUs are used by the threads (a completely > C++20 standard program variant, not FreeBSD specific for > its used source code). Failure again . . . >=20 > (gdb) br serial_kernel_runner > Breakpoint 1 at 0x1c1bc: serial_kernel_runner. (6 locations) > (gdb) br parallel_kernel_runner > Breakpoint 2 at 0x19ac8: parallel_kernel_runner. (6 locations) > (gdb) run > Starting program: = /root/acpphint/acpphint_kernelsamplers_main-OPi+2E-2048MiB-threads_4-ILP32= -FreeBSD_main_n260797_dc1b8c9a846e_32bit-g++_12_O3lto-libc++=20 > . . . > Breakpoint 1, serial_kernel_runner = (clock_info=3D..., laps=3D3, memry=3D2, ki=3D...) at = acpphint_kernelrunners.cpp:69 > 69 static auto serial_kernel_runner > (gdb) bt > #0 serial_kernel_runner (clock_info=3D...,panic:= Assertion td =3D=3D curthread failed at = /usr/main-src/sys/arm/arm/exec_machdep.c:103 > cpuid =3D 0 > time =3D 1676520400 > KDB: stack backtrace: > db_trace_self() at db_trace_self > pc =3D 0xc05f04a0 lr =3D 0xc007ab0c = (db_trace_self_wrapper+0x30) > sp =3D 0xe2964960 fp =3D 0xe2964a78 > db_trace_self_wrapper() at db_trace_self_wrapper+0x30 > pc =3D 0xc007ab0c lr =3D 0xc02ddc44 (vpanic+0x140) > sp =3D 0xe2964a80 fp =3D 0xe2964aa0 > r4 =3D 0x00000100 r5 =3D 0x00000000 > r6 =3D 0xc0790bb4 r7 =3D 0xc0b1b930 > vpanic() at vpanic+0x140 > pc =3D 0xc02ddc44 lr =3D 0xc02dda28 (dump_savectx) > sp =3D 0xe2964aa8 fp =3D 0xe2964aac > r4 =3D 0xe2964ad0 r5 =3D 0xbfbfe158 > r6 =3D 0xe2964ad0 r7 =3D 0xc076a096 > r8 =3D 0xdb7a511c r9 =3D 0x00000016 > r10 =3D 0x00000040 > dump_savectx() at dump_savectx > pc =3D 0xc02dda28 lr =3D 0xc05f3354 (get_vfpcontext+0xb8) > sp =3D 0xe2964ab4 fp =3D 0xe2964ac8 > get_vfpcontext() at get_vfpcontext+0xb8 > pc =3D 0xc05f3354 lr =3D 0xc0611148 (cpu_ptrace+0x38) > sp =3D 0xe2964ad0 fp =3D 0xe2964be8 > r4 =3D 0xdb7ca3e0 r5 =3D 0xbfbfe158 > cpu_ptrace() at cpu_ptrace+0x38 > pc =3D 0xc0611148 lr =3D 0xc0360f4c (kern_ptrace+0x810) > sp =3D 0xe2964bf0 fp =3D 0xe2964c70 > r4 =3D 0xdb76fba0 r5 =3D 0x00000000 > r6 =3D 0xdb7a50d0 r10 =3D 0x00000040 > kern_ptrace() at kern_ptrace+0x810 > pc =3D 0xc0360f4c lr =3D 0xc0360550 (sys_ptrace+0x1cc) > sp =3D 0xe2964c78 fp =3D 0xe2964dc0 > r4 =3D 0xdb76fe5c r5 =3D 0xdb76fba0 > r6 =3D 0xbfbfe158 r7 =3D 0x00000000 > r8 =3D 0x00000000 r9 =3D 0xdb76fe50 > r10 =3D 0xdb754000 > sys_ptrace() at sys_ptrace+0x1cc > pc =3D 0xc0360550 lr =3D 0xc0613b48 (swi_handler+0x170) > sp =3D 0xe2964dc8 fp =3D 0xe2964e38 > r4 =3D 0xdb76fba0 r5 =3D 0x00000001 > r6 =3D 0xc090b220 r7 =3D 0x00000000 > r8 =3D 0x00000000 r9 =3D 0xdb76fe50 > swi_handler() at swi_handler+0x170 > pc =3D 0xc0613b48 lr =3D 0xc05f2d90 (swi_exit) > sp =3D 0xe2964e40 fp =3D 0xbfbfe130 > r4 =3D 0x00000042 r5 =3D 0x22e61c20 > r6 =3D 0xbfbfe158 r7 =3D 0x0000001a > r8 =3D 0x00424124 r9 =3D 0x00000108 > r10 =3D 0x00000040 > swi_exit() at swi_exit > pc =3D 0xc05f2d90 lr =3D 0xc05f2d90 (swi_exit) > sp =3D 0xe2964e40 fp =3D 0xbfbfe130 > KDB: enter: panic > [ thread pid 1107 tid 100140 ] > Stopped at kdb_enter+0x54: ldrb r15, [r15, r15, ror r15]! >=20 > For reference (whitespace may not have > been preserved): >=20 > void > get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) > { > struct pcb *pcb; >=20 > MPASS(td =3D=3D curthread); >=20 > pcb =3D td->td_pcb; > if ((pcb->pcb_fpflags & PCB_FP_STARTED) !=3D 0) { > critical_enter(); > vfp_store(&pcb->pcb_vfpstate, false); > critical_exit(); > } > KASSERT(pcb->pcb_vfpsaved =3D=3D &pcb->pcb_vfpstate, > ("Called get_vfpcontext while the kernel is using the = VFP")); > memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg, > sizeof(vfp->mcv_reg)); > vfp->mcv_fpscr =3D pcb->pcb_vfpstate.fpscr; > } >=20 > Unfortunately the benchmark program is far from being a > minimalist/simple example. >=20 > I'm not sure what FreeBSD might have around that would > have floating point in use but be simple, and possibly > standardly available, to see if a simpler context is > available for analogous testing. >=20 The program, an example way to build it such that it can lead to crashes, and 2 ways to get the FreeBSD crash with it (native armv7 context): // # cc -std=3Dc17 -pedantic -g -O3 simple_dbl.c // // # gdb a.out // (gdb) br test // (gdb) run // FreeBSD CRASHES // // # lldb a.out // (lldb) br set -F test // FreeBSD CRASHES #include _Bool test(double v) { return v<0.5; } int main(void) { return test(drand48()); } =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Thu Feb 16 08:26:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHShc2k1vz3pLwx; Thu, 16 Feb 2023 08: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 4PHShc2DlLz3NG5; Thu, 16 Feb 2023 08: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=1676535984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzIOO+xNeZz7Ap3Ey6KETUDWIU6hNvs8LXeIXbW3Z3I=; b=utbhegPCVAxwi94FWNsCNtgQKujoyC0ltSzOrT3raaMy9Mt8gT6VeMRg2Ns1gFMcDdsrAt AcPDzqUtQjbsPQ3izPc8v66xNYYwhpBiR0Vw2+/Bn9DNFGGwddtFeIsQPmZgN6Y+PzmQne +sBOpNZF5mB+KY8lfk7LcuH9ORy5yXKGEXAVASqekFWrURgDP45zuHBrX/L8ZBV0lKpZ9i de44UOBxuHsY6qPo9ID+WH0kkN1D2o3wgTATSELvO91NSF55DSFbXDglILkn0bzlKqiaxe hXDjn4NvNjeD0Wq0c0a3ceFMoD6QCQ9ifALQTR0D7XioT60Y0xYKuy1nOoO2mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676535984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzIOO+xNeZz7Ap3Ey6KETUDWIU6hNvs8LXeIXbW3Z3I=; b=DH082i0/oHq/ueXXx2kO9pQyAg96vfMekczcdQmkkiUQaLnFA6j5ZXNtoZ+dLI4VcbVFwV VcbIs5xoMF4f66SVHi8UDgYS6vZwfyjHkq78VhMVsMCMKKhk1PFlc20WWUv6mkJss5HFq4 NHkhbsIW+P9VSxxn5I6Mx2laBCSvUysShIjsai0MatCRIlFhbmby5sdyNcVUXztI0i5knc pfdt030UZt5891OR7yeqJzz5txj/zis6NtU040mBoRIfgL8Mv+D5j6MrYO/N3Bi/ir18KY YgdvQtvBmJs0EjHpqZkKk0O7mU9kbUHWtf2G7kRvyiwuD4Ygu0PhTQKzubD77A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676535984; a=rsa-sha256; cv=none; b=mnGiHd9Cif/edbcBbnFFmZqmB/gFANRa14t6NtUhrWmgYoTv+S+9RKoD2Kue4znMeRJTip 3YAKqXOdT++UpUIIps5SNV4KxwQywmtN/Rat+J3VCyRAiVfONsOVVPpGVKW3RhGHVmGf72 tVrdaOjd6ugUo3aRb+3+WuCfjufVBkugtIGOqUNVZHxZaKXmbTZFpPXfsVWyMPMC/7J6HE Ruq+B08T8HYXj4dTu3WCeHf/GtzssDxGlA69+O24iIqkM8lU84TL0ozUFjeBTDxZah87/G HTHtIt/gqHW7KVSV0VvXUnmGNkHxjlB3pkxQcvmeE5QZmu0mZsdKQP7Z1TG8KQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHShc1J3VzxGy; Thu, 16 Feb 2023 08: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 31G8QOsn055941; Thu, 16 Feb 2023 08: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 31G8QO3c055940; Thu, 16 Feb 2023 08:26:24 GMT (envelope-from git) Date: Thu, 16 Feb 2023 08:26:24 GMT Message-Id: <202302160826.31G8QO3c055940@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: 9a1cab6d79b7 - main - pfsync: support deferring IPv6 packets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a1cab6d79b7286e5f650f57ed95625e6ddb8e4b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9a1cab6d79b7286e5f650f57ed95625e6ddb8e4b commit 9a1cab6d79b7286e5f650f57ed95625e6ddb8e4b Author: Kristof Provost AuthorDate: 2023-02-14 06:11:38 +0000 Commit: Kristof Provost CommitDate: 2023-02-16 06:43:04 +0000 pfsync: support deferring IPv6 packets When we send out a deferred packet we must make sure to call ip6_output() for IPv6 packets. If not we might end up attempting to ip_fragment() an IPv6 packet, which could lead to us reading outside of the mbuf. PR: 268246 Reviewed by: melifaro, zlei MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38586 --- sys/netpfil/pf/if_pfsync.c | 91 +++++++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 33 deletions(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 2301dc475e27..1c8d8d325346 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -103,9 +103,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include struct pfsync_bucket; +struct pfsync_softc; union inet_template { struct ip ipv4; @@ -171,6 +175,7 @@ static void pfsync_q_ins(struct pf_kstate *, int, bool); static void pfsync_q_del(struct pf_kstate *, bool, struct pfsync_bucket *); static void pfsync_update_state(struct pf_kstate *); +static void pfsync_tx(struct pfsync_softc *, struct mbuf *); struct pfsync_upd_req_item { TAILQ_ENTRY(pfsync_upd_req_item) ur_entry; @@ -187,8 +192,6 @@ struct pfsync_deferral { struct mbuf *pd_m; }; -struct pfsync_sofct; - struct pfsync_bucket { int b_id; @@ -1837,13 +1840,7 @@ pfsync_defer_tmo(void *arg) free(pd, M_PFSYNC); PFSYNC_BUCKET_UNLOCK(b); - switch (sc->sc_sync_peer.ss_family) { -#ifdef INET - case AF_INET: - ip_output(m, NULL, NULL, 0, NULL, NULL); - break; -#endif - } + pfsync_tx(sc, m); pf_release_state(st); @@ -2326,6 +2323,56 @@ pfsync_push_all(struct pfsync_softc *sc) } } +static void +pfsync_tx(struct pfsync_softc *sc, struct mbuf *m) +{ + struct ip *ip; + int error, af; + + ip = mtod(m, struct ip *); + MPASS(ip->ip_v == IPVERSION || ip->ip_v == (IPV6_VERSION >> 4)); + + af = ip->ip_v == IPVERSION ? AF_INET : AF_INET6; + + /* + * We distinguish between a deferral packet and our + * own pfsync packet based on M_SKIP_FIREWALL + * flag. This is XXX. + */ + switch (af) { +#ifdef INET + case AF_INET: + if (m->m_flags & M_SKIP_FIREWALL) { + error = ip_output(m, NULL, NULL, 0, + NULL, NULL); + } else { + error = ip_output(m, NULL, NULL, + IP_RAWOUTPUT, &sc->sc_imo, NULL); + } + break; +#endif +#ifdef INET6 + case AF_INET6: + if (m->m_flags & M_SKIP_FIREWALL) { + error = ip6_output(m, NULL, NULL, 0, + NULL, NULL, NULL); + } else { + MPASS(false); + /* We don't support pfsync over IPv6. */ + /*error = ip6_output(m, NULL, NULL, + IP_RAWOUTPUT, &sc->sc_imo6, NULL);*/ + } + break; +#endif + } + + if (error == 0) + V_pfsyncstats.pfsyncs_opackets++; + else + V_pfsyncstats.pfsyncs_oerrors++; + +} + static void pfsyncintr(void *arg) { @@ -2333,7 +2380,7 @@ pfsyncintr(void *arg) struct pfsync_softc *sc = arg; struct pfsync_bucket *b; struct mbuf *m, *n; - int c, error; + int c; NET_EPOCH_ENTER(et); CURVNET_SET(sc->sc_ifp->if_vnet); @@ -2353,29 +2400,7 @@ pfsyncintr(void *arg) n = m->m_nextpkt; m->m_nextpkt = NULL; - /* - * We distinguish between a deferral packet and our - * own pfsync packet based on M_SKIP_FIREWALL - * flag. This is XXX. - */ - switch (sc->sc_sync_peer.ss_family) { -#ifdef INET - case AF_INET: - if (m->m_flags & M_SKIP_FIREWALL) { - error = ip_output(m, NULL, NULL, 0, - NULL, NULL); - } else { - error = ip_output(m, NULL, NULL, - IP_RAWOUTPUT, &sc->sc_imo, NULL); - } - break; -#endif - } - - if (error == 0) - V_pfsyncstats.pfsyncs_opackets++; - else - V_pfsyncstats.pfsyncs_oerrors++; + pfsync_tx(sc, m); } } CURVNET_RESTORE(); From nobody Thu Feb 16 09:19:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHTsL2mlhz3pvHN; Thu, 16 Feb 2023 09:19: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 4PHTsL2GMzz3pvx; Thu, 16 Feb 2023 09:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676539142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cVF6GX+vUsO+IpQGMsnyWDYqxbCI8q0VHMh1qo7Jxlw=; b=GweqY2AbUliq+DnobVcThtSTPJ6Eh9+6zBYxKxs7Vs+KRs+gbz5F0fOs8I+qfc406TQuIk X5Fvuupsmb4kWbTgghcS5CUNB38gFyBXjYMkXUpbklSh8lNe6oono3x2Nu3apnv3H5TTpn 3gZcA6yQ6zsBZZqsMD/73hw7w7aSMqbjD4USFb6NTKtlgfTAU9x7bN2cj0KULk2Zo5Lak+ 0d72NfvWzuxdATJsx/42v2XVwvoa1UoMEAKwc+IUJL8ShDpMzh9oZ4+QA4w5B4pala18qY EDdSNOMMinIiaua36xPnhaIZ9UZA8AoOrlH17Hwm3jVn45urMl2yb0b56/jPCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676539142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cVF6GX+vUsO+IpQGMsnyWDYqxbCI8q0VHMh1qo7Jxlw=; b=TQVrFi9EN2UTLcumhwkDFdRWTxyrjBmhkE/LKZk4hW+piH1VUptmRV9ODGed9OLe9neCsx 2YLVa27wIulh7Jr517EDhVV2/q08I8n4hC9pHu5soc5uDvXxlUsEhNTpB/wnyOZIjcD2nv nku2hR+25bfrso+axETNEQ00NdOv+JTNF3SCI+iG/sPyOBpnlpTtFZeD5EmWgztVbDQaBh agwenqmLtXutrSV7mJUHZt9f6PxPyu5KlnQoezChxnSJlDxISTMC0rBe+s02X93DHb0BXF CxoYqcvd8Y7hXyaqRc/bAnTXZUNcyRGmM8yt9TYXhr5z0o6mC2NrzWiVZx9Z1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676539142; a=rsa-sha256; cv=none; b=OtGOv42oPaJ7gYGZ5hNn5kRO/aNc0VR4lWl5LpnXw2R4zxxJVNawNgLNLYCWGiEKDBSKp2 MwfjaMughl7JaL9Ocn9ePKwPdtE0hPwRUu8Z7cwPCTopFHLuhfIUgT1zqhC6M5gvZ25dHo lz6jWXG81yEPZggYleb+/mGmRdYyffbWTbKpADf+2vKki5Ra4JuZiXevzUiWMecyVmOcKX Y5iW9yIgMJK16RlbyJg3/7Eel0tudG0WWHFlV1r3Zb3IWM1j4Efn1cj2hPLWolIVGtySeJ Sju4PgpmaddBXjAhpTzEcuAsBC0jCPyzLMI6Pe561bCi1MuLEI5f3WIkfNp0YQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHTsL1BMnzygS; Thu, 16 Feb 2023 09:19: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 31G9J2p5028084; Thu, 16 Feb 2023 09:19:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G9J2md028083; Thu, 16 Feb 2023 09:19:02 GMT (envelope-from git) Date: Thu, 16 Feb 2023 09:19:02 GMT Message-Id: <202302160919.31G9J2md028083@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: f52ca3dfd552 - main - pfsync: ensure 'error' is always initialised List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f52ca3dfd5520332e8cb8d08eda1b92aca2a159c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f52ca3dfd5520332e8cb8d08eda1b92aca2a159c commit f52ca3dfd5520332e8cb8d08eda1b92aca2a159c Author: Kristof Provost AuthorDate: 2023-02-16 08:16:35 +0000 Commit: Kristof Provost CommitDate: 2023-02-16 08:16:35 +0000 pfsync: ensure 'error' is always initialised Reported by: Herbert J. Skuhra MFC after: 2 weeks --- sys/netpfil/pf/if_pfsync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 1c8d8d325346..f1130ba143f1 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -2327,7 +2327,7 @@ static void pfsync_tx(struct pfsync_softc *sc, struct mbuf *m) { struct ip *ip; - int error, af; + int af, error = 0; ip = mtod(m, struct ip *); MPASS(ip->ip_v == IPVERSION || ip->ip_v == (IPV6_VERSION >> 4)); From nobody Thu Feb 16 13:39:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHbfQ60P6z3qSGJ; Thu, 16 Feb 2023 13:39: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 4PHbfQ5DDCz3PmZ; Thu, 16 Feb 2023 13:39:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676554798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qCb70ACFU72123PFp+gR6zav2SJ3t3YLHezuXfVjJ9Q=; b=rNDZcOtYIZJYvyKvmiXq0ws7i9ng8unIKqyPFYFbjIniIcN5/+0SbxpryyUCrjpizQctkS 1ksGTejqV+DA45AYYKwhfy+lGG4vJEKAxJLdYKI0dI3q3nfe9kEryx8ODZ1m8fdn+2/0cV qqTDfsgVfL4l6SdzgaBXHU7A+aojGiIwwX/zb+asgP1Pu9urx7VqiGcdWepmjqh6DdxFbA qtz/S1bpNc13Et4Egl8j7lDwRxV7RYTGZwkumRrk7KRvWQF9j2Riviuqw8XUz0Gzqy6lvc 9db7JZNxfVMpFvkv8aDAgWZLgV2MI5fvKhZKlAA3Pdh8ukZHMNNOIoZj73bqVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676554798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qCb70ACFU72123PFp+gR6zav2SJ3t3YLHezuXfVjJ9Q=; b=dUUP/MwR7JasCfZWdOA5tn7jtrUyXQDo+knzuoLSSQ+0EZl1HPWTKXBQUXGsaeBaF+XWRa 7wyylwrGIJ35HN8gFWYOuHt5GmSnCkb9TT0siT7F4DXCdvloM2qAjZvN/wEcG/VY+EFOrG glXQ80K0vaOKqEXV4gqDw3JWGUAr+1AGY4CDpMekmaomYXtxk6QAId5SX6alY0bXSQ57no 7anyrbHsCzeqmqYw89nxb4ASKj9fMcc8dl+9NAUY1wDI4l4N5ah41cvLoBX5aMj+aC6ROH HMcKL9rXyhWX/FRx3yFcSOZTf8Byiu2Iti0QZemDYfFs37RniI9rezkvuRe1Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676554798; a=rsa-sha256; cv=none; b=Q3HckYOcTCUTIHrdC27bNy8iIb1h69NUNDGF+mh+X3zyIWOtC678rgL7cbaV1uTus33Ae+ KjjPvurPECCKNsU1V3l1XbyuCC+fVn+Alp2xmqKub11MWpuupN6iMC3mW7nutfLykJ0q6f CCHSkSwFWJamuBauL+scvCjYbum/5rdgKqjviJE9vfDOBjFIkHMKxK1uPMINyeHp8fvm07 71ccwJjN+IRCj0NwYaM26SftmmGs8LIiwOcqSlD4PS+aHzaLfTM9sDKRPobqTKCTEzJ1SN W1U9fDPjYoCQNrPbDO/G3Bl6uucMl6QFH+g4NiP0/Z4l1Wfbr4BLZqeQ2fAAEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHbfQ4J2Tz15RJ; Thu, 16 Feb 2023 13:39: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 31GDdwMN000575; Thu, 16 Feb 2023 13:39:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GDdw2R000574; Thu, 16 Feb 2023 13:39:58 GMT (envelope-from git) Date: Thu, 16 Feb 2023 13:39:58 GMT Message-Id: <202302161339.31GDdw2R000574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 86fd0bdba540 - main - netlink: fix interface dump. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86fd0bdba540132ae298457e160b651f61d1db6b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=86fd0bdba540132ae298457e160b651f61d1db6b commit 86fd0bdba540132ae298457e160b651f61d1db6b Author: Alexander V. Chernikov AuthorDate: 2023-02-16 13:17:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-16 13:20:45 +0000 netlink: fix interface dump. The current code missed interface addition when reallocating temporary buffer. Tweak the code to perform the reallocation first and add interface afterwards unconditionally. Reported by: Marek Zarychta MFC after: 3 days --- sys/netlink/route/iface.c | 33 ++++++++++--------- tests/sys/netlink/test_rtnl_iface.py | 61 ++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 17 deletions(-) diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 9cd7e6e80f3c..0eafacff4775 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -449,24 +449,23 @@ rtnl_handle_getlink(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *n CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { wa.count++; if (match_iface(&attrs, ifp)) { - if (offset < base_count) { - if (!if_try_ref(ifp)) - continue; - match_array[offset++] = ifp; - continue; - } - /* Too many matches, need to reallocate */ - struct ifnet **new_array; - int sz = base_count * sizeof(void *); - base_count *= 2; - new_array = malloc(sz * 2, M_TEMP, M_NOWAIT); - if (new_array == NULL) { - error = ENOMEM; - break; + if (offset >= base_count) { + /* Too many matches, need to reallocate */ + struct ifnet **new_array; + int sz = base_count * sizeof(void *); + base_count *= 2; + new_array = malloc(sz * 2, M_TEMP, M_NOWAIT); + if (new_array == NULL) { + error = ENOMEM; + break; + } + memcpy(new_array, match_array, sz); + free(match_array, M_TEMP); + match_array = new_array; } - memcpy(new_array, match_array, sz); - free(match_array, M_TEMP); - match_array = new_array; + + if (if_try_ref(ifp)) + match_array[offset++] = ifp; } } NET_EPOCH_EXIT(et); diff --git a/tests/sys/netlink/test_rtnl_iface.py b/tests/sys/netlink/test_rtnl_iface.py index ecc932c6213e..cbe5aed8b8ae 100644 --- a/tests/sys/netlink/test_rtnl_iface.py +++ b/tests/sys/netlink/test_rtnl_iface.py @@ -242,6 +242,67 @@ class TestRtNlIface(NetlinkTestTemplate, SingleVnetTestTemplate): assert rx_msg.is_type(NlMsgType.NLMSG_ERROR) assert rx_msg.error_code == errno.ENODEV + @pytest.mark.require_user("root") + def test_dump_ifaces_many(self): + """Tests if interface dummp is not missing interfaces""" + + ifmap = {} + for ifname in (self.vnet.iface_alias_map["if1"].name, "lo0"): + ifindex = socket.if_nametoindex(ifname) + ifmap[ifindex] = ifname + + for i in range(40): + ifname = "lo{}".format(i + 1) + flags = NlmNewFlags.NLM_F_EXCL.value | NlmNewFlags.NLM_F_CREATE.value + msg = NetlinkIflaMessage(self.helper, NlRtMsgType.RTM_NEWLINK.value) + msg.nl_hdr.nlmsg_flags = ( + flags | NlmBaseFlags.NLM_F_ACK.value | NlmBaseFlags.NLM_F_REQUEST.value + ) + msg.add_nla(NlAttrStr(IflattrType.IFLA_IFNAME, ifname)) + msg.add_nla( + NlAttrNested( + IflattrType.IFLA_LINKINFO, + [ + NlAttrStrn(IflinkInfo.IFLA_INFO_KIND, "lo"), + ], + ) + ) + + rx_msg = self.get_reply(msg) + assert rx_msg.is_type(NlMsgType.NLMSG_ERROR) + nla_list, _ = rx_msg.parse_attrs(bytes(rx_msg.cookie)[4:], rtnl_ifla_attrs) + nla_map = {n.nla_type: n for n in nla_list} + assert nla_map[IflattrType.IFLA_IFNAME.value].text == ifname + ifindex = nla_map[IflattrType.IFLA_NEW_IFINDEX.value].u32 + assert ifindex > 0 + assert ifindex not in ifmap + ifmap[ifindex] = ifname + + # Dump all interfaces and check if the output matches ifmap + kernel_ifmap = {} + msg = NetlinkIflaMessage(self.helper, NlRtMsgType.RTM_GETLINK.value) + msg.nl_hdr.nlmsg_flags = ( + NlmBaseFlags.NLM_F_ACK.value | NlmBaseFlags.NLM_F_REQUEST.value + ) + self.write_message(msg) + while True: + rx_msg = self.read_message() + if msg.nl_hdr.nlmsg_seq != rx_msg.nl_hdr.nlmsg_seq: + raise ValueError( + "unexpected seq {}".format(rx_msg.nl_hdr.nlmsg_seq) + ) + if rx_msg.is_type(NlMsgType.NLMSG_ERROR): + raise ValueError("unexpected message {}".format(rx_msg)) + if rx_msg.is_type(NlMsgType.NLMSG_DONE): + break + if not rx_msg.is_type(NlRtMsgType.RTM_NEWLINK): + raise ValueError("unexpected message {}".format(rx_msg)) + + ifindex = rx_msg.base_hdr.ifi_index + assert ifindex == rx_msg.base_hdr.ifi_index + kernel_ifmap[ifindex] = rx_msg.get_nla(IflattrType.IFLA_IFNAME).text + assert kernel_ifmap == ifmap + # # * # * {len=76, type=RTM_NEWLINK, flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_EXCL|NLM_F_CREATE, seq=1662892737, pid=0}, From nobody Thu Feb 16 15:42:10 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHfMQ5F63z3qbHv; Thu, 16 Feb 2023 15:42: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 4PHfMQ4dNXz3vPB; Thu, 16 Feb 2023 15:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676562130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+rkUfXKbESOvTPkhiGw3D4CqaOxQsYDZDwuAx8sbOA=; b=qc0X3lkx12zDBb67eyeqYQzLe7q1rmzR42069Z0i4ilyZzNyk4cyN8Jo021yCCyydYReVT wM/5zp8K9WOivh0kK6ayZ3gd2xHhuou6ZWW2hEAjkcnszVCQy/IJS/8hlpPayIqpL8oECs P1mGTTWTU3RHmhZOMXV4vebhMckyi6axkB0iAXm4tsvp13xEtEjf6E7Bjg6bQY6M2K86ZG pHqs5lfVnc8rBZW3I/AlwoASj3Y/+WJR9d1dXQJmV4lojSJbpcxjj2HW0fSQlH3IVd23a7 PKl5t0l9kiUBLJ+sqr3KU3pRLLGpfgCkk54YdRYlfuGrdNVtLGS2PVWs8FlqUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676562130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+rkUfXKbESOvTPkhiGw3D4CqaOxQsYDZDwuAx8sbOA=; b=tvP5N2SiftX2oOrTB7oBsKkGhDndt4HKQFBU1pgFqjrnkj4Z1SgvW0u0EwYAjGsj93yhkW 4Nj/XA7Lrg0VAb/iLttotVwTIiz8SeTotUXiuann7M1J2AHQmHVOrtrBSMJedOznKoNsYv M1tZDRtN6rSFIUS0uL99/qjAYUU9Zr0pfa85NZuwDewTy8QFYMj1JvTyGIvQElma6QSH/U Try8dyqjTmsAAFBY2Z1H29hcMaQPf37QoYHsRB2rldwMZYWXS+kEv3vQ7dWXJyGtSD53ur cvYpycqW1pyPhWKaY2ZX7d5tDvj2itHRXanRCFf3v85KErrNkXttOEQCDlqa+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676562130; a=rsa-sha256; cv=none; b=nZHTBsWWAktBHB3ESkFgHpp/X2VZNcoqf064ssxAbLYoSfaRdG1DL93zkz8GY4Awxs6Yju 2KqwxEligVwCrEFGq1zHRhFhfVVqxjPqHuknI1CUq1VO3nu1ZdoKgpTFqQIA6y0kloQZ8j s8J3UOJff1e5oCcl8A+gYLiypgfd3/f7mhN0p21FWhcqAnDH1XWnBqEigMYQkLRG92eVH0 kxAMvUwkQwXlVQQnYUrBEGXHdyaYdOBMM8JbgY346Ci27cZ7DviJNYGNliNcSXxKJAnAlY df2+bMW0H+1umz/NnvH7u8Mej+gC4wY1aHoOp/sESiZ4Hnc7yNSPi4L/VAS4iA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHfMQ3N1Mz18NN; Thu, 16 Feb 2023 15:42: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 31GFgAad084326; Thu, 16 Feb 2023 15:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GFgAFu084325; Thu, 16 Feb 2023 15:42:10 GMT (envelope-from git) Date: Thu, 16 Feb 2023 15:42:10 GMT Message-Id: <202302161542.31GFgAFu084325@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: 6d1c946e9168 - main - libpcap: Make pcap/bpf.h a wrapper around system net/bpf.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 6d1c946e916845d01062e146aad5395410da1e54 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrm (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6d1c946e916845d01062e146aad5395410da1e54 commit 6d1c946e916845d01062e146aad5395410da1e54 Author: Joseph Mingrone AuthorDate: 2023-02-13 22:06:51 +0000 Commit: Joseph Mingrone CommitDate: 2023-02-16 15:37:51 +0000 libpcap: Make pcap/bpf.h a wrapper around system net/bpf.h In the past, we modified pcap/pcap.h to include the system net/bpf.h rather than libpcap's own pcap/bpf.h. However, starting around 1.10.2, libpcap requires a few extern functions defined in pcap/bpf.h to build. Simply reverting that local change and pulling in pcap/bpf.h is not a solution, because some ports with '#include ' such as mail/spamd and net/xprobe require the system net/bpf.h to be pulled in. To accommodate both requirements, make pcap/bpf.h a wrapper around the system net/bpf.h, but retain the extern function definitions. This is in preparation for libpcap 1.10.3. Approved by: cy, philip, emaste, delphij (earlier revision) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38575 --- contrib/libpcap/pcap/bpf.h | 16 ++++++++++++++++ contrib/libpcap/pcap/pcap.h | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/contrib/libpcap/pcap/bpf.h b/contrib/libpcap/pcap/bpf.h index 9d748952a0e5..1c9d0f56a01a 100644 --- a/contrib/libpcap/pcap/bpf.h +++ b/contrib/libpcap/pcap/bpf.h @@ -74,6 +74,18 @@ extern "C" { #endif +/* + * In the past, we modified pcap/pcap.h to include the system net/bpf.h, + * rather than this file. However, starting around 1.10.2, libpcap requires + * the extern functions defined here to build. Simply reverting that local + * change is not a solution, because some ports with '#include ' + * such as mail/spamd and net/xprobe require the system net/bpf.h to be + * pulled in. To accommodate both requirements, make this header a wrapper + * around the system net/bpf.h, but keep the extern function definitions. + */ +#if defined(__FreeBSD__) +#include +#else /* BSD style release date */ #define BPF_RELEASE 199606 @@ -244,13 +256,17 @@ struct bpf_insn { #define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } #define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } +#endif /* defined(__FreeBSD__) */ + PCAP_API int bpf_validate(const struct bpf_insn *, int); PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); +#if !defined(__FreeBSD__) /* * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). */ #define BPF_MEMWORDS 16 +#endif #ifdef __cplusplus } diff --git a/contrib/libpcap/pcap/pcap.h b/contrib/libpcap/pcap/pcap.h index a2d6003cdf61..4e30e77812ef 100644 --- a/contrib/libpcap/pcap/pcap.h +++ b/contrib/libpcap/pcap/pcap.h @@ -85,7 +85,10 @@ #endif /* _WIN32/MSDOS/UN*X */ #include /* for SOCKET, as the active-mode rpcap APIs use it */ -#include + +#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H +#include +#endif #include From nobody Thu Feb 16 15:58:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHfkb2PGnz3r6tP; Thu, 16 Feb 2023 15:58: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 4PHfkb1kKnz3xS2; Thu, 16 Feb 2023 15:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oq8NCuPjnb4AtTF56MxM8CQWYgGbO5K319/xPNnTTY0=; b=hk1SZLiF6EnqlO/+QQE0Fj2AxqxPqyf7pP/LYO6eRXSd1dYAFydGyXxe2d+6CjPDcLMZJi Z35rmUtWxbcnSanj+gH/rUob26qKsTDiiZs+wlQJeJDWuWRVY9hsCET5cGZTBQndjL54Bp DrRTTG4dc6RYxcMPWSkKw8eQs71pvtG37NIb/AakRHPGAWzd5czj/k2H6A8laLklv6AZPa SaXAvgrkg1HXJ3pau7PaOUVxBol+ie36cO1DGdmsyrkwVO45wKy/4JSlld2YSLUN3WrNYj PGUV5ktZZq8cOu8V5bVDR8v9HqK2qMGXSmaollpsWxEdCHP4s5lMSoGFCZ1CNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oq8NCuPjnb4AtTF56MxM8CQWYgGbO5K319/xPNnTTY0=; b=wiUPwcAU5GfvHddVIbRXv9l8+kLvY9vbUfmcWz2pattOReOXjtuQUg7K/agvzjXQm8beC5 diMKBheKwX8xHRtZpG8ODwC2I6WwEDA/dlRg4Jh6WyKglU2t/YU4ezMHQz+xTZ3WLPIvtw fyv4+zgeEf3rzaiDN2MgFj6RDUS0WwMauB73rYpPc8MIJSURgLnQPQ3YloIedjQf96+zRh WUiy6G/oaLL86HYvS6QpgTH+SmjDmDWkbe+Rp52bqQd952fMrGGy63tycFYaChuDDtT1bT U8C0L2gDdxus+HLOz8RoSnkhKOCcl07vPtz35rXDIQzG0pLJSe9xBNmzCv/tVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676563127; a=rsa-sha256; cv=none; b=fneaKh2xERkq+2CL5FHXEkUpq/PKI7+iE3PrfvKdBDmSaRjCUVR7VtlkYDIKV6n5MU5Cfs tXu00FS6rGZ6KQUXX0IEoJkGV8k4YnR0YXaYO6d6JuPFm/ETN6X/W+1WsMCAqUhZlBVEz3 pba2Yot08473XHCxNkdO8hsW+Vy+1YycQvFqSJR1gzRly46rg8druCpRk6TXi3Lo5XGDN8 tDgyHbidiRAAcIc/HgceBokrdngDMTGMKzQGDq2/UIhEwBNo58iBUT2kh7TjtMsPwHAXLd nB6db1ulqd/HJuNM2ZIfNomvcjFE/qpCZTZkVOrZQ7VAle2HHC4Ws9DI2dSN5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHfkb0hNtz18dn; Thu, 16 Feb 2023 15:58: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 31GFwkrT099956; Thu, 16 Feb 2023 15:58:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GFwkTS099955; Thu, 16 Feb 2023 15:58:46 GMT (envelope-from git) Date: Thu, 16 Feb 2023 15:58:46 GMT Message-Id: <202302161558.31GFwkTS099955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ccf2121d59ac - main - efivar: Try harder to find label's efimedia List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ccf2121d59ac51e1a0287d75262d48018d09cad6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ccf2121d59ac51e1a0287d75262d48018d09cad6 commit ccf2121d59ac51e1a0287d75262d48018d09cad6 Author: Warner Losh AuthorDate: 2023-02-16 15:53:15 +0000 Commit: Warner Losh CommitDate: 2023-02-16 15:54:39 +0000 efivar: Try harder to find label's efimedia If there's no efimedia attribute on the provider, and the provider's a glabel, then find the 'parent' geom. In this case, the provider's name is label-type/name, but the geom's label will that of the underlying device (eg ada0p1). If it is, recurisvely call find_geom_efimedia with the geom's name, which shuold have the efimedia attribute. Sponsored by: Netflix Reviewed by: corvink, manu, asomers Differential Revision: https://reviews.freebsd.org/D38614 --- lib/libefivar/efivar-dp-xlate.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libefivar/efivar-dp-xlate.c b/lib/libefivar/efivar-dp-xlate.c index 1b30d1dfb143..effc8a2de475 100644 --- a/lib/libefivar/efivar-dp-xlate.c +++ b/lib/libefivar/efivar-dp-xlate.c @@ -527,6 +527,15 @@ find_geom_efimedia(struct gmesh *mesh, const char *dev) if (pp == NULL) return (NULL); efimedia = geom_pp_attr(mesh, pp, "efimedia"); + + /* + * If this device doesn't hav an efimedia attribute, see if it is a + * glabel node, and if so look for the underlying provider to get the + * efimedia attribute from. + */ + if (efimedia == NULL && + strcmp(pp->lg_geom->lg_class->lg_name, G_LABEL) == 0) + efimedia = find_geom_efimedia(mesh, pp->lg_geom->lg_name); if (efimedia == NULL) return (NULL); return strdup(efimedia); From nobody Thu Feb 16 15:58:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHfkc33Vcz3r6lY; Thu, 16 Feb 2023 15:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHfkc2Ptlz3xQy; Thu, 16 Feb 2023 15:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oRKtdN9y9oOg8SASwsPg51+2WDa0pzr0fnRaYxfX1Nk=; b=BPspSt70Sb6nphXF9PXQ3Ih1rIKRqQrAODwRieqCMUnaxNiaDVn9w1LtzHw2VqepBr2j3E HdWC3jzGG+WSisVAdvPvgZF785tsWgpQjIRQgs3H9bl0nnWCHuppJVSSz7Lz+yXZ0iH9Us ouEEEMNuQCo2va3F9EDQMugc4Y7zgho5Ht2BwSf1HFiek28SQDbngrHVogR1dBryZ6fFAg FX0ZVSNRUqRhPKtQtWdGaEka6ktXLPl+uUdy6LBkTqTYdUd1MuTF66XcZivxjXdIM7cTxO 0hy7yxU+ThAg+ZfFoywx5PNmwiGlW24jEjSNmNfh+6nhyGfsfRbQTaIbs/bnpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oRKtdN9y9oOg8SASwsPg51+2WDa0pzr0fnRaYxfX1Nk=; b=C0jHAvUgM1EALryUzLQfmzr+Vj/LP0M2Q3PrF5fQoh1I4gB0Z6KoQWitvkd++N1Ui+2v+A JUXREtc2vaFHK38+pa1lhxUw86nMtpAHNAMOJ9K50UEBWgCN9bdrvxYfc5Kw5ZEISyV++V Ra5t5MOfqitBmrKAsU6KeG1S5+pRCjt+poNtQ1Vt8Fa2PdDE25gLy3/3b+t60QapXPp4NU Ge2JGIAcRnsRu0xmcnijI669mR8t6e0C3XAhMNMm8ZUL/n3jBnoKHT+SvPGMn6w8+tvCG/ TMK8gTOCyoIJvrtMer2i3nzMZN2+mNf6Kp5aD+OcbV/hg0YjR3shu+By9Jft8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676563128; a=rsa-sha256; cv=none; b=VUIg4vSfVA5XUFSUea6q0g4KXB0s6g1bEaoxo2IbvQdPIWyQkjkWxFkpgu7gif72bOL5aS oGNO8U681tNat89vVYVrt/PlR+7Qvp2uhPcJWldc5+3XUFpmXTLOknY4pfTdEqcwqy4FMZ to3Qm395K66YyPbwzOoC8ER2G5HZZPXIP1O2ABDiIJ6m0qf6EnkJpFoDfH9RJu1npwr9/0 FMzxk2cyq64W3ipEqOY3nfZNlCL4gLNq1C7+iEj1lPe6uLDR7y50Lvb+IaQ1X0B82IFwAk UQ+menLU1nXnR1XFUY/kj3sE3tHXIlcuTwXERBplV491aJd+CqJdmAZcWY2pnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHfkc1NCQz18Yn; Thu, 16 Feb 2023 15:58: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 31GFwmOV099980; Thu, 16 Feb 2023 15:58:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GFwmDk099979; Thu, 16 Feb 2023 15:58:48 GMT (envelope-from git) Date: Thu, 16 Feb 2023 15:58:48 GMT Message-Id: <202302161558.31GFwmDk099979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 49fd6affdbfe - main - efivar: Allow NULL paths in build_dp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49fd6affdbfe6af53f119ebb27ff5e5e292e1f67 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=49fd6affdbfe6af53f119ebb27ff5e5e292e1f67 commit 49fd6affdbfe6af53f119ebb27ff5e5e292e1f67 Author: Warner Losh AuthorDate: 2023-02-16 15:53:26 +0000 Commit: Warner Losh CommitDate: 2023-02-16 15:54:39 +0000 efivar: Allow NULL paths in build_dp Allow there to be NULL paths in buildp. This lets us return the device path to the partition, as well as to files on the partition. Sponsored by: Netflix Reviewed by: corvink, manu, asomers Differential Revision: https://reviews.freebsd.org/D38615 --- lib/libefivar/efivar-dp-xlate.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/libefivar/efivar-dp-xlate.c b/lib/libefivar/efivar-dp-xlate.c index effc8a2de475..b6adae80fdb4 100644 --- a/lib/libefivar/efivar-dp-xlate.c +++ b/lib/libefivar/efivar-dp-xlate.c @@ -544,23 +544,25 @@ find_geom_efimedia(struct gmesh *mesh, const char *dev) static int build_dp(const char *efimedia, const char *relpath, efidp *dp) { - char *fp, *dptxt = NULL, *cp, *rp; + char *fp = NULL, *dptxt = NULL, *cp, *rp = NULL; int rv = 0; efidp out = NULL; size_t len; - rp = strdup(relpath); - for (cp = rp; *cp; cp++) - if (*cp == '/') - *cp = '\\'; - fp = path_to_file_dp(rp); - free(rp); - if (fp == NULL) { - rv = ENOMEM; - goto errout; + if (relpath != NULL) { + rp = strdup(relpath); + for (cp = rp; *cp; cp++) + if (*cp == '/') + *cp = '\\'; + fp = path_to_file_dp(rp); + free(rp); + if (fp == NULL) { + rv = ENOMEM; + goto errout; + } } - asprintf(&dptxt, "%s/%s", efimedia, fp); + asprintf(&dptxt, "%s/%s", efimedia, fp == NULL ? "" : fp); out = malloc(8192); len = efidp_parse_device_path(dptxt, out, 8192); if (len > 8192) { From nobody Thu Feb 16 15:58:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHfkd3ZH6z3r742; Thu, 16 Feb 2023 15:58: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 4PHfkd37Psz3xZ1; Thu, 16 Feb 2023 15:58:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lp4YOAi1p9DCSw+MRn4xpU/61RH8nQZHJNewBz2D8ws=; b=SNoD2We9o1xSsmETZ3flU3uocsfxQOdeeSeb+4teLLq0+/byGpbuj3fL2wrBWuQnJZH7US Zmmn2PJC+OSFp2Hjzc2X5Kf4rPy4C8gnJzjztAg/9QQxZKTeAnEKVurvrnCkffpdHnjILk doENsa8InwVvEp8oX9kIYZNzpT+BIddRuLoi5sOqJ/NKd4d+8fgN4pDX+fF0V+o+QjZbPp 7q9Ez+VPEJdmH8qwQPQMW45MRLjJfXF3qYbcRKSiiessW5fVe0XgNRr4oNhFCcJ6UzAeP6 3uykNlsNUU67RSIt3gSgVBXkaQdbvmgc+6rNoG44Qm+50cKCbvRmgZHDTD6tIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lp4YOAi1p9DCSw+MRn4xpU/61RH8nQZHJNewBz2D8ws=; b=EeOT3hVDHy+gGhug8lIdlzAzexXQ07wfpBvpmssO6kEsPm30BLckSCvyhtdvSgZSYZUxV+ mqOzGhUH9ChLO1sXg4aNfoBmoFotDJmaBKJjkYW8GWIqloo8MftlwKvfeYcmmE71PqeWyN DRwgI30sZo9g5PjcOxaoYM5E7Sz3BjOZvVehfHL4RqGISs67/EWFxp3HAsjL7C3EkRbl++ V6gRBIIUk/tDq8vmD7pOlrwZQtUsDAJIgWU77Zuj4cUqgbUbTvC35slMxoPNXvWThV6LSA 4k4UkfPFRoXjvj36N6ujn+izLAEhMIX0LMt7tgweL7vX5L5uot0uu7n7NA6mZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676563129; a=rsa-sha256; cv=none; b=I8grGzNAaBQVsD8imOq+ugwHooF3rEWKG7uY/HB1lxJOWmWIu4F1ayYbPGy7/Im7or3Whx tUMzs5Qwz18EaXr0wZVSLuKn1OaazOIoBvqkHblgvcjy+iwy2oxRcRvT71ixpAe8MecQu9 gwOfO0YASnbF2s+ZI9gw/tGCFCxYOFA7RAKZdHE5Gk2acKX6XLgGebxuks76NHIO+di/Cn JvKTLuf9iPTsv3+C658o8ovZPzxo856lNwu4vNInx5J7SavAxgEJFUVX93PNJBy5NGlB5Q 5g2yvbpr0BSgjjZWVwy8m7lB/z514y3gwRgRnv18Vki18hVGex/QicucgUy3jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHfkd2FNwz187W; Thu, 16 Feb 2023 15:58: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 31GFwnjG000029; Thu, 16 Feb 2023 15:58:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GFwndd000028; Thu, 16 Feb 2023 15:58:49 GMT (envelope-from git) Date: Thu, 16 Feb 2023 15:58:49 GMT Message-Id: <202302161558.31GFwndd000028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 57d5ca4eeba6 - main - efivar: support device paths as well as mounted paths in path_to_dp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57d5ca4eeba6192e91044aad86fca4429966cfac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=57d5ca4eeba6192e91044aad86fca4429966cfac commit 57d5ca4eeba6192e91044aad86fca4429966cfac Author: Warner Losh AuthorDate: 2023-02-16 15:53:35 +0000 Commit: Warner Losh CommitDate: 2023-02-16 15:54:39 +0000 efivar: support device paths as well as mounted paths in path_to_dp In path_to_dp, allow passing in either the actual device path "eg /dev/foo/bar" or the path where the device is mounted (say /mnt/baz/bing). In the former case we'll assume the path within the device is nothing (the relpath). In the latter, we'll take from the mount point on down as the relpath. Sponsored by: Netflix Reviewed by: corvink, manu, asomers Differential Revision: https://reviews.freebsd.org/D38616 --- lib/libefivar/efivar-dp-xlate.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/libefivar/efivar-dp-xlate.c b/lib/libefivar/efivar-dp-xlate.c index b6adae80fdb4..586ba7d08180 100644 --- a/lib/libefivar/efivar-dp-xlate.c +++ b/lib/libefivar/efivar-dp-xlate.c @@ -648,6 +648,7 @@ errout: } /* Handles /path/to/file */ +/* Handles /dev/foo/bar */ static int path_to_dp(struct gmesh *mesh, char *path, efidp *dp) { @@ -667,9 +668,19 @@ path_to_dp(struct gmesh *mesh, char *path, efidp *dp) } dev = buf.f_mntfromname; - if (strncmp(dev, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) - dev += sizeof(_PATH_DEV) -1; - ep = rp + strlen(buf.f_mntonname); + /* + * If we're fed a raw /dev/foo/bar, then devfs is returned from the + * statfs call. In that case, use that dev and assume we have a path + * of nothing. + */ + if (strcmp(dev, "devfs") == 0) { + dev = rp + sizeof(_PATH_DEV) - 1; + ep = NULL; + } else { + if (strncmp(dev, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + dev += sizeof(_PATH_DEV) - 1; + ep = rp + strlen(buf.f_mntonname); + } efimedia = find_geom_efimedia(mesh, dev); #ifdef notyet From nobody Thu Feb 16 15:58:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHfkf4X2zz3r6tT; Thu, 16 Feb 2023 15:58: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 4PHfkf3ts7z3xTl; Thu, 16 Feb 2023 15:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1iOlnzkjHFoc4goZ30vV24/FOK3RGZPgzMgTGEoJUHM=; b=aWex3FnIFpqbQ4+qIOENB8qenissjfDRPfmMfJ6ey9Joh2T4edMaAb4GjKIB1+9RDTuOx+ lOui+dwsFe3FshD4p0joFyhQeCQB4e0zg8++T4QUu0Nx3WHADHiHz+0nzzcxAw204140JO WbGkCsIighqVJ3ftX1POV/F3TPIsYHgNKoTaNlJnp+CM7kk3WMkZvVNbdLYwAvjUUQtNlU qUcCS5nabaaTZPvWo8b8BXpkqXMadMDRKZqbbsoRPIcXjc3D9CKxCr1DzKklSFaesD9otz F+ECYewCox//7R/Fae3uJsSKFu645OtH3VjwBPnhncGB2iIZABMASGZ3ZLNB+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1iOlnzkjHFoc4goZ30vV24/FOK3RGZPgzMgTGEoJUHM=; b=Eb6bdyQXIw1OZVPcS38QblvnV3+mezaGQKgC4uV+txG9zN/1bsgn8PwN5wntk04PGZjlwF lknZ7cFGXpcNxWWJpq0NYahwJiVYpBc5qk1jkyxoxuCta17GG9vmxCLaNvIAN9gvG4B0ny s77w74UklnpcCuRw6OZ3MSRELfQ3d6BzPkLQmZGqnczoCzcqrU+T7ifdlpfgkNdujca1fC MtMqRzXKFUlzzlBnrAnGFWKyB2VzeqDtTISSbR2TjWdkXlVBwfzhIlj+27ED3VxYPTMwnv r/GrjEa50ZDxXmT36jKvhbtFECR+chyll691DMjfsLxhUIDkn78hGIRbL9yz/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676563130; a=rsa-sha256; cv=none; b=W5EoZBA39aE37qXigyHjpzjayQPrg9NQBxZnw7bDCilFIDgTP/LFKg6FmlsJy2iVBwyJQA oQx33/yN94q+V0We6IUFjJvP14Lh+lrDSEffovFQ7BpDceB5SlgpvaFrRE3iSzM3hhfnTk kezIFrjiGmoKR81mpsi53St44vLKlGQwV0YC4lPO+Df37+6V67s7JBGLxhRMpl4c6ErE/Y sGDc8K4kW3ZYUhzStUMbYDZohXhtyXbu722rJS6Bh//H0hcU1Czoi4oZdZFaTDGGb9HPUl ++3GQeq5aJ7WgMkGlqynp18UCQLAvnxrQR0YTcEcpA8zGHFeHmzqfAUQ7YD5Dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHfkf30Ghz18B7; Thu, 16 Feb 2023 15:58: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 31GFwoae000053; Thu, 16 Feb 2023 15:58:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GFwouc000052; Thu, 16 Feb 2023 15:58:50 GMT (envelope-from git) Date: Thu, 16 Feb 2023 15:58:50 GMT Message-Id: <202302161558.31GFwouc000052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9a7915299484 - main - efibootmgr: Add --efidev (-u) to discover UEFI's device path to a dev or file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a7915299484a767fbffc7234b8dc45c29954cca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9a7915299484a767fbffc7234b8dc45c29954cca commit 9a7915299484a767fbffc7234b8dc45c29954cca Author: Warner Losh AuthorDate: 2023-02-16 15:53:45 +0000 Commit: Warner Losh CommitDate: 2023-02-16 15:54:39 +0000 efibootmgr: Add --efidev (-u) to discover UEFI's device path to a dev or file "efibootmgr --efidev unix-path" will return the UEFI device-path to the file or device specified by unix-path. It's useful for debugging, but may also be useful for scripting. Sponsored by: Netflix Reviewed by: corvink, manu Differential Revision: https://reviews.freebsd.org/D38617 --- usr.sbin/efibootmgr/efibootmgr.8 | 6 +++++- usr.sbin/efibootmgr/efibootmgr.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.8 b/usr.sbin/efibootmgr/efibootmgr.8 index 6b53de33db56..0aa70fe63da7 100644 --- a/usr.sbin/efibootmgr/efibootmgr.8 +++ b/usr.sbin/efibootmgr/efibootmgr.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2022 +.Dd February 15, 2023 .Dt EFIBOOTMGR 8 .Os .Sh NAME @@ -69,6 +69,7 @@ .Fl t Ar timeout .Nm .Fl T +.Nm Fl u Ar unix-path .Sh "DESCRIPTION" The .Nm @@ -174,6 +175,9 @@ Set the bootmenu timeout value. Delete the .Cm BootTimeout variable. +.It Fl u -efidev Ar unix-path +Displays the UEFI device path of +.Ar unix-path . .It Fl v -verbose Display the device path of boot entries in the output. .El diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index 53bc417c4e07..58d83d28d6e5 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001 typedef struct _bmgr_opts { + char *dev; char *env; char *loader; char *label; @@ -85,6 +86,7 @@ typedef struct _bmgr_opts { bool dry_run; bool device_path; bool esp_device; + bool find_dev; bool fw_ui; bool no_fw_ui; bool has_bootnum; @@ -114,6 +116,7 @@ static struct option lopts[] = { {"dry-run", no_argument, NULL, 'D'}, {"env", required_argument, NULL, 'e'}, {"esp", no_argument, NULL, 'E'}, + {"efidev", required_argument, NULL, 'u'}, {"fw-ui", no_argument, NULL, 'f'}, {"no-fw-ui", no_argument, NULL, 'F'}, {"help", no_argument, NULL, 'h'}, @@ -284,6 +287,9 @@ parse_args(int argc, char *argv[]) opts.set_timeout = true; opts.timeout = strtoul(optarg, NULL, 10); break; + case 'u': + opts.find_dev = true; + opts.dev = strdup(optarg); case 'v': opts.verbose = true; break; @@ -996,7 +1002,7 @@ report_esp_device(bool do_dp, bool do_unix) char *name, *dev, *relpath, *abspath; uint8_t *walker, *ep; efi_char *descr; - efidp dp, edp; + efidp dp; char buf[PATH_MAX]; if (do_dp && do_unix) @@ -1026,7 +1032,6 @@ report_esp_device(bool do_dp, bool do_unix) // Now we have fplen bytes worth of file path stuff dp = (efidp)walker; walker += fplen; - edp = (efidp)walker; if (walker > ep) errx(1, "malformed boot variable %s", name); if (do_dp) { @@ -1068,6 +1073,26 @@ set_boot_to_fw_ui(bool to_fw) errx(1, "failed to set boot to fw ui"); } +static void +find_efi_device(const char *path) +{ + efidp dp = NULL; + size_t len; + int ret; + char buf[1024]; + + ret = efivar_unix_path_to_device_path(path, &dp); + if (ret != 0) + errc(1, ret, + "Cannot translate path '%s' to UEFI", path); + len = efidp_size(dp); + if (len > MAX_DP_LEN) + errx(1, "Resulting device path too long."); + efidp_format_device_path(buf, sizeof(buf), dp, len); + printf("%s -> %s\n", path, buf); + exit (0); +} + int main(int argc, char *argv[]) { @@ -1075,7 +1100,10 @@ main(int argc, char *argv[]) memset(&opts, 0, sizeof (bmgr_opts_t)); parse_args(argc, argv); - if (!efi_variables_supported()) + /* + * find_dev can operate without any efi variables + */ + if (!efi_variables_supported() && !opts.find_dev) errx(1, "efi variables not supported on this system. root? kldload efirt?"); read_vars(); @@ -1107,6 +1135,8 @@ main(int argc, char *argv[]) set_boot_to_fw_ui(true); else if (opts.no_fw_ui) set_boot_to_fw_ui(false); + else if (opts.find_dev) + find_efi_device(opts.dev); print_boot_vars(opts.verbose); } From nobody Thu Feb 16 15:58:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHfkg5Y8Zz3r745; Thu, 16 Feb 2023 15:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHfkg53RRz3xpD; Thu, 16 Feb 2023 15:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MuGyrMoSHJkHKh2dKvHdzhgus1fuTJoYDKhFRRgmobk=; b=PMLDXi96tInetg+1cQDbYY77+OiTmpgtmnxD64KGlg/bO2+DzNtRVpTytHdOMFrrgAQIJr LpG6RCK2E8DTOYxz6j8VbPWIYPozZ9HbBnfDVAFf0fB2iyxgqHn11mbYumXt63wPtZIrRS 99qyVUKnfjBX6B9XLIHMrakYL5fQIkasu6TGNVrIbYND8ZJ94IkcwHliZxE7cZUa6/RgcW l6vhqD7sA4dOe8bSm9PM79nci0CvPDJVbza+Cxnn0xxUfbSXzTxRB0bW1ofBbBuqTG//MP S+BPin7hUCOEXRFHJJC2uTmu/+f3XvkB+QRIZiCYdGjlRnOx3peCTxrBv/Us6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676563131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MuGyrMoSHJkHKh2dKvHdzhgus1fuTJoYDKhFRRgmobk=; b=p9yhDI66lFcvrkOEDFWyyK+faNAs7HNF1BAH1HAhqpg1zB2oJeil4s+mQeXfNt+itoGeaX bbNOCCNXrY2BVeqqU4XlLI6GvcrvC5qnXKLkzye2WJRxN97r5rfT2pv8MHrwdoIQXC8MWq Ykkqw5kuxBoGHurnFIKyoKi2M8Tvb3mFdRvGvAKbye8DW9yONue03+EqTgHey5F0c3BPab ksEYitMmknnU7yO2wKo+JVM70IvU+fJBZ/mLEes2+NGWo7RrW/8DcGly1DCDJuR8BPHQQC oXKTaMrzharLKRO/7sK2mw9qpg/axVmCIF2r8ZkSexIteHXajkwlUGH9mKDRrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676563131; a=rsa-sha256; cv=none; b=dpK6s/V8CyM6ToTugB7mJ9N8B4egFYH2a5cekhDSa1s0m8BWf79Cu+4HXn2TpBUsynULuS l6LLBEPpMU2iIEOR27GkYI/cP8LytGEJ54uVnAgWbVaMPNXpI8xGh3wBHrimjQFps5cTYC QdwwE8qU6rd9o4u4Hl6/sGC5v7JwyZUNReR3xAyVyzw+hM20gxt8kaagD+S9+g2H8wjN4Q b8Rsnfqo0KM2bee3iaenwBNE0olZulnoqUsr6drAqaKfx174cVhZ9JT1lJ4gRYxdO1brn2 Djbd/f1cfv7/fh/irYmAU4RoNn2XYjlxH6qjPp/95pjhec6aKT09G5QdPMOUyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHfkg48vQz18Yp; Thu, 16 Feb 2023 15:58: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 31GFwpnq000078; Thu, 16 Feb 2023 15:58:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GFwpiO000077; Thu, 16 Feb 2023 15:58:51 GMT (envelope-from git) Date: Thu, 16 Feb 2023 15:58:51 GMT Message-Id: <202302161558.31GFwpiO000077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2b460910326c - main - efivar: Really look for labels for the provider with right efimedia List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b460910326c4f39068fe2158a0726dc3d362f68 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2b460910326c4f39068fe2158a0726dc3d362f68 commit 2b460910326c4f39068fe2158a0726dc3d362f68 Author: Warner Losh AuthorDate: 2023-02-16 15:53:53 +0000 Commit: Warner Losh CommitDate: 2023-02-16 15:54:39 +0000 efivar: Really look for labels for the provider with right efimedia The prior code mistakently thought that the g_consumer that hung off the provider we found were the right thing to use to find all the glabel aliases for this node. However, the only way to find that is to iterate through all the geoms that belong to the glabel geom class, looking for those geoms with the same name as the provider with the right efimedia. Do this in a way that caches glabel class, and allows for it to be absent. Tighten the filter for mounted filesystems to only look for the ones that are mounted on /dev/.. since the rest of the code assumes that. MFC After: 3 days Sponsored by: Netflix Reviewed by: corvink, asomers Differential Revision: https://reviews.freebsd.org/D38619 --- lib/libefivar/efivar-dp-xlate.c | 64 ++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/lib/libefivar/efivar-dp-xlate.c b/lib/libefivar/efivar-dp-xlate.c index 586ba7d08180..3d63868dacef 100644 --- a/lib/libefivar/efivar-dp-xlate.c +++ b/lib/libefivar/efivar-dp-xlate.c @@ -134,12 +134,15 @@ efi_hd_to_unix(struct gmesh *mesh, const_efidp dp, char **dev, char **relpath, c const_efidp media, file, walker; size_t len, mntlen; char buf[MAX_DP_TEXT_LEN]; - char *pwalk; + char *pwalk, *newdev = NULL; struct gprovider *pp, *provider; - struct gconsumer *cp; struct statfs *mnt; + struct gclass *glabel; + struct ggeom *gp; walker = media = dp; + *dev = NULL; + *relpath = NULL; /* * Now, we can either have a filepath node next, or the end. @@ -174,12 +177,6 @@ efi_hd_to_unix(struct gmesh *mesh, const_efidp dp, char **dev, char **relpath, c goto errout; } - *dev = strdup(pp->lg_name); - if (*dev == NULL) { - rv = ENOMEM; - goto errout; - } - /* * No file specified, just return the device. Don't even look * for a mountpoint. XXX Sane? @@ -217,6 +214,16 @@ efi_hd_to_unix(struct gmesh *mesh, const_efidp dp, char **dev, char **relpath, c rv = errno; goto errout; } + + /* + * Find glabel, if it exists. It's OK if not: we'll skip searching for + * labels. + */ + LIST_FOREACH(glabel, &mesh->lg_class, lg_class) { + if (strcmp(glabel->lg_name, G_LABEL) == 0) + break; + } + provider = pp; for (i = 0; i < n; i++) { /* @@ -225,30 +232,53 @@ efi_hd_to_unix(struct gmesh *mesh, const_efidp dp, char **dev, char **relpath, c * we'll need to invent one, but its decoding will be handled in * a separate function. */ - if (mnt[i].f_mntfromname[0] != '/') + if (strncmp(mnt[i].f_mntfromname, "/dev/", 5) != 0) continue; /* * First see if it is directly attached */ - if (strcmp(provider->lg_name, mnt[i].f_mntfromname + 5) == 0) + if (strcmp(provider->lg_name, mnt[i].f_mntfromname + 5) == 0) { + newdev = provider->lg_name; break; + } /* - * Next see if it is attached via one of the physical disk's - * labels. + * Next see if it is attached via one of the physical disk's labels. + * We can't search directly from the pointers we have for the + * provider, so we have to cast a wider net for all labels and + * filter those down to geoms whose name matches the PART provider + * we found the efimedia attribute on. */ - LIST_FOREACH(cp, &provider->lg_consumers, lg_consumer) { - pp = cp->lg_provider; - if (strcmp(pp->lg_geom->lg_class->lg_name, G_LABEL) != 0) + if (glabel == NULL) + continue; + LIST_FOREACH(gp, &glabel->lg_geom, lg_geom) { + if (strcmp(gp->lg_name, provider->lg_name) != 0) { continue; - if (strcmp(g_device_path(pp->lg_name), mnt[i].f_mntfromname) == 0) - goto break2; + } + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + if (strcmp(pp->lg_name, mnt[i].f_mntfromname + 5) == 0) { + newdev = pp->lg_name; + goto break2; + } + } } /* Not the one, try the next mount point */ } break2: + /* + * If nothing better was mounted, then use the provider we found as + * is. It's the most correct thing we can return in that acse. + */ + if (newdev == NULL) + newdev = provider->lg_name; + *dev = strdup(newdev); + if (*dev == NULL) { + rv = ENOMEM; + goto errout; + } + /* * No mountpoint found, no absolute path possible */ From nobody Thu Feb 16 17:52:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHjFr3jxgz3rDwW; Thu, 16 Feb 2023 17:52:32 +0000 (UTC) (envelope-from jbeich@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 4PHjFr2HPYz4Gm0; Thu, 16 Feb 2023 17:52:32 +0000 (UTC) (envelope-from jbeich@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676569952; 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=nTKambmFjTWuGsJpIfS/Rr4CRgmkEcTlA0sCYtAH1m8=; b=YVtlCO14clPrW812Po4d5UrxenxV96SA2/OpBQdw8HSuCVqoclFYKIks0+Mox1gnmT7Pqw n58kTgbMkLDbdtW7Gaq1+sc0sCGFuE3ha2+CFtIU/FrL+OJmZLWziij9N9n/w0XOpOlJYt gSya7xPBSYnY4d62mMnrChLlfvdix74eLU2tOHQNC4FKnKwPVH89EmKGWYW1PfKlVi8MOZ +4Qziwulq1AqLITpHYVaVnBkAKgINIYiIjH1Pyh3wX4oOJdVWt9BCBAXqlmwLAjkyRFMFW WeGzRSyPHt6rgz3sHi6JN2nbxawq8sOJklmEfhOOiCBM5pLOqhPY71msxpWT8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676569952; 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=nTKambmFjTWuGsJpIfS/Rr4CRgmkEcTlA0sCYtAH1m8=; b=C5wICxNvMGO+CcEWIr1grnPbDL1GX227z757awhaIJX1oXoM0+Fv1PkaGYrUmgpHSqYrjQ H1XsOXDm3GAPvSRkjze46lXbHaZQYPtf/3C2mTvQf9OUMef5Ry/My3rwWY1kE5S7gkiH/C OVBaiXr0FzQVb9BKmUhjm3ua3nMwQAGY8yD1oRLco5igtK99TfzCPmYfxuXd186DuKNQeQ U6e2Q5QCzdo1GxkBhiVXyRByOwIcmWoxrR5BTFwqF5JmITmicApTE93Fpdgn/rnvS8EFDx QcZ0M0Fy4sXXy0OAyrdfQt6bpOEca1WCBZSNtoZmhd3M/HIdNCzBxv4DzgXm/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676569952; a=rsa-sha256; cv=none; b=dRhq0vKqipt6urKOILVs1tnsSZU/6cUSO/QxldL1eBl661TZY2hrAMefq9WB4YWmT4XmMg z3JRFGtNMJ2tmLEOxshPQtRLAjEu5Nxdtc7GjTpo44R+sIqG7upaVo7GvGkUzLtkiFjx56 SXAX0lV9u2Y+6KaW7Sk6H3pupOr3R1QvuFkoQQciTWaiAKV1ZEFcypIL0vjc8zOzWA2mlb J4bSSho8Z3GUz9KIpbHe3dgB4Spe8hFkjw4GOH+kfokTMmyXn3z7fiw1QFoQ1ynZjzR7yi VD5O3RQ2/3uIp7Y+S8W0x6HBT79SBs/vpjMl4Z6+QaZyqxpDt2gYf7HhjyCvTw== Received: by freefall.freebsd.org (Postfix, from userid 1354) id 348F1442F; Thu, 16 Feb 2023 17:52:32 +0000 (UTC) From: Jan Beich To: Mateusz Guzik Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: d9d5f2c042a5 - main - cpuset: add --count In-Reply-To: <202302041751.314HpRrn042970@gitrepo.freebsd.org> (Mateusz Guzik's message of "Sat, 4 Feb 2023 17:51:27 GMT") References: <202302041751.314HpRrn042970@gitrepo.freebsd.org> Date: Thu, 16 Feb 2023 18:52:29 +0100 Message-ID: List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-ThisMailContainsUnwantedMimeParts: N Mateusz Guzik writes: > +.Pp > +The long options are as follows: > +.Bl -tag -width ".Fl -count" > +.It Fl -count > +Count the number of hardware threads included in the set. Requires > +.Fl g > +and > +.Fl p > +flags. > +.El --count appears to report total number of "hardware threads" instead of "included in the set". Is this intentional? If so the wording is confusing. $ cpuset -l 1 -- cpuset -g --count -p -1 8 $ cpuset -l 1 -- cpuset -g -p -1 pid -1 mask: 1 pid -1 domain policy: first-touch mask: 0 $ procstat cpuset $$ PID TID COMM TDNAME CPU CSID CPU MASK 1111 7777 zsh - -1 1 0-7 $ cpuset -l 1 yes >/dev/null & $ cpuset -g --count -p $(pgrep yes) 8 $ cpuset -g -p $(pgrep yes) pid 2222 mask: 1 pid 2222 domain policy: first-touch mask: 0 $ procstat cpuset $(pgrep yes) PID TID COMM TDNAME CPU CSID CPU MASK 2222 8888 yes - 1 3 1 From nobody Thu Feb 16 18:01:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHjSJ3mjWz3rFgx for ; Thu, 16 Feb 2023 18:01:36 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHjSH1syxz4J6q for ; Thu, 16 Feb 2023 18:01:35 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none Received: by mail-wm1-f44.google.com with SMTP id f23-20020a05600c491700b003dff4480a17so4406017wmp.1 for ; Thu, 16 Feb 2023 10:01:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=N3La6jg3tmlLrBdnmvlcc/v8VU0BaBUAk40M0XZAX40=; b=v4QCGCd/2+KZvbMicY75UKZ2BvjKl9UTQLxQqtdJIUHDEx1Tn1E4PhT9+q3Th6azsK zDa039077ZnV6pVktSLJwgYJ8el2DgZ4aOufFgCXu7N91dc3/08SGT+u/J7cza+tVX4M N6mnl59kQSgA2eu7JqXEUXCMy7u8FgoHlHRIHi3VYh2e10SVBalc8XENARHfeMQhYmq4 TcyPSJNyEKaUFNwnM+yDzKq4KvOGwm30KL97NJFoI2KCX9v1FkgCWf5dG2hsCJ+GnRIL tyVeKdCbnOhuvZr3ZS9ODgnQYliEPvyOMIVBPkTARNazJhNQRV5lrDsRIkbPRB7ceCRG C9eA== X-Gm-Message-State: AO0yUKUL7CZW93uK4R5q6nm5vyMqoKl8spb/FpfSVdVf+iVvRohCYO20 QdrxAYovk0DDRKv4PLtmt4jmcQ== X-Google-Smtp-Source: AK7set9bwvSrmWkQl5RgM03V/e7ZcEytZ7oZoOFe9/l2MPo9L6Qf0k4rUS25ZzJ3/7PkZm9CcMUJng== X-Received: by 2002:a05:600c:198a:b0:3e0:114:62ee with SMTP id t10-20020a05600c198a00b003e0011462eemr5569151wmq.8.1676570493993; Thu, 16 Feb 2023 10:01:33 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id k1-20020a7bc401000000b003dc47d458cdsm2417923wmi.15.2023.02.16.10.01.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2023 10:01:33 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: d9d5f2c042a5 - main - cpuset: add --count From: Jessica Clarke In-Reply-To: Date: Thu, 16 Feb 2023 18:01:32 +0000 Cc: Mateusz Guzik , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202302041751.314HpRrn042970@gitrepo.freebsd.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spamd-Result: default: False [-2.49 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.992]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.44:from]; FREEFALL_USER(0.00)[jrtc27]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.44:from]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org] X-Rspamd-Queue-Id: 4PHjSH1syxz4J6q X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On 5 Feb 2023, at 17:28, Alexey Dokuchaev wrote: >=20 > On Sun, Feb 05, 2023 at 04:42:16PM +0100, Mateusz Guzik wrote: >> On 2/5/23, Alexey Dokuchaev wrote: >>> On Sat, Feb 04, 2023 at 05:51:27PM +0000, Mateusz Guzik wrote: >>>> commit d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483 >>>>=20 >>>> cpuset: add --count >>>>=20 >>>> Can be used to count the number of hardware threads in the cpu = set. >>>>=20 >>>> For example: [...] >>>>=20 >>>> The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus >>>=20 >>> Speaking of these two, do we really need both, unless they are not >>> exactly the same? (They do seem so, though.) >>=20 >> They are not, cpuset grabs a pid argument, while nproc only works on = itself. >=20 > cpuset? pid argument? But I was not asking about cpuset, I was = wondering > whether we need both of these sysctls: >=20 > $ sysctl hw.ncpu > hw.ncpu: 2 > $ sysctl kern.smp.cpus > kern.smp.cpus: 2 One prints mp_ncpus, the other smp_cpus. As far as I=E2=80=99m aware = those two are the same for as long as userspace is running, and only differ during early boot before AP bringup (mp_ncpus is how many it will bring up, and smp_cpus counts up as they come online until the two become equal). Jess From nobody Thu Feb 16 18:19:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHjrQ4CPjz3rGyf; Thu, 16 Feb 2023 18:19: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 4PHjrQ39MNz4M60; Thu, 16 Feb 2023 18:19:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676571542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OzGzZtdio9k+Gfrfhc5xZkZ0Dl9sbTqHMWkp/kpgf50=; b=SumkDMjXKmTXis6XoBgKd5b52ztnN5Cp8U/AzH78ZQoBVCoTdyc09n1fWCvCMB93KOLLil nx+IPf0YnKChIpcrAyHP2/D9k1ik4j0EbzgS6ieYBpPmRfv0QNkMeNVS/+0UjM3E3Dn1ZJ ZLnlI/1x+cwcoS8E+ASvZ0zS6SE2+R9nr1OVYzlx9XBbA/H2g0ofRz2smaHvCOqM7ZzDJt WtRM7+2vwevHz4nSZjCKdFfsBNVuD913ucDV14ISEzcfwElKpNf1rJITjhJ9FF87U7VXWY PS7MKELhd0og8DbaLX0iLXx0s/HE4WePWVqD3iXcnv5v2MEIA5uhrgJpX5ZMTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676571542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OzGzZtdio9k+Gfrfhc5xZkZ0Dl9sbTqHMWkp/kpgf50=; b=IgHDiYKIJZopP7SgiWsjfuKMXHmZm/JiviP9u08majTjfTv/q3DtXKyLydGgVdNqPrRHtX 2/fTdOGWI2hUM/OkTzvJsmK+ZURvWTc8IAxI1AAeRTyOJFsvFfU43wE6kA6wIbkyPa8JxZ Pj8+3EWZgX/VZZkD3JQ1lnGr2SmX+lSDB+d3X9mRHot45GKsf8+hj5YGy3Rlgx63gvUd64 bLrOvzJi/zQOrqjSAqj1vuHbriwgCEOgbP8zzsSp0IbQfSbGUAcCK52XZelKgheFiPXIT3 gJrmTDG6P2gvoQ0XpaNgePIncj2kI7w/9B735VSDjAL98IjxtrPwWkrLSImLuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676571542; a=rsa-sha256; cv=none; b=ZVVjLg6k18u74ZUmp2MfU5BfAp5eGuLZxX2o83zvRnuqsV35bc7vlOT267h4qWonSgVtuy 9kYooFFiBxTVXNvri00o749/nmnd+JBmvOR3aX7OSWcPjECNYnWBSfWcIsA8SHMklonK74 IA1Y+NEPqwQd4OROq7s5nzzCF5jMmFreunS/DH0hFbKWl2zqEpwpehzFbXyFwxTZD2VEwT 7dlD7NyRuaCDdbIB+tH5VcStwEdtG7Ber9RKT0DVYQirXZrt/1lmVbvviSkh2HifbAbpB+ b0g2hQTD5sI6RWqHwvpTPQ/TkecynHsyjWmB9WsxG3tDQgCf+brBdgnbRO4cOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHjrQ2DK2z1CcP; Thu, 16 Feb 2023 18:19: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 31GIJ2Du001753; Thu, 16 Feb 2023 18:19:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GIJ2JI001752; Thu, 16 Feb 2023 18:19:02 GMT (envelope-from git) Date: Thu, 16 Feb 2023 18:19:02 GMT Message-Id: <202302161819.31GIJ2JI001752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 2924ae099a1e - main - Revert "cpuset: add --count" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2924ae099a1e8ffc5b6040f3af5645aa54c0f629 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2924ae099a1e8ffc5b6040f3af5645aa54c0f629 commit 2924ae099a1e8ffc5b6040f3af5645aa54c0f629 Author: Mateusz Guzik AuthorDate: 2023-02-16 18:12:46 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-16 18:18:49 +0000 Revert "cpuset: add --count" The patch introduced a behavior change coming from getopt_long, namely the entire argument array would be parsed looking for opts, which affected uses spawning new processes without passing '--' to delimit where cpuset arguments end. [1] Apart from that turns out the change had a bug: using CPU_LEVEL_ROOT instead of CPU_LEVEL_WHICH, returning a different cpuset than intended. [2] The intended functionality is provided with nproc(1), which landed after this change. As such, revert for the time being. This reverts commit d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483. Reported by: Mark Millard [1] Reported by: jbeich [2] --- usr.bin/cpuset/cpuset.1 | 16 +--------------- usr.bin/cpuset/cpuset.c | 51 +------------------------------------------------ 2 files changed, 2 insertions(+), 65 deletions(-) diff --git a/usr.bin/cpuset/cpuset.1 b/usr.bin/cpuset/cpuset.1 index 31a3e45134d7..1d0180c98991 100644 --- a/usr.bin/cpuset/cpuset.1 +++ b/usr.bin/cpuset/cpuset.1 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2022 +.Dd July 3, 2018 .Dt CPUSET 1 .Os .Sh NAME @@ -57,10 +57,6 @@ .Fl g .Op Fl cir .Op Fl d Ar domain | Fl j Ar jail | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq -.Nm -.Fl g -.Fl -count -.Fl p Ar pid .Sh DESCRIPTION The .Nm @@ -176,16 +172,6 @@ Specifies a thread id as the target of the operation. .It Fl x Ar irq Specifies an irq as the target of the operation. .El -.Pp -The long options are as follows: -.Bl -tag -width ".Fl -count" -.It Fl -count -Count the number of hardware threads included in the set. Requires -.Fl g -and -.Fl p -flags. -.El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES diff --git a/usr.bin/cpuset/cpuset.c b/usr.bin/cpuset/cpuset.c index 528cbc39bbc7..79c6c2b6ca79 100644 --- a/usr.bin/cpuset/cpuset.c +++ b/usr.bin/cpuset/cpuset.c @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -53,9 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * Short opts. - */ static int Cflag; static int cflag; static int dflag; @@ -69,24 +65,12 @@ static int rflag; static int sflag; static int tflag; static int xflag; - -/* - * Long-only opts. - */ -static int count_flag; - static id_t id; static cpulevel_t level; static cpuwhich_t which; -#define OPT_THREADCOUNT (CHAR_MAX + 1) static void usage(void); -static struct option long_opts[] = { - { "count", no_argument, NULL, OPT_THREADCOUNT }, - { NULL, 0, NULL, 0 } -}; - struct numa_policy { const char *name; int policy; @@ -299,18 +283,6 @@ printsetid(void) levelnames[level], setid); } -static void -printcpucount(void) -{ - cpuset_t mask; - CPU_ZERO(&mask); - - if (cpuset_getaffinity(CPU_LEVEL_ROOT, CPU_WHICH_PID, id, - sizeof(mask), &mask) != 0) - err(EXIT_FAILURE, "getaffinity"); - printf("%d\n", CPU_COUNT(&mask)); -} - int main(int argc, char *argv[]) { @@ -328,8 +300,7 @@ main(int argc, char *argv[]) level = CPU_LEVEL_WHICH; which = CPU_WHICH_PID; id = pid = tid = setid = -1; - while ((ch = getopt_long(argc, argv, - "Ccd:gij:l:n:p:rs:t:x:", long_opts, NULL)) != -1) { + while ((ch = getopt(argc, argv, "Ccd:gij:l:n:p:rs:t:x:")) != -1) { switch (ch) { case 'C': Cflag = 1; @@ -388,30 +359,12 @@ main(int argc, char *argv[]) which = CPU_WHICH_IRQ; id = atoi(optarg); break; - case OPT_THREADCOUNT: - count_flag = 1; - break; default: usage(); } } argc -= optind; argv += optind; - - /* - * count requires g and p flags and is incompatible with - * everything else for simplicity. - */ - if (count_flag) { - if (!gflag || !pflag) - usage(); - if (Cflag || cflag || dflag || iflag || jflag || lflag || - nflag || rflag || sflag || tflag || xflag) - usage(); - printcpucount(); - exit(EXIT_SUCCESS); - } - if (gflag) { if (argc || Cflag || lflag || nflag) usage(); @@ -518,7 +471,5 @@ usage(void) fprintf(stderr, " cpuset -g [-cir]\n" " [-d domain | -j jailid | -p pid | -t tid | -s setid | -x irq]\n"); - fprintf(stderr, - " cpuset -g --count -p pid\n"); exit(1); } From nobody Thu Feb 16 18:19:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHjsG5kTSz3rGw9; Thu, 16 Feb 2023 18:19:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) (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 4PHjsG3bQHz4Mg2; Thu, 16 Feb 2023 18:19:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x232.google.com with SMTP id cz14so2502720oib.12; Thu, 16 Feb 2023 10:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yAcFh9e221DXzKjyGFEb0RaR72E7gEMT51OAT9JHMTs=; b=E/u8mrMMrOQ5QRMB0LuChYf9gS8pzlg9kHqdCN7ghTPvNAbl3r1J4glmAnKb54X92q JCt4b1SyioVbKHw+uWWOsk1BUnSxfXPS14jVZDmdQanFNFc2BfNRonAZ2CZ7PyG+Am2F tfRApoPJ23wjiIXk3ZR1ln/YyRRy2VwvtPBTJNQOfdPG2PoqRqKwcBrdCUx5hmdcH/Rz c7Zm2uzmsIvhIWp0LVoyaKk4DCqZbSXJhg84HcJI1Hg/DtailWTxEdi8YzLROX7CpivE u8y6sX3r+YQpCyilZbwIVYl3irZ/36PqXVpfRdhC0wH2amBtixtaevcDKvP0IS2E6tU1 H7jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yAcFh9e221DXzKjyGFEb0RaR72E7gEMT51OAT9JHMTs=; b=c+daRH9WcwpOQ4x1tniYbiGd2nlJS8R8Si6/E1FPcOJDCl9xHcj/viJjw09nPu4aKp 8PlIGUY+JTKzHmv2Efly88FcJmKkfpqDJIzKnzl04k508K+/HN0C1hHr6yDkoreZ0m1z D9tnRjH4+HNBMjit38nHn4IFdIzuoX5T7gcqs4DpFC81psjE2jFhPz78uRbSnC71p/tQ davU3eF1QU1j6v61M/A3AFiAKdV4HX8e4AuA4UExb2SRSadnBPfyU1XsDaSzlPc1jpxQ R3lDq3FYOVYEjPS333gyZ685AjcTLfQZOvXS2I3ZRdF889/svGfyBBkXPAJDx+mMMQPz wcfw== X-Gm-Message-State: AO0yUKUuceS7CYu3wox2ri4U/pXK1Rm8bDSXXskCRQelpcClZRm+shPQ BlnfBVHfaukWelHSRDJGiW8ZSmsCPQBJi43szHgpNaNe X-Google-Smtp-Source: AK7set/2s/5kOUVHJeoILWlv5m1rJbG/AYepopYihEx1if1YK+hIrXQWxtkBRX8V4chI3t2oJN1F5eRaTLF2QFTTv9g= X-Received: by 2002:a05:6808:2195:b0:378:348b:9346 with SMTP id be21-20020a056808219500b00378348b9346mr197261oib.81.1676571584911; Thu, 16 Feb 2023 10:19:44 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:4381:0:b0:4b9:9c2d:ce62 with HTTP; Thu, 16 Feb 2023 10:19:44 -0800 (PST) In-Reply-To: References: <202302041751.314HpRrn042970@gitrepo.freebsd.org> From: Mateusz Guzik Date: Thu, 16 Feb 2023 19:19:44 +0100 Message-ID: Subject: Re: git: d9d5f2c042a5 - main - cpuset: add --count To: Jan Beich 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-Rspamd-Queue-Id: 4PHjsG3bQHz4Mg2 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 2/16/23, Jan Beich wrote: > Mateusz Guzik writes: > >> +.Pp >> +The long options are as follows: >> +.Bl -tag -width ".Fl -count" >> +.It Fl -count >> +Count the number of hardware threads included in the set. Requires >> +.Fl g >> +and >> +.Fl p >> +flags. >> +.El > > --count appears to report total number of "hardware threads" instead of > "included in the set". Is this intentional? If so the wording is confusing. > > $ cpuset -l 1 -- cpuset -g --count -p -1 > 8 > $ cpuset -l 1 -- cpuset -g -p -1 > pid -1 mask: 1 > pid -1 domain policy: first-touch mask: 0 > $ procstat cpuset $$ > PID TID COMM TDNAME CPU CSID CPU MASK > 1111 7777 zsh - -1 1 0-7 > > $ cpuset -l 1 yes >/dev/null & > $ cpuset -g --count -p $(pgrep yes) > 8 > $ cpuset -g -p $(pgrep yes) > pid 2222 mask: 1 > pid 2222 domain policy: first-touch mask: 0 > $ procstat cpuset $(pgrep yes) > PID TID COMM TDNAME CPU CSID CPU MASK > 2222 8888 yes - 1 3 1 > that was a bug not worth fixing, so i whacked the feature: https://cgit.freebsd.org/src/commit/?id=2924ae099a1e8ffc5b6040f3af5645aa54c0f629 -- Mateusz Guzik From nobody Thu Feb 16 18:21:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHjv01BmDz3rGwQ for ; Thu, 16 Feb 2023 18:21:16 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) (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 4PHjtz3fJTz4Myd for ; Thu, 16 Feb 2023 18:21:15 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=lAArgQQa; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2001:4860:4864:20::33 as permitted sender) smtp.mailfrom=mjguzik@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-16e55be7c76so3536044fac.6 for ; Thu, 16 Feb 2023 10:21:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WseQ6WeGM4Q0d4cOnEYeTZ2hK+HrctevXAUtCanvU8E=; b=lAArgQQanAlzHArv/J27bNoDbgNSuwaknLeIZ/YgWJkNebVO6JZIUW4IhrDpSplCQx 35A1sIMQi4wWsmXsA/+Ni+JuohgyocbT4wHxFhFifTUDX02ZWrhrz+lyh5uXpf5XjZXK GdaB4rOAc3SjiIouiYHa0fgs09nnwYatuQMbYQfqdOmAP+iuFuFkYLz7wiVGoOHwPsbL NslZuwjVXMkw4WQs0ZGGH3NKNcnq97a+xkc94PXiXuxPfqErmSShFupXpSTM0l4OBhNC Botao/gyAr8uFQ1rgD/NSdKNtshWt/mHh3SgbEkJ785nKK0+CuUmme1BpA5et++A3CDS ALNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WseQ6WeGM4Q0d4cOnEYeTZ2hK+HrctevXAUtCanvU8E=; b=qqmzrqMfGU+IDXHDJUbYMNY+u7Cq2ZIiE5vEp3ZA4KOb8JuufxwEMtmpRJ3TeVBx49 gdSzaxEEp5vMTcz3Ie1QNgjYcMe+Qc95oB2XSyv8+o8+pSwF82NtBR5nXg3afrNaiqY+ M0wmfznvYNbEtvfNI/C2xuoxpbgDrNDLOp3cvZxwKl6qSeU44xsE7om7ul1+mEl9ZZAI g1AHiJ3319wn7r5Rdl4vZKS0jCq/E/K5hA6vRv7F2rims5xqIjjhNhVyQkF1Ekp1lZVV aoL0v/Vs4NVW//w9gfWypEvrLjEk4qhfXY9sdfc4lqIN0RwLIsV9go/FFcgPtV51XG4T vobQ== X-Gm-Message-State: AO0yUKWomOTX1fYtCa0+rXRyhauG0oiOZBK+dZKltt829MAIrJyNAmYM VSG+PryN7SA0aGSZAHlrGN9rlPFnTa5CaXQkJPuzNQqO X-Google-Smtp-Source: AK7set9YtLLeBMJPsiJ28dd0MktPnfeetqZEr6QLVBKDIGbbmv3jhOYvqJG8j9fyq4q1Iliiq+b9pGCwB0aaTttpQ3I= X-Received: by 2002:a05:6870:eca1:b0:16e:25e:f294 with SMTP id eo33-20020a056870eca100b0016e025ef294mr212945oab.81.1676571674530; Thu, 16 Feb 2023 10:21:14 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:4381:0:b0:4b9:9c2d:ce62 with HTTP; Thu, 16 Feb 2023 10:21:13 -0800 (PST) In-Reply-To: References: From: Mateusz Guzik Date: Thu, 16 Feb 2023 19:21:13 +0100 Message-ID: Subject: Re: git: d9d5f2c042a5 - main - cpuset: add --count [changed/broken command line parsing] To: Mark Millard Cc: dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2001:4860:4000::/36:c]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_IN_DNSWL_NONE(0.00)[2001:4860:4864:20::33:from]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_TO(0.00)[yahoo.com]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org] X-Rspamd-Queue-Id: 4PHjtz3fJTz4Myd X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On 2/15/23, Mark Millard wrote: > On Feb 14, 2023, at 23:08, Mateusz Guzik wrote: > >> On 2/15/23, Mark Millard wrote: >>> Mateusz Guzik wrote on >>> Date: Sat, 04 Feb 2023 17:51:27 UTC : >>> >>>> The branch main has been updated by mjg: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483 >>>> >>>> commit d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483 >>>> Author: Mateusz Guzik >>>> AuthorDate: 2023-02-04 17:47:41 +0000 >>>> Commit: Mateusz Guzik >>>> CommitDate: 2023-02-04 17:50:41 +0000 >>>> >>>> cpuset: add --count >>>> >>>> Can be used to count the number of hardware threads in the cpu set. >>>> >>>> For example: >>>> $ cpuset -g -p $$ >>>> pid 2440 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, >>>> 16, >>>> 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, >>>> 35, 36, 37, 38, 39 >>>> pid 2440 domain policy: first-touch mask: 0, 1 >>>> $ cpuset -g --count -p $$ >>>> 40 >>>> >>>> The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus >>>> which >>>> can be found in the tree, which are not adequate given existence of >>>> cpusets. >>>> >>>> Right now only -g -p combination is supported to reduce complexity. >>>> As anything else errors out, this can be expanded later as needed. >>>> >>>> Differential Revision: https://reviews.freebsd.org/D36351 >>> >>> This broke long standing commands sequences in some makefiles >>> that I use to build and run some benchmarks, the commands >>> at issue involve use of cpuset. >>> >>> However I can show the oddity in a much simpler context: >>> >>> # cpuset echo "text" >>> text >>> >>> # cpuset echo "-text" >>> usage: cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] cmd ... >>> cpuset [-l cpu-list] [-n policy:domain-list] [-s setid] -p pid >>> cpuset [-c] [-l cpu-list] [-n policy:domain-list] -C -p pid >>> cpuset [-c] [-l cpu-list] [-n policy:domain-list] >>> [-j jailid | -p pid | -t tid | -s setid | -x irq] >>> cpuset -g [-cir] >>> [-d domain | -j jailid | -p pid | -t tid | -s setid | -x >>> irq] >>> cpuset -g --count -p pid >>> >>> >>> By contrast, in my stable/13 context, so, showing the old behavior: >>> >>> # cpuset echo "-text" >>> -text > > FYI: the use of quotes was in my original text for other > reasons. I should not have duplicated them into the above > examples. (Same results without quotes.) > >> the idiomatic way to pass progs to spawn is to denote the end of any >> opts with -- > > The cpuset man page gives no indication that it requires such > notation. Programs with that requirement normally document it > explicitly. (Programs that do not require the ntoation often > allow the notation without documenting it.) > > There may be a consideration of how long it has allowed such > a lack of use of "--" and how many things might break because > it worked before. > > Lots of programs taking commands do not require such. For > example: "time echo -text", "truss echo -text", and "ktrace > echo -text". These have not and are not being changed to > require such. They do allow the "--" notation. > > > If it stays as it is, the change should probably be in UPDATING > or other such place(s) that note where changes are required to > keep things working. > >> so in particular you would: >> cpuset -- echo -text > > Yep. > >> the fact that previous version worked without it is kind of a bug > > I disagree with that last statement, given the many programs > that do not require such. Some programs have some specific > notational complication lead to making it required. But, from > what I've seen, most of the others do not make "--" required. > > So I found that on Linux 'perf stat' et al don't require --. Due to a just found bug in the change anyway I decided to just whack it: https://cgit.FreeBSD.org/src/commit/?id=2924ae099a1e8ffc5b6040f3af5645aa54c0f629 -- Mateusz Guzik From nobody Thu Feb 16 18:42:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHkMz5M8Mz3rJxB for ; Thu, 16 Feb 2023 18:42:55 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic314-20.consmr.mail.gq1.yahoo.com (sonic314-20.consmr.mail.gq1.yahoo.com [98.137.69.83]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHkMy4FkBz3kCf for ; Thu, 16 Feb 2023 18:42:54 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=dDbYat2q; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.83 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676572972; bh=AU7MgewbdKKlCE+bpJaXpZe9UupmnA1jG5D5m/vdBgU=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=dDbYat2qAG7VWgqADZ+RZnI+wogtxvgSB1cqC1hGTezWydbwzVDP242M7fbR3ehZywUrNXkFX2C+yVuOpt5eFMwxL37kM+Hr/oOaVVIJFeDuhpJaa2o0/7Q/CDt4xQZ8JdVawx4u/Fab1/12BdAk3N5PafIgX265eoULJsQoDLUJ0RAyVAyjimhOfDs3PKJYZEodRJgS0R/2jCKGH1aXAX0jmlT/M5iCLM2IXqqYaMKwp1WerkCU09gK+W6HUjqwrAeWbv1+w+usYicoJS6wjl+gzgTHA4U9s7JYe/TTOvzcx0kNxop2wSa2oeL6C9jvkZkvZ0DQRyU0b9Nukd20Tg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676572972; bh=WFOK+fwdAtLSAaeMT6jffixvCerDOrlLqHgO5tq2c3D=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=AQzqcxjzkWDE2lRFWMCm7roSV843BOQ9mUimk40Syi9uj/j0+QYsjTJEoQTl+kFsHVb/J1quP+t0QrgXETjdDS86ZmpukC5AugG457ayJIfKPx2DYUjMw6/JhNVRQ/QsEBqMlwX2heAkTfmZLkOWi7Gj94Ca/8FBRyHaRZZglwhwr1N5xHrGoYwm8zdj/NpV2NOVfhC2YTmYsVkt8fK2v6L7trcGFcISnXiRqKOL+Li/GI+jc4V+ezlpYoX0HCQl3hT/z464WJWitbyNgRPU3sVpqe7Q1oUVENCoGSuIs2H5xfr/zAz4KikF+RQ7DYwj4bTiBJzfZfi9EzXluznkTw== X-YMail-OSG: ibRvMrAVM1nwhif8tvrVoopCURJapptwQVFYxWGoooMJ0saula27lUQVnkJwQcc xyILlBObvG0742rRWbvOIOJHDHuDqeYz7FcCtN3zH0SQAW.VaxPlA4jX2gsNGXzbTV6dJdTALHxF QtBuoaTteRt9nBSQtJrGodTb4u1VN85.XSY4CaU3BsZ.l_7Jw7mPe8stPzHpt.iDrU3bfO65_bSt YAUK8V8QfD5vY_ulPJH4P6ew8Zi4XsUdfesX_g5N.ZA_luCHywBb0Jorx7tspefR2745If_Pk8Qj DE2IAcB0RD4z.JInz85CSklkJ5R2hfDAbomHYG4XwXQdblgWGivFZKNI3iNnRH4wMRQEeInqmhSL HNdJsEqfvdfKenEoYOSuztKY.oTpn4_5onzdWzsnMNdjfWwgoRfmvrvSnUrbCJWPDb.VAmE2fvgB FtD90V8fCb0OQbTHtS8B1_6iRpoE3B1eMpyv5oHuD.SiToPAFwoaziSaOrjUN.3VQcKrssncGi8s 4nFrRp8Cjq95Qx_8hQqTLq5bDT_m0AXCXmOLfiyfuTxNkcxsR4Z3Qkh_wh_7PV.iEVhdfLEncPBc s_mhDd.nz0IF5PvzzdIrqQu_G9Ge_oLwQk3ayn0HieW8aEUdlIAwr.4gAmmXxXKYxiSJha3gsScc BbeePZyDaNhOT1ghcTN48Ppq2J6Cex59ilpdDFSgC_owpx065mjHPXXAyDspZ1IN1F7wkAbTsULg vbe5a.9p6JiaIY8xdD7Z4aWdS1CEF5oAsxVILlp.Z8jY5vUFo_Q1O_jUMzNRMdcRQucknhxN8yrD FwS89FUQcBpZaPYqX2FzkpqwA.qOX2vVJ9mwRKSF81Qy71yf9IfxX2YZHIhozl7YCqyU17JoOgsx ng7nRF_PFfGIsDRnQo3CxUGJHooTmjE7E0Ve7_cke1hciLZjPpWBVQl_2somLAw0fapHdoCRZVIY 7vb_u25AeMPF5SKsBsUP9_6kIimdgvw5ovxv3O9w8kapkjH3Wn_QqWccRvyI6wYH5GVuXPhB9g2P Qx40yuQorpIMp4nvImavmeMWeurloAnUX9uo9ETIVHmh1qanAVdVjxE7J.TtjiCZlnGf.zVa_VFL 7dxOdKbGXs6G3UJZWdE9dMNUxFw1BZpfW6djLQdaR6__.y.1.H9nv5gtYcmJLu6aAL_WTS.voGul D.nEqPIrD8xTjmWhO.WP0UGb.nm0mosHVFUjmgtlRpADmXqEc758Aw9sucp4zr1IIBO4d35hYB3V .WPF5gqyQ0NZ79tI18i4ixp6dODutmVmJBHSnfZSSyjTuachy.M4JM373aEDtkzYmyIRX_RoKD2d 2k3qHDNSYc57tTa93bgKnWhoMCnNX2tPoNUXdANY2YMVNIQnft6lwenoZsLzDCjOYuTa1zNS7r91 dh8f3eP_v2oYeEAX8LfjoEAwrG7IWYeqTAYiqJsgCWR9ysE32H7FXkQVmo8QIG2MObXn7RXBMZ_M zngr9whw7sJSZEy63QDdVmJYRk4hwehagbSRdMQetn4S8w0h77lof3g0rT3J5jiiubEwZPlQTU5H 5Y0DmIpRxK86sutYpjWjPFODQbGzkZykWenxHAXLSbnOS6LJfm7Wu1WwzhiWJc6MU3ov.pNg4dXg 3Z1qV0jEIuFVGi.cHeGmLRdxBYSihWvObVCUnvkdQKaXgAekNGojZy7FVVm0wjecxZA0z6Pbu3MJ 8q5dKC3t9VZCx6_3IVuZ9axoWfJl1lDgdBDmugEjXP6dvT7WoIMmxfgETtUxTT74YA86S7tj6KX. TxIFv0fWShztqrhPgtx9j88Icdq1BxsjlHBFJI_oOi6W2oZrIrx1R1XTTsK97pBPY_axpl.r5n7t 0JCNWLzbOQ5fepFPdksGxmbldXFWY7jadodq93yRf7NlV_AwlFipwL4qFul7dLYLwxCgUfGMANyy I21L0hw11REO1_XDuy05lks0NbGwCLTS0PASMV9_cCQnPDsDe3J_ytU1eqaMT9xajRy2MWF3ZCFZ uy8bWmpudF5s_BcVvHcF3y_3ykibDSzPD.63o5cLwh6Nw6xtybwT8P3g.LdIqn5OEB0IaTfSPi_O CyzqNpLC9Bhq0gsJNNwrJi1tyxdGnSQNDeF8PXIKBrEneoOFJAe1aKByCxh3gYq_G8pXMyWN3v9T m4cN9dGnFZw8qhXZZ9nQCIt.e2R20bRK77SVqdwZmMio2CakmfOhdJbeZeoiMFjnhdiDqc87Mc7N Rl.zmk.awkiGFfs2pjudw2DMv6cimk7odvZik7IUpKRxcMwIoAho1Utg9h1Tknv7TDP2c2WYCgir _49k- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Thu, 16 Feb 2023 18:42:52 +0000 Received: by hermes--production-gq1-655ddccc9-5h9tn (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d4ba328eab782f1a280b7a15aea7f91d; Thu, 16 Feb 2023 18:42:49 +0000 (UTC) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: 6926e2699ae5 - main - arm: Add support for using VFP in kernel [added new: Called fill_fpregs while the kernel is using the VFP] From: Mark Millard In-Reply-To: <4F9A3687-9577-4419-AE1B-D02A4C9212ED@yahoo.com> Date: Thu, 16 Feb 2023 10:42:38 -0800 Cc: Warner Losh Content-Transfer-Encoding: quoted-printable Message-Id: <402AEA29-B895-4031-99A0-876A39C02157@yahoo.com> References: <3A143148-895F-472B-9AFB-5F1AA0FD1FA0@yahoo.com> <782B252E-60AC-4036-BD74-46B95A31B337@yahoo.com> <4F9A3687-9577-4419-AE1B-D02A4C9212ED@yahoo.com> To: "kd@freebsd.org" , "wma@freebsd.org" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.83:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.83:from] X-Rspamd-Queue-Id: 4PHkMy4FkBz3kCf X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N [Adding: Small c++ program that leads to a FreeBSD crash when I force a core-dump (using control-\) during runs .] On Feb 16, 2023, at 00:09, Mark Millard wrote: > [A very simple program gets the failure under gdb > or lldb of example breakpoints.] >=20 > On Feb 15, 2023, at 20:29, Mark Millard wrote: >=20 >> On Feb 15, 2023, at 16:08, Mark Millard wrote: >>=20 >>> Kornel Dul=C4=99ba wrote on >>> Date: Sat, 04 Feb 2023 19:22:23 UTC : >>>=20 >>>> The branch main has been updated by kd: >>>>=20 >>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D6926e2699ae55080f860488895a2a9aa= 6e6d9b4d >>>>=20 >>>> commit 6926e2699ae55080f860488895a2a9aa6e6d9b4d >>>> Author: Kornel Dul=C4=99ba >>>> AuthorDate: 2023-02-04 12:59:30 +0000 >>>> Commit: Kornel Dul=C4=99ba >>>> CommitDate: 2023-02-04 19:21:43 +0000 >>>>=20 >>>> arm: Add support for using VFP in kernel >>>>=20 >>>> Add missing logic to allow in-kernel VFP usage for ARMv7 NEON. >>>> The implementation is strongly based on arm64 code. >>>> It introduces a family of fpu_kern_* functions to enable the usage >>>> of VFP instructions in kernel. >>>> Apart from that the existing armv7 VFP logic was modified, >>>> taking into account that the state of the VFP registers can now >>>> be modified in the kernel. >>>>=20 >>>> Co-developed by: Wojciech Macek >>>> Sponsored by: Stormshield >>>> Obtained from: Semihalf >>>> Reviewed by: andrew >>>> Differential Revision: https://reviews.freebsd.org/D37419 >>>> --- >>>> lib/libthread_db/arch/arm/libpthread_md.c | 21 ++-- >>>> sys/arm/arm/exec_machdep.c | 49 ++++---- >>>> sys/arm/arm/machdep.c | 1 + >>>> sys/arm/arm/machdep_kdb.c | 31 ++++- >>>> sys/arm/arm/swtch-v6.S | 8 +- >>>> sys/arm/arm/swtch.S | 8 +- >>>> sys/arm/arm/vfp.c | 182 +++++++++++++++++++++++++++++- >>>> sys/arm/arm/vm_machdep.c | 6 +- >>>> sys/arm/include/fpu.h | 7 ++ >>>> sys/arm/include/pcb.h | 5 + >>>> sys/arm/include/reg.h | 12 +- >>>> sys/arm/include/vfp.h | 17 +++ >>>> 12 files changed, 293 insertions(+), 54 deletions(-) >>>=20 >>> [This is a somewhat adjusted version of a note replying >>> to a Warner note about a panic someone got during a >>> process coredump that was happening.] >>>=20 >>> Just a possible point, given recent kernel floating >>> point work: >>>=20 >>> I tried to do a typical build and test of some >>> benchmark programs that I sometimes use that involve >>> floating point in some of the programs, some use with >>> multithreading involved. (As FreeBSD and g++ progress >>> I tend to do this once and a while, not as often on >>> armv7 as on aarch64.) >>>=20 >>> On armv7, I now usually get a message about a failure >>> of an internal cross-check, which also leads to the >>> program being stopped early. The messaging from run >>> to run varies what the failure is, but the runs should >>> not vary and should not fail the cross-checks --and >>> previously did not, including when I last tried armv7. >>> (Not recently.) >>>=20 >>> For the specific example failures, the initial serial >>> (single thread) test with float involved works but the >>> following multi-thread test in the same program fails >>> and causes the program to stop when it notices there >>> is a problem. (On occasion the cross-check does does >>> not detect a problem.) >>>=20 >>> The programs that do not test floating point do not >>> fail. (Same algorithm on integral types.) These can >>> involve floating point outside the algorithm >>> benchmarked, but with no multi-threading involved for >>> such and no floating point based cross-checks involved. >>>=20 >>> At this point it is far from obvious to me how I >>> would trackdown the specifics of what leads to the >>> failed cross-checks. But the above is suggestive of >>> there being problems for armv7 handling of saving >>> and restoring floating point context for >>> multi-threading in a process, at least. I've no clue >>> if such are strictly limited to the floating point >>> values that show up vs. if there might be wider >>> memory handling problems that result in the process. >>>=20 >>=20 >> Further runs of the benchmark program show that I also >> get cross-check failures for single-threaded (the first >> way it tests). >>=20 >> But it turns out that, even for single treaded execution >> of the algorithm benchmarked, it is not run on the >> process's initial thread but instead on a created thread. >>=20 >> Turns out that for a debug armv7 kernel (debug is not >> what I normally run) attempting a bt in gdb can lead to >> a kernel panic (td =3D=3D curthread failed) related to >> floating point handling: >>=20 >> . . . >> (gdb) br serial_kernel_runner >> Breakpoint 1 at 0x1db34: serial_kernel_runner. (6 locations) >> (gdb) br parallel_kernel_runner >> Breakpoint 2 at 0x1b43c: parallel_kernel_runner. (6 locations) >> (gdb) run >> Starting program: = /root/acpphint/acpphint_kernelsamplers_main-OPi+2E-2048MiB-threads_4-ILP32= -FreeBSD_main_n260797_dc1b8c9a846e_32bit-g++_12_O3lto-libc++-cpulockdown=20= >> . . . >>=20 >> Breakpoint 1, serial_kernel_runner = (clock_info=3D..., laps=3D3, memry=3D2, ki=3D...) at = acpphint_kernelrunners.cpp:69 >> 69 static auto serial_kernel_runner >> (gdb) bt >> #0 serial_panic: Assertion td =3D=3D curthread failed at = /usr/main-src/sys/arm/arm/exec_machdep.c:103 >> cpuid =3D 3 >> time =3D 1676519530 >> KDB: stack backtrace: >> db_trace_self() at db_trace_self >> pc =3D 0xc05f04a0 lr =3D 0xc007ab0c = (db_trace_self_wrapper+0x30) >> sp =3D 0xe28ea960 fp =3D 0xe28eaa78 >> db_trace_self_wrapper() at db_trace_self_wrapper+0x30 >> pc =3D 0xc007ab0c lr =3D 0xc02ddc44 (vpanic+0x140) >> sp =3D 0xe28eaa80 fp =3D 0xe28eaaa0 >> r4 =3D 0x00000100 r5 =3D 0x00000000 >> r6 =3D 0xc0790bb4 r7 =3D 0xc0b1b930 >> vpanic() at vpanic+0x140 >> pc =3D 0xc02ddc44 lr =3D 0xc02dda28 (dump_savectx) >> sp =3D 0xe28eaaa8 fp =3D 0xe28eaaac >> r4 =3D 0xe28eaad0 r5 =3D 0xbfbfe150 >> r6 =3D 0xe28eaad0 r7 =3D 0xc076a096 >> r8 =3D 0xdb8a47f4 r9 =3D 0x00000016 >> r10 =3D 0x00000040 >> dump_savectx() at dump_savectx >> pc =3D 0xc02dda28 lr =3D 0xc05f3354 (get_vfpcontext+0xb8) >> sp =3D 0xe28eaab4 fp =3D 0xe28eaac8 >> get_vfpcontext() at get_vfpcontext+0xb8 >> pc =3D 0xc05f3354 lr =3D 0xc0611148 (cpu_ptrace+0x38) >> sp =3D 0xe28eaad0 fp =3D 0xe28eabe8 >> r4 =3D 0xdb75cba0 r5 =3D 0xbfbfe150 >> cpu_ptrace() at cpu_ptrace+0x38 >> pc =3D 0xc0611148 lr =3D 0xc0360f4c (kern_ptrace+0x810) >> sp =3D 0xe28eabf0 fp =3D 0xe28eac70 >> r4 =3D 0xe583dba0 r5 =3D 0x00000000 >> r6 =3D 0xdb8a47a8 r10 =3D 0x00000040 >> kern_ptrace() at kern_ptrace+0x810 >> pc =3D 0xc0360f4c lr =3D 0xc0360550 (sys_ptrace+0x1cc) >> sp =3D 0xe28eac78 fp =3D 0xe28eadc0 >> r4 =3D 0xe583de5c r5 =3D 0xe583dba0 >> r6 =3D 0xbfbfe150 r7 =3D 0x00000000 >> r8 =3D 0x00000000 r9 =3D 0xe583de50 >> r10 =3D 0xdb756730 >> sys_ptrace() at sys_ptrace+0x1cc >> pc =3D 0xc0360550 lr =3D 0xc0613b48 (swi_handler+0x170) >> sp =3D 0xe28eadc8 fp =3D 0xe28eae38 >> r4 =3D 0xe583dba0 r5 =3D 0x00000001 >> r6 =3D 0xc090b220 r7 =3D 0x00000000 >> r8 =3D 0x00000000 r9 =3D 0xe583de50 >> swi_handler() at swi_handler+0x170 >> pc =3D 0xc0613b48 lr =3D 0xc05f2d90 (swi_exit) >> sp =3D 0xe28eae40 fp =3D 0xbfbfe128 >> r4 =3D 0x00000042 r5 =3D 0x22e61c20 >> r6 =3D 0xbfbfe150 r7 =3D 0x0000001a >> r8 =3D 0x00424124 r9 =3D 0x00000108 >> r10 =3D 0x00000040 >> swi_exit() at swi_exit >> pc =3D 0xc05f2d90 lr =3D 0xc05f2d90 (swi_exit) >> sp =3D 0xe28eae40 fp =3D 0xbfbfe128 >> KDB: enter: panic >> [ thread pid 5438 tid 106943 ] >> Stopped at kdb_enter+0x54: ldrb r15, [r15, r15, ror r15]! >>=20 >> Note: the code was built via g++12 but using libc++, >> not libstdc++. >>=20 >> So I tried the b=3Dprogram variant that does not tryin to >> lock down which CPUs are used by the threads (a completely >> C++20 standard program variant, not FreeBSD specific for >> its used source code). Failure again . . . >>=20 >> (gdb) br serial_kernel_runner >> Breakpoint 1 at 0x1c1bc: serial_kernel_runner. (6 locations) >> (gdb) br parallel_kernel_runner >> Breakpoint 2 at 0x19ac8: parallel_kernel_runner. (6 locations) >> (gdb) run >> Starting program: = /root/acpphint/acpphint_kernelsamplers_main-OPi+2E-2048MiB-threads_4-ILP32= -FreeBSD_main_n260797_dc1b8c9a846e_32bit-g++_12_O3lto-libc++=20 >> . . . >> Breakpoint 1, serial_kernel_runner = (clock_info=3D..., laps=3D3, memry=3D2, ki=3D...) at = acpphint_kernelrunners.cpp:69 >> 69 static auto serial_kernel_runner >> (gdb) bt >> #0 serial_kernel_runner = (clock_info=3D...,panic: Assertion td =3D=3D curthread failed at = /usr/main-src/sys/arm/arm/exec_machdep.c:103 >> cpuid =3D 0 >> time =3D 1676520400 >> KDB: stack backtrace: >> db_trace_self() at db_trace_self >> pc =3D 0xc05f04a0 lr =3D 0xc007ab0c = (db_trace_self_wrapper+0x30) >> sp =3D 0xe2964960 fp =3D 0xe2964a78 >> db_trace_self_wrapper() at db_trace_self_wrapper+0x30 >> pc =3D 0xc007ab0c lr =3D 0xc02ddc44 (vpanic+0x140) >> sp =3D 0xe2964a80 fp =3D 0xe2964aa0 >> r4 =3D 0x00000100 r5 =3D 0x00000000 >> r6 =3D 0xc0790bb4 r7 =3D 0xc0b1b930 >> vpanic() at vpanic+0x140 >> pc =3D 0xc02ddc44 lr =3D 0xc02dda28 (dump_savectx) >> sp =3D 0xe2964aa8 fp =3D 0xe2964aac >> r4 =3D 0xe2964ad0 r5 =3D 0xbfbfe158 >> r6 =3D 0xe2964ad0 r7 =3D 0xc076a096 >> r8 =3D 0xdb7a511c r9 =3D 0x00000016 >> r10 =3D 0x00000040 >> dump_savectx() at dump_savectx >> pc =3D 0xc02dda28 lr =3D 0xc05f3354 (get_vfpcontext+0xb8) >> sp =3D 0xe2964ab4 fp =3D 0xe2964ac8 >> get_vfpcontext() at get_vfpcontext+0xb8 >> pc =3D 0xc05f3354 lr =3D 0xc0611148 (cpu_ptrace+0x38) >> sp =3D 0xe2964ad0 fp =3D 0xe2964be8 >> r4 =3D 0xdb7ca3e0 r5 =3D 0xbfbfe158 >> cpu_ptrace() at cpu_ptrace+0x38 >> pc =3D 0xc0611148 lr =3D 0xc0360f4c (kern_ptrace+0x810) >> sp =3D 0xe2964bf0 fp =3D 0xe2964c70 >> r4 =3D 0xdb76fba0 r5 =3D 0x00000000 >> r6 =3D 0xdb7a50d0 r10 =3D 0x00000040 >> kern_ptrace() at kern_ptrace+0x810 >> pc =3D 0xc0360f4c lr =3D 0xc0360550 (sys_ptrace+0x1cc) >> sp =3D 0xe2964c78 fp =3D 0xe2964dc0 >> r4 =3D 0xdb76fe5c r5 =3D 0xdb76fba0 >> r6 =3D 0xbfbfe158 r7 =3D 0x00000000 >> r8 =3D 0x00000000 r9 =3D 0xdb76fe50 >> r10 =3D 0xdb754000 >> sys_ptrace() at sys_ptrace+0x1cc >> pc =3D 0xc0360550 lr =3D 0xc0613b48 (swi_handler+0x170) >> sp =3D 0xe2964dc8 fp =3D 0xe2964e38 >> r4 =3D 0xdb76fba0 r5 =3D 0x00000001 >> r6 =3D 0xc090b220 r7 =3D 0x00000000 >> r8 =3D 0x00000000 r9 =3D 0xdb76fe50 >> swi_handler() at swi_handler+0x170 >> pc =3D 0xc0613b48 lr =3D 0xc05f2d90 (swi_exit) >> sp =3D 0xe2964e40 fp =3D 0xbfbfe130 >> r4 =3D 0x00000042 r5 =3D 0x22e61c20 >> r6 =3D 0xbfbfe158 r7 =3D 0x0000001a >> r8 =3D 0x00424124 r9 =3D 0x00000108 >> r10 =3D 0x00000040 >> swi_exit() at swi_exit >> pc =3D 0xc05f2d90 lr =3D 0xc05f2d90 (swi_exit) >> sp =3D 0xe2964e40 fp =3D 0xbfbfe130 >> KDB: enter: panic >> [ thread pid 1107 tid 100140 ] >> Stopped at kdb_enter+0x54: ldrb r15, [r15, r15, ror r15]! >>=20 >> For reference (whitespace may not have >> been preserved): >>=20 >> void >> get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) >> { >> struct pcb *pcb; >>=20 >> MPASS(td =3D=3D curthread); >>=20 >> pcb =3D td->td_pcb; >> if ((pcb->pcb_fpflags & PCB_FP_STARTED) !=3D 0) { >> critical_enter(); >> vfp_store(&pcb->pcb_vfpstate, false); >> critical_exit(); >> } >> KASSERT(pcb->pcb_vfpsaved =3D=3D &pcb->pcb_vfpstate, >> ("Called get_vfpcontext while the kernel is using the = VFP")); >> memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg, >> sizeof(vfp->mcv_reg)); >> vfp->mcv_fpscr =3D pcb->pcb_vfpstate.fpscr; >> } >>=20 >> Unfortunately the benchmark program is far from being a >> minimalist/simple example. >>=20 >> I'm not sure what FreeBSD might have around that would >> have floating point in use but be simple, and possibly >> standardly available, to see if a simpler context is >> available for analogous testing. >>=20 >=20 > The program, an example way to build it such that > it can lead to crashes, and 2 ways to get the > FreeBSD crash with it (native armv7 context): >=20 > // # cc -std=3Dc17 -pedantic -g -O3 simple_dbl.c > // > // # gdb a.out > // (gdb) br test > // (gdb) run > // FreeBSD CRASHES > // > // # lldb a.out > // (lldb) br set -F test > // FreeBSD CRASHES >=20 > #include >=20 > _Bool test(double v) { > return v<0.5; > } >=20 > int main(void) { > return test(drand48()); > } Generating a FreeBSD crash during a core dump for this program looks like: # ./a.out ^\panic: Called fill_fpregs while the kernel is using the VFP cpuid =3D 3 time =3D 1676570748 KDB: stack backtrace: db_trace_self() at db_trace_self pc =3D 0xc05f04a0 lr =3D 0xc007ab0c = (db_trace_self_wrapper+0x30) sp =3D 0xe340b790 fp =3D 0xe340b8a8 db_trace_self_wrapper() at db_trace_self_wrapper+0x30 pc =3D 0xc007ab0c lr =3D 0xc02ddc44 (vpanic+0x140) sp =3D 0xe340b8b0 fp =3D 0xe340b8d0 r4 =3D 0x00000100 r5 =3D 0x00000000 r6 =3D 0xc078f79c r7 =3D 0xc0b1b930 vpanic() at vpanic+0x140 pc =3D 0xc02ddc44 lr =3D 0xc02dda28 (dump_savectx) sp =3D 0xe340b8d8 fp =3D 0xe340b8dc r4 =3D 0xe5a68a80 r5 =3D 0xe29fbe90 r6 =3D 0xe2a132f0 r7 =3D 0xc5763140 r8 =3D 0xe2a132e0 r9 =3D 0xe5a68a80 r10 =3D 0xe340b960 dump_savectx() at dump_savectx pc =3D 0xc02dda28 lr =3D 0xc05fd5a4 (set_regs) sp =3D 0xe340b8e4 fp =3D 0xe340b8f8 set_regs() at set_regs pc =3D 0xc05fd5a4 lr =3D 0xc02617a4 (elf32_get_fpregset+0x2c) sp =3D 0xe340b900 fp =3D 0xe340b908 r4 =3D 0xe2a132f0 r5 =3D 0xc0261778 elf32_get_fpregset() at elf32_get_fpregset+0x2c pc =3D 0xc02617a4 lr =3D 0xc025f6b0 (elf32_coredump+0x308) sp =3D 0xe340b910 fp =3D 0xe340b988 r4 =3D 0xc090a65c r10 =3D 0xe340b960 elf32_coredump() at elf32_coredump+0x308 pc =3D 0xc025f6b0 lr =3D 0xc02e2af8 (sigexit+0xd18) sp =3D 0xe340b990 fp =3D 0xe340bcf8 r4 =3D 0x0000004e r5 =3D 0xe3e37300 r6 =3D 0x00000000 r7 =3D 0xc025f3a8 r8 =3D 0xd79c79ec r9 =3D 0xe3e37274 r10 =3D 0x00000000 sigexit() at sigexit+0xd18 pc =3D 0xc02e2af8 lr =3D 0xc02e3420 (postsig+0x12c) sp =3D 0xe340bd00 fp =3D 0xe340bd88 r4 =3D 0x00000003 r5 =3D 0xe32c23e0 r6 =3D 0xe340bd20 r7 =3D 0xe340bd18 r8 =3D 0xd79c7928 r9 =3D 0xe32cfab8 r10 =3D 0x00000002 postsig() at postsig+0x12c pc =3D 0xc02e3420 lr =3D 0xc02e73ec (ast_sig+0x11c) sp =3D 0xe340bd90 fp =3D 0xe340be08 r4 =3D 0xe32c23e0 r5 =3D 0xd79c79ec r6 =3D 0xc077b982 r7 =3D 0x00000000 r8 =3D 0xd79c7928 r9 =3D 0x00000ab8 r10 =3D 0x00000000 ast_sig() at ast_sig+0x11c pc =3D 0xc02e73ec lr =3D 0xc0348950 (ast_handler+0xe0) sp =3D 0xe340be10 fp =3D 0xe340be28 r4 =3D 0xe340be40 r5 =3D 0x0000000e r6 =3D 0x00004000 r7 =3D 0xc0973e3c r8 =3D 0xe32c23e0 r9 =3D 0x00000001 ast_handler() at ast_handler+0xe0 pc =3D 0xc0348950 lr =3D 0xc0348860 (ast+0x20) sp =3D 0xe340be30 fp =3D 0xe340be38 r4 =3D 0xe340be40 r5 =3D 0xe32c23e0 r6 =3D 0x00000000 r7 =3D 0x000001c6 r8 =3D 0x20032030 r9 =3D 0x204ae084 ast() at ast+0x20 pc =3D 0xc0348860 lr =3D 0xc05f2dcc (swi_exit+0x3c) sp =3D 0xe340be40 fp =3D 0xbfbfec60 r4 =3D 0x60000013 r5 =3D 0xe32c23e0 swi_exit() at swi_exit+0x3c pc =3D 0xc05f2dcc lr =3D 0xc05f2dcc (swi_exit+0x3c) sp =3D 0xe340be40 fp =3D 0xbfbfec60 KDB: enter: panic [ thread pid 3640 tid 100207 ] Stopped at kdb_enter+0x54: ldrb r15, [r15, r15, ror r15]! Note: Having done a dump before reboot after this lead to following boot to fail while processing the dump: . . . Writing crash summary to /var/crash/core.txt.7. panic: Called fill_fpregs while the kernel is using the VFP . . . (Rebooting again worked.) The C++ program, with comments for the usage is: // # c++ -std=3Dc++20 -pedantic -g -O3 -pthread = dbl_and_ull_via_async.cpp // or: // # g++12 -std=3Dc++20 -stdlib=3Dlibc++ -pedantic -g -O3 -pthread = -Wl,-rpath=3D/usr/local/lib/gcc12 dbl_and_ull_via_async.cpp // then: // ./a.out // control-\ # to force the process core dump. // FreeBSD CRASHES #include // std::numeric_limits #include // std::future, std::async, std::launch::async #include // std::abort int main(void) { static_assert(std::numeric_limits::radix=3D=3D2,"double's = radix is not 2 and is unhandled"); constexpr unsigned int ull_width =3D std::numeric_limits::digits; constexpr unsigned int dbl_width =3D = std::numeric_limits::digits; constexpr unsigned int use_width =3D (dbl_width To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f518229d5520 - main - config: fix some common issues with path() usage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f518229d552012bfb1129b2bf1d18dfc89a03b58 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f518229d552012bfb1129b2bf1d18dfc89a03b58 commit f518229d552012bfb1129b2bf1d18dfc89a03b58 Author: Kyle Evans AuthorDate: 2023-02-16 20:36:16 +0000 Commit: Kyle Evans CommitDate: 2023-02-16 20:36:16 +0000 config: fix some common issues with path() usage None of the callers check that the allocation in path() failed, so let's check in path() and abort instead of failing. Along those lines, none of the callers seem to acknowledge that the returned string needs to be free()d -- let's do that as well. There are a couple not addressed in this commit that will be addressed in a future commit by pushing the path() call down into moveifchanged() instead and freeing it properly there. CID: 1505271, 1505250, 1505279 Reviewed by: emaste, imp --- usr.sbin/config/main.cc | 8 +++++++- usr.sbin/config/mkoptions.cc | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/usr.sbin/config/main.cc b/usr.sbin/config/main.cc index ef24d373c8b0..f155b7c5387a 100644 --- a/usr.sbin/config/main.cc +++ b/usr.sbin/config/main.cc @@ -457,6 +457,8 @@ path(const char *file) asprintf(&cp, "%s/%s", destdir, file); else cp = strdup(destdir); + if (cp == NULL) + err(EXIT_FAILURE, "malloc"); return (cp); } @@ -553,6 +555,8 @@ configfile(void) fo = fopen(p, "w"); if (!fo) err(2, "%s", p); + free(p); + if (filebased) { /* Is needed, can be used for backward compatibility. */ configfile_filebased(cfg); @@ -673,8 +677,10 @@ cleanheaders(char *p) if (hl) continue; printf("Removing stale header: %s\n", dp->d_name); - if (unlink(path(dp->d_name)) == -1) + p = path(dp->d_name); + if (unlink(p) == -1) warn("unlink %s", dp->d_name); + free(p); } (void)closedir(dirp); } diff --git a/usr.sbin/config/mkoptions.cc b/usr.sbin/config/mkoptions.cc index f45c1026417c..134c09c2d074 100644 --- a/usr.sbin/config/mkoptions.cc +++ b/usr.sbin/config/mkoptions.cc @@ -294,6 +294,7 @@ tooption(char *name) static char hbuf[MAXPATHLEN]; char nbuf[MAXPATHLEN]; struct opt_list *po; + char *fpath; /* "cannot happen"? the otab list should be complete.. */ (void)strlcpy(nbuf, "options.h", sizeof(nbuf)); @@ -305,7 +306,9 @@ tooption(char *name) } } - (void)strlcpy(hbuf, path(nbuf), sizeof(hbuf)); + fpath = path(nbuf); + (void)strlcpy(hbuf, fpath, sizeof(hbuf)); + free(fpath); return (hbuf); } From nobody Thu Feb 16 20:37:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHmwH25vqz3rVg0; Thu, 16 Feb 2023 20:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHmwH1H0tz3vyc; Thu, 16 Feb 2023 20:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676579855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ceWreJTICDSg5+OSZpN/mnzbQlnJrwD3fi0zuSQFjg=; b=sA54yPwQvSm78ZqcIuUdvY9pnRtln6P2T+2XSTAjn9f7QsbUGAUxAhz8nm+r+Z+Ua03tnC RIcujgQoZfujnR+OwL9Dj6WYUQGh54PqzjxYDQy0lqKTG9wGxzjcRpNEbszt9zu3DyMrOu TJ1AMCkUGBNEkzQqUQ1A4hrkwF+kGpwr1fbjWDhpFrlAyLHGTbetgfuAM0TpNC2wGRiCgP d9zcPPEaZJ0pPDvcVTIZ4aqPgfeCnf0x+CxPR+szCRcYVqKdqn0mt5g/sSUFWucDc2vNZk 1jFLFQifnOk6H7tCtwN6IYtuSelvoASBHmbjB7BWIKchgfTZg4SwvpzX+7fz0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676579855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ceWreJTICDSg5+OSZpN/mnzbQlnJrwD3fi0zuSQFjg=; b=kHjYPWhYuLi32NqV393bnl9hg2v97D/YKimLcKGGKhMxwsxHSzjRZ/j2qQjBNm+I6iwy/5 bnFLOJTi6OLW574DUsLvLTgqFcbyjjZKiXtKgGHzuRg7shApcmeFfkPmkjhLhOnOps2dvr id1imgohejOYUBEHK/XD/Mc1yvm57V36p7A8qcLTu59QcqepFiSx0yWO+EzwaL58RQlQYa /pEFguAC934T2cHkaMfK+RlOeqsqzi9yH0p7rWLCjvXkZt5BBts6vxGouRhKRnBXb08SIe RKftPuYIMGhr2h4Y3QloK3g+LYDCHvRJFIbGDCSvgstMk54K+LWacBIBS7LuuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676579855; a=rsa-sha256; cv=none; b=JaHCowjPxdboEO5ifpzVfYR2ddjAkLRDIMaru+dcfJ3mCo46iHb27g5kuCTfh8Leri+Je8 l3gbSFev4FWjG8/0dkEwpoh3qPkmUcZiILFKwL4DZFVvMTD/iteQ6CE+z+MBJ0YNaWLZiK 1z97gPlvSqPE0VcCWQ3Etw8S38w9kmiss+4qMQ0WA0Y3fjUaQ0agmA750DG0qx3pxSDHDs gTYqKRgMnG3Y2/UOrOakhrbDd9wXOvwC10UUwvw8FCculMNigMyDM7QNcsERni2EQakQU2 oEPNjzJoajwzsPSX3IZIW7DiYWPoKOeuOsuy7Mpz+PuoEG4IM/pihJJluFvGiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHmwH0FZMzHqM; Thu, 16 Feb 2023 20:37: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 31GKbYsV002499; Thu, 16 Feb 2023 20:37:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GKbYuq002498; Thu, 16 Feb 2023 20:37:34 GMT (envelope-from git) Date: Thu, 16 Feb 2023 20:37:34 GMT Message-Id: <202302162037.31GKbYuq002498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: b2c5a01722f9 - main - config: push path() into moveifchanged() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2c5a01722f9b18a56ab5459dceba1ae5e50fddd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b2c5a01722f9b18a56ab5459dceba1ae5e50fddd commit b2c5a01722f9b18a56ab5459dceba1ae5e50fddd Author: Kyle Evans AuthorDate: 2023-02-16 20:36:16 +0000 Commit: Kyle Evans CommitDate: 2023-02-16 20:36:42 +0000 config: push path() into moveifchanged() Every caller path()s its arguments anyways, just simplify these and push path() into moveifchanged(). This fixes a number of memory leaks in the process since path() allocates memory, which we will now free(). While we're here, make sure we close from_fd/to_fd appropriately. CID: 1471040, 1471714, 1472045, 1006907, 1006908 Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D38641 --- usr.sbin/config/main.cc | 33 ++++++++++++++++++++++----------- usr.sbin/config/mkmakefile.cc | 6 +++--- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/usr.sbin/config/main.cc b/usr.sbin/config/main.cc index f155b7c5387a..66a071401183 100644 --- a/usr.sbin/config/main.cc +++ b/usr.sbin/config/main.cc @@ -579,7 +579,7 @@ configfile(void) p += strlen(KERNCONFTAG); fprintf(fo, "%s", p); fclose(fo); - moveifchanged(path("config.c.new"), path("config.c")); + moveifchanged("config.c.new", "config.c"); cfgfile_removeall(); } @@ -591,6 +591,7 @@ void moveifchanged(const char *from_name, const char *to_name) { char *p, *q; + char *from_path, *to_path; int changed; size_t tsize; struct stat from_sb, to_sb; @@ -598,17 +599,19 @@ moveifchanged(const char *from_name, const char *to_name) changed = 0; - if ((from_fd = open(from_name, O_RDONLY)) < 0) + from_path = path(from_name); + to_path = path(to_name); + if ((from_fd = open(from_path, O_RDONLY)) < 0) err(EX_OSERR, "moveifchanged open(%s)", from_name); - if ((to_fd = open(to_name, O_RDONLY)) < 0) + if ((to_fd = open(to_path, O_RDONLY)) < 0) changed++; if (!changed && fstat(from_fd, &from_sb) < 0) - err(EX_OSERR, "moveifchanged fstat(%s)", from_name); + err(EX_OSERR, "moveifchanged fstat(%s)", from_path); if (!changed && fstat(to_fd, &to_sb) < 0) - err(EX_OSERR, "moveifchanged fstat(%s)", to_name); + err(EX_OSERR, "moveifchanged fstat(%s)", to_path); if (!changed && from_sb.st_size != to_sb.st_size) changed++; @@ -619,23 +622,31 @@ moveifchanged(const char *from_name, const char *to_name) p = (char *)mmap(NULL, tsize, PROT_READ, MAP_SHARED, from_fd, (off_t)0); if (p == MAP_FAILED) - err(EX_OSERR, "mmap %s", from_name); + err(EX_OSERR, "mmap %s", from_path); q = (char *)mmap(NULL, tsize, PROT_READ, MAP_SHARED, to_fd, (off_t)0); if (q == MAP_FAILED) - err(EX_OSERR, "mmap %s", to_name); + err(EX_OSERR, "mmap %s", to_path); changed = memcmp(p, q, tsize); munmap(p, tsize); munmap(q, tsize); } + if (changed) { - if (rename(from_name, to_name) < 0) - err(EX_OSERR, "rename(%s, %s)", from_name, to_name); + if (rename(from_path, to_path) < 0) + err(EX_OSERR, "rename(%s, %s)", from_path, to_path); } else { - if (unlink(from_name) < 0) - err(EX_OSERR, "unlink(%s)", from_name); + if (unlink(from_path) < 0) + err(EX_OSERR, "unlink(%s)", from_path); } + + close(from_fd); + if (to_fd >= 0) + close(to_fd); + + free(from_path); + free(to_path); } static void diff --git a/usr.sbin/config/mkmakefile.cc b/usr.sbin/config/mkmakefile.cc index 472f85fa4bc2..969d32cf1389 100644 --- a/usr.sbin/config/mkmakefile.cc +++ b/usr.sbin/config/mkmakefile.cc @@ -184,7 +184,7 @@ makefile(void) } (void) fclose(ifp); (void) fclose(ofp); - moveifchanged(path("Makefile.new"), path("Makefile")); + moveifchanged("Makefile.new", "Makefile"); } static void @@ -327,7 +327,7 @@ makehints(void) } fprintf(ofp, "\"\\0\"\n};\n"); fclose(ofp); - moveifchanged(path("hints.c.new"), path("hints.c")); + moveifchanged("hints.c.new", "hints.c"); } /* @@ -369,7 +369,7 @@ makeenv(void) } fprintf(ofp, "\"\\0\"\n};\n"); fclose(ofp); - moveifchanged(path("env.c.new"), path("env.c")); + moveifchanged("env.c.new", "env.c"); } static void From nobody Thu Feb 16 20:37:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHmwJ2HJ5z3rVg3; Thu, 16 Feb 2023 20:37: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 4PHmwJ1jcnz3vxL; Thu, 16 Feb 2023 20:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676579856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1rossOgng60yxtutRLUfCRL88HVrw6+PZjXnslexh3E=; b=J7r/iJdxtvtH0SxUrhLJ6lTjke/iLjVGdoy7KQGnjgqOvSNHct1L3iGQXsP5iuIu1KLp0U oo/L2D2Dr//EZPy8Am4iIiB9SBNnw2gg58mKG20zFGkm09SPp45SPsEYoOYl51TPq2bxtb cN/qrGpX1fe2gqGjMYq1GWBs6VU6JpYqmhS20O32nuUDzZYaVbaTYxR01S2c9VzHKBtpz9 m71lqoue2DcUaTsSHDW3aIknRpNClGepeeJ3f0agpj+WkjRm9tkNuh4g1zHtxhuDLxkNmR y8FC12jKYCzp1cMtEtbo/6qCPvQVIdCvfGCP59rb4Xa+K//nf98RWSJ3GHZIYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676579856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1rossOgng60yxtutRLUfCRL88HVrw6+PZjXnslexh3E=; b=aD9e1Xex8QSqfJcRf0Pm3nQAdvlhEPH58sGpOVaf05B+xSj19vB4FrZiSFgRMAVhlWOy4O iTmvVVnfOWKR82MGzFKTJQQdKxQ+v7qzEkebo8pvQtU29bYsSqW2q23GoMnhP5in5nFN+i 9f5h1HyVF0/7LcbExqivnwYLnpM4w8R7N3gULEd3yMA7+mLQEvaFBidJhVMMJuZFwEUO1R TzlEiITHYziJNz+yS75738k0xvbw/SlkCMgz1PBnehAklawQv3DvKAoy2Fg8vkQYWEKEAm DtqcjDgD/eM3d6r8kWuWiMiUG5W4h14UDp0Rm3rEjdY5DdMlOqj2givrVl1q9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676579856; a=rsa-sha256; cv=none; b=ToBRbw4p2vymI+Tn/0LLhROsnI/RZKrNQgRG9+R4pic32OkeZ1srrF3lRb7VSen82s9SV4 w6p7tJjb34C1GbPXw//+gFEpPpz0lK4SX7qcK5uWrRMO3IrYYR/4LsjuzDlIOetROKNB3v a4bzJS8ykM6eJaBOQ5q/ZKsNsUCdOcru/vgIibrS6PUjuoUn01anzWrD+gdoTeO8HzNkcF nNs7FzsqzbPZTXEG5mnTQVNr6692Zw/E990Qdgo/sOvJW3yYzCLECTU7k8xiA2o3rLG9c6 4YSYx6xX5hA01fTHuOPzAQJXre7QzHbyWUTpK08zxxV5fvyc415tdtIeE2FVcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHmwJ0mWqzHHB; Thu, 16 Feb 2023 20:37: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 31GKbaPM002527; Thu, 16 Feb 2023 20:37:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GKba12002526; Thu, 16 Feb 2023 20:37:36 GMT (envelope-from git) Date: Thu, 16 Feb 2023 20:37:36 GMT Message-Id: <202302162037.31GKba12002526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: da8884202940 - main - config: error out on malformed env/hint lines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da8884202940498096a8c37d91d2fbbf471c6e7b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=da8884202940498096a8c37d91d2fbbf471c6e7b commit da8884202940498096a8c37d91d2fbbf471c6e7b Author: Kyle Evans AuthorDate: 2023-02-16 20:36:17 +0000 Commit: Kyle Evans CommitDate: 2023-02-16 20:37:05 +0000 config: error out on malformed env/hint lines We need these to be assignments, error out if they're not. While we're here, tag errout as __printflike so that the compiler will sanity check the format string + args. CID: 1505293 Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D38642 --- usr.sbin/config/mkmakefile.cc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/usr.sbin/config/mkmakefile.cc b/usr.sbin/config/mkmakefile.cc index 969d32cf1389..2aaed82ce3ee 100644 --- a/usr.sbin/config/mkmakefile.cc +++ b/usr.sbin/config/mkmakefile.cc @@ -69,10 +69,11 @@ static void read_files(void); static void sanitize_envline(char *result, const char *src); static bool preprocess(char *line, char *result); static void process_into_file(char *line, FILE *ofp); -static void process_into_map(char *line, env_map &emap); +static int process_into_map(char *line, env_map &emap); static void dump_map(env_map &emap, FILE *ofp); -static void errout(const char *fmt, ...) +static void __printflike(1, 2) +errout(const char *fmt, ...) { va_list ap; @@ -269,16 +270,20 @@ process_into_file(char *line, FILE *ofp) fprintf(ofp, "\"%s\\0\"\n", result); } -static void +static int process_into_map(char *line, env_map &emap) { char result[BUFSIZ], *s; if (preprocess(line, result)) { s = strchr(result, '='); + if (s == NULL) + return (EINVAL); *s = '\0'; emap[result] = s + 1; } + + return (0); } static void @@ -320,8 +325,11 @@ makehints(void) ifp = fopen(hint->hint_name, "r"); if (ifp == NULL) err(1, "%s", hint->hint_name); - while (fgets(line, BUFSIZ, ifp) != NULL) - process_into_map(line, emap); + while (fgets(line, BUFSIZ, ifp) != NULL) { + if (process_into_map(line, emap) != 0) + errout("%s: malformed line: %s\n", + hint->hint_name, line); + } dump_map(emap, ofp); fclose(ifp); } @@ -360,8 +368,11 @@ makeenv(void) ifp = fopen(envvar->env_str, "r"); if (ifp == NULL) err(1, "%s", envvar->env_str); - while (fgets(line, BUFSIZ, ifp) != NULL) - process_into_map(line, emap); + while (fgets(line, BUFSIZ, ifp) != NULL) { + if (process_into_map(line, emap) != 0) + errout("%s: malformed line: %s\n", + envvar->env_str, line); + } dump_map(emap, ofp); fclose(ifp); } else From nobody Thu Feb 16 20:37:37 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHmwK3BLqz3rVTQ; Thu, 16 Feb 2023 20:37: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 4PHmwK2k8dz3wG5; Thu, 16 Feb 2023 20:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676579857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ydtejTkSLfsO92GbNB3rG2ZKvQG6rAedFZKOx9yFjEs=; b=knkDMFs+8fMTuyxeiu6Lxl1ul4PzdHGcdXGbpVoWJnLUrzfIv2TFqvdW1rGbF/WvTOGMU1 17TAhvQbp74KFnjOq4Cyf2d/H2sGsnHU8sDasEnNND8Fi/5SmB675Nlv0I6xwTAxv2sk+Q 10A8ULNBt6Qe0LHMr9YzFdjZ58+4FJ1cLc9DjDwKqAqvK22UBXOlo9RNPl3oK9GzoVAK79 hOAi/WPo/pO/T7vUDVekOkaT+30UtbQL8YLjYB7AvD25PxPRWo2KJq3iZElm2JnO8AIygo WCWxelOr6NKbIVSb6wGs4XwFTSpByu2JcJnRq6CN0Hcg5ME+p+erepAa5gNxFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676579857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ydtejTkSLfsO92GbNB3rG2ZKvQG6rAedFZKOx9yFjEs=; b=a0H8bVRDe2+HfvXuvjXSTDsW6MK8rXEV4ZT1hScgrD72xZNLIH8OnPCHOx0eDA2fkYsseL Oqm0ZNx8KK5p8MREaGdlcC21gZh3xot+sx6mVnGi4GujZpy9hwESt1v5+EdiQ4DZTUeb/A zF8fiAaQAC8HlzzCFAuWXGBtaQr9JSHdnIH3pkLJLlGxMKaSRSE03Z3tWbH50pE5wbIbu6 8KyslRJDNu//ISWR9+1lSAlQH4Hhbz3cYJAktwQDFnxXsZcDf6CMc2qeXNRScBvbLCS7ML kl8szHdQ2PPw+cwnJuQHLHfmdKwNf1/W8liRJ7P37Qv2NDdYIWI/UUEtFdTkJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676579857; a=rsa-sha256; cv=none; b=W11NBoxXiTRYTLC3UdpVLhEX7syroPyoy8xUQAd+8T/YofTnQmpYESimStPRJb43uSfTeS ZyiBAMekPtc6AiCTH3Z6LLhJFQiX8KLJUxDZhiwJ/nx8B+OVTjgv9egVa3gN62BwcY3Cy2 0gssLJS35xgXppedOxHQw+GEY/QYqyt6AMzD03YXWAzYcA9qoe3kNzXX8bXCcVD0ig2yyH FsTY80rquQo7fUQIn5m0h/z4de+cDq6UhP5DgNeuSYP6u/ss6jiv8/LrD9W5PqvpJLpy+o zX/tyyXS4slsKO5HlwNvd65JolWGfzmI32RUwHXt1Q3B1KxVqhmRI15eYMoLHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHmwK1k9czHfC; Thu, 16 Feb 2023 20:37: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 31GKbbfB002562; Thu, 16 Feb 2023 20:37:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GKbbAY002561; Thu, 16 Feb 2023 20:37:37 GMT (envelope-from git) Date: Thu, 16 Feb 2023 20:37:37 GMT Message-Id: <202302162037.31GKbbAY002561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: c04ad15ca7db - main - config: address a number of Coverity issues List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c04ad15ca7dbe9034b274e404edc0bcf6a5300e0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c04ad15ca7dbe9034b274e404edc0bcf6a5300e0 commit c04ad15ca7dbe9034b274e404edc0bcf6a5300e0 Author: Kyle Evans AuthorDate: 2023-02-16 20:36:17 +0000 Commit: Kyle Evans CommitDate: 2023-02-16 20:37:06 +0000 config: address a number of Coverity issues Highlights: - Various memory leaks - FILE* leaks - `tsize` in moveifchanged() is only needed if !changed, and `from_sb` is only valid if !changed. - Simplify trivially true expression - Sanity check elfdump size output (+ fix variable sizes) (des@) CID: 1471167, 1006391, 1505333, 1505275, 1505349, 1505306, 1505232 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D38643 --- usr.sbin/config/lang.l | 2 ++ usr.sbin/config/main.cc | 10 ++++++---- usr.sbin/config/mkoptions.cc | 20 +++++++++++++++----- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l index ed0b2aa794b3..243b66666d0e 100644 --- a/usr.sbin/config/lang.l +++ b/usr.sbin/config/lang.l @@ -297,6 +297,8 @@ include(const char *fname, int ateof) return (-1); } cfgfile_add(fnamebuf == NULL ? fname : fnamebuf); + free(fnamebuf); + in = malloc(sizeof(*in)); assert(in != NULL); in->in_prev = inclp; diff --git a/usr.sbin/config/main.cc b/usr.sbin/config/main.cc index 66a071401183..f6c99e32c594 100644 --- a/usr.sbin/config/main.cc +++ b/usr.sbin/config/main.cc @@ -616,9 +616,9 @@ moveifchanged(const char *from_name, const char *to_name) if (!changed && from_sb.st_size != to_sb.st_size) changed++; - tsize = (size_t)from_sb.st_size; - if (!changed) { + tsize = (size_t)from_sb.st_size; + p = (char *)mmap(NULL, tsize, PROT_READ, MAP_SHARED, from_fd, (off_t)0); if (p == MAP_FAILED) @@ -736,7 +736,7 @@ kernconfdump(const char *file) struct stat st; FILE *fp, *pp; int error, osz, r; - unsigned int i, off, size, t1, t2, align; + size_t i, off, size, t1, t2, align; char *cmd, *o; r = open(file, O_RDONLY); @@ -765,8 +765,10 @@ kernconfdump(const char *file) free(cmd); (void)fread(o, osz, 1, pp); pclose(pp); - r = sscanf(o, "%d%d%d%d%d", &off, &size, &t1, &t2, &align); + r = sscanf(o, "%zu%zu%zu%zu%zu", &off, &size, &t1, &t2, &align); free(o); + if (size > SIZE_MAX - off || off + size > (size_t)st.st_size) + errx(EXIT_FAILURE, "%s: incoherent ELF headers", file); if (r != 5) errx(EXIT_FAILURE, "File %s doesn't contain configuration " "file. Either unsupported, or not compiled with " diff --git a/usr.sbin/config/mkoptions.cc b/usr.sbin/config/mkoptions.cc index 134c09c2d074..1ffb9722af8b 100644 --- a/usr.sbin/config/mkoptions.cc +++ b/usr.sbin/config/mkoptions.cc @@ -263,7 +263,7 @@ do_option(char *name) if (op == NULL) err(EXIT_FAILURE, "calloc"); op->op_name = ns(name); - op->op_value = value ? ns(value) : NULL; + op->op_value = ns(value); SLIST_INSERT_HEAD(&op_head, op, op_next); } @@ -383,8 +383,10 @@ read_option_file(const char *fname, int flags) } optname = ns(wd); wd = get_word(fp); - if (wd.eof()) - return (1); + if (wd.eof()) { + free(optname); + break; + } if (wd.eol()) { if (flags) { fprintf(stderr, "%s: compat file requires two" @@ -399,10 +401,18 @@ read_option_file(const char *fname, int flags) } else { val = ns(wd); } - if (flags == 0) + + if (flags == 0) { + /* + * insert_option takes possession of `optname` in the + * new option instead of making yet another copy. + */ insert_option(fname, optname, val); - else + } else { update_option(optname, val, flags); + free(optname); + optname = NULL; + } } (void)fclose(fp); return (1); From nobody Thu Feb 16 21:28:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHp315gm8z3rYvC; Thu, 16 Feb 2023 21:28: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 4PHp3159n4z43Bh; Thu, 16 Feb 2023 21:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676582909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V48vs2RYzVTGZzYuahq9Fb/wjxWes3+auaYrUz15r1U=; b=cG8Ih03iGgSFy13wTnIXjUa/A3TUXH/D6pxMruGqRwmMgwg7AIwl5xklw6WGYlXZtMJ7x2 uCx/Ap0L5lHA2i51OyB4bPC4q5aZFrTHBPCG96HZ+xtALgbl4UunYCQ5eDtxBeUHXLFII1 DzVvpNIH7NKJ81VZ1zmOf16nAExRyUEsdpoSfmMBhfcOer5qGJ0Mia0EyAPY6NhYzNXWhf JZN6UitpVYksOsmg/czmOt3K5MvWAjo9pMANGgn3DyRHRT3OpFBmqJN2zIFQHMH52T98Vb QghbqfaIZl4GOLv3ozMe0xaOD5WXOJAhxZevyRjODgY/adG01E6K37jQWWTKjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676582909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V48vs2RYzVTGZzYuahq9Fb/wjxWes3+auaYrUz15r1U=; b=qmuqaKRQKGvxK5UJTJYYv5JFfm2v0XXXEnzvjwKobv804Q0IYRBNDBv5lJ26CkWIyojxvK dEERiYyk8yFhHiYaFR2aukg5OKkQBiL9AE2tOmtyV5FP2RWqOJ3KKxpRwG23syfxuqVurx 968eLqX2VdJSRMf+8hITu0ec7j7tzm0lMLBHwhjLQffEa5jj2ZrAMRCzfahXKJ1OKK9AKL Ss7FgScuGz7Qbh/mztc39Wj6ytielAqdPfosJSuub9HdMS8NH0pdX9lXnJT+SXqxfM674A CXYauNmfXThtehjFSUqgLRs4r1UCZFNgXw0t4WUwiKFyeG2WE/N81dFiDuxlzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676582909; a=rsa-sha256; cv=none; b=Y2X/C7iYbkQQYUbx6E4PJFZYJAmaYG/E4KoWcYX2awpeuNUi/WDyhvTO8rzg9PFOWyQrAb c8Z26sBGzcBPLmzXFnpv6s/61S7hlz8W+unGorM2347mvg+Tw0zKw3L8XMx/5mzlQw9FqX /L5fy7MkZdwmGUJ+soTq5nRlRSvA/1nxiN2rUVVi2WxMBBzCGwI/ctZf2+WxCACGQHWDzi oRODSifKXGX4DXyVMggPsIJQJIlDkD6ev7SOfSuI+iwfSZPj3hkD8bMOrKHalS7/Ur+upo lnZyxT9RB4VhkVj/MKMWBPmyDGW+W6tOJjc9ztsFfg0BXCMsPXqbLrkmVISAzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHp314DlpzK3t; Thu, 16 Feb 2023 21:28: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 31GLSTet074456; Thu, 16 Feb 2023 21:28:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GLSTqa074455; Thu, 16 Feb 2023 21:28:29 GMT (envelope-from git) Date: Thu, 16 Feb 2023 21:28:29 GMT Message-Id: <202302162128.31GLSTqa074455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 4787d888c31f - main - Clean up additional obsolete MLINKS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4787d888c31fbce84af003bbd4cd4bdce0b1bcd9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=4787d888c31fbce84af003bbd4cd4bdce0b1bcd9 commit 4787d888c31fbce84af003bbd4cd4bdce0b1bcd9 Author: Mitchell Horne AuthorDate: 2023-02-13 18:29:12 +0000 Commit: Mitchell Horne CommitDate: 2023-02-16 21:22:35 +0000 Clean up additional obsolete MLINKS Sponsored by: The FreeBSD Foundation Fixes: d1c7405ef68a ("PCBGROUP.9: remove obsolete man page") Fixes: 52f9a2823c64 ("rtalloc.9: remove obsolete man page") --- ObsoleteFiles.inc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 2f676ae41e14..74f0c70c25f1 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -411,9 +411,31 @@ OLD_FILES+=usr/tests/usr.bin/timeout/timeout_test # 20230124: rtalloc.9 removed OLD_FILES+=usr/share/man/man9/rtalloc.9.gz +OLD_FILES+=usr/share/man/man9/rtalloc_fib.9.gz +OLD_FILES+=usr/share/man/man9/rtalloc_ign.9.gz +OLD_FILES+=usr/share/man/man9/rtalloc_ign_fib.9.gz +OLD_FILES+=usr/share/man/man9/rtalloc1.9.gz +OLD_FILES+=usr/share/man/man9/rtalloc1_fib.9.gz +OLD_FILES+=usr/share/man/man9/rtfree.9.gz +OLD_FILES+=usr/share/man/man9/RT_ADDREF.9.gz +OLD_FILES+=usr/share/man/man9/RT_LOCK.9.gz +OLD_FILES+=usr/share/man/man9/RT_REMREF.9.gz +OLD_FILES+=usr/share/man/man9/RT_RTFREE.9.gz +OLD_FILES+=usr/share/man/man9/RT_UNLOCK.9.gz +OLD_FILES+=usr/share/man/man9/RTFREE.9.gz +OLD_FILES+=usr/share/man/man9/RTFREE_LOCKED.9.gz # 20230123: PCBGROUP.9 removed OLD_FILES+=usr/share/man/man9/PCBGROUP.9.gz +OLD_FILES+=usr/share/man/man9/in_pcbgroup_byhash.9.gz +OLD_FILES+=usr/share/man/man9/in_pcbgroup_byinpcb.9.gz +OLD_FILES+=usr/share/man/man9/in_pcbgroup_destroy.9.gz +OLD_FILES+=usr/share/man/man9/in_pcbgroup_enabled.9.gz +OLD_FILES+=usr/share/man/man9/in_pcbgroup_init.9.gz +OLD_FILES+=usr/share/man/man9/in_pcbgroup_remove.9.gz +OLD_FILES+=usr/share/man/man9/in_pcbgroup_update.9.gz +OLD_FILES+=usr/share/man/man9/in_pcbgroup_update_mbuf.9.gz +OLD_FILES+=usr/share/man/man9/in6_pcbgroup_byhash.9.gz # 20221214: TCPDEBUG removed OLD_FILES+=usr/include/netinet/tcp_debug.h From nobody Thu Feb 16 21:28:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHp326L5mz3rZJc; Thu, 16 Feb 2023 21:28:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHp325jjhz43FT; Thu, 16 Feb 2023 21:28:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676582910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qdV1UJDJuHC1USclDSwmwvz7kY6i2sNZiW7Wni4OVgU=; b=m/LFmkoys2Zp06t4rDoECvaWNo3xeqj6im8kO2qceTnD5sVHvnSPUkov8GuSgOIiuV4k/W 0LTV/qeXiMV7P2F+3dTcSeEZZapSM8VW/cZikBrtc2R2PlNmeh7Zbdl5F75gFY321Zmm/F X3ZalbC1YDUIUv+CqDtck7jYnq+hRzqDmFZnCRPbtM71pICLrDC2kIDxl41QGaN5LnLIbV or6zbp3SJ9xHOrx4EXObwJfJ8Pw71dPmFA8c6OxvvMI9lpuJLsP3Y4aH6ClrTM6cfMre7K +/fIgHfBgZppdFCj4OJSKtrl3jZ/Trbq1nA/TG6LAgY3rZxQH7pJzen2yfl9Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676582910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qdV1UJDJuHC1USclDSwmwvz7kY6i2sNZiW7Wni4OVgU=; b=YLfuywzDflExhQiHwofDoOwHL0LxUzvrq5WjT5vjgswQTtl5Dl7I8WDpFMHvciEPMD3siL XgZwcvLGqUA1hCThpvcXKBrA2YS/tOJrR+w85nY+EcPbdcW2ARLyCALiu+Tuzi2IplTXgq sorD071vPM0KTmROm6yFDRNVIizRxeUsTMNv/TUSSyYBXBjIKwv+JBy37uUobq55z9zbF6 saoMxki0M6dE6MY3O2mKyVFZAQx0jA5qdR8KZfonZOYBz5UPfvi3+WDqaOhW3asyGiYKE+ DomK/cwJqOh4KMvZDimhoBOazfk4mfG0AB/5APvuOlue9MB9HfFWMtvmHzsR9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676582910; a=rsa-sha256; cv=none; b=U0yGgWUO31h87/c9MOlwb2J8ET6FyyhfZFfxZJUAOuaULMyU4FGQ+/D2Vge1PPa9js2BTC /Fscse8Gnv5bmOYGKtdWWdlCvnUsjkC297O467Ujl8CSm0u/EtqcUFU2gFoY+pxvAHlMKc rHcQ3Pb+pTo19uMGdmiV5kCtc+IqCyvKTFcLdsOX9ZcdEvZeHbqc6D38Ll74AskPUm4VM8 EfFEdgxnwQ/XpKA0NjPps3qhCJcXqixRfAN2yw4ZLuGZ4SrbvXaKWTQHzqrbTS2kTNPwqf +DybzRCBnc/mfz7lB2j3J+xSKH7RT1yckQGD0GSqV12qsJB563DAq1ozcQBkOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHp324q2RzJXh; Thu, 16 Feb 2023 21:28:30 +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 31GLSU6k074480; Thu, 16 Feb 2023 21:28:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GLSUOD074479; Thu, 16 Feb 2023 21:28:30 GMT (envelope-from git) Date: Thu, 16 Feb 2023 21:28:30 GMT Message-Id: <202302162128.31GLSUOD074479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 3aed0ffc1588 - main - kern/clock: remove interrupt reporting from watchdog_fire() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3aed0ffc15881c5cf3fc0824dad037accc960dcb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3aed0ffc15881c5cf3fc0824dad037accc960dcb commit 3aed0ffc15881c5cf3fc0824dad037accc960dcb Author: Elliott Mitchell AuthorDate: 2023-02-16 21:18:54 +0000 Commit: Mitchell Horne CommitDate: 2023-02-16 21:24:29 +0000 kern/clock: remove interrupt reporting from watchdog_fire() The interrupt counts may have been valuable in the past, but now DDB can readily provide them via 'show intrcnt'. This is one of the only consumers of these counter arrays outside of the interrupt code itself, and this should be avoided. Reviewed by: mhorne, fuz Differential Revision: https://reviews.freebsd.org/D37870 --- sys/kern/kern_clock.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index b8122b7d6468..1670b6fde0c4 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -828,30 +828,11 @@ watchdog_config(void *unused __unused, u_int cmd, int *error) } /* - * Handle a watchdog timeout by dumping interrupt information and - * then either dropping to DDB or panicking. + * Handle a watchdog timeout by dropping to DDB or panicking. */ static void watchdog_fire(void) { - int nintr; - uint64_t inttotal; - u_long *curintr; - char *curname; - - curintr = intrcnt; - curname = intrnames; - inttotal = 0; - nintr = sintrcnt / sizeof(u_long); - - printf("interrupt total\n"); - while (--nintr >= 0) { - if (*curintr) - printf("%-12s %20lu\n", curname, *curintr); - curname += strlen(curname) + 1; - inttotal += *curintr++; - } - printf("Total %20ju\n", (uintmax_t)inttotal); #if defined(KDB) && !defined(KDB_UNATTENDED) kdb_backtrace(); From nobody Thu Feb 16 21:30:25 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHp5F57mdz3rZY3; Thu, 16 Feb 2023 21:30: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 4PHp5F4j1vz43qf; Thu, 16 Feb 2023 21:30:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676583025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tl+uKTXHcn4AKaj2lnB6ve4a1SLoKsdp9bZWxG6RTzY=; b=FbbybFcQLL6zStExTF7cHcwcy4oZ8R/mTsFo045k0OTYYA3OlTZ6pt0qA38SilILnUmBdE PQjvS74lQb/SRJEEDBt3IB3zsCGXgbC0xJdZZSwwl28+dOLLZHY6WHG4G3X6f+y4TwtEu6 VD1+kKC27uvmBdZGkRiX9L+dsmjRw45v7rUp0aX4+tt59nTIq4XEsexGbhsDkOlfc11Avs kXtgXQ4H3D+Nv7qEzDoYvDGsJnvWOU42OQER44VTDxMPmTPXsHs6mV7D7m6jc6ZREavBJj 2Pl/z8vOys+MIYJknsL6FtArJ6OZeFgZnIZ/JhGP5thUZzYpgLv0CYagyGXnpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676583025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tl+uKTXHcn4AKaj2lnB6ve4a1SLoKsdp9bZWxG6RTzY=; b=sCDJFztVEDH4yjT2UR3XODP+rYB/VvRiJa/GRSkUpQDRm0FmL8/iCcdOjT3u0txqIKwywp U/YI//foONvMRrrCHcFUlX14xmw3uWdMxOkBiKDm7VJNccSAbfoeusRFqGan9menms6OCP s1KzPYPyQLrfBO16v0eHgJY+3AleZbv9GFNeB4JA0TbHb4xFd6ZChQtA/VuK3r5nVlBN1D 33tFk9jiPtur/qLAha/kQ80x8HJ4oVVbKcuAUTjSIlfWmS9MMQIE6B2He9JCITGRDU+uEP EeZ4U990LVpFfdOEnf1Jv4LzF7q+J//Staf7sh8XoJNrtBoooxJxHigm9iTFMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676583025; a=rsa-sha256; cv=none; b=Awe9hgz29hFLu7hMEOJqmbpxfmsXH3keQO5G2z25ashHbagPRxfoUUua8Zl+8uzNWHLJr8 OKpYG2J58vhLdQE/dB+LgH+OehzmMghSVYCJe2od3l2er7uCPIpKYcbBVhwMSQ94puYqqf FOka0TtF+GnMfWqbANIC2UjjR/yRcxmafoOBxS07bmgMNLwyMyraxfRmoJm1t8dy/QrA1e MUVuTEagYuHtnJ7GKmxjDjYQIuY7cNYCgoryTlgnifj81fCus3RJqRRJxA/q1YRlNNO8Fd sqvVrTPtDgH2WXuPADzLEF/c6maI7mNHx5RX8lSl+Zjb+yTlUyKKaYhq8bBRtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHp5F3mvmzJvn; Thu, 16 Feb 2023 21:30: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 31GLUPUG083215; Thu, 16 Feb 2023 21:30:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GLUPls083214; Thu, 16 Feb 2023 21:30:25 GMT (envelope-from git) Date: Thu, 16 Feb 2023 21:30:25 GMT Message-Id: <202302162130.31GLUPls083214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 660609698622 - main - powerpc: remove nexus_get_cpus() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6606096986222bac46e6f97d6ca47fc14978d172 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=6606096986222bac46e6f97d6ca47fc14978d172 commit 6606096986222bac46e6f97d6ca47fc14978d172 Author: Mitchell Horne AuthorDate: 2023-02-13 17:38:41 +0000 Commit: Mitchell Horne CommitDate: 2023-02-16 21:29:22 +0000 powerpc: remove nexus_get_cpus() It is identical in functionality to root_get_cpus(). Reviewed by: jhibbits MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38494 --- sys/powerpc/powerpc/nexus.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index c0d4f8396cfa..3a1e961c743e 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -83,8 +83,6 @@ static int nexus_unmap_resource(device_t bus, device_t child, int type, struct resource *r, struct resource_map *map); static bus_space_tag_t nexus_get_bus_tag(device_t, device_t); -static int nexus_get_cpus(device_t, device_t, enum cpu_sets, size_t, - cpuset_t *); #ifdef SMP static bus_bind_intr_t nexus_bind_intr; #endif @@ -112,7 +110,6 @@ static device_method_t nexus_methods[] = { #endif DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), - DEVMETHOD(bus_get_cpus, nexus_get_cpus), /* ofw_bus interface */ DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), @@ -209,24 +206,6 @@ nexus_get_bus_tag(device_t bus __unused, device_t child __unused) #endif } -static int -nexus_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, - cpuset_t *cpuset) -{ - - switch (op) { -#ifdef SMP - case INTR_CPUS: - if (setsize != sizeof(cpuset_t)) - return (EINVAL); - *cpuset = all_cpus; - return (0); -#endif - default: - return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); - } -} - #ifdef SMP static int nexus_bind_intr(device_t bus __unused, device_t child __unused, From nobody Thu Feb 16 21:43:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHpWk6DfBz3qMjW; Thu, 16 Feb 2023 21:49: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 4PHpWk57Pxz476w; Thu, 16 Feb 2023 21:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676584194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c7THzebfo+wwXtu/TQwPjQG5GaVM3V6DTVhGrDlzV6I=; b=EnKAGiYXXTJWteRmpBfsei0apr0PSG5AZfqcvtcTfxqhwIleA3wrxz5WgRkWWGEo63WVUg k7pmoizzZmcYaQe0lKrNx6Yeg0FWx/b4TBEnCH6CE+VZJQOlUQEz+rbVOmSzx6h8vq+6qQ hDV/QSQhhHFQW//YMMFoWHVIF+v62pUlOpqV0SbB8e10SrHt/gbF09GYDb7Lw22nSpu6AW YDBGH/QJpao6muGioyKlL7Z9QaJeW1Pkrs1KVeNo0YHBPGYL53AwXJ0JUOzgJd34XuzPEu llUJf7iB6CjpHQcPc1I4xRQ2hTjB0coId7XIcozWapagDJnAWchccG43l9rwrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676584194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c7THzebfo+wwXtu/TQwPjQG5GaVM3V6DTVhGrDlzV6I=; b=kYYQOGWCKdTvHzVuobd98IBvU9eGd7tzGnMPfaVNrRa0wrg4SPddgFmCpsHcFakRBqNgF4 YwUFLNMu1vXAs5aMGvFydEfrRJfuQDrBGy6b3v5VO0CC4a3Fejv1ziyQTJM0OiWtt0BKd5 Uyv+rIStiGTZA4fmAgxYbE8S4ZAEo0jXHEK6VPhbb22l2hNXsscNJ+YuUThsShv2vCJulJ ZdfdNG0ulN+oYxjShVGDwr9G4khb+Mo/2ulqL5vBX61MNnYzqOmhqnkz6K7WwSqQGpckvp ep2Rb+77gbpKLok9x18wtifDoEfSonkxP0IEL6CILTd+Q48vHuRpmd/m1BgATQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676584194; a=rsa-sha256; cv=none; b=C2r1fQ3Bwpxc4oXhWx2I95QZQUWim1sMjTJOkdmCiqdWBgQv5k4EX70nb51RBuKWlNjImV /MAd4ztT4pJ+Vqo6nwSk+UMB6lY0znz+dTW5Ebn3tvMfPeQZcCmog1R5ZynzTVVnRl9ayO jJXJUfSw9KJDc2YCqPUiYq9rt6q9Ktm2JIchK1iP4ovFJPmHKnGsLLM5Sox94jfAl0Z3Dy V44JpscWLoKoENZz6mDzh3o1NZKA5OeqYy+H4Uxx5xC5ng9QugSlrpKZA0IzX96KzwCdmA bfDC0fpNKSMAS6gbiKbf7dIh/1BM9YOHEyr4lBa0MwEuoUEyO+U897J9OlW7Fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHpNc0MfnzK08; Thu, 16 Feb 2023 21:43: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 31GLhhIY002444; Thu, 16 Feb 2023 21:43:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GLhcMH002433; Thu, 16 Feb 2023 21:43:38 GMT (envelope-from git) Date: Thu, 16 Feb 2023 21:43:38 GMT Message-Id: <202302162143.31GLhcMH002433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: c9539b890109 - main - zfs: merge openzfs/zfs@57cfae4a2 (master) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9539b89010900499a200cdd6c0265ea5d950875 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=c9539b89010900499a200cdd6c0265ea5d950875 commit c9539b89010900499a200cdd6c0265ea5d950875 Merge: 660609698622 57cfae4a2f04 Author: Martin Matuska AuthorDate: 2023-02-16 21:38:51 +0000 Commit: Martin Matuska CommitDate: 2023-02-16 21:38:51 +0000 zfs: merge openzfs/zfs@57cfae4a2 (master) Notable upstream pull request merges: #13816 Fix a race condition in dsl_dataset_sync() when activating features #14402 Prefetch on deadlists merge #14410 Improve resilver ETAs #14428 Resilver performance tuning #14439 Resolve WS-2021-0184 vulnerability in zstd #14440 EIO caused by encryption + recursive gang #14448 Fix console progress reporting for recursive send #14454 Improve arc_read() error reporting #14460 Restore FreeBSD to use .rodata #14474 Reduce need for contiguous memory for ioctls Obtained from: OpenZFS OpenZFS commit: 57cfae4a2f04aaff10c45b3f7975e0fe3ef3e8b8 sys/contrib/openzfs/cmd/zdb/zdb.c | 26 ++++++- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 3 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 33 ++++++--- sys/contrib/openzfs/config/kernel-filemap.m4 | 26 +++++++ sys/contrib/openzfs/config/kernel.m4 | 2 + sys/contrib/openzfs/contrib/initramfs/scripts/zfs | 58 ++++++++++----- sys/contrib/openzfs/include/libzutil.h | 1 + .../include/os/freebsd/spl/sys/ia32/asm_linkage.h | 2 +- .../include/os/freebsd/zfs/sys/zfs_znode_impl.h | 3 +- .../openzfs/include/os/linux/zfs/sys/trace_acl.h | 9 +-- .../include/os/linux/zfs/sys/zfs_znode_impl.h | 16 +++- sys/contrib/openzfs/include/sys/bpobj.h | 1 + sys/contrib/openzfs/include/sys/dsl_dataset.h | 1 + sys/contrib/openzfs/include/sys/spa.h | 2 +- sys/contrib/openzfs/include/sys/zfs_znode.h | 1 - sys/contrib/openzfs/lib/libshare/nfs.c | 2 +- .../include/os/freebsd/sys/ia32/asm_linkage.h | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 6 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 12 ++- sys/contrib/openzfs/man/man4/zfs.4 | 11 ++- .../module/icp/asm-x86_64/blake3/blake3_avx2.S | 1 - .../module/icp/asm-x86_64/modes/aesni-gcm-x86_64.S | 5 ++ .../module/icp/asm-x86_64/modes/gcm_pclmulqdq.S | 2 +- .../module/icp/asm-x86_64/sha2/sha256_impl.S | 2 +- .../module/icp/asm-x86_64/sha2/sha512_impl.S | 3 +- .../openzfs/module/os/freebsd/zfs/kmod_core.c | 10 +-- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 3 +- sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 14 ++-- .../openzfs/module/os/linux/zfs/zfs_ctldir.c | 17 ++++- .../openzfs/module/os/linux/zfs/zfs_ioctl_os.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_vfsops.c | 3 +- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 5 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 4 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 6 +- sys/contrib/openzfs/module/zfs/arc.c | 24 ++++-- sys/contrib/openzfs/module/zfs/bpobj.c | 65 +++++++++++++++- sys/contrib/openzfs/module/zfs/dmu_send.c | 4 +- sys/contrib/openzfs/module/zfs/dsl_dataset.c | 23 +++--- sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 71 +++++++++++++++++- sys/contrib/openzfs/module/zfs/dsl_scan.c | 76 ++++++++++++++++--- sys/contrib/openzfs/module/zfs/spa.c | 58 ++++++++------- sys/contrib/openzfs/module/zfs/spa_misc.c | 1 - sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 27 ++++--- sys/contrib/openzfs/module/zfs/zfs_replay.c | 6 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 8 +- sys/contrib/openzfs/module/zfs/zio.c | 16 ++-- .../module/zstd/lib/compress/zstd_double_fast.c | 4 +- .../openzfs/module/zstd/lib/compress/zstd_fast.c | 6 +- .../openzfs/module/zstd/lib/compress/zstd_lazy.c | 12 ++- sys/contrib/openzfs/rpm/generic/zfs.spec.in | 8 +- sys/contrib/openzfs/tests/runfiles/common.run | 2 +- .../tests/test-runner/bin/test-runner.py.in | 2 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 1 + .../tests/functional/no_space/enospc_ganging.ksh | 86 ++++++++++++++++++++++ sys/modules/zfs/zfs_config.h | 7 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 56 files changed, 614 insertions(+), 191 deletions(-) diff --cc sys/contrib/openzfs/config/kernel-filemap.m4 index 000000000000,745928168f92..745928168f92 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-filemap.m4 +++ b/sys/contrib/openzfs/config/kernel-filemap.m4 diff --cc sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c index e4c6cf7d097d,f4c87013dbf0..9a268573528c --- a/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c @@@ -141,8 -141,8 +141,8 @@@ zfsdev_ioctl(struct cdev *dev, ulong_t if (len != sizeof (zfs_iocparm_t)) return (EINVAL); - uaddr = (void *)zp->zfs_cmd; + uaddr = (void *)(uintptr_t)zp->zfs_cmd; - zc = kmem_zalloc(sizeof (zfs_cmd_t), KM_SLEEP); + zc = vmem_zalloc(sizeof (zfs_cmd_t), KM_SLEEP); #ifdef ZFS_LEGACY_SUPPORT /* * Remap ioctl code for legacy user binaries diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/no_space/enospc_ganging.ksh index 000000000000,1d35fba5dbfa..1d35fba5dbfa mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/no_space/enospc_ganging.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/no_space/enospc_ganging.ksh diff --cc sys/modules/zfs/zfs_config.h index 5c30abf047f4,000000000000..0d4fea6ea856 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,1024 -1,0 +1,1027 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* block multiqueue is available */ +/* #undef HAVE_BLK_MQ */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* dentry aliases are in d_u member */ +/* #undef HAVE_DENTRY_D_U_ALIASES */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* FALLOC_FL_ZERO_RANGE is defined */ +/* #undef HAVE_FALLOC_FL_ZERO_RANGE */ + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + ++/* filemap_range_has_page() is available */ ++/* #undef HAVE_FILEMAP_RANGE_HAS_PAGE */ ++ +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* fops->fadvise() exists */ +/* #undef HAVE_FILE_FADVISE */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAPPED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* linux/blk-cgroup.h exists */ +/* #undef HAVE_LINUX_BLK_CGROUP_HEADER */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + +/* iops->rename2() exists */ +/* #undef HAVE_RENAME2 */ + +/* struct inode_operations_wrapper takes .rename2() */ +/* #undef HAVE_RENAME2_OPERATIONS_WRAPPER */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* cs->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* standalone exists */ +/* #undef HAVE_STANDALONE_LINUX_STDARG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* struct kobj_type has default_groups */ +/* #undef HAVE_SYSFS_DEFAULT_GROUPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + +/* i_op->tmpfile() uses old dentry signature */ +/* #undef HAVE_TMPFILE_DENTRY */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* user_namespace->ns.inum exists */ +/* #undef HAVE_USER_NS_COMMON_INUM */ + +/* iops->getattr() takes a vfsmount */ +/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */ + +/* aops->direct_IO() uses iovec */ +/* #undef HAVE_VFS_DIRECT_IO_IOVEC */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* aops->direct_IO() uses iov_iter with rw and offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ + +/* filemap_dirty_folio exists */ +/* #undef HAVE_VFS_FILEMAP_DIRTY_FOLIO */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + +/* fops->iterate() is available */ +/* #undef HAVE_VFS_ITERATE */ + +/* fops->iterate_shared() is available */ +/* #undef HAVE_VFS_ITERATE_SHARED */ + +/* fops->readdir() is available */ +/* #undef HAVE_VFS_READDIR */ + +/* address_space_operations->readpages exists */ +/* #undef HAVE_VFS_READPAGES */ + +/* read_folio exists */ +/* #undef HAVE_VFS_READ_FOLIO */ + +/* fops->read/write_iter() are available */ +/* #undef HAVE_VFS_RW_ITERATE */ + +/* __set_page_dirty_nobuffers exists */ +/* #undef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS */ + +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* yes */ +/* #undef HAVE_WAIT_ON_BIT_ACTION */ + +/* wait_queue_entry_t exists */ +/* #undef HAVE_WAIT_QUEUE_ENTRY_T */ + +/* wq_head->head and wq_entry->entry exist */ +/* #undef HAVE_WAIT_QUEUE_HEAD_ENTRY */ + +/* xattr_handler->get() wants dentry */ +/* #undef HAVE_XATTR_GET_DENTRY */ + +/* xattr_handler->get() wants both dentry and inode */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE */ + +/* xattr_handler->get() wants dentry and inode and flags */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE_FLAGS */ + +/* xattr_handler->get() wants xattr_handler */ +/* #undef HAVE_XATTR_GET_HANDLER */ + +/* xattr_handler has name */ +/* #undef HAVE_XATTR_HANDLER_NAME */ + +/* xattr_handler->list() wants dentry */ +/* #undef HAVE_XATTR_LIST_DENTRY */ + +/* xattr_handler->list() wants xattr_handler */ +/* #undef HAVE_XATTR_LIST_HANDLER */ + +/* xattr_handler->list() wants simple */ +/* #undef HAVE_XATTR_LIST_SIMPLE */ *** 168 LINES SKIPPED *** From nobody Thu Feb 16 22:34:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHqVq687mz3qRcC; Thu, 16 Feb 2023 22:34: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 4PHqVq5dK6z4Gsw; Thu, 16 Feb 2023 22:34:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676586851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z75Q9n+CeBMjAJ2Jlwi5Unjb1w1XgGXJ3x10kMPYd/Y=; b=tUdCjoTd/KxTB4GwkOLJYOGcVrN89ebIoxq6RsW+WjkV28v4oRkN1nSx8HToAfVDuDNTj5 iW3wy5gNnHMVNjcHRv3aXf/9+w3KkeZaVWWBMooDpQ9uFc45zZOmESXSOHrim/Bk11SUfc Q5x9RdXoWmRVgyHpm2pNn0WfhNgnoXQagrQYaXNwfsnS24+Bge/e0ibV5hQaNVVHv6KZCS aeK0S4dhIjgcl6ZvfY4cFxX28v4eCjtrA6I7k23lUffWy4x7p7t2jBgYX3AwFA6RN5hFSG 4DSThm38nXWfGWvL6azGROkqp29KqmZdx18pxLUIMNl+vmYg7VkjV+v3IaVnSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676586851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z75Q9n+CeBMjAJ2Jlwi5Unjb1w1XgGXJ3x10kMPYd/Y=; b=hI7mYYSuQ8l+Sz6hdAHvlOO+ZB2KY9aW+mQv4Mw7fghOgxVNvn4U1NjNPhMm3joFzYVwSZ xuBIfDcWNOP3UGeEKEn+dM+Go5uxtko8osXZR0EeQRTY9hTPXYRefwWMjC58eBfT2FObJ3 5krdaMlOZZs7U0bZacbu0K1X2pTOW+7EC6Lbm3ZSj6Z7YJRmIXGUARicDUKYMDxHRW5+Ck TeERxhL4UISdYNX+HU9RrSMXFmqIwqONE4TiQAyErt+w9a781YovM/uD+Q/MGmSc6xq11A ypbMfsFshz7scMRNF9JFpzAZxZAX0rb6CX4aNKawqdXs03hHaIgH6Xo9LwtTVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676586851; a=rsa-sha256; cv=none; b=VRzSHvMS29dMnMiTwHQaKJUBpOz2UqZ/49dNXH54OviWmIFmrBjBccmAyXru2wpx5B0IcN qWvxRJKvsJcCfBh3tcGm7IoA4BbwpsgFJPWZqJypldkujgmFbIzcns+zVFeno3TZRD4b0L aOFb94gN3/6crRV+G3SKXwQ+baxvQ1vDBas/MInv/1w2zfT0lrXRmPUsVgbc7xFcyK9yjr XOizjnM/LViCXYLNEYd4vrH+6n1LIHHTs6l499L6Kx8lCPP4uku9ZJLlq/IghNWJLE8RJT y0vUiB8DEGXzbiR9ReyhcVhGSEVLfD9zZsHaZKTvi/B+fncAFgMltl0SibK37A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PHqVq4hQlzLVH; Thu, 16 Feb 2023 22:34: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 31GMYBJG074270; Thu, 16 Feb 2023 22:34:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GMYBWH074269; Thu, 16 Feb 2023 22:34:11 GMT (envelope-from git) Date: Thu, 16 Feb 2023 22:34:11 GMT Message-Id: <202302162234.31GMYBWH074269@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: 780bae23b8e6 - main - krpc: Replace !jailed() with IS_DEFAULT_VNET() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 780bae23b8e6c386e4b2f971eb27fa3bd1a6edd1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=780bae23b8e6c386e4b2f971eb27fa3bd1a6edd1 commit 780bae23b8e6c386e4b2f971eb27fa3bd1a6edd1 Author: Rick Macklem AuthorDate: 2023-02-16 22:32:50 +0000 Commit: Rick Macklem CommitDate: 2023-02-16 22:32:50 +0000 krpc: Replace !jailed() with IS_DEFAULT_VNET() Since svcpool_create() is now called from an initialization function, !jailed() no longer works. Replace it with IS_DEFAULT_VNET(). MFC after: 3 months --- sys/rpc/svc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c index 065da0cc23a4..5ebf1f5a48b3 100644 --- a/sys/rpc/svc.c +++ b/sys/rpc/svc.c @@ -127,7 +127,7 @@ svcpool_create(const char *name, struct sysctl_oid_list *sysctl_base) pool->sp_space_low = (pool->sp_space_high / 3) * 2; sysctl_ctx_init(&pool->sp_sysctl); - if (!jailed(curthread->td_ucred) && sysctl_base) { + if (IS_DEFAULT_VNET(curvnet) && sysctl_base) { SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, "minthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, pool, 0, svcpool_minthread_sysctl, "I", From nobody Thu Feb 16 23:31:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHrmx2wyyz3qWyG for ; Thu, 16 Feb 2023 23:31:29 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic314-20.consmr.mail.gq1.yahoo.com (sonic314-20.consmr.mail.gq1.yahoo.com [98.137.69.83]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHrmw3MBgz4Mlj for ; Thu, 16 Feb 2023 23:31:28 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=lz7IgGUn; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.83 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676590286; bh=T1SvUZUkxgywIv4mdJ+KnUgGHBtUTQwMPrKzHN/RiH0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=lz7IgGUnMutNmckjZ/5H6oKiSLaluXsJxF/4S0In5vZ7dfE2ZHM27Vutfg3As9u4PlKRO4RiFCFhynhcpSb42+2nC8V2k9K0Q7C4jrpEoNfQnOtghsF1fP0aZzoaMWrJ/EWBfzsfZnJGbOpls8+cKoXqJGpKwR7AVUPwjuRnU0pSRQD0r/YjAi14niMkbgEU5k/Zb9CJapeHCiGsU3jBFJWnv57gzpAQVwVpY7a8KXoqYxHX5z3eErh8aLxYkOKYtVoWktV0qZlOGSTnQzIMkYa+K2de4tnew4luyUNdF/M5u2KTsRZmcnD3w+16zL3LNJOhQ/JfhNFLyTE0juel2Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676590286; bh=CpH4SpQKaNlqEvlZUbRaj9cLZzBlQ1Ls8Z6JV6BYg+5=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=PINQg9EoVlfgqmRpKK/c0uZ5prtLxwo8dOeoegNO+DnA3AtGCQct1ZipCaiX6P3y33WPxZOFxd+HRqehXbryKHznKCTrvoAusQOY7YeQMIBj4TGDRe6KalQLNCNu0frFxgWSvyFD+Pv4xZdMN56aIsPFfRApkWkeaEbwod4VwMnrhPoelb97CO2mfzepF+bu3BuzkS28NsINaknHntDgFAwiCCMoOrx3Bsw91lGszVHibd13jjcRMpMOgZwwwsMV1lSJHXk3SpdMd+42OrjlWOdISUR9vcxexONytaWT6E66ztkLMktiz0KJQUS9//733VGFWLPtO39kE7C7c9Fm0Q== X-YMail-OSG: uaf_IZcVM1kzwHUAMqhTKcOF2D1q.eqomTEYG3OFs9kreILWxfLwGDQ2ZwMYwUs 2qYXeoXT.EMQt0EI.Az0k4YIcVpGeVTxnPNBnvSH22YsISeJSX3CxJz4aySC4nyjEcxl52otOrVM gbgvrQ9_1.IlyxJNquBySqEpbzhSw06dEtcZHCdVkifwh4gY6wKlOxuv2fD0HfxkE1vwdIokBVr4 z8aY_fVsSOCR.TrUVysZBtEKT6Q2ThXd0y2ZHY3YoxN6i8EjsBAJGudHMLbaY6DvHawPc4Twk54D 3zvsqh37CH5Gy8BiLbdKOot6_vZJ9Otxb5z9vhtx8TpIbPo9EF0c6HqHDCd.wePzzJX4i_SIG5xY 0Rako5wVAWcpQ8_QzaRp8rBx08vSO3sZBgqXUoM2dcocUtbqOtzbm3.3rmbsANWm7lmJFCadG5Bq 7.RqwFpROAx1QS1mSjMPbKRWi5ICvSLvlSK1zm9BLHkF.1pvmsIWvRQA1TGiE8ZYK1QpSklsgpHl vrbvAoIZUlvUaijXDF3agJ_FRAarBQ38igqtLAZ5Fgok2vPsuKMux.DkZkLhlWhKhgMBNaSJK2sF OLzO6rHJu7cTK63og4WtNXUBqrYNRcbUaaTEGemUjLqpsAOP.ZVCyklvlyvLJ3OraqozD8_OZmn5 byHyrjWl9vxsyGkSHwPi.JXl0pShKAwbv6ikGYlERmgcEw41aPKUB0c5uUIs1fuccABCedu8NUXP s4WJKtYCzB.awrg8tCRctdqgn_P2b0QxGIsEDzGXP6jcY.EkYQjY_HiT70vc03ZEIORIqS0b5FQI 9IcwkBOzrNm3QQG9VNqOWzQEyasgHZG_aiwXHd3itAkJMmGYYTr.D9JgaZM6XNNldJn.e.VJEhXK eKlSLSFnApilRWdtI_dD4eBzxlEPZF2olBU_jUSAfBVYqFBdhJBEzdMfIHAzHi9_aS9_AbLxpatF bhMHKj.Xfi3F9Izy5fKUQaP_kWCXjRKhyye_hZAFJTJe2m3eBixUe97p3ZfKHOBSwQsOvVxneh3X iSNrx.s8cLLDju1VZ.7qRJo_k3sHonbjuEOWkPrFmblIHWd133sAPgdxqctBiUXVSzfb55aULpJZ qu3A5cpuYLT9eQ7tC_XBUf3r7UQN1UWjC.1tUPgYOemcPSMr_hVulitE3k1XPdzfrHePfWrG.9I4 GHVEE..vmFh7hp7DW_oKY038rNkRlqnyZw9WHbZOYCiW.pzvAolQj4MMLqDN.H0K_4jV9Fphny0g UsrhfsGkJhO6O38GnFWGP7KUkeKC5ZqgV5_2BMmYrtO_d4K2dyscLNkF67YK.XHmeWWUZxwk6PWv 9JcbikgwCXAHIRTvn_JxuYcjkR0RPoQkT80GFUZqLyWe.pfFmrvMPZYZrHy.vZgxmSO7fClmBAv7 oVBu2Khzt6W6dNfdkkiWzMx8e4tRUBeCWU8YWryTnMXrxzf0VFBzr5YEUC4hTvEg_fM2.xtPehOj uIweYcjIO1U2U._ioAg8drfJhvH1hdaviMyF9.4ROsTiHig_uj8wdQyvJLpzjtDio5icqaBXmrNO _wcMRshkw9ykxs.ho8i3KJ8KeZr5eYtLrTb87BEugxqNm9eTpIeq5nIzQ2FhGdkxGIsUr01U5jxF bigavO6_kZj8YPs2ZFdK.Y2ltbURLAC7dtdY4RftS8Lltb_Adp1YoZAZ12MBibDxuQenwvaFG.sr 8FTU5beI7nhw4wf5vrGeXqlGH641mLD01tkkwUAMZUawgNDDD6TO8hcczj5EUgnNlzJ6pbYDkN.8 7ebgIfIPMA51kKHh8_cytaa8uYH2tw1ReJBOGpKDBbu_PaiQWjob1W2e.xTViNPx5abN6wnc49P7 8MG_5CHeSaUZzOxB5wEtJY5i6PQWyWvTr9dfh9IC3501zciHa382vQCMdVpFhgybrRDKrqZORXfr UMWcnw7WK4XFiWDlbIsb_8Ee44gZt2peubdKHQUdEDJCysKpLIUVavGtOIXVGPAcUmtqG3AUXVe5 joGZuQf8XBwoL5cedCfzyzSuPyHzD3fBT114UPCaEZhDYnYGl6BDoKY4FQsdX1B9Oy1kiEYzzjsx ndgp3MQyaYASD15GkP.Cal2uue1ayP8c2BkRR3BFUXAMqFDDUdqe3Z6flDpQ5TFDFGaKReTZgCqu 9ddKGdSg7fBUf0KF0vDQVIfpe.CgfUn3AomupOHcZCtTJu2ZD113R73ziKRUsRdnBxgRrq.zCFzC rNPH1__8OA6BjC6RkEMkq9pjUUQpSTkD3ZNZIJTBH5SizXC0EwH0EW6b060Kz503HG4D7V0hZUM. d8aBa3Q-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Thu, 16 Feb 2023 23:31:26 +0000 Received: by hermes--production-gq1-655ddccc9-h558d (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d15cc390eabf52117af6b7c9e5e4cdab; Thu, 16 Feb 2023 23:31:24 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: 6926e2699ae5 - main - arm: Add support for using VFP in kernel [new: bad floating point data with multi-threading, not a crash] From: Mark Millard In-Reply-To: <402AEA29-B895-4031-99A0-876A39C02157@yahoo.com> Date: Thu, 16 Feb 2023 15:31:13 -0800 Cc: Warner Losh Content-Transfer-Encoding: quoted-printable Message-Id: References: <3A143148-895F-472B-9AFB-5F1AA0FD1FA0@yahoo.com> <782B252E-60AC-4036-BD74-46B95A31B337@yahoo.com> <4F9A3687-9577-4419-AE1B-D02A4C9212ED@yahoo.com> <402AEA29-B895-4031-99A0-876A39C02157@yahoo.com> To: "kd@freebsd.org" , "wma@freebsd.org" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spamd-Result: default: False [-3.43 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.93)[-0.929]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.83:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.83:from] X-Rspamd-Queue-Id: 4PHrmw3MBgz4Mlj X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N I start this message as independent of the prior crash reports: this is not a crash report. It is a messed-up floating point data report instead. I have a simple C++ program that creates 2 independent threads, each working on just local variables, where it appears that after a while one thread ends up with a floating point value from the other thread. The two threads each just have loops incrementing a unsigned long long and a double by 1 in the range where no information is lost, initializing to zero. The cross-check for failure is if it finds an example of n_as_dbl !=3D (double)n . An example build-then-run showing a failure is: # g++12 -std=3Dc++20 -pedantic -g -O3 -pthread = -Wl,-rpath=3D/usr/local/lib/gcc12 dbl_and_ull_multithread.cpp # ./a.out 95534435.000000 !=3D 95531411 ^C (The program would run for a very long time unless both threads observe such a failure in a shorter time frame. So the normal exit is to use control-C (SIGINT).) So far, the values printed are always similar instead of random data showing up. This is part of what suggests that data from the wrong thread has shown up. Because libc++ does not yet have I build with using libstdc++. I have demonstrated the problem via libc++ (clang++ and g++12) as well, calling std::abort instead of outputting. (But that crashes armv7 FreeBSD during the attempt to produce the core file.) The C++ program source and how-to-use-comment is: (whitespace details might not be preserved) // # g++12 -std=3Dc++20 -pedantic -g -O3 -pthread = -Wl,-rpath=3D/usr/local/lib/gcc12 dbl_and_ull_multithread.cpp // # ./a.out // double_value !=3D unsigned_long_long_value // Use control-C to stop it. #include // std::numeric_limits #include // std::future, std::async, std::launch::async #include // std::to_string #include // std::osyncstream #include // std::cout int main(void) { static_assert(std::numeric_limits::radix=3D=3D2,"double's = radix is not 2 and is unhandled"); constexpr unsigned int ull_width { std::numeric_limits::digits }; constexpr unsigned int dbl_width { = std::numeric_limits::digits }; constexpr unsigned int use_width { (dbl_width; Fri, 17 Feb 2023 02:45:26 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-21.consmr.mail.gq1.yahoo.com (sonic306-21.consmr.mail.gq1.yahoo.com [98.137.68.84]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHx4j1Wqrz3CM8 for ; Fri, 17 Feb 2023 02:45:25 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=ZIa+PQll; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.68.84 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676601923; bh=IpgIuPY+2QcrIAz5e5+ADiTLFiT5r5OWWxYfG9ML38Q=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=ZIa+PQllMtHqSSaHG/B7pcVQfB9cklsZsBHoK9NnBhtkYUKCzG3NSKxf8ierN/wSeh3z7j5zF5geknHmKhWj0ogGUKV1bY0EWWRwmHRwA3udO1Tc98korxzvUBJK/g55C/TMoVudSV8g0yU7Q662MfI7dn/1OX8CsKPLptak9j0nRt9WNdOPd3Jrtsn4VW8kzPiWbttlh/TpmE795BBW5+OA13axt/Hjk7vp2sreCLpV2QEd/OztjF3lhddtmuN6Ie9OC36ZGaAowU5DIXG7UXOxnP7TBAHHtHper1bZbm6/pjocr+jiay7mwUW/omqVB6yirE1F1VGrw9Z5RYHdJg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676601923; bh=Av0meu/wX6bAgIMzoL55Br55J8V6q7ASNQCQeyNSD8l=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=QwTuvCBRLfulKDxCZq72JWU7WkT+/zq+lTUXriPgSg1XEfp4SWlUtlPs/+3MQOO2YO7dzOMwaaFYAc/zZgynqZ2Evhm8MSqRw1hIJ5rR8hn1/O1/NvSExYvLWG2nDLZezp2DooFXqBJY2l57JMlm6JB0Ti37VVsYjj9owHIbphjkqEIChahGfJbJUQuFHId/zRnY7xE4TlutP8R10R4Ct0FecwitI8ky+/UPNJSxVqwpMfImLz2oFsPt/H6pSpjq/1ejQ/+oS/c00Kh+ZGsBLiXEtjNmJV2DAP3Cm99EvmfWtRE8tQz3/m9hoFytJsB1KR88ZkHVAbBTY+zSTd/K0g== X-YMail-OSG: l_M9Zc4VM1kuPG.hvY4jrwjIh2mL3c_7qZVq.uG.0.A43mkWvG9ut8pkHQLC9GZ cwVPyF9szGr4.N4_o1IPgwH_a9J2BnixKLkZWOjHAjyDmvpAHB76nwabN0qaaJNyJ9zVuWdP7.I8 7s5HyWQOsZN.94j.2_DCcrsR9Mqv2KDX9_O_qqpOutDhQ3gs9i7l0HKUPWDw_f2uWXr4Ve1FSItZ B_N3mUJYcPIZrr8ZGeoTbSZLFHN5DrJU8Bt.AJbnYpDPaFxJdyrB0um.Swst0AVRUtc..PjXJJER grKVWuRjyuX8h4pSB2YR4QSC0xtWum4q4LPNNS6cPCpz3Ppwsp26ZzuhYMPMVH7MrPFoRjBDU8zZ 8ypzFZUF8eByY6Q2JSmtBluOw9cIvbFvrH_NyWmiBsEElpjbqS87J7yPgD_9AHIyBEnvP1uLRdVF QV9lxH2B04HfxNWbcTLi18ldeyDXOCptQ8XLgQrbyfYhXa99r3dHBi13NGUHTQp8sI0SAS2ORXbf X3tXwTpP76aD3S5RqLKrPfWsaDB_5Mc.Uy4xChaKdNfoikGQ4q4UMdRPE0xKewp8Myl8v6ZqU652 SUF8OIEJL5trgu.NX4uocw.LG7MaVdeCyLWuiEM8Op5Z64MQawus9bMi3iCOeivhikAYuaRcooH8 UMche27Pc.3eu6Gyoay9GJtyTlyj8BFWx0kRJ6hZuLwuKnUUalYK25uNAhjIDI.7mlMHZcyQUGK4 pE0SPMJe8lBOZRG1mZEOlDFJ5mkPbo3lu_untZRfwq7ms1_hASYuB1DMGnF9YYb3paI4uTNNuMjk kOoUfZUTWsaYAFFQKT80TouXTTtrPUabkZoY6X_17333C1zLQxtzxdWD2zp4UGWSW2ot72Z3FJgk YzA8zhmc3rCBpfaNYT2ixJuI3aYm.3kuUW20Ys1HH3iH7oyNr.7lANH2Gqa.VHr8xwSm8ygizxH4 zIaYULi3lUKfWaYG1rFNBffqYfRgZN0_HMd1zd4z6qHPCCm3vCZr2DCJG.QIubsyrcoaPN8BnbL9 8EAeZq2Yjs1q6kdKWOMHZt3qleq31MSAyDUocVXqwxgWDhgNhuKz4pyCAUe5nirCyAyuzswgaxJ. tkg8UI60XzoTmonm6UU6LRNI5bpxHG7EuDUNYT9cP8la7Ze.J9ba49iVSDbPIWma8ojbBV0XVOXk LxmZ6SXWeuMXxvJWe.RIANbuOyKTJAO99LyAl5mJj_YdgYxyy8UJZUvKsBRr1jne.1Pq0p2kWbta MltAdObp4h0SHxHyrreAjnEDs8UWiX6M6oeJQ3QMHzlYpcsNw1c_Db4I7m8F_RzwMNyskXSxyAiX f3tVZL0WJmht.6BI5AniXsy2SqoYsfPWzNO9dFg0hrOtNtUMoSdhVyHNcOhXVujdoeVGMXa2g5SR qnHc3GE2upFSJ3MFIGKGsdjHNHE5qLp2ng03xs7kxys1g1.Ccg7XdkW1E2NdhHryNR2Y482mZRCM j39LfRXCqf65be5EB1zfYgJFy4KzN9NNL45mS1KXnNN6zjIzazKfrg1P0m69oke4zA8b1Q.mXDLH A_ovOlZa3v8FTPQoIdV5crrqjYRRquutjCmRv79aaBRiCj9K.iAy9kI3hQhjD1z2E0U8EvQolmit Su2S8I5P_6IaCOlpN9ocZgDOizIV_QHx_zRdvqvCWA9KN1.w4xbTvJ2LBYLzIrQPCNGam54BFiOZ xGFv5ymgLDRXYOjqLLbAC1xwJbIBb6bauOupXfcCT8YG_l3tdqe0I0QTwxY_PopXjvhvgkyly5fl eVPiqUq.AwvbSHAD3kigHat8Uxxk4vqIILe6DQnXXBFEvx.Mo47G_AwpWx.Q2rFU8Z7FUqy_WbTG A.n6suYM1DwSS26heV3jzuqa93_zjVxvaxMquENiAlQ7eaJBKyZuriWNg_zi8S9X9BXBSvACsAgD JbDdgE0o7WGJrW64p2yMMyJTEmKlXCpwg4xWySxG1bz4Lu9YPynSX_RE7fx_a3ZNvj7lOn3Gz2Kj 5d4BuD6S_3lVY2OsEzICcBv1wtKKZZyDn.i4VqLYa2xotyRGH1vJYbC2xMMW6oWUQcMYl63RKzXb tYTr041pTfxvdcJUhA73QCAI4gu0YAJWJfLQyOxes9fc6k5rmJFgVT0AeDptCZJCbuMmLnJgB1eB IoQoqKbz1pVLjZKbo8ByQ5yEPtt1qfEDDGNPiCnE_scs6euMh9X1C_zc7OKm4k26ZaxH6wf3PZ9T KG1scunJgP9JIR8l2z2tLigoDSTv9DJDcJMGcU2q7AyWUj2wMALvxCYwmHWy32J9ixbUGKhK6hz7 bthvX25Rf X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Fri, 17 Feb 2023 02:45:23 +0000 Received: by hermes--production-ne1-746bc6c6c4-8fvwf (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 4eaae5ef0957820b92b3bb120e1aa972; Fri, 17 Feb 2023 02:45:18 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: git: 6926e2699ae5 - main - arm: Add support for using VFP in kernel [new: bad floating point data with multi-threading, not a crash] From: Mark Millard In-Reply-To: Date: Thu, 16 Feb 2023 18:45:06 -0800 Cc: Warner Losh Content-Transfer-Encoding: quoted-printable Message-Id: <72CD283D-8669-4574-B9DA-3CEEB198FFF5@yahoo.com> References: <3A143148-895F-472B-9AFB-5F1AA0FD1FA0@yahoo.com> <782B252E-60AC-4036-BD74-46B95A31B337@yahoo.com> <4F9A3687-9577-4419-AE1B-D02A4C9212ED@yahoo.com> <402AEA29-B895-4031-99A0-876A39C02157@yahoo.com> To: "kd@freebsd.org" , "wma@freebsd.org" , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spamd-Result: default: False [-3.18 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.68)[-0.679]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.84:from]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.84:from] X-Rspamd-Queue-Id: 4PHx4j1Wqrz3CM8 X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N [I've updated the program so that which thread is reported in the output and the scale of each value indicates which thread the value is from (unless it runs for a very long time). Thread 0 creates small values (unless it runs for a very long time), thread 1: creates only huge values. Values from the wrong thread are reported.] On Feb 16, 2023, at 15:31, Mark Millard wrote: > I start this message as independent of the prior crash reports: > this is not a crash report. It is a messed-up floating point > data report instead. >=20 > I have a simple C++ program that creates 2 independent threads, > each working on just local variables, where it appears that > after a while one thread ends up with a floating point value > from the other thread. >=20 > The two threads each just have loops incrementing a unsigned > long long and a double by 1 in the range where no information > is lost, initializing to zero. The cross-check for failure is > if it finds an example of n_as_dbl !=3D (double)n . An example > build-then-run showing a failure is: # g++12 -std=3Dc++20 -pedantic -g -O3 -pthread = -Wl,-rpath=3D/usr/local/lib/gcc12 dbl_and_ull_multithread.cpp # ./a.out Thread 1: 34018092.000000 !=3D 4503599674389816 ^C # ./a.out Thread 0: 4503599680497650.000000 !=3D 38453432 ^C So: the floating point values (left hand sides) are the ones from the wrong thread and the unsigned long long values (right hand sides) are from the correct thread. So far this has been uniform. Also: which thread gets the odd value varies. The new C++ source is: // # g++12 -std=3Dc++20 -pedantic -g -O3 -pthread = -Wl,-rpath=3D/usr/local/lib/gcc12 dbl_and_ull_multithread.cpp // # ./a.out // Thread [01]: double_value !=3D unsigned_long_long_value=20 // Use control-C to stop it. #include // std::numeric_limits #include // std::future, std::async, std::launch::async #include // std::to_string #include // std::osyncstream #include // std::cout int main(void) { static_assert(std::numeric_limits::radix=3D=3D2,"double's = radix is not 2 and is unhandled"); constexpr unsigned int ull_width { std::numeric_limits::digits }; constexpr unsigned int dbl_width { = std::numeric_limits::digits }; constexpr unsigned int use_width { (dbl_width To: Jessica Clarke Cc: Mateusz Guzik , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d9d5f2c042a5 - main - cpuset: add --count Message-ID: References: <202302041751.314HpRrn042970@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N On Thu, Feb 16, 2023 at 06:01:32PM +0000, Jessica Clarke wrote: > On 5 Feb 2023, at 17:28, Alexey Dokuchaev wrote: > > ... > > I was wondering whether we need both of these sysctls: > > > > $ sysctl hw.ncpu > > hw.ncpu: 2 > > $ sysctl kern.smp.cpus > > kern.smp.cpus: 2 > > One prints mp_ncpus, the other smp_cpus. As far as I'm aware those > two are the same for as long as userspace is running, and only differ > during early boot before AP bringup (mp_ncpus is how many it will > bring up, and smp_cpus counts up as they come online until the two > become equal). Thank you, makes sense. I guess it would be nice to have this piece of knowledge documented somewhere (as these sysctl's own descriptions are kind of vague) but I can't think of where should it belong. ./danfe From nobody Fri Feb 17 13:18:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJC6t0bMrz3sLDb; Fri, 17 Feb 2023 13:18: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 4PJC6s746sz4H5h; Fri, 17 Feb 2023 13:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676639894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bu+myK4tZ0/3bclC4ye6HwMO8FfHt5NUIOHunKB+OXg=; b=RTE+3YPoFhVqVxCR13p0tx5wAs9WaEchfHxFQxsa6heOT2EuZtyO1otEYQx+dhDSH1fuFA HuzeXJc4jhgbipljJ9SfbA2pAgD2smkPjHl1Wiv2PMGGKwsVmW3ap09N0eEFczc4ffD66P be+QC0ok25Nrn6CqfO6/+Gyy5+9s/5CHJ0huN4X21d7r6DApwH4mI8bwkCiCtkHYcsjDPZ 9CArUw/fwRZzmoHqG7BYTQxkfP7+3vrZC8ur+3UZR7rm5IJw5ZExvGNGCzXxoo6Y69CUcQ P5Y3WX17zTxXieWgnTAOAdQC5NySaGHFqc3QJZgzZ/ItZHsAQeicHOxNGm9a7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676639894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bu+myK4tZ0/3bclC4ye6HwMO8FfHt5NUIOHunKB+OXg=; b=OHg+sImKbSctJwew6Z+oq1U0QDHgnKWwl+gPLcdb927XlJIMnqNwtiAclpj00xVFr7FlVd dnkNAs01gxb/xmlNklLjeN8PEXmr1J2kehBNnAio90lL/hi6ZnllgN+/4pnNzYaWHnS9BH oZygJTfhA38Gnat2HdZQf0vwAgeFC4V4np2JN2dl2E93303fmTgkz4EAVqxHJrTredUrWb AXee4uYUh3pJ5toqvk9fQLJF4VSqcZdbSV8tymFSH0CfEFFVJuUvDsynDv1+ON8RjcqZ92 xXAOSn5KJcgXzu5w19jpjRGQ3Dcxd1fxQabtYZ6GB+mAPX+j7vPrE7n+yj718Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676639894; a=rsa-sha256; cv=none; b=aFjqGXhClpSd6JDKrd1QU36jx55mOOJ8eQz71KgbFMtWSPGK8K99p4WxnOhhlnrGk3k0OR 1qxSZXQ4UG0tvNvOf7fw5IhIycev4i3J5w2NJU6khDzEtlaR6rt55NM51ThjXEnK7aXZzD rIeavhSdeG4jNEGxSMRlpWtnQDDOVD2wkpFZ7w0pj82xRyrIvGSSUv9DDUhTYvs8bvcPbm J88/GqR2Qivwb/NmgGHnE5BZxKODZwhhxBJwX/vlueaa4MOxN1lg9J/aTz+A1GKpkYY49S RmQUHHD5CDc2qPU+NZhXKwWGuuvXnn1jmeJl6wFTOrY/eVEH29z7YDxzMPTjag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJC6s5t1TzkLh; Fri, 17 Feb 2023 13:18:13 +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 31HDIDrf027353; Fri, 17 Feb 2023 13:18:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HDIDlo027352; Fri, 17 Feb 2023 13:18:13 GMT (envelope-from git) Date: Fri, 17 Feb 2023 13:18:13 GMT Message-Id: <202302171318.31HDIDlo027352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Fernando=20Apestegu=C3=ADa?= Subject: git: 9e0d41c8f063 - main - rc.conf.5: clarify source directories List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e0d41c8f063111803c36e5aaff1126c99e8c7ea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/src/commit/?id=9e0d41c8f063111803c36e5aaff1126c99e8c7ea commit 9e0d41c8f063111803c36e5aaff1126c99e8c7ea Author: Jamie Landeg-Jones AuthorDate: 2023-02-16 11:55:01 +0000 Commit: Fernando Apesteguía CommitDate: 2023-02-17 12:17:54 +0000 rc.conf.5: clarify source directories In 454adf0fa4d787bf6e6ff7be0aa6c27a91d2be8e some of the issues reported in the PR where addressed. This commit adds a clarification about how the prefix of the directories to be sourced actually behave. PR: 197152 Reported by: jason.mann+freebsd@gmail.com Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D38627 --- share/man/man5/rc.conf.5 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index c979ffe6cae1..0080e5f8d075 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2023 +.Dd February 17, 2023 .Dt RC.CONF 5 .Os .Sh NAME @@ -80,8 +80,13 @@ script in the .Pa /etc/rc.conf.d directory or .Ao Ar dir Ac Ns Pa /rc.conf.d -directories specified in -.Va local_startup , +directories (where +.Ao Ar dir Ac +is each entry specified in + .Va local_startup , +but with any trailing +.Pa /rc.d +stripped), which will be included by the .Va load_rc_config function. From nobody Fri Feb 17 13:51:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJCrl3d54z3qQ2x; Fri, 17 Feb 2023 13:51: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 4PJCrl3B7rz4M2K; Fri, 17 Feb 2023 13:51:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676641863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oBxutzsLi9uguWrgIoANWP3P7Oklr3JArBkK78WSJ9I=; b=iLeBhI0OiTEkPQ1+nWiP1S/aYc9MpyCgxaFJesKRP7u8x13iEFlXtyKTQlLjvqOHV9Tc9r BRMBjuD3yVgWEsESt414Awf8j9Vq8YznyY/yy+JDSQkqzibfc24mzuXVMAS3W43I9LY3dF BHnCXtH2NfGttslpTu9BgiZx0WulwFzS0GmW31FnjdWtaiNoIwatl1E+djxEvPsJO1qnhG Gm+xA+U2S1IO6So2CstOiO1ajaXurbtQQI6UT+H9JzqbjnENOCuWGT4t74xtCVtYogDQs/ KjvK/qt15Qw6Z+A6BaSARvPejbzbJSsWeTiJDM7Cbaikq6lkjjZ+ku+iGqj6Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676641863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oBxutzsLi9uguWrgIoANWP3P7Oklr3JArBkK78WSJ9I=; b=aoLDPyrqecX/NCLEln+IUTjPedi5XfaChw43XVNcepdf8ucxWCIQ6KUUhPUlviLGv3qjHp yZZWvSAb7IFBac4Jj5nunpc2RivHqG4DrtjI7fmAG0AZ2u6xnEfLwGa/x5AQzZ+86vTZsM V2mBlUnckt2BZHve9N2+aiJu40evwxSGCdY/EKshAoVMNcamjXFvSWRYEtTdOGMqwh+3JG VBu7PuR97zImrro7Fl85zXAqv+GNFqKntixbX8l6Sa3p/OsOFLQcHRsCVYuMDAgXzD7bMN 7NPKchx2urskXTN9ijXLkuCV6dZF5KJwHfpiWTyft98hoqHrpK9cAtDtfHjJaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676641863; a=rsa-sha256; cv=none; b=oc/Vyq/B3++8vCk6BZvlLtXINIlZcJ9e2zjArXqmd6WWAmF4rlCn1HP1tvklMqDEti5NYU xgctPoVGQSpMzNiq/inhQEqJGfskUzjyj/nXmPKm6o131V+eFr4URlDO4zpy19ttlYfhC8 gCR+ILd2GY/XA8fXoZ34OV0UXNKJluoxV/X+ARkqR3LIjX5R+63oB4I4kjo0KFPEsi1fFm K5cD/t7gDTBMBd0J3voGuBX1tEKNiWdR0N1YwhVmqQRJzDSTw5qjQZrkfgd3eg1vpqkNrW GsTB/pLecI+zNPXbCdTBtBmIWyjJC3hAX8EgIYmL9R4x8iIU2HOMwn1rQ802kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJCrl2DlrzlYS; Fri, 17 Feb 2023 13:51: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 31HDp3h8080877; Fri, 17 Feb 2023 13:51:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HDp3pB080876; Fri, 17 Feb 2023 13:51:03 GMT (envelope-from git) Date: Fri, 17 Feb 2023 13:51:03 GMT Message-Id: <202302171351.31HDp3pB080876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: a0fdaf9a7b34 - main - linuxkpi: Add more suspend defines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0fdaf9a7b34b6f8fdab747f7a198158e66b57ab Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a0fdaf9a7b34b6f8fdab747f7a198158e66b57ab commit a0fdaf9a7b34b6f8fdab747f7a198158e66b57ab Author: Emmanuel Vadot AuthorDate: 2023-02-17 13:49:52 +0000 Commit: Emmanuel Vadot CommitDate: 2023-02-17 13:50:58 +0000 linuxkpi: Add more suspend defines Needed by drm 5.15-lts Sponsored by: Beckhoff Automation GmbH & Co. KG --- sys/compat/linuxkpi/common/include/linux/suspend.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/suspend.h b/sys/compat/linuxkpi/common/include/linux/suspend.h index 9bd6c2c55875..dacecbebdc08 100644 --- a/sys/compat/linuxkpi/common/include/linux/suspend.h +++ b/sys/compat/linuxkpi/common/include/linux/suspend.h @@ -9,6 +9,10 @@ extern suspend_state_t pm_suspend_target_state; #define PM_SUSPEND_ON 0 #define PM_SUSPEND_TO_IDLE 1 +#define PM_SUSPEND_STANDBY 2 +#define PM_SUSPEND_MEM 3 +#define PM_SUSPEND_MIN PM_SUSPEND_TO_IDLE +#define PM_SUSPEND_MAX 4 static inline int pm_suspend_via_firmware(void) From nobody Fri Feb 17 13:57:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJD0m0y3Wz3qQMK; Fri, 17 Feb 2023 13: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 4PJD0m0RmXz4NNL; Fri, 17 Feb 2023 13: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=1676642280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c1xYkUJDfGfPaLKYYPIN4LLOetUxQ7rudFh73eMGvlA=; b=dd/rGY1G0vBvVWSyZ2QAK8zvCCa5qx5/DVgtiDFbZlFECU3L16/3P3P0FSoFTARfT4QVA0 cbkcRRWtLTpZsvlOCWWuuwWiPOyiofvh6E6BytV5jDbRz7YzF2FG5H0cRlV6nLIv8sLU/C 1fMcT6464BO6dFR2Ue7rXHtSYMMu05PPKGEkrdaSUaw/Pe4MBgPxjbKmfHsr1dB81roJt2 tx1617lfPoq9XRWKi44mDYlD6CNVuwSoiUG2q3JzjlSeudcyKPL1tEsloTQHZCT8Dss0no tZWIUw1DclCodGeX3eVLz+IwKFMv532FAIQ3JUaGfUj1z4bo4Qea1T4LKpILTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676642280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c1xYkUJDfGfPaLKYYPIN4LLOetUxQ7rudFh73eMGvlA=; b=e2cazT+63gjzrPxoBtR2LYRY+aXg+SnpI0MOQxpZHPQ6ix4XNADZfs+ddFkFSMkRa8m6pE 7EC7vHcD2p+AnjyuaTjnFSBORQZ4xxbSUhpaKz8wPJgE10kOV3XlHwjc00xaX9W7irRkwy vVHerbjF0Wh4bjjD7ESK7LivxRbzxEkJeVsW0qJnfAb4ZSlWTqcgxONKWMwX28Ak4LNVX7 3HR+6y5/jzTbBffPVKwf+r7fRTnIWJxdhI7sfSqwpVXn6EEImt0wF4IMmSS+mUCvcYTaR3 Ond2AjuomwFByzSwMbWyb8nBVY6Vu2ZGjtD0LMUBLf8nKe25s39fsdSgPezx+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676642280; a=rsa-sha256; cv=none; b=TfC2ADE62KscWk4WNNUgmGhHZqIgfCPg4sUFhi+BNclsAQEsZi4SapIcMR9cC3GKbGhcFp RMFApOG5RkytLNGdlPAA3vs79wtzIN+jUfqLkrIwtexnjtOXdq/FUKQu4SFWeQxNEBoAK/ U6iyWoYU9zBDQoxQzq+G2/GmmfKag/DgeCoEHld4nLPgZbhjSsHcSkYcM1KvMxFAV1Woeu OXB7H36rJT9V9hYPtHzRTZGEILOdDlsiTzloYhf9/miM74VyQtUHnDW72fqc6b48iuMLkP WEg3VI+viWbhRaWSgBnE0u+sG7/2Ynj0s8QncMFGOtYyQgw1OmUz2sPJbdN6WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJD0l6dJXzlNy; Fri, 17 Feb 2023 13: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 31HDvxvG083648; Fri, 17 Feb 2023 13: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 31HDvxAp083647; Fri, 17 Feb 2023 13:57:59 GMT (envelope-from git) Date: Fri, 17 Feb 2023 13:57:59 GMT Message-Id: <202302171357.31HDvxAp083647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 545c5c40767c - main - Bump __FreeBSD_version after linuxkpi changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 545c5c40767c84d73fe732fe7fe75f6471f30c00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=545c5c40767c84d73fe732fe7fe75f6471f30c00 commit 545c5c40767c84d73fe732fe7fe75f6471f30c00 Author: Emmanuel Vadot AuthorDate: 2023-02-17 13:57:24 +0000 Commit: Emmanuel Vadot CommitDate: 2023-02-17 13:57:24 +0000 Bump __FreeBSD_version after linuxkpi changes Needed to add a graphics/drm-515-kmod port. Sponsored by: Beckhoff Automation GmbH & Co. KG --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index e0808609447d..bdc73475b8e9 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 1400080 +#define __FreeBSD_version 1400081 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Feb 17 15:35:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJG9k0thHz3qYDs; Fri, 17 Feb 2023 15:35: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 4PJG9k0Dffz3KWc; Fri, 17 Feb 2023 15:35:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676648154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z3TJguVmP5h6h8gdiXfr14fNX+we/W2HsiUUdc8bqVg=; b=vvfvpCumAGll81fYyNr/4Qxe2hk9xFwAk6PUfzp3R6Y4oc2aWKnWRUnQoVorLb3wdJOY6I qKcXfzR8FKeGrFBB5pM3xEZfjMGPaAGs8ZY9jCMealhpY5+ZIPf3duTXiCQyJ8Ax/q6vGM FR3/mXKym1rEZM68RpMz8d/S98VQiZOUU3+OHKSwAiPCb9rQ4NkhHg+B6clfQbp1TUJMuq /fA4SzLd0Kt3eT58opbUX0qokYSb2i/TCEs/xLx2E25AMfsY2n3VCdJmJM3Cx5GoQMiwE2 9Eq+qz1/Eqe/RltJgFvJJPghiVWe6ZGheHeE5YNUBJxGPtMohYrojGuwI0OlDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676648154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z3TJguVmP5h6h8gdiXfr14fNX+we/W2HsiUUdc8bqVg=; b=OMUQJJzN+iHV0nWVYPbDoMC4FdmeeeuwFw2xBapcBEctAAlF3/+RYVPawH1BjONyuuz7e2 byXz7sK7PtMtLBf/zzucG+gNfmmw3mbwBe8NOjceJVh1+OlZB+Onn6jK01N+vyk9PU0Oz3 gmVpyBK29IWVp8EddDZ8cbLxtpKsrR5yuLM2q+5LrVt5NRc8j1P87V8J9tBUeKEjM0RLl6 p1iV5x1nRqMbXoWexjlbxqa1Y7pgWIdQeM33wxCsA4sqkgDewT5vjsSimEsAtQqHNifpxC NgYSlm3bppFViy9tiPVLzZS/1JA3/5iMLS1zOIAr5yap0HB2SyxaA054frRy+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676648154; a=rsa-sha256; cv=none; b=ZTqATpZcVM8I++gqY1BO0UJ7W0BVteVIDY32gFa1OOrG74HHtjGZFeUBXPd6mv21AoGhWa 7o9Iipm3BXJIn6Gxeh9qexvsIgn8tvEFORufFl2ew+n5Hm4Avw+pyFI1bf53XE0kROjjfX 854DWf6Z46Cre0igtiNmoeNrRWHd3UMMZExUBqAlRlJZecz8i94BkrF18br5Y1UMJHDUkB dSQZNZY44GTIAUmjWNxdYZbhVH/sxJXfi5zbVMU8BoPMPk1QcTB4A7ord2FKJ5I9KrF+zo SnID4tVO4Bsbr797GPuOstlCX2ci1OAdSlpcJdwUmwQAQU81tApiuu8eU+FM1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJG9j6MHCznbb; Fri, 17 Feb 2023 15:35: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 31HFZrrn026272; Fri, 17 Feb 2023 15:35:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HFZr7n026271; Fri, 17 Feb 2023 15:35:53 GMT (envelope-from git) Date: Fri, 17 Feb 2023 15:35:53 GMT Message-Id: <202302171535.31HFZr7n026271@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: b99c419587db - main - nfsd: Get rid of useless "pool" field in nfs_fha_new.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b99c419587db2ac75b929637f61ec3b845d7b5f6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b99c419587db2ac75b929637f61ec3b845d7b5f6 commit b99c419587db2ac75b929637f61ec3b845d7b5f6 Author: Rick Macklem AuthorDate: 2023-02-17 15:34:40 +0000 Commit: Rick Macklem CommitDate: 2023-02-17 15:34:40 +0000 nfsd: Get rid of useless "pool" field in nfs_fha_new.c Since svcpool_create() is now called from an initialization function, the pool field of fha_params is always non-NULL, so just get rid of it and the useless check for it being NULL. MFC after: 3 months --- sys/fs/nfsserver/nfs_fha_new.c | 9 --------- sys/fs/nfsserver/nfs_fha_new.h | 1 - 2 files changed, 10 deletions(-) diff --git a/sys/fs/nfsserver/nfs_fha_new.c b/sys/fs/nfsserver/nfs_fha_new.c index 59933ef01bd4..05a03bee5d1c 100644 --- a/sys/fs/nfsserver/nfs_fha_new.c +++ b/sys/fs/nfsserver/nfs_fha_new.c @@ -62,8 +62,6 @@ SYSCTL_DECL(_vfs_nfsd); extern int newnfs_nfsv3_procid[]; -NFSD_VNET_DECLARE(SVCPOOL *, nfsrvd_pool); - SYSINIT(nfs_fhanew, SI_SUB_ROOT_CONF, SI_ORDER_ANY, fhanew_init, NULL); SYSUNINIT(nfs_fhanew, SI_SUB_ROOT_CONF, SI_ORDER_ANY, fhanew_uninit, NULL); @@ -80,8 +78,6 @@ fhanew_init(void *foo) snprintf(softc->server_name, sizeof(softc->server_name), FHANEW_SERVER_NAME); - softc->pool = &NFSD_VNET(nfsrvd_pool); - /* * Initialize the sysctl context list for the fha module. */ @@ -656,11 +652,6 @@ fhenew_stats_sysctl(SYSCTL_HANDLER_ARGS) sbuf_new(&sb, NULL, 65536, SBUF_FIXEDLEN); - if (!*softc->pool) { - sbuf_printf(&sb, "NFSD not running\n"); - goto out; - } - for (i = 0; i < FHA_HASH_SIZE; i++) if (!LIST_EMPTY(&softc->fha_hash[i].list)) break; diff --git a/sys/fs/nfsserver/nfs_fha_new.h b/sys/fs/nfsserver/nfs_fha_new.h index 7d437e7a0853..08f52539450e 100644 --- a/sys/fs/nfsserver/nfs_fha_new.h +++ b/sys/fs/nfsserver/nfs_fha_new.h @@ -99,7 +99,6 @@ struct fha_params { struct sysctl_oid *sysctl_tree; struct fha_ctls ctls; char server_name[32]; - SVCPOOL **pool; }; SVCTHREAD *fhanew_assign(SVCTHREAD *this_thread, struct svc_req *req); From nobody Fri Feb 17 17:08:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJJDJ6kn5z3r9gH; Fri, 17 Feb 2023 17:08: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 4PJJDJ6HRYz3lrP; Fri, 17 Feb 2023 17:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676653696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=brXXyyxypg75ADlxP1qptJUaervDmqpbqNdHL+9KioE=; b=P8NsMhCT08JFLx9w2Hkq9RV9DJlQrKcjIQ+RqGt6VymTA711owoMUykmQEkzepjvyw1+MI EyUexW57cCnN05nK7u86XvuA86JtGtEgl3zCBZCxnAxjv3+zWAdp2rr6gzFhhwEFantfPo XLYlFCTLwM2VkRTlxn4N6OBIdcJIFu7VwnUegrLlRAgeIfl8+Hyk+6dvpLgESOUPEkum2u V2vhCWtcR2ZP9TrpxfDRQBFrzzqnENiDKOTHr1hx5aWEd7rJa3sb1kZY/vH7F3cmSQAko3 B/ki1s7KgOhxASXfCkeZRhOlRkvV88ejCtXRT6hL1vDGJTJf+y2ifdeSOz1FFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676653696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=brXXyyxypg75ADlxP1qptJUaervDmqpbqNdHL+9KioE=; b=v8q4Ugf5f0WjJzDtPkYoQz+lkFJZqwEdXQlPWvXZ/xq7pPFRZFOqKod6nI+zFm3zm00j/s WX4lMACbweWstb1I81/oW3XyJUQ0NZIKVKrC3hO98h/D1RyOmx6QeG5yWwotEh+u9bcNcm jK0jTbFUL/YPalwtOcllpfoqUQNquU4iGvfLVSLQvEC/pvpceaGvVrC7zDiOkAH0HMkGid MS/nlKiOTlO/q+cXVpwN1aZ2GxEL3mRv5UWDiVJrOJ/jJexU5rhHavTDuMuLS2YH46snAP ZhouVWazHHQ0XDANfwDS1DMJidUjxpuXF5s0TCgtYxbxC1RJSMPDhjYPWVsfZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676653696; a=rsa-sha256; cv=none; b=SbF3Ni6DAuvYi1miSJAvHEjXSyugXHhC8fr4x0zxV77rDC8SHjoVMmGXAW4nVFsLRnmWaC rx8Xz/pEsr385gQXcsTm9Sm5uYi5T9kTNCaJOCheCuz4XoMt/rTQPoxzdU60M5Wlb4eDne LGN/BMWIxpmpl8GhIjMbeqXFzTF0KyZ2yo3xf3Mdd0SYWqECVVd82HCCSBwLMrKT2UbDwu r5px4+fYOWAmPk6mXJ4A/wWIPRb195IcIiaebOQz0i4vJrgm/cqOF0b3+9jFzwf9ZJVtlD CXY+9ShpMMcO12NiKaiXJIJ6kzNv1krpcR4Zqu6akWwoQw5AA1+UsZoNZPkkNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJJDJ5Kq2zr7l; Fri, 17 Feb 2023 17:08: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 31HH8GZ0054931; Fri, 17 Feb 2023 17:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HH8GCO054930; Fri, 17 Feb 2023 17:08:16 GMT (envelope-from git) Date: Fri, 17 Feb 2023 17:08:16 GMT Message-Id: <202302171708.31HH8GCO054930@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: 8afd23de9276 - main - cxgbe: Allow parse_pkt to internally queue a packet. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8afd23de92768ed4c80f0c3913bf30f72635d13d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8afd23de92768ed4c80f0c3913bf30f72635d13d commit 8afd23de92768ed4c80f0c3913bf30f72635d13d Author: John Baldwin AuthorDate: 2023-02-17 17:03:23 +0000 Commit: John Baldwin CommitDate: 2023-02-17 17:03:23 +0000 cxgbe: Allow parse_pkt to internally queue a packet. If parse_pkt returns EINPROGRESS, return from cxgbe_transmit without queueing the packet in a txq. Use this to move the call to ethofld_transmit for packet pacing into parse_pkt. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D38577 --- sys/dev/cxgbe/adapter.h | 1 - sys/dev/cxgbe/t4_main.c | 12 ++++++------ sys/dev/cxgbe/t4_sge.c | 9 ++++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 5460462c5f51..b470d1a6461c 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1404,7 +1404,6 @@ void t4_register_fw_msg_handler(int, fw_msg_handler_t); void t4_register_cpl_handler(int, cpl_handler_t); void t4_register_shared_cpl_handler(int, cpl_handler_t, int); #ifdef RATELIMIT -int ethofld_transmit(struct ifnet *, struct mbuf *); void send_etid_flush_wr(struct cxgbe_rate_tag *); #endif diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 33d372f575d0..71ee366e04e0 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -3062,16 +3062,16 @@ cxgbe_transmit(struct ifnet *ifp, struct mbuf *m) rc = parse_pkt(&m, vi->flags & TX_USES_VM_WR); if (__predict_false(rc != 0)) { + if (__predict_true(rc == EINPROGRESS)) { + /* queued by parse_pkt */ + MPASS(m != NULL); + return (0); + } + MPASS(m == NULL); /* was freed already */ atomic_add_int(&pi->tx_parse_error, 1); /* rare, atomic is ok */ return (rc); } -#ifdef RATELIMIT - if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { - if (m->m_pkthdr.snd_tag->sw->type == IF_SND_TAG_TYPE_RATE_LIMIT) - return (ethofld_transmit(ifp, m)); - } -#endif /* Select a txq. */ sc = vi->adapter; diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 88a7f44cadb7..ad3cb63dade4 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -345,6 +345,7 @@ static inline u_int txpkt_eo_len16(u_int, u_int, u_int); #endif static int ethofld_fw4_ack(struct sge_iq *, const struct rss_header *, struct mbuf *); +static int ethofld_transmit(struct ifnet *, struct mbuf *); #endif static counter_u64_t extfree_refs; @@ -2960,6 +2961,10 @@ restart: set_mbuf_eo_nsegs(m0, nsegs); set_mbuf_eo_len16(m0, txpkt_eo_len16(nsegs, immhdrs, needs_tso(m0))); + rc = ethofld_transmit(mst->ifp, m0); + if (rc != 0) + goto fail; + return (EINPROGRESS); } #endif #endif @@ -6847,7 +6852,7 @@ ethofld_tx(struct cxgbe_rate_tag *cst) } } -int +static int ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) { struct cxgbe_rate_tag *cst; @@ -6903,8 +6908,6 @@ ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) done: mtx_unlock(&cst->lock); - if (__predict_false(rc != 0)) - m_freem(m0); return (rc); } From nobody Fri Feb 17 17:08:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJJDL0fJyz3r9gK; Fri, 17 Feb 2023 17:08: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 4PJJDK6qGfz3lv4; Fri, 17 Feb 2023 17:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676653698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MXfg7E/e8jx9M+WSZqRff1hEac1QihxxCQIlJw/WXXQ=; b=miBfvivi9B3IrCH2v4SmrVAYtb5xiLj2Zxnuh3vm4eZK7P7F5Ett3PyfUgcews1S2FLGEv EIegP/OQn1xrMmp6Xl6+q7Trxs04qeyFoJQ2Oi6IYOPCuay84OLZN7azgWFQi9dOf/EIx2 A18blXgzMJReFmOtRxDAJuwkmS0eRC+O7+tW0rDb0qwf3XsT70IvUKmepHiXetjirvWzci R3BCXsdF/j1yMVTlkoAqtRqMTGG/4vlLUUclJv18MEiQznhNhQc7bLoB4SHPXF4bj9ykQV aVLftPyEq6YsFkHGbtJ7f0/N1u3hsBuQAFIMHTW70UknLkdOIBI//j8RQKS6lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676653698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MXfg7E/e8jx9M+WSZqRff1hEac1QihxxCQIlJw/WXXQ=; b=tPimqfCtCFBxyv6vV33PtZZ4WdLZHhXpHl+KW7/zYp+t6nIac0DSmbmvZCAGbnE3+c6PQZ mEWtZM0tqBpMG77Rsr4kxOEkk6K2UkJSjfa9jpzMLZZReF4c3wHhGuCBKc826BHvgxGyf8 dyeM8C+nodjTZNa7klnKTDV+HKBJXY9omWFZdjvs4bjmTPdUj1cWToEDb4oP4rKO4Gdxn6 f2TKcCsCIPKa0HPS/zDAFPZFhT4fG+V007Ckyax2PFwxrRBhTxGE9MANU8ejutO8hjLf3j muM+4/XPS8+iXmUzpGFeLuT5tHZ1KSrapDOyAb85iaSGmR1Lh6iKIdxlOMQ/Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676653698; a=rsa-sha256; cv=none; b=sJ5EO8Ipt1U+OwawpMYoYY4W8lufap7IHQUO35+KN0KLdBM9Goa/Drj3D50CHyD7pMOJO+ v5Zf/dLPDqilCaOnGLrfYts5PAQdDQrVKccyqlN+rlaPeGBiR4OP4m2aP5QaKnTC+JkFUr 5E1zVXNBWyXDmdydFHM5tOOLSTAzxpERUx9M3U4cBREvlOZvG2PWVwjtdakpGhJgOhPUAq dqwr/IPY/MCU8UVZbJU35mn9pERvvuhpVVbNBm9errIXlC/GyghcQZ+c79LRLJDISWlCtI xneuu4HY2ubHHu0gWxv8WRm4W5Q5lE7ffejpuel0UV6vqC/mKPyXix1mbcc7xA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJJDK5tx2zr7m; Fri, 17 Feb 2023 17:08: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 31HH8Hlm054956; Fri, 17 Feb 2023 17:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HH8H9I054955; Fri, 17 Feb 2023 17:08:17 GMT (envelope-from git) Date: Fri, 17 Feb 2023 17:08:17 GMT Message-Id: <202302171708.31HH8H9I054955@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: b919bf05966c - main - cxgbe: Move helper functions for mbuf metadata to adapter.h. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b919bf05966c34cef8e02451ff1dfe9eec0f9cbd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b919bf05966c34cef8e02451ff1dfe9eec0f9cbd commit b919bf05966c34cef8e02451ff1dfe9eec0f9cbd Author: John Baldwin AuthorDate: 2023-02-17 17:06:12 +0000 Commit: John Baldwin CommitDate: 2023-02-17 17:06:12 +0000 cxgbe: Move helper functions for mbuf metadata to adapter.h. Previously private to t4_sge.c, this allows other parts of the driver (such as NIC TLS) to use these helpers directly. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D38578 --- sys/dev/cxgbe/adapter.h | 58 +++++++++++++++++++++++++++++++++++++++++++++ sys/dev/cxgbe/t4_sge.c | 63 ------------------------------------------------- 2 files changed, 58 insertions(+), 63 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index b470d1a6461c..7076b1cf781a 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1118,6 +1118,64 @@ hw_off_limits(struct adapter *sc) return (__predict_false(off_limits != 0)); } +static inline int +mbuf_nsegs(struct mbuf *m) +{ + M_ASSERTPKTHDR(m); + KASSERT(m->m_pkthdr.inner_l5hlen > 0, + ("%s: mbuf %p missing information on # of segments.", __func__, m)); + + return (m->m_pkthdr.inner_l5hlen); +} + +static inline void +set_mbuf_nsegs(struct mbuf *m, uint8_t nsegs) +{ + M_ASSERTPKTHDR(m); + m->m_pkthdr.inner_l5hlen = nsegs; +} + +/* Internal mbuf flags stored in PH_loc.eight[1]. */ +#define MC_NOMAP 0x01 +#define MC_RAW_WR 0x02 +#define MC_TLS 0x04 + +static inline int +mbuf_cflags(struct mbuf *m) +{ + M_ASSERTPKTHDR(m); + return (m->m_pkthdr.PH_loc.eight[4]); +} + +static inline void +set_mbuf_cflags(struct mbuf *m, uint8_t flags) +{ + M_ASSERTPKTHDR(m); + m->m_pkthdr.PH_loc.eight[4] = flags; +} + +static inline int +mbuf_len16(struct mbuf *m) +{ + int n; + + M_ASSERTPKTHDR(m); + n = m->m_pkthdr.PH_loc.eight[0]; + if (!(mbuf_cflags(m) & MC_TLS)) + MPASS(n > 0 && n <= SGE_MAX_WR_LEN / 16); + + return (n); +} + +static inline void +set_mbuf_len16(struct mbuf *m, uint8_t len16) +{ + M_ASSERTPKTHDR(m); + if (!(mbuf_cflags(m) & MC_TLS)) + MPASS(len16 > 0 && len16 <= SGE_MAX_WR_LEN / 16); + m->m_pkthdr.PH_loc.eight[0] = len16; +} + static inline uint32_t t4_read_reg(struct adapter *sc, uint32_t reg) { diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index ad3cb63dade4..94fc705bd1d4 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -87,11 +87,6 @@ __FBSDID("$FreeBSD$"); #define RX_COPY_THRESHOLD MINCLSIZE #endif -/* Internal mbuf flags stored in PH_loc.eight[1]. */ -#define MC_NOMAP 0x01 -#define MC_RAW_WR 0x02 -#define MC_TLS 0x04 - /* * Ethernet frames are DMA'd at this byte offset into the freelist buffer. * 0-7 are valid values. @@ -2284,64 +2279,6 @@ t4_update_fl_bufsize(struct ifnet *ifp) #endif } -static inline int -mbuf_nsegs(struct mbuf *m) -{ - - M_ASSERTPKTHDR(m); - KASSERT(m->m_pkthdr.inner_l5hlen > 0, - ("%s: mbuf %p missing information on # of segments.", __func__, m)); - - return (m->m_pkthdr.inner_l5hlen); -} - -static inline void -set_mbuf_nsegs(struct mbuf *m, uint8_t nsegs) -{ - - M_ASSERTPKTHDR(m); - m->m_pkthdr.inner_l5hlen = nsegs; -} - -static inline int -mbuf_cflags(struct mbuf *m) -{ - - M_ASSERTPKTHDR(m); - return (m->m_pkthdr.PH_loc.eight[4]); -} - -static inline void -set_mbuf_cflags(struct mbuf *m, uint8_t flags) -{ - - M_ASSERTPKTHDR(m); - m->m_pkthdr.PH_loc.eight[4] = flags; -} - -static inline int -mbuf_len16(struct mbuf *m) -{ - int n; - - M_ASSERTPKTHDR(m); - n = m->m_pkthdr.PH_loc.eight[0]; - if (!(mbuf_cflags(m) & MC_TLS)) - MPASS(n > 0 && n <= SGE_MAX_WR_LEN / 16); - - return (n); -} - -static inline void -set_mbuf_len16(struct mbuf *m, uint8_t len16) -{ - - M_ASSERTPKTHDR(m); - if (!(mbuf_cflags(m) & MC_TLS)) - MPASS(len16 > 0 && len16 <= SGE_MAX_WR_LEN / 16); - m->m_pkthdr.PH_loc.eight[0] = len16; -} - #ifdef RATELIMIT static inline int mbuf_eo_nsegs(struct mbuf *m) From nobody Fri Feb 17 17:08:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJJDM3vcSz3r9jr; Fri, 17 Feb 2023 17:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJJDM11J5z3lsG; Fri, 17 Feb 2023 17:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676653699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AuNsrn01CpijSrOmUipwFjzFIPeDxGJiXbQPAZuxA/0=; b=C2dGofuxA9C4XPC+URPNylEv/Mlyz2YNTtm8z7g+KwGrR27pekWYpzxKmjp+PLqhV3Gg0e TrTWTeHF+F6b5DbgswXcwU8pi87BsCgJ+/5iUEFR9ZBhSwCgXVOlMyO8O38q1xQxNc3F4o Kkg+Xh9qJ+KmVePW/P6vcnkjzpE1nD/1nCz58Kv1JZ51LpELi3fL5DfFCEHhef8BJqfKD2 f9gIK0SnVByHJpbJvYLUaIp+pvn9q+zSFA9NQAsTtV7jVulC0QSk7jA2u7zdxIZ5cqiCs3 TiJWc1pQkVYcYGEFzLT73gF7u58OBvXdrdkfNjEIZfrq5kibO92WaCH3UobGMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676653699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AuNsrn01CpijSrOmUipwFjzFIPeDxGJiXbQPAZuxA/0=; b=BBMwkatTCJOKh59gGF3rB2vO7AFiWiUgT8+p7P4XotCZi1YJvqQ7IXei9MCeVecQUj8ijP rSOCGNS1e945dJfOkkBGK3xYBVZjG6v+ciibCMVaFUJcmQgwVuqI/5E/oHm7nh9x1SNBZJ NoFyChoTRSQljhsD1f7VrcmF6rRadCqE2f1e/wzESjoZF44M5hifhwc7lNDhpJc6hd9GH/ 1p7/jyJaRuFm6UMU0Uv7hjEUMsJfI9FPC0DKzNgxi23tlWufeuc4H1Xga0g5QC79LyY0T2 bk7BodN3zeLwwdAQGTO6T/oGO6CJ/tbGz+/djJk/yEPLqOMToF4yQPER+KOxnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676653699; a=rsa-sha256; cv=none; b=a9ZJBQFNgKY2BLDo69Rh43DsvH+LNMP3UJBpUS9jM3RlVRQQ2td1YGWJHYpTbPbWkt1+I4 3ZWfCkjNiNix6mxgdoFrZYmVDr3OFl9QCwsdL2JUdTqQv8cEuQhEEH8f2yzAA+FDHY8Ikr NxIHm/Z8NMm/klc5T4QPzGdc/St20r9yNKgpYUmq1Cqxy+ozbd1Km8k0JBabjzRxnhARX9 ltOJ89Xca5k7Q8/7GnojwE/yML1MjPLqoHkchDRQnIyGSyKonjq2mEOAlbTfr5Jv6tc0xN XOgU/JPxB3E8KCzL2zoFNjYJ3VQ+tevSd5SxVH5AfdhHdfWKPJZ9x5WKL5JSAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJJDM008mzqry; Fri, 17 Feb 2023 17:08: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 31HH8I0R054978; Fri, 17 Feb 2023 17:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HH8IGq054977; Fri, 17 Feb 2023 17:08:18 GMT (envelope-from git) Date: Fri, 17 Feb 2023 17:08:18 GMT Message-Id: <202302171708.31HH8IGq054977@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: ca457729cc7b - main - cxgbe: Queue NIC TLS mbufs internally. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca457729cc7bee218ce4d001a39306687c433d39 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ca457729cc7bee218ce4d001a39306687c433d39 commit ca457729cc7bee218ce4d001a39306687c433d39 Author: John Baldwin AuthorDate: 2023-02-17 17:07:17 +0000 Commit: John Baldwin CommitDate: 2023-02-17 17:07:17 +0000 cxgbe: Queue NIC TLS mbufs internally. Set internal mbuf properties and queue NIC TLS mbuf chains to the connection's TX queue directly. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D38579 --- sys/dev/cxgbe/adapter.h | 4 +-- sys/dev/cxgbe/crypto/t6_kern_tls.c | 66 ++++++++++++++++---------------------- sys/dev/cxgbe/t4_sge.c | 11 ++----- 3 files changed, 33 insertions(+), 48 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 7076b1cf781a..4206bca95cdf 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1379,8 +1379,8 @@ int t6_tls_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, void t6_ktls_modload(void); void t6_ktls_modunload(void); int t6_ktls_try(struct ifnet *, struct socket *, struct ktls_session *); -int t6_ktls_parse_pkt(struct mbuf *, int *, int *); -int t6_ktls_write_wr(struct sge_txq *, void *, struct mbuf *, u_int, u_int); +int t6_ktls_parse_pkt(struct mbuf *); +int t6_ktls_write_wr(struct sge_txq *, void *, struct mbuf *, u_int); #endif /* t4_keyctx.c */ diff --git a/sys/dev/cxgbe/crypto/t6_kern_tls.c b/sys/dev/cxgbe/crypto/t6_kern_tls.c index 0be0c092d7e0..f1302d063051 100644 --- a/sys/dev/cxgbe/crypto/t6_kern_tls.c +++ b/sys/dev/cxgbe/crypto/t6_kern_tls.c @@ -72,6 +72,7 @@ struct tlspcb { struct vi_info *vi; /* virtual interface */ struct adapter *sc; struct l2t_entry *l2te; /* L2 table entry used by this connection */ + struct sge_txq *txq; int tid; /* Connection identifier */ int tx_key_addr; @@ -95,7 +96,6 @@ struct tlspcb { /* Fields only used during setup and teardown. */ struct inpcb *inp; /* backpointer to host stack's PCB */ - struct sge_txq *txq; struct sge_wrq *ctrlq; struct clip_entry *ce; /* CLIP table entry used by this tid */ @@ -785,12 +785,7 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struct mbuf *m_tls, /* This should always be the last TLS record in a chain. */ MPASS(m_tls->m_next == NULL); - - /* - * XXX: Set a bogus 'nsegs' value to avoid tripping an - * assertion in mbuf_nsegs() in t4_sge.c. - */ - *nsegsp = 1; + *nsegsp = 0; return (wr_len); } @@ -893,7 +888,7 @@ ktls_find_tcp_timestamps(struct tcphdr *tcp) } int -t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *len16p) +t6_ktls_parse_pkt(struct mbuf *m) { struct tlspcb *tlsp; struct ether_header *eh; @@ -901,6 +896,7 @@ t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *len16p) struct ip6_hdr *ip6; struct tcphdr *tcp; struct mbuf *m_tls; + void *items[1]; int nsegs; u_int wr_len, tot_len; @@ -976,7 +972,6 @@ t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *len16p) * Each of the remaining mbufs in the chain should reference a * TLS record. */ - *nsegsp = 0; for (m_tls = m->m_next; m_tls != NULL; m_tls = m_tls->m_next) { MPASS(m_tls->m_flags & M_EXTPG); @@ -993,8 +988,8 @@ t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *len16p) * Store 'nsegs' for the first TLS record in the * header mbuf's metadata. */ - if (*nsegsp == 0) - *nsegsp = nsegs; + if (m_tls == m->m_next) + set_mbuf_nsegs(m, nsegs); } MPASS(tot_len != 0); @@ -1035,12 +1030,13 @@ t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *len16p) tot_len += roundup2(wr_len, EQ_ESIZE); - *len16p = tot_len / 16; + set_mbuf_len16(m, tot_len / 16); #ifdef VERBOSE_TRACES CTR4(KTR_CXGBE, "%s: tid %d len16 %d nsegs %d", __func__, - tlsp->tid, *len16p, *nsegsp); + tlsp->tid, mbuf_len16(m), mbuf_nsegs(m)); #endif - return (0); + items[0] = m; + return (mp_ring_enqueue(tlsp->txq->r, items, 1, 256)); } /* @@ -1316,10 +1312,9 @@ _Static_assert(W_TCB_SND_UNA_RAW == W_TCB_SND_NXT_RAW, "SND_NXT_RAW and SND_UNA_RAW are in different words"); static int -ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, - void *dst, struct mbuf *m, struct tcphdr *tcp, struct mbuf *m_tls, - u_int nsegs, u_int available, tcp_seq tcp_seqno, uint32_t *tsopt, - u_int pidx, bool set_l2t_idx) +ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, void *dst, + struct mbuf *m, struct tcphdr *tcp, struct mbuf *m_tls, u_int available, + tcp_seq tcp_seqno, uint32_t *tsopt, u_int pidx, bool set_l2t_idx) { struct sge_eq *eq = &txq->eq; struct tx_sdesc *txsd; @@ -1335,7 +1330,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, u_int auth_start, auth_stop, auth_insert; u_int cipher_start, cipher_stop, iv_offset; u_int imm_len, mss, ndesc, offset, plen, tlen, twr_len, wr_len; - u_int fields, tx_max_offset, tx_max; + u_int fields, nsegs, tx_max_offset, tx_max; bool first_wr, last_wr, using_scratch; ndesc = 0; @@ -1457,7 +1452,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, out = (void *)(wr + 1); fields = 0; if (set_l2t_idx) { - KASSERT(nsegs != 0, + KASSERT(m->m_next == m_tls, ("trying to set L2T_IX for subsequent TLS WR")); #ifdef VERBOSE_TRACES CTR3(KTR_CXGBE, "%s: tid %d set L2T_IX to %d", __func__, @@ -1469,7 +1464,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, fields++; } if (tsopt != NULL && tlsp->prev_tsecr != ntohl(tsopt[1])) { - KASSERT(nsegs != 0, + KASSERT(m->m_next == m_tls, ("trying to set T_RTSEQ_RECENT for subsequent TLS WR")); #ifdef VERBOSE_TRACES CTR2(KTR_CXGBE, "%s: tid %d wrote updated T_RTSEQ_RECENT", @@ -1485,7 +1480,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, } if (first_wr || tlsp->prev_seq != tx_max) { - KASSERT(nsegs != 0, + KASSERT(m->m_next == m_tls, ("trying to set TX_MAX for subsequent TLS WR")); #ifdef VERBOSE_TRACES CTR4(KTR_CXGBE, @@ -1504,7 +1499,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, * reset SND_UNA_RAW to 0 so that SND_UNA == TX_MAX. */ if (tlsp->prev_seq != tx_max || mtod(m_tls, vm_offset_t) != 0) { - KASSERT(nsegs != 0, + KASSERT(m->m_next == m_tls, ("trying to clear SND_UNA_RAW for subsequent TLS WR")); #ifdef VERBOSE_TRACES CTR2(KTR_CXGBE, "%s: tid %d clearing SND_UNA_RAW", __func__, @@ -1524,7 +1519,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, tlsp->prev_seq = tcp_seqno + tlen; if (first_wr || tlsp->prev_ack != ntohl(tcp->th_ack)) { - KASSERT(nsegs != 0, + KASSERT(m->m_next == m_tls, ("trying to set RCV_NXT for subsequent TLS WR")); write_set_tcb_field_ulp(tlsp, out, txq, W_TCB_RCV_NXT, V_TCB_RCV_NXT(M_TCB_RCV_NXT), @@ -1536,7 +1531,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, } if (first_wr || tlsp->prev_win != ntohs(tcp->th_win)) { - KASSERT(nsegs != 0, + KASSERT(m->m_next == m_tls, ("trying to set RCV_WND for subsequent TLS WR")); write_set_tcb_field_ulp(tlsp, out, txq, W_TCB_RCV_WND, V_TCB_RCV_WND(M_TCB_RCV_WND), @@ -1547,8 +1542,10 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, tlsp->prev_win = ntohs(tcp->th_win); } - /* Recalculate 'nsegs' if cached value is not available. */ - if (nsegs == 0) + /* Use cached value for first record in chain. */ + if (m->m_next == m_tls) + nsegs = mbuf_nsegs(m); + else nsegs = sglist_count_mbuf_epg(m_tls, m_tls->m_epg_hdrlen + offset, plen - (m_tls->m_epg_hdrlen + offset)); @@ -1948,7 +1945,7 @@ ktls_write_tcp_fin(struct sge_txq *txq, void *dst, struct mbuf *m, } int -t6_ktls_write_wr(struct sge_txq *txq, void *dst, struct mbuf *m, u_int nsegs, +t6_ktls_write_wr(struct sge_txq *txq, void *dst, struct mbuf *m, u_int available) { struct sge_eq *eq = &txq->eq; @@ -2043,18 +2040,11 @@ t6_ktls_write_wr(struct sge_txq *txq, void *dst, struct mbuf *m, u_int nsegs, } ndesc = ktls_write_tls_wr(tlsp, txq, dst, m, tcp, m_tls, - nsegs, available - totdesc, tcp_seqno, tsopt, pidx, - set_l2t_idx); + available - totdesc, tcp_seqno, tsopt, pidx, set_l2t_idx); totdesc += ndesc; IDXINCR(pidx, ndesc, eq->sidx); dst = &eq->desc[pidx]; - /* - * The value of nsegs from the header mbuf's metadata - * is only valid for the first TLS record. - */ - nsegs = 0; - /* Only need to set the L2T index once. */ set_l2t_idx = false; } @@ -2126,13 +2116,13 @@ t6_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, } int -t6_ktls_parse_pkt(struct mbuf *m, int *nsegsp, int *len16p) +t6_ktls_parse_pkt(struct mbuf *m) { return (EINVAL); } int -t6_ktls_write_wr(struct sge_txq *txq, void *dst, struct mbuf *m, u_int nsegs, +t6_ktls_write_wr(struct sge_txq *txq, void *dst, struct mbuf *m, u_int available) { panic("can't happen"); diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 94fc705bd1d4..8cd9be275126 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -2691,16 +2691,12 @@ restart: #endif #ifdef KERN_TLS if (mst != NULL && mst->sw->type == IF_SND_TAG_TYPE_TLS) { - int len16; - cflags |= MC_TLS; set_mbuf_cflags(m0, cflags); - rc = t6_ktls_parse_pkt(m0, &nsegs, &len16); + rc = t6_ktls_parse_pkt(m0); if (rc != 0) goto fail; - set_mbuf_nsegs(m0, nsegs); - set_mbuf_len16(m0, len16); - return (0); + return (EINPROGRESS); } #endif if (nsegs > max_nsegs_allowed(m0, vm_wr)) { @@ -3260,8 +3256,7 @@ skip_coalescing: #ifdef KERN_TLS } else if (mbuf_cflags(m0) & MC_TLS) { ETHER_BPF_MTAP(ifp, m0); - n = t6_ktls_write_wr(txq, wr, m0, mbuf_nsegs(m0), - avail); + n = t6_ktls_write_wr(txq, wr, m0, avail); #endif } else { ETHER_BPF_MTAP(ifp, m0); From nobody Fri Feb 17 17:14:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJJMb0fNlz3rB06; Fri, 17 Feb 2023 17:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJJMb07m4z3n3D; Fri, 17 Feb 2023 17:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676654075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S8v7hFyHvPFkSMKhKJqupJM7x2SAAc6Blk0pq/hPpGU=; b=pGb4lNjSp8JbxxTi8gnBb9Eo1FIGdms9wRpmf0XXGdTEXtd4ggrU35NnbQ5KUCZK363pGG filC9e6z6DC7ccKbyPwZ1TmEMPXNdKpLKQw1idQcRryAuvgXnhmII/jbbWxDkM1vJrAGnO ay2PrsvTYA0Daqt9DBhJ2kjV5x0ZvIE/zwH80GlZwDX6/pP6KUwZWB7UL2bmsbfT2EjeqO yw/yn8jPpWB/xxDuh6jry7flu9BdHUqroxbK7Fr47mVVkZOAFTBvShiQBhls6U3Np6zPfw +vzxHXKslAVgCLsNwjpU0k7qWzLV82QhAs9DduPzPJui1XyOIlJThlAgfrx3vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676654075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S8v7hFyHvPFkSMKhKJqupJM7x2SAAc6Blk0pq/hPpGU=; b=yTlsq8WdffrKLLlRUMUxN3grm4lklUjLxPYqs+GZf+YnoAnjLUDg1sKpqJFft13J2Zf6Pl WxvY3hBLhFjo9EIfZnfSlk2zbrfIaTUBYzPnTUhUm+eZfQYjdLyl5Q81oVkXUStIZSKbye yA5smS79B8joOSZbBz1TuVoLVb/fQE+AmcK34lUlwTJrrDvIM32C85m0AEu4eD2TtWO6I4 b4WU+HACBuhriwNHR75ZYFmLf2IOpboCY5qq+zuklDd2v38OlJInZvlmfqZXCepO9TUr5P ru7BGALCR9BT/JC19UWxX9Qrrtck5olO5Mk+nVoDvBjjJFqBmrQh05/US/iSHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676654075; a=rsa-sha256; cv=none; b=KP24Vf9l667OEt4NSGxbCu6MA8pcXMRGN4Oz+BdRqPTxXX+sLtMDh+sqClykqGkI0sQOX9 plSZyWMbZtve2FFFVsl0g9FAPC0RQqElHpA8Ia7ZEZZkpc6S4bcxh1UeRSaK/ARIx7yvTX 2W/OgqvLd+5LTIiePSQrZ9yycPMPXp/YSI86/O4AHyi3F0mm1ttdF2h/FogTFKflDF8pnc u+c4mvMpILNYnlfuxS9WcmwSdGuhI16s/tspicHpqGWAplOoJOyIIED+MmCRuaSSp95+BR ++3s+y2lIxHFbNMCVBgNuVMoNR2ZYh6AsqlSKQFvjIdoRz42Agv27O2Lrw9PGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJJMZ6GCXzqq2; Fri, 17 Feb 2023 17:14: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 31HHEYlW068974; Fri, 17 Feb 2023 17:14:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HHEYAT068973; Fri, 17 Feb 2023 17:14:34 GMT (envelope-from git) Date: Fri, 17 Feb 2023 17:14:34 GMT Message-Id: <202302171714.31HHEYAT068973@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: cda6bdbaa15e - main - tcp: Don't try to disconnect a socket multiple times. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cda6bdbaa15e04857e2c0ae7ac06e9dbabac9835 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cda6bdbaa15e04857e2c0ae7ac06e9dbabac9835 commit cda6bdbaa15e04857e2c0ae7ac06e9dbabac9835 Author: John Baldwin AuthorDate: 2023-02-17 17:13:53 +0000 Commit: John Baldwin CommitDate: 2023-02-17 17:13:53 +0000 tcp: Don't try to disconnect a socket multiple times. When the checks for INP_TIMEWAIT were removed, tcp_usr_close() and tcp_usr_disconnect() were no longer prevented from calling tcp_disconnect() on a socket that was already disconnected. This triggered a panic in cxgbe(4) for TOE where the tcp_disconnect() on an already-disconnected socket invoked tcp_output() on a socket that was already in time-wait. Reviewed by: rrs, np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D37112 --- sys/netinet/tcp_usrreq.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 1dbf4659ad00..0c36e4281010 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -654,6 +654,8 @@ tcp_usr_disconnect(struct socket *so) goto out; } tp = intotcpcb(inp); + if (tp->t_state == TCPS_TIME_WAIT) + goto out; tcp_disconnect(tp); out: TCP_PROBE2(debug__user, tp, PRU_DISCONNECT); @@ -1248,14 +1250,16 @@ tcp_usr_close(struct socket *so) ("tcp_usr_close: inp_socket == NULL")); /* - * If we still have full TCP state, and we're not dropped, initiate + * If we are still connected and we're not dropped, initiate * a disconnect. */ if (!(inp->inp_flags & INP_DROPPED)) { tp = intotcpcb(inp); - tp->t_flags |= TF_CLOSED; - tcp_disconnect(tp); - TCP_PROBE2(debug__user, tp, PRU_CLOSE); + if (tp->t_state != TCPS_TIME_WAIT) { + tp->t_flags |= TF_CLOSED; + tcp_disconnect(tp); + TCP_PROBE2(debug__user, tp, PRU_CLOSE); + } } if (!(inp->inp_flags & INP_DROPPED)) { soref(so); From nobody Fri Feb 17 17:49:00 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJK7M4l04z3rDPK; Fri, 17 Feb 2023 17:49:03 +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 4PJK7M4Cnbz3qDG; Fri, 17 Feb 2023 17:49:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676656143; 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=TqVPO7GnClqIdyts5m8v2qtx3wNKVhXk/v2F/efJRTY=; b=hVQoX59q2W/d4ckYIptB8Z5WvmhxG9X/KNNmqk2cX9qFIhRDBwOsb5eBkb/FBWOou0HRK3 kbw5oycap/NkBDtTvSmNfYhWEvy9XFrUBaZyeQ9z0lC99JM8sgt5LCfEFVhEBsXgvgkJW+ aeiSWrGUMfJS4hbKJIWE6EmwC4hCSBMTE4qSDhDba/3WucRjMAtnJ1THPOe72qjt/qlVQA xmck64H+2N3HXwa+LL+6///GZhtNzU1uiGiEIX4lsFOK+y+J/EkJRXN6Iu+hxAzGTEB3u1 hE5ldqBRqIy94pV6IoaKlgxQjSAOXKkycUThQeS0yv7F38cZatXC7Uzh8jNgCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676656143; 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=TqVPO7GnClqIdyts5m8v2qtx3wNKVhXk/v2F/efJRTY=; b=pg3xRhpUNQBgAoL1fW88r/sQUIrwMP78t3HuBvu9IssDOUDTws/QsPTRWuNJVvdef3Ki/7 U6O92HCnAoIEHecQgwrnRqV4exk+jkfiII6TE893FqM0ALrzXU+aarHy+49Ut5cozHJXQw 8/jnz50/uECzeP3J8nlvrRCdqtnU+PlFUzh9Y+OrK13fNj3rYLabRkR2pWwEOgQoZ7lqub 0Ndqox5q1rPtIlWXcr8dpZ6edPgEWbe3WpiwXz3EEeCuSYNLu6pYIo2VRMF3EcvvCFYeS9 ZyzEwhuDClnhPG8KynFr0no/0NHbMsirPz6YpP3jJkceg+3A2Gg5ZB6KFzGQ2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676656143; a=rsa-sha256; cv=none; b=Lmrv1Z2+bcsQQvaOpnboyAXTFqLyUUzQaDaaco0VLZgTtI9UT0r39/EgACT2yb0ePmVB/O IEep5vchSQmHp2rDggkqEYfeqxm/IJ4ECMSCcwaqJc6KIW2WoML/dTY7hRF30nVL8+4JF2 O/yj7YsTst0sgQDrburPiyxyMMXuCwxt+aRQrKKnLNFsxiTgP+FHtYF1zb5hvwChrDi2vT /i0Tnw6fCok16htkUpg5ytK+s+rFiLplV0jY45a2gyYKFd5cPx8/QjXQ/jVaXBbv+Jc8cK A8/e19UNBgxiqbRX4Xe0+NUkE4Eb/z3KCbmZt4yVN8JflvX7USpkANInuHg9AQ== Received: from [IPV6:2601:648:8680:16b0:10b2:ebc3:c7be:fc24] (unknown [IPv6:2601:648:8680:16b0:10b2:ebc3:c7be:fc24]) (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 4PJK7L6kj6znM2; Fri, 17 Feb 2023 17:49:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <2fb2622d-8aae-af37-2e52-df7f20e27646@FreeBSD.org> Date: Fri, 17 Feb 2023 09:49:00 -0800 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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.7.2 Subject: Re: git: 98844e99d40a - main - aio: Fix more synchronization issues in aio_biowakeup. Content-Language: en-US To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202302152133.31FLXEep021521@gitrepo.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 2/15/23 2:05 PM, Alan Somers wrote: > On Wed, Feb 15, 2023 at 2:33 PM John Baldwin wrote: >> >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=98844e99d40a90ae89d84762e07150af3a8f89bd >> >> commit 98844e99d40a90ae89d84762e07150af3a8f89bd >> Author: John Baldwin >> AuthorDate: 2023-02-15 21:32:52 +0000 >> Commit: John Baldwin >> CommitDate: 2023-02-15 21:32:52 +0000 >> >> aio: Fix more synchronization issues in aio_biowakeup. >> >> - Use atomic_store to set job->error. atomic_set does an or >> operation, not assignment. >> >> - Use refcount_* to manage job->nbio. >> >> This ensures proper memory barriers are present so that the last bio >> won't see a possibly stale value of job->error. >> >> - Don't re-read job->error after reading it via atomic_load. >> >> Reported by: markj (1) >> Reviewed by: mjg, markj >> Differential Revision: https://reviews.freebsd.org/D38611 > > Thanks for fixing these subtle problems in aio_(read|write)v. Will you MFC too? Yes. I only noticed these while reviewing the original fix from the folks at TidalScale FWIW. -- John Baldwin From nobody Fri Feb 17 18:16:42 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJKlH2R4Fz3rGZf; Fri, 17 Feb 2023 18:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJKlH1hQgz3sb0; Fri, 17 Feb 2023 18:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Uak2lpbos1l05WZlZE36uKu/ZjNPeNOb1rUQfHZQI8=; b=hj/tQfrnWzB3yXXBOC8LRGn8pUB9Ww8OrjoNxSS4d64D1B+0Esstp6DIEz3evKofWgJ4rh NrMwgWD2lBbGDEiTdD/wrfYF7GuWMIBjsfbZFaBwJqjNXKC80OFLUXlqiRn5dBB64RZSm8 5pK4Kn+Uruq7C3YLW6cgZ9pg5P9jEsZMz8/Pvym+eBOjKdW7kq5T3leE9uYk3jMTlGlOa0 fREL/P6ZdFxpe3vh7Q57WaDlSzWq7MDnJ9MkMpsJZf/rwKtWn3wyXEPPv1ihFqNbnR94XV /ctp8TpHIxHuxbrcGLj4TZlezr6bXUg5yUQfSk4wR1gd/m5o1s9WxTqDbbmNtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Uak2lpbos1l05WZlZE36uKu/ZjNPeNOb1rUQfHZQI8=; b=INS3SMvYAzr2HwLC6PsR4NSIP95+mSDh/LcUxhQh6C4x+OWbH121dDVOhOGom4xdBS/neB GHTA7Wn9q99+XBWz/nNqdnIQYzNSG7oqbO96K8gPs8hUmGNq4ywdp7al1NioYj+BrnL4hn qGzgDSQdJftm11iMB1O1mSohvr9SvznupgG/8O+vwxUZP03JGe15caoDnRVuzJ5njTxpv+ RyF9Uw4gq8SX+jHWmvxcC6uohIxHrvY+XjxsKextrdpkcxzrHnQ2pZArW/6wijj4z8sQOk XdHLiOQO8qRm7WGpBHKS9kbOZQ+k7Npq3AkP2hvw0rM1FnFj1EIG6vZ+zBZg8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676657803; a=rsa-sha256; cv=none; b=hbs6DwDIi/tKUK+HZnEira170kQg8Bbr0thaxVXfFGk5gAJOZ8OGgJimL+niLI/CWwd7Ta 0+qLLbjhUNzUJ/WisaANYiFaoCxggVthXrn+UeO0GZvT1OG8CsMuoJ5wHcwjmXgNZF4sH5 cTWM9uPtmH+12wa36zYYvRsHj4jdmT8xk+mLueaQy/ieLLV7i+PStMoNyMIR5XDY/I0V75 ELevYGyCs4Z+qVzjyVvxhGAXRPUNGRYMudOY4a/IeyGKcR8h1GyCFld1sji3G1z7i/FmWl SSSeFr/nPSKCBojmrKZum7GF1bC1qb2yWFVeL6y1YWCFehiZros6yIDJp+m2Og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJKlG6sTbzscK; Fri, 17 Feb 2023 18:16: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 31HIGgPk054295; Fri, 17 Feb 2023 18:16:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HIGg18054294; Fri, 17 Feb 2023 18:16:42 GMT (envelope-from git) Date: Fri, 17 Feb 2023 18:16:42 GMT Message-Id: <202302171816.31HIGg18054294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: a0aa160b6d26 - main - routing: always pass rtentry to add_route_flags(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0aa160b6d261f67b29a25c7cc5e04668fb6faf7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a0aa160b6d261f67b29a25c7cc5e04668fb6faf7 commit a0aa160b6d261f67b29a25c7cc5e04668fb6faf7 Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:20:38 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-17 18:00:37 +0000 routing: always pass rtentry to add_route_flags(). add_route_flags() uses `rt` prefix data to lookup the the current rtentry from the routing table. Update rib_add_route_px() to always pass rtentry regardless of the op_flags. Reported by: Stefan Grundmann MFC after: 1 day --- sys/net/route/route_ctl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index fd374b468b7c..755765869e84 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -455,7 +455,7 @@ fill_pxmask_family(int family, int plen, struct sockaddr *_dst, * Attempts to add @dst/plen prefix with nexthop/nexhopgroup data @rnd * to the routing table. * - * @fibnum: rtable id to insert route to + * @fibnum: verified kernel rtable id to insert route to * @dst: verified kernel-originated sockaddr, can be masked if plen non-empty * @plen: prefix length (or -1 if host route or not applicable for AF) * @op_flags: combination of RTM_F_ flags @@ -490,6 +490,16 @@ rib_add_route_px(uint32_t fibnum, struct sockaddr *dst, int plen, FIB_RH_LOG(LOG_INFO, rnh, "rtentry allocation failed"); return (ENOMEM); } + } else { + struct route_nhop_data rnd_tmp; + RIB_RLOCK_TRACKER; + + RIB_RLOCK(rnh); + rt = lookup_prefix_bysa(rnh, dst, netmask, &rnd_tmp); + RIB_RUNLOCK(rnh); + + if (rt == NULL) + return (ESRCH); } return (add_route_flags(rnh, rt, rnd, op_flags, rc)); @@ -766,6 +776,8 @@ add_route_flags(struct rib_head *rnh, struct rtentry *rt, struct route_nhop_data struct rtentry *rt_orig; int error = 0; + MPASS(rt != NULL); + nh = rnd_add->rnd_nhop; RIB_WLOCK(rnh); From nobody Fri Feb 17 18:16:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJKlJ36HBz3rGZj; Fri, 17 Feb 2023 18:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJKlJ1yQCz3sXK; Fri, 17 Feb 2023 18:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XA9et2vN+9CUA47xz0z9P2tI1aDvru91bBNlXn2G7LU=; b=ZfvueuiV/qrbRfr6hYYn/tT2/puDp+zJg+uUTCVgXcgXg6LX4TMVFD3xbaFFm8OsRSkuYy /rASqr+aVLR3MwcoJRMQIwxqp2Bs+eJL8V6zH6+icAn7FrVWJFMZZopYzSyWjZUwcYvTvT ywD3RY5P9OClTQ7aa9r27mdp6wqIWLQfpC9E0RGVx6dM7KZXzlj4B6s38j/i2Wv4YjbsNG WJbUVxR4eVJwBIykZugD2RERLKYI0jzTUMHscWqoiwb126QqX7JsoHE1dcgL00Y9CdlWbP Cc/Zc+TuxH2xQPwn9UbLBZraNosr5g4fvdDTo1Vt9bKCL0CnmsV0WzLqNoa8dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XA9et2vN+9CUA47xz0z9P2tI1aDvru91bBNlXn2G7LU=; b=rpqlLFRogjeDiblPeQp6rb0INRfrRMFUiVT8KtZOcoRmPfAG8sy5wOc6HqKzDLY4fQIEWN avTVt1X/qR+uh4lWyz9eefwWxDNc5yBiUXr/gOVwgBKGaj8jhxkUMvWku1hk2ezs0C+BON hZDDy8D0aR6NetgCU3+FUsJa8iq0S7lHUgxs0dpCU/ea8h2MmwMGGmBcLLw1hm4jMAXsYq AiNXV/Qv2MRnDlde8gWH2ibPsD4NNIvgiJ4d5gqR1LserQ03CmbIWHm10KnbDY8Zg3lb65 E96x9cuknpa1ZRyv2viChUFsW+tSp2r8bYKvo6H2hhJsE/TbywTWniKtM6/hKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676657804; a=rsa-sha256; cv=none; b=J4MsWFlZ4gW24wJbgcDK7vVpjGEBdqOtWZYbUzVJXDNUtqxlkhL+qABasu3C9RJlupmm+4 FmDylkpwJe6cvnkG0QmDu1MXlxFmkzULtp8GBbBr5xJfXMx+1tKFAjSanQpfc0g4JkXnCQ iDyD+i179gOt3Pta3lEzb1zwOwrjEqDAwiq0h9xh0TngePLJx11No5BAul+kCLUw+Ov8gR 4IDSSal8qxnfLEoLrneAIJ38pesqxRGYbDoMFO5SMuKVtqz2ZQKNTxZJJoWX52/1N0lUXt swgc7iZ/r3RXEEhO0Z1eR8mLIhauq+4AEVNLCqScxL7onYeEQi1OYdSrgjLmDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJKlJ0f5lzsT7; Fri, 17 Feb 2023 18:16: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 31HIGhcf054314; Fri, 17 Feb 2023 18:16:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HIGh5h054313; Fri, 17 Feb 2023 18:16:43 GMT (envelope-from git) Date: Fri, 17 Feb 2023 18:16:43 GMT Message-Id: <202302171816.31HIGh5h054313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: f2f7911c5513 - main - netlink: validate rtable value in RTM_ROUTE. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2f7911c5513096e46422ad7756bc90c13c6e6d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f2f7911c5513096e46422ad7756bc90c13c6e6d8 commit f2f7911c5513096e46422ad7756bc90c13c6e6d8 Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:31:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-17 18:00:37 +0000 netlink: validate rtable value in RTM_ROUTE. Reported by: Stefan Grundmann MFC after: 1 day --- sys/netlink/route/rt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 59b34c53ad4b..aca69e75fea8 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -840,6 +840,11 @@ rtnl_handle_newroute(struct nlmsghdr *hdr, struct nlpcb *nlp, return (EINVAL); } + if (attrs.rta_table >= V_rt_numfibs) { + NLMSG_REPORT_ERR_MSG(npt, "invalid fib"); + return (EINVAL); + } + if (attrs.rta_nh_id != 0) { /* Referenced uindex */ int pxflag = get_pxflag(&attrs); @@ -898,6 +903,11 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp, return (ESRCH); } + if (attrs.rta_table >= V_rt_numfibs) { + NLMSG_REPORT_ERR_MSG(npt, "invalid fib"); + return (EINVAL); + } + error = rib_del_route_px(attrs.rta_table, attrs.rta_dst, attrs.rtm_dst_len, path_match_func, &attrs, 0, &rc); if (error == 0) @@ -915,6 +925,11 @@ rtnl_handle_getroute(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate * if (error != 0) return (error); + if (attrs.rta_table >= V_rt_numfibs) { + NLMSG_REPORT_ERR_MSG(npt, "invalid fib"); + return (EINVAL); + } + if (hdr->nlmsg_flags & NLM_F_DUMP) error = handle_rtm_dump(nlp, attrs.rta_table, attrs.rtm_family, hdr, npt->nw); else From nobody Fri Feb 17 18:16:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJKlK2z7Rz3rGkp; Fri, 17 Feb 2023 18:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJKlK29Qfz3sXY; Fri, 17 Feb 2023 18:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b/FG1gGOIFUgiIhIY1ucZPpt4EFUcRL4o5cI4aP8LRE=; b=opvFUDtdREfMJDcL/oKEWR84LwToVhrYHRq7pPhDuSkZtKsJ9vhqbjGO3S/kA1PII9T4iS TyfsJPTp8Whd4WA3VfORd9f/DDiaTAH/oB4xntlWbk5yx5embM/GhY8ohi56CNE5N5+7RK A4ySVUD/dHTcbmgSrt3nFfBzviuYzke2M+ZMO4Onpb7+BAnyg6tyQ9LnsSoVU/U3D/0jHy RMGju5QSh7ynA6o5sr3d9QOn+6WdhOpdDmyRaaeTPb5w2NCTmnpTNOUW8kZkxlMOsjD96J 01qLylA4mHd7N6xk5wE9m+9TPlpKoQfO66lGaKUQhEEKoE7PTL3GuLnqnqI+Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b/FG1gGOIFUgiIhIY1ucZPpt4EFUcRL4o5cI4aP8LRE=; b=plyS3XfCFVWxb68u59wMsm5thfLtTAoAJKh6zbVLXCLGYQROejIgphY+fhLq3myFOSmybD L0UHe1dMeZrgSRODaL4mIiL+qlwOByU3r1g2iy/IhxOSr7mO5dvSwfHbg/dyHYwTwsTgZC kOJH0dV8D5p9bUEaJ2p/qCF/mGtHsU+j7VhGYyzYkp26ZMFgRUwPB8tbH9EljG6ccvmRnC OD+II24Fd51Gv1KTdU8//9IxAGYsikBRiipfqmSx2rV+Wip4ua5nvOiXOGuC+I/vIPo93A TpvaYn9nnP/3lP8yS94J6b4MsjKHudf3bc1RgTnOlPBf9BOa6CSJhT9UYKKnRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676657805; a=rsa-sha256; cv=none; b=sPTL1reOCOhlSmaE/rhSq4pRWk1eQ0FLk4t6wqt2H8J9HDjLIIYE0q6s4YotyO53io2DQy gKliGMwcwUFm4m7RnxBQ55iw6auwHmEAsnPejkXJfWpViDRSunix0tmPOdaWIX7PYXqBcd 2czf9ETVLtnybHM6XE/ir3ocufNeEdpJRSrRR9kZC8QxkbZBEAXYVlA4M6aWxNEyGbhOU5 2wOsaTqY/4g2jtekhRRWOUe2+lK8d4SucGvgDHhzSJ6TWmIo7zvAVTak7Okxs2wc6a6aL9 D+EqT8LP+EaR9U2Cie45g+0zmdWCxXB9JYWLYtb0SibJeG1UxLMmxuImKrv01g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJKlK1HF5zrlp; Fri, 17 Feb 2023 18:16: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 31HIGjIC054337; Fri, 17 Feb 2023 18:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HIGj8U054336; Fri, 17 Feb 2023 18:16:45 GMT (envelope-from git) Date: Fri, 17 Feb 2023 18:16:45 GMT Message-Id: <202302171816.31HIGj8U054336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 6694cb1f5784 - main - netlink: fix if_allocdescr() malloc options argument. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6694cb1f5784d6ceacd684d29b3e3012e1e4e4d5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6694cb1f5784d6ceacd684d29b3e3012e1e4e4d5 commit 6694cb1f5784d6ceacd684d29b3e3012e1e4e4d5 Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:35:28 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-17 18:00:37 +0000 netlink: fix if_allocdescr() malloc options argument. The current value was based on the initial revision of D37566 and was not updated afterwards. MFC after: 1 day --- sys/netlink/route/iface_drivers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netlink/route/iface_drivers.c b/sys/netlink/route/iface_drivers.c index e944fe88994e..7cfaa5a6614b 100644 --- a/sys/netlink/route/iface_drivers.c +++ b/sys/netlink/route/iface_drivers.c @@ -72,7 +72,7 @@ modify_generic(struct ifnet *ifp, struct nl_parsed_link *lattrs, if (lattrs->ifla_ifalias != NULL) { if (nlp_has_priv(nlp, PRIV_NET_SETIFDESCR)) { int len = strlen(lattrs->ifla_ifalias) + 1; - char *buf = if_allocdescr(len, true); + char *buf = if_allocdescr(len, M_WAITOK); memcpy(buf, lattrs->ifla_ifalias, len); if_setdescr(ifp, buf); From nobody Fri Feb 17 18:16:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJKlL3tTBz3rGj5; Fri, 17 Feb 2023 18:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJKlL37rrz3sm4; Fri, 17 Feb 2023 18:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gl2Ugm7vC0QjVLZvJN6eoiRbBLW6+elOt8/5WsbEIa4=; b=RduTfNsscgJRpofh2e03G0RGYzzA9BgHyANrbjyg35WPg/2JBeuKraifg9GCuzg6LiybPF oKzwIIu82aW8Pt16LGBx6MKVWubvQCulKl5E6ysOUpd7xBKQO/95gFcJut5bZHM3fuPktI OCpkEA3NTaqRvNKCvjB9yD7lKwS4gm7nQCQz0yf/QlF43BSHZuBZPa+V7s1dQvmDSZIFJT OK8CjKKI0078KRpNkliD+xrbeANCZU+holxtnwPMuUNMbVbMQBtpcXSuIDySjvyFZv/r3f Alsy7bWHdchCaPwAZBYEIBGTQHhqHypKqET/Gi6y/zEFUYkFQ/4qwuV00HPjxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gl2Ugm7vC0QjVLZvJN6eoiRbBLW6+elOt8/5WsbEIa4=; b=xDyiHUZFMd4Da1wgSM0GUaurgL3nVQoYa4FJBO+1mPZO227N9fSOOSFVlMF0qD8mw0jnMp lJ4q9mBLgDSs68I3jbxNQuUc7EJwkqTJ1OegRLX8W0AROnX1NecUq3B9tc2RNUeSCF43an yUX9jUTfcmEl2fIqOID4JbbjS8iWO/2K9Q9cEbH/kaaNUchCpQT/CxKxZjBHTMiqV3fDMz 65qAaqwxauc0a4+ZOw2VtO62lVHZM6ef/ugSrNo5Ns/Nk7wSCK3Ikk+0WZyPAVzC9sXrAl 89YqcH491sfN/sYkdw6zJBrk/JKwTEU8oYpKn6pj5KouzetexWUvtI3htxtX7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676657806; a=rsa-sha256; cv=none; b=sHaJTY3kPOqbNrCnZR64kgot5ts+yyDSU0CWpdv7sSYKHKcWON5/ARtmoGXO50PVya8vW5 FbYHPOYoNnwD2j4Ec1za0eZoRTLQEUxy/x+u8JONJpgy0/FHh4LQwLNjKUcFyQY2UnzaPV ExrnVNy3IMsrZsQrc647O3hyf4tKISlNW43ytmlom9OmGrwgcnZ4q9ldr+v27DlZy2aOew bRt3RahqAgpaN1CwJbTzZI3/GeKsCtx1DjGV68gzKixQnW3Wf+upcCLSn0MYB1RXDNMkp6 x4KdFQ0SsCBCRyPjW+KPqHrvVl6Wx/FVe2yDFuuUxPY8SrnkkZYHwIPsaUD0+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 4PJKlL2BsMzsmM; Fri, 17 Feb 2023 18:16: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 31HIGkWH054359; Fri, 17 Feb 2023 18:16:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HIGkYd054358; Fri, 17 Feb 2023 18:16:46 GMT (envelope-from git) Date: Fri, 17 Feb 2023 18:16:46 GMT Message-Id: <202302171816.31HIGkYd054358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 45356a1864c7 - main - netlink: simplify temporary address allocation in rtnl_handle_getlink(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45356a1864c79680c6911b48a18b14a88a7d07fa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=45356a1864c79680c6911b48a18b14a88a7d07fa commit 45356a1864c79680c6911b48a18b14a88a7d07fa Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:57:44 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-17 18:16:07 +0000 netlink: simplify temporary address allocation in rtnl_handle_getlink(). MFC after: 3 days --- sys/netlink/route/iface.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 0eafacff4775..96f21a79a369 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -439,9 +439,8 @@ rtnl_handle_getlink(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *n NL_LOG(LOG_DEBUG2, "Start dump"); - struct ifnet **match_array; - int offset = 0, base_count = 16; /* start with 128 bytes */ - match_array = malloc(base_count * sizeof(void *), M_TEMP, M_NOWAIT); + struct ifnet **match_array = NULL; + int offset = 0, base_count = 0; NLP_LOG(LOG_DEBUG3, nlp, "MATCHING: index=%u type=%d name=%s", attrs.ifi_index, attrs.ifi_type, attrs.ifla_ifname); @@ -452,14 +451,14 @@ rtnl_handle_getlink(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *n if (offset >= base_count) { /* Too many matches, need to reallocate */ struct ifnet **new_array; - int sz = base_count * sizeof(void *); - base_count *= 2; - new_array = malloc(sz * 2, M_TEMP, M_NOWAIT); + /* Start with 128 bytes, do 2x increase on each realloc */ + base_count = (base_count != 0) ? base_count * 2 : 16; + new_array = malloc(base_count * sizeof(void *), M_TEMP, M_NOWAIT); if (new_array == NULL) { error = ENOMEM; break; } - memcpy(new_array, match_array, sz); + memcpy(new_array, match_array, offset * sizeof(void *)); free(match_array, M_TEMP); match_array = new_array; } From nobody Fri Feb 17 18:16:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJKlM5c8vz3rGZq; Fri, 17 Feb 2023 18: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 4PJKlM4Hw8z3t1Q; Fri, 17 Feb 2023 18: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=1676657807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4BCe3GGO6l15Yl20rbyFuGq9MIj0ncERTsoaILWieyQ=; b=aUpiGvCzFsXO2DXIFWVwdo5F4h83kfsQ8Qm0SVr8sZLQkZ88aORC8vK1vRzBeJ5LwE4DJ9 Z0AzO6G63lIa37rfZ3bC0vpq0hTKH0RkPCd8h9SqhXi/XzubwNXgvRJiG7Rb9d18tR63DY cze7w6/+Zf1tMQZYVcYPRuJ295RxoPcMKn3Hj9qh9PQOSKeN80iWzXjoupDvpbirg5yut9 2yboz/zlIAxbmEoXuLyt0YP6fCIlO16bAxbevAPE5hRaGptfjacGAUfT06BTtZC2ymdN9u Bjk62uFAEEBN0v75puViJN4Hx2Ir8ax9S8YfpIVMuoNPKzBLEzDF4B/D1uavNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4BCe3GGO6l15Yl20rbyFuGq9MIj0ncERTsoaILWieyQ=; b=ks8jorMmPOdI6vwOT0LJj/ppxamhUm18jwKZhL2gDWs4qzSqEGctB8mg4pZR3EEd35y8bk yZ4siwbFDAuOPyUCX5FuGvqfGMse+qJQ/iVmllL8Pu0rg+fP+cezjhy0YyFj66z+WWWDoK VdY2rWJw+XLzkBgFhopF3Hy21jLdqPx5lUEWmoNoVoOMShiB7Ran+ZdleOw3Mi+q7VgSLf P8lW+GuHVUduNRcsROgaDnQvmQT6JhT13kLpKAJoOujC+0n1mQUYko+qE+0V05L9r5oreH Mx41ziaTOVJ/WHPUJB3+yLXgUX6+9yLZmpIxPh7XKSmNZV3JdqGw+9fW6Yt3/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676657807; a=rsa-sha256; cv=none; b=SZdsmQMJOKIRhF7arXuE1TK4uWbLrlWPFKXPQOT+THDKtAZ1hxArGTj+EKbMIrgMP5JrKL aYD5YawVacuKx9U1nYTxvH+vdTHoM/SUV03s/4/OUvoWJsEX4f6MMIT+2c7FVn1g1DUyNb P2WihrS2hrZmxueZbeyimNOrFKheDcg/KHh35TZurae8UIb4o3wc3r7/YHCIQ8NSCETc/S BVsUMb+MKfinpdTkFYrr0E54X2z119zqgC9S8qdolFkcS0GzEGPYF4xAyPB7+NILWbiMTI K3xD9kbSklI/+PI6UwhIWRlCt5Y53lnV6lXED39rNnc5r0UQKlX5W9pj6ULQpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJKlM35vhzsT8; Fri, 17 Feb 2023 18: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 31HIGlTA054379; Fri, 17 Feb 2023 18: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 31HIGlEJ054378; Fri, 17 Feb 2023 18:16:47 GMT (envelope-from git) Date: Fri, 17 Feb 2023 18:16:47 GMT Message-Id: <202302171816.31HIGlEJ054378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 7cbe771f013f - main - netlink: call genetlink notification handler upon successful family search. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7cbe771f013f6cf3316910648f6d46641cad7f44 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7cbe771f013f6cf3316910648f6d46641cad7f44 commit 7cbe771f013f6cf3316910648f6d46641cad7f44 Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:58:53 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-17 18:16:07 +0000 netlink: call genetlink notification handler upon successful family search. MFC after: 3 days --- sys/netlink/netlink_generic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c index 028ea24fc5e9..066379e2afae 100644 --- a/sys/netlink/netlink_generic.c +++ b/sys/netlink/netlink_generic.c @@ -160,9 +160,8 @@ genl_unregister_family(const char *family_name) GENL_LOCK(); struct genl_family *gf = find_family(family_name); - nlctrl_notify(gf, CTRL_CMD_DELFAMILY); - if (gf != NULL) { + nlctrl_notify(gf, CTRL_CMD_DELFAMILY); found = true; unregister_groups(gf); /* TODO: zero pointer first */ From nobody Fri Feb 17 18:16:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJKlP1Tjhz3rGZt; Fri, 17 Feb 2023 18:16: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 4PJKlN5443z3swJ; Fri, 17 Feb 2023 18: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=1676657808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QKNmo9vqv+APArMm3LQpD3mHKB6OKNK5BgR76ixZxug=; b=R01Om7aIcWB52AP0zoZMHJ85Q3b7O24at0rfIGC2jH5DpETKEFHMZuoPqKZzizB6yBIGMv knD+7ljs6iKdV07NqXJVHt4e23kJyb3uGoSDslvw9+thqFLYiFyWTvV85YLku8au67jEt7 tYx3sUIxFUTkTqs6IGKG1oxoUhImk+j0mZurC0er24/9Mk5vXp+XQycdY1t0wIyzqcI4Pr 2YXWTJr3cByOT14S8jIfo3shXzpyGpF1QhPvSNav0uaVrRx2U6zL7BJWosS75gXDTb9qgA 8B2enwVmViLBQx+r8N7mSOmA06qnLNym862L29XS4hx2B9cfnOFWdXQLI/6mGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676657808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QKNmo9vqv+APArMm3LQpD3mHKB6OKNK5BgR76ixZxug=; b=XzY0wOf+x50AFKTPVcub026aYjXUwT5ZO3opPUeCghqSUBs3gEfdfZoJg7saWXd61gSQLT FvIixdywW8Rpy1lVmw8XIWFsNQC8R7azs1wDFjjiqLj+UgR1Kd6NiqqDrW6g53xZ+WwPAg 3vU2BVf+/ilAzXNL2SeqZ6qOaUS9RdUfeJrj72PR9RVCgO3ym9rtx2ezQdc9yN4TTD5jwt SJO9ot2DU0wdtseyO8/7wqpvKvKXCLl2R/iV0bkA6Qo6YlDrikRsrGgiCIdwW98TCvKn5z SLVzVsPo18paD8BlBrif9H9xaaIum7VZ2xx94QaokWGbDpClIZOXID8nAwz/qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676657808; a=rsa-sha256; cv=none; b=RbTt2gWCJ22WDEAmKutgQPQhqcBXW3gCjnOXvpiVDnG9pyuoiBT+ahuQA/LZ7Azcfnqxqd NOa3PMdb7NuXKCMxt1JmKwXzaewOZYfxXhbQ+KgZiYZs4Y49jY/5Xrx5WLTuUeTd9QyjuP kLxTOCG7o+JjGRTdbaDiolwDwnlbkFX87Jrom8kW8Td6+oJfDRHx0b5uC8cP/k19mRFSdB hHxnD7QC1heTPWnXfVYykmNccxBrq031zAtJIxrjW9ZIEci8UvB/IbuAjMdwOtpyFEMItg 7X1T/kWCPZQrYojw8j5JN57YXmk8VFfufZWNncS26WDcuBkDn0lDU2mHSqNGuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJKlN3mK2zscL; Fri, 17 Feb 2023 18: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 31HIGmNf054402; Fri, 17 Feb 2023 18: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 31HIGmXg054401; Fri, 17 Feb 2023 18:16:48 GMT (envelope-from git) Date: Fri, 17 Feb 2023 18:16:48 GMT Message-Id: <202302171816.31HIGmXg054401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: ff8da9b2bab4 - main - netlink: improve attribute decoding in python tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff8da9b2bab43920a19c16855ac3d30b5ccb1df2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=ff8da9b2bab43920a19c16855ac3d30b5ccb1df2 commit ff8da9b2bab43920a19c16855ac3d30b5ccb1df2 Author: Alexander V. Chernikov AuthorDate: 2023-02-17 18:04:53 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-17 18:16:08 +0000 netlink: improve attribute decoding in python tests MFC after: 2 weeks --- tests/atf_python/sys/net/netlink.py | 131 +++++++++++++++++++++++++----------- 1 file changed, 92 insertions(+), 39 deletions(-) diff --git a/tests/atf_python/sys/net/netlink.py b/tests/atf_python/sys/net/netlink.py index ba7d41c7cbf8..16cb746157cc 100644 --- a/tests/atf_python/sys/net/netlink.py +++ b/tests/atf_python/sys/net/netlink.py @@ -72,36 +72,38 @@ class NlErrattrType(Enum): class RtattrType(Enum): RTA_UNSPEC = 0 - RTA_DST = auto() - RTA_SRC = auto() - RTA_IIF = auto() - RTA_OIF = auto() - RTA_GATEWAY = auto() - RTA_PRIORITY = auto() - RTA_PREFSRC = auto() - RTA_METRICS = auto() - RTA_MULTIPATH = auto() - RTA_PROTOINFO = auto() - RTA_FLOW = auto() - RTA_CACHEINFO = auto() - RTA_SESSION = auto() - RTA_MP_ALGO = auto() - RTA_TABLE = auto() - RTA_MARK = auto() - RTA_MFC_STATS = auto() - RTA_VIA = auto() - RTA_NEWDST = auto() - RTA_PREF = auto() - RTA_ENCAP_TYPE = auto() - RTA_ENCAP = auto() - RTA_EXPIRES = auto() - RTA_PAD = auto() - RTA_UID = auto() - RTA_TTL_PROPAGATE = auto() - RTA_IP_PROTO = auto() - RTA_SPORT = auto() - RTA_DPORT = auto() - RTA_NH_ID = auto() + RTA_DST = 1 + RTA_SRC = 2 + RTA_IIF = 3 + RTA_OIF = 4 + RTA_GATEWAY = 5 + RTA_PRIORITY = 6 + RTA_PREFSRC = 7 + RTA_METRICS = 8 + RTA_MULTIPATH = 9 + # RTA_PROTOINFO = 10 + RTA_KNH_ID = 10 + RTA_FLOW = 11 + RTA_CACHEINFO = 12 + RTA_SESSION = 13 + # RTA_MP_ALGO = 14 + RTA_RTFLAGS = 14 + RTA_TABLE = 15 + RTA_MARK = 16 + RTA_MFC_STATS = 17 + RTA_VIA = 18 + RTA_NEWDST = 19 + RTA_PREF = 20 + RTA_ENCAP_TYPE = 21 + RTA_ENCAP = 22 + RTA_EXPIRES = 23 + RTA_PAD = 24 + RTA_UID = 25 + RTA_TTL_PROPAGATE = 26 + RTA_IP_PROTO = 27 + RTA_SPORT = 28 + RTA_DPORT = 29 + RTA_NH_ID = 30 class NlMsgType(Enum): @@ -314,6 +316,32 @@ class NlRtaxType(Enum): RTAX_FASTOPEN_NO_COOKIE = auto() +class RtFlagsBSD(Enum): + RTF_UP = 0x1 + RTF_GATEWAY = 0x2 + RTF_HOST = 0x4 + RTF_REJECT = 0x8 + RTF_DYNAMIC = 0x10 + RTF_MODIFIED = 0x20 + RTF_DONE = 0x40 + RTF_XRESOLVE = 0x200 + RTF_LLINFO = 0x400 + RTF_LLDATA = 0x400 + RTF_STATIC = 0x800 + RTF_BLACKHOLE = 0x1000 + RTF_PROTO2 = 0x4000 + RTF_PROTO1 = 0x8000 + RTF_PROTO3 = 0x40000 + RTF_FIXEDMTU = 0x80000 + RTF_PINNED = 0x100000 + RTF_LOCAL = 0x200000 + RTF_BROADCAST = 0x400000 + RTF_MULTICAST = 0x800000 + RTF_STICKY = 0x10000000 + RTF_RNH_LOCKED = 0x40000000 + RTF_GWFLAG_COMPAT = 0x80000000 + + class NlRtGroup(Enum): RTNLGRP_NONE = 0 RTNLGRP_LINK = auto() @@ -496,13 +524,17 @@ class NlHelper: cls = AddressFamilyLinux return cls + @staticmethod + def build_propmap(cls): + ret = {} + for prop in dir(cls): + if not prop.startswith("_"): + ret[getattr(cls, prop).value] = prop + return ret + def get_propmap(self, cls): if cls not in self._pmap: - ret = {} - for prop in dir(cls): - if not prop.startswith("_"): - ret[getattr(cls, prop).value] = prop - self._pmap[cls] = ret + self._pmap[cls] = self.build_propmap(cls) return self._pmap[cls] def get_name_propmap(self, cls): @@ -536,8 +568,8 @@ class NlHelper: def get_rta_name(self, val): return self.get_attr_byval(RtattrType, val) - def get_bitmask_map(self, cls, val): - propmap = self.get_propmap(cls) + @staticmethod + def get_bitmask_map(propmap, val): v = 1 ret = {} while val: @@ -551,7 +583,13 @@ class NlHelper: return ret def get_bitmask_str(self, cls, val): - bmap = self.get_bitmask_map(cls, val) + bmap = self.get_bitmask_map(self.get_propmap(cls), val) + return ",".join([v for k, v in bmap.items()]) + + @staticmethod + def get_bitmask_str_uncached(cls, val): + pmap = NlHelper.build_propmap(cls) + bmap = NlHelper.get_bitmask_map(pmap, val) return ",".join([v for k, v in bmap.items()]) def get_nlm_flags_str(self, msg_str: str, reply: bool, val): @@ -743,6 +781,12 @@ class NlAttrU8(NlAttr): return self._to_bytes(struct.pack("@B", self.u8)) +class NlAttrRtFlags(NlAttrU32): + def _print_attr_value(self): + s = NlHelper.get_bitmask_str_uncached(RtFlagsBSD, self.u32) + return " rtflags={}".format(s) + + class NlAttrIp(NlAttr): def __init__(self, nla_type, addr: str): super().__init__(nla_type, b"") @@ -808,6 +852,11 @@ class NlAttrNhId(NlAttrU32): return " nh_id={}".format(self.u32) +class NlAttrKNhId(NlAttrU32): + def _print_attr_value(self): + return " knh_id={}".format(self.u32) + + class NlAttrMac(NlAttr): def _print_attr_value(self): return ' mac="' + ":".join(["{:02X}".format(b) for b in self._data]) + '"' @@ -956,9 +1005,13 @@ rtnl_route_attrs = prepare_attrs_map( AttrDescr(RtattrType.RTA_SRC, NlAttrIp), AttrDescr(RtattrType.RTA_IIF, NlAttrIfindex), AttrDescr(RtattrType.RTA_OIF, NlAttrIfindex), - AttrDescr(RtattrType.RTA_GATEWAY, NlAttrTable), + AttrDescr(RtattrType.RTA_GATEWAY, NlAttrIp), + AttrDescr(RtattrType.RTA_TABLE, NlAttrTable), + AttrDescr(RtattrType.RTA_PRIORITY, NlAttrU32), AttrDescr(RtattrType.RTA_VIA, NlAttrVia), AttrDescr(RtattrType.RTA_NH_ID, NlAttrNhId), + AttrDescr(RtattrType.RTA_KNH_ID, NlAttrKNhId), + AttrDescr(RtattrType.RTA_RTFLAGS, NlAttrRtFlags), AttrDescr( RtattrType.RTA_METRICS, NlAttrNested, From nobody Sat Feb 18 02:31:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJXk65L7Hz3s9JD; Sat, 18 Feb 2023 02:31: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 4PJXk64Ttrz3pZv; Sat, 18 Feb 2023 02:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676687486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VTrxk+M/L++LV880HdQgXY9Fp32OINtx1hLoep3phQc=; b=mnhJoZw/j834IYGczAbjIiUR3zOlm+KpqqL8iZwDqDIR9ir4BpW5cZKl35tz7ROeEEnvEA tK4LyI4NN7HF5kAkH8wHgqXYl69Mh4lIz2x94p5Fz8+eYHyEWI0ZhNu+28tP/oRC+KjOvH rTVZRg6eMlYDFWp8rXP+c4umANl1Y51wI+xKZHIM+2jXM39MOC1JcJTMccBv4E0qhbOcQo C/Zq8/4oXGaQ9faYQUYVBpsewLbEMfx8bZvDbL3jj/3TwgZryEa0TOQRxbmr7fwo3xCXZ7 Ys14rwFg86SMt1Q9ckKoX74xutEiCKZJYxG+NYgScr2yKgKXtJznQZzYya20Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676687486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VTrxk+M/L++LV880HdQgXY9Fp32OINtx1hLoep3phQc=; b=Xy7D4nItQDuX1cUhEtWT33NvLv65uB6slp138XwnQif4/X/lJ8Lwzv7Wjepxs/nbhE+Hbw tMfXPlRYyxUI1wjIPwJHaaVtaaNOpKxFv7FNqUOxlRPUoFuONqEYkdUSRxF5OpwWK901La Icz6YtSDT3AAh7lkarCuxp7IutL2HnGVGl+gMX6yds8TptZuESF/ekvejG3EgVoFoXRlfQ O1for20OBhbVOBjpoI9H06EoGBe6PMAg4AutKLF53+c2fwFeviEBO8P6jVCTrzA9g5Ubn6 X9TI/7BePzTDbEaqMG+zvwUM7pjm3XIRMU1xxl3kNe4z8h8r8oZa0NoDmW2+zQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676687486; a=rsa-sha256; cv=none; b=YMovsHNh4Tz9fyWsJRgaHagWGWeEmhIuVYU44V4e1EhjIYrtpW7dvK0gfIRwz+UsuZ6iSC qqFGxNshiuvkmszERZdPQmWAaZLuE06fV9z4H2Hpb7TNHwrH1f7k/DzT1DcOoYa6GCleHa AgMVWyDvtRhPvaGYjD0BCNKz5oFoxULfliR7efIxjliFnRGa+gEg25TsWrv1IkmfnfeFyP Ftx7L1qhwKSqt7zccmrFEua0aazb0i+0vnFwsrG4ISHjwLLJ6OOAYLMXRgjD0w7nMfJTVq dHwuIDjttoSrOAVdFcbMAzkirQiSUZdNBDrHAcF3CnlhYb9XxePooHN3qd7H2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJXk63WbJz15SQ; Sat, 18 Feb 2023 02:31: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 31I2VQBD062491; Sat, 18 Feb 2023 02:31:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31I2VQHb062490; Sat, 18 Feb 2023 02:31:26 GMT (envelope-from git) Date: Sat, 18 Feb 2023 02:31:26 GMT Message-Id: <202302180231.31I2VQHb062490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: df91d8167d97 - main - mutex(9): correct man page, mtx_trylock_spin returns int not void List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df91d8167d97fcddc5831af923729d000c7f5b45 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=df91d8167d97fcddc5831af923729d000c7f5b45 commit df91d8167d97fcddc5831af923729d000c7f5b45 Author: Allan Jude AuthorDate: 2022-05-22 00:13:16 +0000 Commit: Allan Jude CommitDate: 2023-02-18 02:30:18 +0000 mutex(9): correct man page, mtx_trylock_spin returns int not void Reviewed by: kib, pauamma, debdrup Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D35283 --- share/man/man9/mutex.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/mutex.9 b/share/man/man9/mutex.9 index 43d523a56c98..cb207ff4596a 100644 --- a/share/man/man9/mutex.9 +++ b/share/man/man9/mutex.9 @@ -28,7 +28,7 @@ .\" from BSDI $Id: mutex.4,v 1.1.2.3 1998/04/27 22:53:13 ewv Exp $ .\" $FreeBSD$ .\" -.Dd May 24, 2017 +.Dd February 17, 2023 .Dt MUTEX 9 .Os .Sh NAME @@ -74,7 +74,7 @@ .Fn mtx_trylock "struct mtx *mutex" .Ft int .Fn mtx_trylock_flags "struct mtx *mutex" "int flags" -.Ft void +.Ft int .Fn mtx_trylock_spin "struct mtx *mutex" .Ft int .Fn mtx_trylock_spin_flags "struct mtx *mutex" "int flags" From nobody Sat Feb 18 15:46:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJtN06w5cz3sfWt; Sat, 18 Feb 2023 15:46: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 4PJtN06Rkwz3wZR; Sat, 18 Feb 2023 15:46:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676735216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ypNKUrYew/3wP+Dz3ZTTejSQ8pPUDy0tNz5TzqjAmXU=; b=Ouh5bTaPRQKz7vV8gxa6KRnFc3jxa1uy3giCjtIBV/5emPkMIldnbK92LojMpBeNgXNBoj X/zg1C8OPXNiZE8tPYbwzagRhW9Io2+Vf1TiCr+iVZCQJVNtjaBV+IzVkN4tDfywfY5D6R VWA8wRR18S/s8dETtY3qqbe7ozK4i+diDz0KPiVuL5hfoiNOt2Z+HJcNOHa91tUGcNNuO4 uCRIXMfQu7OvkF9Y0OSjSAyGDCJluzA6AuChXC47cxV5wJfyrHvN3EDHpSrMRPYOndeqad eUG2+lww9+bvALrWxuanrmhAn5JQp5JU9KPONlfLJfbcVp6jlxZovsT5KcaCUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676735216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ypNKUrYew/3wP+Dz3ZTTejSQ8pPUDy0tNz5TzqjAmXU=; b=jPiB0e87dJbPIH7AfxYdRXi/witt6ctT3zdlJrqSdaxeoUAXTrYWnCiMRf8pjoE5kuR7UV 3eq0RaA7Bmzyq7/d4QbfZAvG/FrOpmKiUctpc39HgdK7cJC1seoDtrWT5fv2bYHCjYhXdV InTZjdVm6BtGx/MG6bIVD9vqWatIc2bkeoSysLnMg3wPGLOYQneARnBStEYyC1GtGm7fsl kUJMTpdhuqzyuV/NUhI01VXb1TcaXqYr8CvziYnZZhNGLK6sOL2IKu/VZqDOPD5bFnrXeh 6qvwJZVvgDCFa5++POOSV/+8digTkF7bRbIMVw36AXVqmWodSEf2XDEKbE+oWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676735216; a=rsa-sha256; cv=none; b=ljs1dQ6+cRb/vkOKCzhJ++A77UNm36JNB1vRAnhGbN6KpQZ8tCWJnBD8qqzgJYv3/Y1fBe WL05hLTJ989RJzS+sWBxCUTv3QmOYWmPAMxiHDy78joFLQWOXtQkhiPdjAPAp558/os434 yqbKX7iEpgyPbm9H+RIh1k0GPIxNPnW2d0G4FldDtVJXKleepX27BJB8X1Dik7iNzgt3cW MXgfdslsifrhvXhIfeOA8QfOyiWlLm3/+JQwgYUM9ECJGYDWLhsgESs3i+0R+Ltl/QBxOn RDGE4NBJPkdOMfm5sSUPUzkARvRbTWQjRQS0uKc/TLT9yaKoy6dBrz153KVEoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJtN05VtxzSg6; Sat, 18 Feb 2023 15:46: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 31IFkuSL098091; Sat, 18 Feb 2023 15:46:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IFkuYl098090; Sat, 18 Feb 2023 15:46:56 GMT (envelope-from git) Date: Sat, 18 Feb 2023 15:46:56 GMT Message-Id: <202302181546.31IFkuYl098090@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: cd406ac94d8b - main - nfsd: Add NFSD_VNET() macros to nfs_fha_new.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd406ac94d8beae7f184adb14a3c94e058366b9a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=cd406ac94d8beae7f184adb14a3c94e058366b9a commit cd406ac94d8beae7f184adb14a3c94e058366b9a Author: Rick Macklem AuthorDate: 2023-02-18 15:45:38 +0000 Commit: Rick Macklem CommitDate: 2023-02-18 15:45:38 +0000 nfsd: Add NFSD_VNET() macros to nfs_fha_new.c Although it is not 100% obvious if the affinity threads lists need to be vnet'd when nfsd runs in a prison, I think it is necessary for the unusual case where the same file system is exported in multiple prisons. For this case, the affinity code might try to assign the RPC to a svc thread that runs in a different prison. Also, it makes sense to vnet them, since there are separate svc threads for each prison running nfsd(8). This patch adds the macros for vnet'ng to nfs_fha_new.c. The macros are still null, so the only semantics change is malloc'ng the fha_param structure. MFC after: 3 months --- sys/fs/nfsserver/nfs_fha_new.c | 108 +++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 46 deletions(-) diff --git a/sys/fs/nfsserver/nfs_fha_new.c b/sys/fs/nfsserver/nfs_fha_new.c index 05a03bee5d1c..203e98d3ac86 100644 --- a/sys/fs/nfsserver/nfs_fha_new.c +++ b/sys/fs/nfsserver/nfs_fha_new.c @@ -56,14 +56,14 @@ static int fhenew_stats_sysctl(SYSCTL_HANDLER_ARGS); static void fha_extract_info(struct svc_req *req, struct fha_info *i); -static struct fha_params fhanew_softc; +NFSD_VNET_DEFINE_STATIC(struct fha_params *, fhanew_softc); SYSCTL_DECL(_vfs_nfsd); extern int newnfs_nfsv3_procid[]; -SYSINIT(nfs_fhanew, SI_SUB_ROOT_CONF, SI_ORDER_ANY, fhanew_init, NULL); -SYSUNINIT(nfs_fhanew, SI_SUB_ROOT_CONF, SI_ORDER_ANY, fhanew_uninit, NULL); +SYSINIT(nfs_fhanew, SI_SUB_VNET_DONE, SI_ORDER_ANY, fhanew_init, NULL); +SYSUNINIT(nfs_fhanew, SI_SUB_VNET_DONE, SI_ORDER_ANY, fhanew_uninit, NULL); static void fhanew_init(void *foo) @@ -71,9 +71,9 @@ fhanew_init(void *foo) struct fha_params *softc; int i; - softc = &fhanew_softc; - - bzero(softc, sizeof(*softc)); + NFSD_VNET(fhanew_softc) = malloc(sizeof(struct fha_params), M_TEMP, + M_WAITOK | M_ZERO); + softc = NFSD_VNET(fhanew_softc); snprintf(softc->server_name, sizeof(softc->server_name), FHANEW_SERVER_NAME); @@ -82,12 +82,14 @@ fhanew_init(void *foo) * Initialize the sysctl context list for the fha module. */ sysctl_ctx_init(&softc->sysctl_ctx); - softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_vfs_nfsd), OID_AUTO, "fha", - CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "NFS File Handle Affinity (FHA)"); - if (softc->sysctl_tree == NULL) { - printf("%s: unable to allocate sysctl tree\n", __func__); - return; + if (IS_DEFAULT_VNET(curvnet)) { + softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_vfs_nfsd), OID_AUTO, "fha", + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "NFS File Handle Affinity (FHA)"); + if (softc->sysctl_tree == NULL) { + printf("%s: unable to allocate sysctl tree\n", __func__); + return; + } } for (i = 0; i < FHA_HASH_SIZE; i++) @@ -106,36 +108,38 @@ fhanew_init(void *foo) /* * Add sysctls so the user can change the tuning parameters. */ - SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "enable", CTLFLAG_RWTUN, - &softc->ctls.enable, 0, "Enable NFS File Handle Affinity (FHA)"); - - SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "read", CTLFLAG_RWTUN, - &softc->ctls.read, 0, "Enable NFS FHA read locality"); - - SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "write", CTLFLAG_RWTUN, - &softc->ctls.write, 0, "Enable NFS FHA write locality"); - - SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "bin_shift", CTLFLAG_RWTUN, - &softc->ctls.bin_shift, 0, - "Maximum locality distance 2^(bin_shift) bytes"); - - SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RWTUN, - &softc->ctls.max_nfsds_per_fh, 0, "Maximum nfsd threads that " - "should be working on requests for the same file handle"); - - SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "max_reqs_per_nfsd", CTLFLAG_RWTUN, - &softc->ctls.max_reqs_per_nfsd, 0, "Maximum requests that " - "single nfsd thread should be working on at any time"); - - SYSCTL_ADD_OID(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "fhe_stats", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - 0, 0, fhenew_stats_sysctl, "A", ""); + if (IS_DEFAULT_VNET(curvnet)) { + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "enable", CTLFLAG_RWTUN, + &softc->ctls.enable, 0, "Enable NFS File Handle Affinity (FHA)"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "read", CTLFLAG_RWTUN, + &softc->ctls.read, 0, "Enable NFS FHA read locality"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "write", CTLFLAG_RWTUN, + &softc->ctls.write, 0, "Enable NFS FHA write locality"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "bin_shift", CTLFLAG_RWTUN, + &softc->ctls.bin_shift, 0, + "Maximum locality distance 2^(bin_shift) bytes"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RWTUN, + &softc->ctls.max_nfsds_per_fh, 0, "Maximum nfsd threads that " + "should be working on requests for the same file handle"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "max_reqs_per_nfsd", CTLFLAG_RWTUN, + &softc->ctls.max_reqs_per_nfsd, 0, "Maximum requests that " + "single nfsd thread should be working on at any time"); + + SYSCTL_ADD_OID(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "fhe_stats", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, fhenew_stats_sysctl, "A", ""); + } } static void @@ -144,11 +148,12 @@ fhanew_uninit(void *foo) struct fha_params *softc; int i; - softc = &fhanew_softc; + softc = NFSD_VNET(fhanew_softc); sysctl_ctx_free(&softc->sysctl_ctx); for (i = 0; i < FHA_HASH_SIZE; i++) mtx_destroy(&softc->fha_hash[i].mtx); + free(softc, M_TEMP); } static rpcproc_t @@ -556,11 +561,13 @@ noloc: SVCTHREAD * fhanew_assign(SVCTHREAD *this_thread, struct svc_req *req) { - struct fha_params *softc = &fhanew_softc; + struct fha_params *softc; SVCTHREAD *thread; struct fha_info i; struct fha_hash_entry *fhe; + NFSD_CURVNET_SET(NFSD_TD_TO_VNET(curthread)); + softc = NFSD_VNET(fhanew_softc); /* Check to see whether we're enabled. */ if (softc->ctls.enable == 0) goto thist; @@ -602,9 +609,11 @@ fhanew_assign(SVCTHREAD *this_thread, struct svc_req *req) mtx_lock(&thread->st_lock); mtx_unlock(fhe->mtx); + NFSD_CURVNET_RESTORE(); return (thread); thist: req->rq_p1 = NULL; + NFSD_CURVNET_RESTORE(); mtx_lock(&this_thread->st_lock); return (this_thread); } @@ -619,12 +628,15 @@ fhanew_nd_complete(SVCTHREAD *thread, struct svc_req *req) struct fha_hash_entry *fhe = req->rq_p1; struct mtx *mtx; + NFSD_CURVNET_SET(NFSD_TD_TO_VNET(curthread)); /* * This may be called for reqs that didn't go through * fha_assign (e.g. extra NULL ops used for RPCSEC_GSS. */ - if (!fhe) + if (!fhe) { + NFSD_CURVNET_RESTORE(); return; + } mtx = fhe->mtx; mtx_lock(mtx); @@ -638,12 +650,13 @@ fhanew_nd_complete(SVCTHREAD *thread, struct svc_req *req) fha_hash_entry_remove(fhe); } mtx_unlock(mtx); + NFSD_CURVNET_RESTORE(); } static int fhenew_stats_sysctl(SYSCTL_HANDLER_ARGS) { - struct fha_params *softc = &fhanew_softc; + struct fha_params *softc; int error, i; struct sbuf sb; struct fha_hash_entry *fhe; @@ -652,6 +665,8 @@ fhenew_stats_sysctl(SYSCTL_HANDLER_ARGS) sbuf_new(&sb, NULL, 65536, SBUF_FIXEDLEN); + NFSD_CURVNET_SET(NFSD_TD_TO_VNET(curthread)); + softc = NFSD_VNET(fhanew_softc); for (i = 0; i < FHA_HASH_SIZE; i++) if (!LIST_EMPTY(&softc->fha_hash[i].list)) break; @@ -694,6 +709,7 @@ fhenew_stats_sysctl(SYSCTL_HANDLER_ARGS) } out: + NFSD_CURVNET_RESTORE(); sbuf_trim(&sb); sbuf_finish(&sb); error = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); From nobody Sat Feb 18 17:08:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJwBG2Rcyz3slyt; Sat, 18 Feb 2023 17: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 4PJwBG1tdGz47BC; Sat, 18 Feb 2023 17: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=1676740118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lmNwpuf7apST5ri6P5DsIj6FvQ+H0bH78gXbmgZj9og=; b=dj2B6iSet+WR780efnc48PjBQVzypk+ivC2X7oRgfXQJUFr70OH6l6RoPOrWo7vzYKghfC egQQb5jd03V1eEldOrEYujP4KOv+1ofGznL7b/s5BxpzOoNtTyvdb4zTsZWe+dnpr0jlVr HfKBW3T4VYXcOOcr9dq3rmTo6ZZojnb4voTpV3yZJt8l2AEXA6XKHrmqmXq9rLJBFBYfBM v4ZwecZGWjJHCtdCSOrxa/17uNcDPwzh8hElc/85IfEwd29z4At3I3pxSLKFHZJM1QNMtb 0BH6tXwGHw4XPdoTwCxDo3cjNXMYJ2C52dlozFYGYw77ShPO+hEAEGSpl2VoMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676740118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lmNwpuf7apST5ri6P5DsIj6FvQ+H0bH78gXbmgZj9og=; b=N+5AXiOey4vtwVXU9qHByIlr41o0xH6h+rrBZMPGCm4DBZLCFFzlEJpXtPTufMUQZvkuT/ Ev6gEoqjtcI5icTLzhpIojFOAyeOSBo3GthOs2jx3J1VlVAFSP7BbHRzwAoeiNH3vjJ6Qr e6k2hh+TcZ2/4T18kFsFr/oEfOIqGb05r2gRJnM2jVI5ZUY7vd5J3NQrshBkKhcx54mDvO QPKgm2YuTUKHn/7t5UxjppatZac5w2mqcU9v/bSyT/TCPuDpa9zzJ/WHSoxaNk7ZrFe1fj e7S7942dz6McrZZ86uXTGK0ZiXacfcVdt+RAZKfX6NPEuF6+5AeAX/JJjZ6Bgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676740118; a=rsa-sha256; cv=none; b=B3GV3OTQLqyQQ92fzJE0pRRG25+hSQlK/mWIvsXPhmI5lKpBeNAfJhmhD3cxqy84RCbyDy 5DqzTpMHI/F83IQw4aBAJBM7rwvLGhQTY+pbAvAZhunJmIFel+hXQgwjZ61s4Yk3ZnWCrY UujBCCUQeOraC3C+bPLnYBU+3fyuYxsmuOYkTS4ZzSjRUz3QLH2LxIkokGoHAZjy701GsT lf7nyVNVBVuitVWMLnQlS1CvaWSHsEdQjkqJOiPTroM9We5KRMlg8ReXoN8mQhWDbraEog a+fWjX+5YDLITMqlpikTJ4VrTZwNqtDwSUt5iFZaoqwKNcTrB6GJm+f9lYWVOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJwBG0vwnzWD1; Sat, 18 Feb 2023 17:08: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 31IH8cab012815; Sat, 18 Feb 2023 17:08:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IH8c07012814; Sat, 18 Feb 2023 17:08:38 GMT (envelope-from git) Date: Sat, 18 Feb 2023 17:08:38 GMT Message-Id: <202302181708.31IH8c07012814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Fernando=20Apestegu=C3=ADa?= Subject: git: 91706f0d6d97 - main - netstat.1: Clarify -i and -I priorities List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91706f0d6d972c3ff359565e144828dad2a790af Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/src/commit/?id=91706f0d6d972c3ff359565e144828dad2a790af commit 91706f0d6d972c3ff359565e144828dad2a790af Author: Fernando Apesteguía AuthorDate: 2023-02-18 17:00:29 +0000 Commit: Fernando Apesteguía CommitDate: 2023-02-18 17:01:34 +0000 netstat.1: Clarify -i and -I priorities netstat(1) allows to specify both -i (all interfaces) and -I . However, when both are specified, -I always overrides -i. Add a comment where appropriate the same way we do in rm(1) for -f and -i. PR: 202708 Reported by: demon@ Approved by: manpages (pauamma@) Differential Revision: https://reviews.freebsd.org/D38654 --- usr.bin/netstat/netstat.1 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index 819e7c94df74..c57e00d11648 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 27, 2022 +.Dd February 18, 2023 .Dt NETSTAT 1 .Os .Sh NAME @@ -284,6 +284,14 @@ The network addresses of the interface and the maximum transmission unit .Pq Dq mtu are also displayed. +If both +.Fl i +and +.Fl I +are specified, +.Fl I +overrides any instances of +.Fl i . .Bl -tag -width indent .It Fl 4 Show IPv4 only. @@ -432,6 +440,14 @@ See .Ek .Xc Display per-interface statistics for each network protocol. +If both +.Fl i +and +.Fl I +are specified, +.Fl I +overrides any instances of +.Fl i . .Bl -tag -width indent .It Fl 4 Show IPv4 only From nobody Sat Feb 18 17:55:00 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJxCm6jxHz3spwV; Sat, 18 Feb 2023 17:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJxCm6HLkz4Gcc; Sat, 18 Feb 2023 17:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEeQxOl/Xw06FxLIXkk3yUz8/vC0nCqlqIXp+riseKU=; b=aE96uy2Qoeq8yt6C8c+bRzcMpQ9hrRUCzw8p5GagLdPWxNPeb/xEfvVHeJZ73T5SKXhN8d 3MSsafVWp8/3U0MLjGIcTKOIcbTpxRa6VY7vPvrvJ0LJgezQvWyJWW8UkTyEF3Nu5Zj9fO e0V5C3YcgInW9GVgIe3H1m8kNomWcePFu5j0s1PGLxcs7OJqeIbqazC4AHeAeV9Xm27NJk ZUQv6R4zRTNzenG4mGK6ooWZ6RnhrQEy7vZQ7iPAEPvAUlULErJhZyQfXbW6urb02ybF/P KWiCUA4E8iz5wcl1n7iCfwawURBjtMrUiwfh+IdCgXF6f5soW4oI0FkR5zFPTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEeQxOl/Xw06FxLIXkk3yUz8/vC0nCqlqIXp+riseKU=; b=qDK1Y8ChuLx+UTZJwS94lMw5ESWf/zQdWOcUnY1itSIVK1QeP+gCqei5LGfoI57/p5+LB5 q4w8bZI487Exf4IMnJrl0v4mt+Dn19Z+49d0ytI1SgVzreheMq1YqhjO4KmIZqlS2HMH1z d/qt/wa0ryJXjJqjxDF1Cn1yjJxoRSHviZATHO8Ebse1/BYkxF4Gbb2W5OtLguRuGEqF93 LzGF4fzF1fT17p++qRSYTmORe24wZVWV4Qll4zt/GUkj8R1gDqXkEKmK4Hw1PhqcLIBprr O0+SkmpSn9bApzyhTY48NjTfcTsJVtCkwOT9zLjR9pVSCtZJI5XjmJOLF5Pp3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676742900; a=rsa-sha256; cv=none; b=Qa6z0IpzHvA8aVoT6MPfpyV0hffIUB+OLIRKy81FSb3gsRnolJ2Mt/lnlYsHBq3rxy9f1c mN7RgEIbPSI7xwMe+ckcqvHtEU5VMCMLxfeQOtLh35NxcHi58N4Q7boOjzG5KCIo20W4Th lmh/jES3JwKkvQ0FEjEQKnpp6n6Nik5qJ6g0yMng2U4tHC05SoWukzY7dTpjlz33sefu3M 5N9LhFB/wKgXjc1r2uLJGNUqyE8vTQHOC/pLOziButk6ul0CRE4CG9uCjBIulGFzHVSEjt P1Bcq8wgNW8wYzNTsMVxY5uLqOru1Onm3Txva6St02M26jHDDCcc5JnVe3j0gA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJxCm5LcWzWyG; Sat, 18 Feb 2023 17:55: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 31IHt0ex083424; Sat, 18 Feb 2023 17:55:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IHt0D9083423; Sat, 18 Feb 2023 17:55:00 GMT (envelope-from git) Date: Sat, 18 Feb 2023 17:55:00 GMT Message-Id: <202302181755.31IHt0D9083423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 1ea58b413595 - main - netlink: remove redundant check. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ea58b413595310de43587c609421ede74770f11 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=1ea58b413595310de43587c609421ede74770f11 commit 1ea58b413595310de43587c609421ede74770f11 Author: Alexander V. Chernikov AuthorDate: 2023-02-18 17:10:39 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-18 17:53:05 +0000 netlink: remove redundant check. MFC after: 2 weeks CID: 1498867 --- sys/netlink/route/iface.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 96f21a79a369..116acd863ba9 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -779,15 +779,11 @@ get_sa_plen(const struct sockaddr *sa) switch (sa->sa_family) { #ifdef INET case AF_INET: - if (sa == NULL) - return (32); paddr = &(((const struct sockaddr_in *)sa)->sin_addr); return bitcount32(paddr->s_addr);; #endif #ifdef INET6 case AF_INET6: - if (sa == NULL) - return (128); paddr6 = &(((const struct sockaddr_in6 *)sa)->sin6_addr); return inet6_get_plen(paddr6); #endif From nobody Sat Feb 18 17:55:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJxCp0chGz3spSd; Sat, 18 Feb 2023 17:55: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 4PJxCp072hz4H4p; Sat, 18 Feb 2023 17:55:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fI5ROyz3OYFhzGNiStfjI5KW0iuedrSQPsdFVIXhXJo=; b=nvsp2x1PsdTtFRNRW9xbU3oCzBQ51//vAQEHmqQ6u1C58+foX8uO4LEhfjSeChWqR37Tr8 3Bx/aRyEU6cysd4kREPpc9Y+o+3kVHqsK2vjBgzGk/PlVySq/0pvqZ+qgCQlMF0e0FRpxc b4jjhr1dspEJW2RFJ2NylECGjF+2zetxBnmnVZ4h/zZ1N2dnCkWJdRkxHQFvPyhO4JnoG+ tyPF6zaXO99SuLlNoBBB1PQbLK11iuax78fw2p6UccfK3dTgQiP93AFdP1siFwyFdOT64S a3QeNl9Ext7hz9nQdRpoXcP4DnTaIIbhneQsOYRpf51wNqWAZIWVYFX/Xwe9VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fI5ROyz3OYFhzGNiStfjI5KW0iuedrSQPsdFVIXhXJo=; b=fq/JQvohrI+J5b32hYH3KE7mlmqxaNzRBkM4L4BOcKdto7wYB+Q4eucI6x9uG++tmty7az 2cJNeS6Kj2XAaaW9TDumR91B8Ddfuimjiw4U1u78eo0iReyERIcGOo9yb0DIiFHY6+CNDq JrCR6cXRonU5H3wnrWXFQ8QqALsa9QuXOMt5x4jZ5h3V8ECPyOaeGR0Busqs0hOlc1gaKs jLjRiX7NGRodoyhxnuzlVNRnaQiuVCAYy9xJFpf4OKOmZsmiMhC7TBUW4RwMwgFU+DsXwf 7r2LIPPjb1HvirgmrAhscSVDZZ5FSChBbSckL42CrrxrhVpcY1HBCWyP9ZkuNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676742902; a=rsa-sha256; cv=none; b=QVFFh1mMoJ7ZxTPEgXhdszTGZW9mHV8IwXwOeqALJOFQ9ClHv74vJdhelae5HGO3zx3Uin 1QqLQAqh5n+qkwFXV+ShAf1X4jm0zlw7oiAvrqpcw0YmXWblTa2/fizlX+2P/fLS0ohEOv QCGwq7Dgry8PdYf9KhpdQHeOwS5tiGSjTryhF3oZpD8Y1zebhxzc9x0dxF/aF+vOBU/jZ3 8uXGQBiN8z+NQRjl4KLqkYckMB/ABV3tId+qZ3RrHAN3e80m5ld8IBS5YhO9bSqg5Owkp5 n3g5ZjX7uQSkOS2FYd2qe1sYcorIo6hThNJRI6fm2/J+jCNZCAucGonyPjXRXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJxCn6CjmzWRH; Sat, 18 Feb 2023 17:55: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 31IHt1ln083443; Sat, 18 Feb 2023 17:55:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IHt12T083442; Sat, 18 Feb 2023 17:55:01 GMT (envelope-from git) Date: Sat, 18 Feb 2023 17:55:01 GMT Message-Id: <202302181755.31IHt12T083442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 3f70fca90f9f - main - netlink: check result of sooptcopyin(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f70fca90f9f1c6a40e55e6edd2dc1b1272f4998 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=3f70fca90f9f1c6a40e55e6edd2dc1b1272f4998 commit 3f70fca90f9f1c6a40e55e6edd2dc1b1272f4998 Author: Alexander V. Chernikov AuthorDate: 2023-02-18 17:15:25 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-18 17:53:05 +0000 netlink: check result of sooptcopyin(). CID: 1498866 MFC after: 2 weeks --- sys/netlink/netlink_domain.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index 4d34fd381c39..630ce47cd228 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -612,7 +612,9 @@ nl_ctloutput(struct socket *so, struct sockopt *sopt) switch (sopt->sopt_name) { case NETLINK_ADD_MEMBERSHIP: case NETLINK_DROP_MEMBERSHIP: - sooptcopyin(sopt, &optval, sizeof(optval), sizeof(optval)); + error = sooptcopyin(sopt, &optval, sizeof(optval), sizeof(optval)); + if (error != 0) + break; if (optval <= 0 || optval >= NLP_MAX_GROUPS) { error = ERANGE; break; @@ -629,7 +631,9 @@ nl_ctloutput(struct socket *so, struct sockopt *sopt) case NETLINK_CAP_ACK: case NETLINK_EXT_ACK: case NETLINK_GET_STRICT_CHK: - sooptcopyin(sopt, &optval, sizeof(optval), sizeof(optval)); + error = sooptcopyin(sopt, &optval, sizeof(optval), sizeof(optval)); + if (error != 0) + break; flag = nl_getoptflag(sopt->sopt_name); From nobody Sat Feb 18 17:55:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJxCq57gXz3spf9; Sat, 18 Feb 2023 17:55: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 4PJxCq0ld3z4H54; Sat, 18 Feb 2023 17:55:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5kMgFAEQ0OzUoaTrktS23j/Rr0Tv/9eCoKWHVRa0gx0=; b=TgihDJT973o6sTPEsA0otnnMqgWsoT1AsNLvkx8nWQ2+0BT5vWEaKREpmPnQkzPfjxBFjZ KCIVt9c5pUAswMihtVIdeaCWS/W0PGV9PwVrf0yiZQpQfqBkSyqMz2MThIE2UIUd/ZiyWr fK2L6RcnQ4ms3sGOz1mYs1GbXh+XDr3gcJapzFXk2wWxa9z+aDRVZp/m+OXhCtO2YwX+tW UcPCyioV6xD+uJq5hqicDFFIWq4VE9EFYrMK79LCT5xhplkmc3va1/CwIe7YJtpTAKgdNZ soxMHKcFQL0fnKP1/xDc6/R3n5lKkFFx1Di1VRHjjJJ9D4wh/vornqTn7WTjQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5kMgFAEQ0OzUoaTrktS23j/Rr0Tv/9eCoKWHVRa0gx0=; b=mhHsG6gbhdqnfaYDpVn4QrDoN5McDpIP1NgMQxqIe493pg7SpvJ8a0NFCqwBiu0ahxFDhZ ZR7CkuwPRiRN8uycJ15CqOK9OPMG1vXHdtQHE/qOwu7BonYygo2FlJ9jAYYp7Na7h9cFNN CFVacc4aCU2gO93PG+ktVVhbAWlQtLn8Luc5AWxbBfEbBeG+JoCPNae6I+TIEG9Ineuagh RthpBuDYYvd3zFfcDSGVTJ/Ro0fQmoUIplrzYfEcwMlY3xMrExEQC2kEH+ap9aSgtreSUH Pj8bD92mt6+WjaAZrB9nAhtj4pljveTgkF4g6/k9+YPjGvVInW6uRsW+YCqf9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676742903; a=rsa-sha256; cv=none; b=NShq+Bzcy3dADagcwtFGxBfkBDm7O6xQT3J6sPKIG2fM+s0Ih7Vd4bI4LOyimjP9YYM+au 0LrhO0w4wCpwOM64QyXNfpmsBOoQQkLmklGocctUA6/SEC/1GkdzZk4M/sfRHhb8ZCyDpV FnQmB38g2mZbZ8qAol1oVXnGO6bx9sp583rSGzEG1IuhnSlMJWodrxiIzGQ6sc8YoZNGcz Jw7yHEFWo4nPaNupB99RvfQRGjJG+noQ9DWHXEB9xIMLXnaBKTmwww6dquXZ7GahSYPgoA pmtIMYW6rgEZnjWyi3yovI36K9sg3vTrlalILKQj22tlyfblCE+RAeCel4b3pA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJxCp6yhvzWyH; Sat, 18 Feb 2023 17:55: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 31IHt2vJ083464; Sat, 18 Feb 2023 17:55:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IHt25O083462; Sat, 18 Feb 2023 17:55:02 GMT (envelope-from git) Date: Sat, 18 Feb 2023 17:55:02 GMT Message-Id: <202302181755.31IHt25O083462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 4404e840cf3a - main - netlink: initialise error in nl_autobind_port(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4404e840cf3aa8d06d79dc281fffbb32860ab2af Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=4404e840cf3aa8d06d79dc281fffbb32860ab2af commit 4404e840cf3aa8d06d79dc281fffbb32860ab2af Author: Alexander V. Chernikov AuthorDate: 2023-02-18 17:18:57 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-18 17:53:05 +0000 netlink: initialise error in nl_autobind_port(). CID: 1498877 MFC after: 2 weeks --- sys/netlink/netlink_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index 630ce47cd228..5f9120f14308 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -384,7 +384,7 @@ nl_autobind_port(struct nlpcb *nlp, uint32_t candidate_id) uint32_t port_id = candidate_id; NLCTL_TRACKER; bool exist; - int error; + int error = EADDRINUSE; for (int i = 0; i < 10; i++) { NL_LOG(LOG_DEBUG3, "socket %p, trying to assign port %d", nlp->nl_socket, port_id); From nobody Sat Feb 18 17:55:04 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJxCr59pGz3spwZ; Sat, 18 Feb 2023 17:55: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 4PJxCr1hxlz4H7G; Sat, 18 Feb 2023 17:55:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ETIUijigiWOtSCyhFFLF1+noRXO+Gw3dFH/hxENkQnM=; b=BY8vEyqqrax0vwi7tFo3bK3vrcSsioO6OXrNHflVdBShsyLeCpogk1uSKLYH1OCN8Dh04y otzoVh0nBs4qWNP1Nb+Xm1a4FWpToPCmhnVfEVP1+fmFP7FGWpI/lvzfUKEsQ5FTXPbAs/ m4SkbNHmQfoa9FPprxTEzEz+4sDP5JQ434pSvKBf/mo959IaoOyEb7hM3u6uNljkvYDOhv YuOKwo6k5VnX6kUO76hdAhn5QbWQ9/NjDPmyVIxYHZVpaMEbtmNNv8iBFNXxmkDMBRdAwk NJtLFHzJYZamt2ivtxOQsQz4JXcobNsl7ClbVPgGGrsIP7MgP5sPhZ1Epx1Epw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ETIUijigiWOtSCyhFFLF1+noRXO+Gw3dFH/hxENkQnM=; b=vjJMzWNC7ZvNPdRJz4ZtlXTiJyH6gFBXL1QSAJiF754TpdbO6q9u+Q3LejYSEI4XtqYl+C fuBaSiDE0JcFqe5u5/+wtHBs4bL7rGuedbLVjgrtWBFPaMaVWWf+1vxDw79sEuSwkTm1LV Dz5bA7ye6cYQNIcYNeZ04rG7CyQFuYQXHHSffqnlP0R9Am254QLnm/o9nexyilEwsju4Pz mkPPr/5HAsRSyrHdpvVzP+BryfpPk9nT7+1UIWK3YWSQwXLfJ8C8PI3ZTkJrTnaI3xgxDO dEaC2+ZMz61nSKvsiP57Tnc58nFVN47GEtFwtN+i4CrpZBsogxl0W3R3h2+YmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676742904; a=rsa-sha256; cv=none; b=yk2itpnxcOMX5K4A7cxeCu4GDH6+lrywXOyjPtmyDB2WXTSZYmFLT3nl0K8+Z5h328xraN apkMPTWNmBtuQ9HksMwxjyO7vAllkAsZChRYq2xb4psEo+oPyQ/YIcqR+l5NXK2KTUAA2o gwDnPNAtI1ZHwgvzNE/2wXL2RHG/zGCz5nbNZ6c+4aZYGAjKMQ8dU8trA8JS8bsphbUGV3 PZa1RujoR+xcM56yH+o0RCWssWZDOgODtFNJmbXSjxzqzBcNFiXSGBP8vWLxTm/BxWP/Lu dBh7Zwctxb/pAG/bUL1uj49miXMGQ2rsgtNa/EsRGrsKl1sL7Cb4dQqKZkuSpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJxCr0lkMzXLR; Sat, 18 Feb 2023 17:55: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 31IHt4W5083488; Sat, 18 Feb 2023 17:55:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IHt4WS083487; Sat, 18 Feb 2023 17:55:04 GMT (envelope-from git) Date: Sat, 18 Feb 2023 17:55:04 GMT Message-Id: <202302181755.31IHt4WS083487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 8f7455a9265f - main - netlink: fix OOB read in genetlink List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f7455a9265f4952f885b06c08c57fcce6f16e5c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=8f7455a9265f4952f885b06c08c57fcce6f16e5c commit 8f7455a9265f4952f885b06c08c57fcce6f16e5c Author: Alexander V. Chernikov AuthorDate: 2023-02-18 17:24:59 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-18 17:53:06 +0000 netlink: fix OOB read in genetlink CID: 1498863 MFC after: 1 day --- sys/netlink/netlink_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c index 066379e2afae..a16fdc312daa 100644 --- a/sys/netlink/netlink_generic.c +++ b/sys/netlink/netlink_generic.c @@ -267,7 +267,7 @@ genl_handle_message(struct nlmsghdr *hdr, struct nl_pstate *npt) int family_id = (int)hdr->nlmsg_type - GENL_MIN_ID; - if (__predict_false(family_id < 0 || family_id > MAX_FAMILIES)) { + if (__predict_false(family_id < 0 || family_id >= MAX_FAMILIES)) { NLP_LOG(LOG_DEBUG, nlp, "invalid message type: %d", hdr->nlmsg_type); return (ENOTSUP); } From nobody Sat Feb 18 17:55:05 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJxCt29LPz3spYv; Sat, 18 Feb 2023 17:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJxCs2bjcz4Gm7; Sat, 18 Feb 2023 17:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HowWIIf5RiFc9heyAErVlnF5M51NubcBy2Pe0hIovKg=; b=XPMIQtlIo/GrTSRdk8XdotR8iYTy13eXik4Q6DBwoJV3VVx5skGuw7HEzg8G3ATVlqZ53L REIx4XRfw3Q4YcjRsZdMUYJxiEDqY7elYqpOD/snL8QitPOorfxfuYzpuwO9HYgQub9e+Z IkOpRy9uiAg6l0J1PgebuLIaocb1B9JUDlRjS7IHaQZZlpcC1i+WZGrgt7oll9H+eZyaqJ gGmbY11su0VgfmuhRZCu/WQVR4mCR1cNuPuwVKZeGuddkN8B/wyQdSNNzmkaRKyFH/08fN k+OWltEryO5kiOKJanIPR3F7+GeX6/lO/hPdbUkpLU0UpBSVYpeCNkKFdoxjuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676742905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HowWIIf5RiFc9heyAErVlnF5M51NubcBy2Pe0hIovKg=; b=Zj67qVKEU88rjbeFFouVokbwn/kfysvdrTWD4QEFl0X+lpCswPNcloOH1vN2ELs0YG74IL n+5IACWkljePu9PWNyLjSJcuJaInJtqewuYz3ILyiDp1QUqyvp/RHQAmA8fdO9E+mqiu+u sucMOvbIxVSWQZsExwrcf1DO2IM4sbXh9DbdCmLCbn778gm1BiuvtIS3EI4oIWQDjx0uZE k5dkYIeSH2Fs16NOshx0E5RP3lcZmfHkmBPOm9II8L9EZRaJpxFMoFbIhSNDFSmKd7vupM 6d0dStZAx9e8F0Xghed0OB9RrKFER/jRQCjV/tVzm20jYhqoJIPf5X/f7ebUIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676742905; a=rsa-sha256; cv=none; b=Xxn6erzZ46rdmQ+HOWyD4SBnzkZ/2OOVLZzRo5yRUEY3xxVOisuCafW4HieUgIEGGd1q5v f76pq4V2dWySJyDiA0iJOFDtzeyLUsOxVbKmVKVXxpEbqvVwthzfpD5/TcykmgIkHxh1Q0 7gdIkwIdDPuyTENzvr/oh9rnVz5L5HEuVUw922Qf15Qjht8O6ka6D0qk29JhsNf2Hja1/6 7syO0l4DK+qMPTCgDU4knCCF4ObxBzXGo+sSJmkBaZIJ+KNu+QRw1Sd/qb92HQIXbsf+Li 5UVMMAosWi21Y/ZePZRxBVQxQru6UmlWeCkxP3BWVZt6HakCH9UrAUBvOzY/5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PJxCs1hmyzWRJ; Sat, 18 Feb 2023 17:55: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 31IHt5uL083507; Sat, 18 Feb 2023 17:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IHt5u7083506; Sat, 18 Feb 2023 17:55:05 GMT (envelope-from git) Date: Sat, 18 Feb 2023 17:55:05 GMT Message-Id: <202302181755.31IHt5u7083506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 453c7d6803aa - main - netlink: do not crash when linux message translation fails. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 453c7d6803aa9cbbaec74c7706276736de22f7b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=453c7d6803aa9cbbaec74c7706276736de22f7b4 commit 453c7d6803aa9cbbaec74c7706276736de22f7b4 Author: Alexander V. Chernikov AuthorDate: 2023-02-18 17:41:48 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-18 17:53:06 +0000 netlink: do not crash when linux message translation fails. CID: 1498889 MFC after: 2 weeks --- sys/netlink/netlink_io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netlink/netlink_io.c b/sys/netlink/netlink_io.c index fb8006f689e4..509065d04818 100644 --- a/sys/netlink/netlink_io.c +++ b/sys/netlink/netlink_io.c @@ -430,9 +430,11 @@ nl_receive_message(struct nlmsghdr *hdr, int remaining_length, struct nlmsghdr *hdr_orig = hdr; hdr = linux_netlink_p->msg_from_linux(nlp->nl_proto, hdr, npt); if (hdr == NULL) { - npt->hdr = hdr_orig; + /* Failed to translate to kernel format. Report an error back */ + hdr = hdr_orig; + npt->hdr = hdr; if (hdr->nlmsg_flags & NLM_F_ACK) - nlmsg_ack(nlp, EAGAIN, hdr, npt); + nlmsg_ack(nlp, EOPNOTSUPP, hdr, npt); return (0); } } From nobody Sat Feb 18 21:13:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK1dB1YNvz3rrwP; Sat, 18 Feb 2023 21:13: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 4PK1dB13LDz3NFs; Sat, 18 Feb 2023 21:13:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676754830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1zlRgeV6Idk8q6AkXVTZFkvxXwGJqxyE8VxrTgiBEo=; b=HmiBljkBDLpQrQuvBS8clZgKpqHBZj1oWP7SvWt6uiPVAgEjtIZavHB0r23V0r/RVlBUDy 5siiVf0vw+JhRvD/0aqSU+8CaMIY15d35OWG64WA2BlJOqBNd2wo0oL9XYhfmUyF86gtqv Zsqzpk2GhHViLgPseLlVBc0mZToQggZoDORKJ9DcyHKionb2RQRNaOv2PHXZSOKWtzPZEU NLv53f7B8DRtiQdmrZxbKSRFz/e7oROpOCTGcE3CPEtbJa+lCKHg3vMbQKH6H3sMe5QQGJ 8476aD8KWbPVvqnY/+70KupqfWCD6Qv8FQArvSX5Ak088TQvl9VKji96MsbNvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676754830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1zlRgeV6Idk8q6AkXVTZFkvxXwGJqxyE8VxrTgiBEo=; b=r7I5A/j58OqtfoU0s+wb4wVpZ6o7mDcM5nngSOuHlyrE6AJNnXauooanLfHtGUSNLD1JRD NR+mVSUcRQBhwQ7JaJTbKf5daA3nM3EFhiibCbQgW5regy7gfdMPvp+YrL5xJxF2qxrCYU cstCtoamkTaUg2FcMVFjkE9JyvTGNRaCKnIMzOpvNUoWAAR/IrUVx49Nx6isufyO3Wif9R sHye6N0u17ZhuAjxRki8Awp9T6k72/gGRJHWrJzJHTzq/g19RRYMoiqMhgciXJmdBcgBeA l1S4ymALacqleiAiLdBLViG33I/DHBEIQvHghOVXqFWxl/sXXhlUQdYFLhnarw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676754830; a=rsa-sha256; cv=none; b=Ep30XSOh9q/quggQAUm2IqX9W5NzXU1hvhVSOvAMAANdpKP9hK5oA8p/bMQ5vYY6tvykYB b4HbFXe3ZH767kthmrztsMz43AFJFYJLnqbrqUuk92zQ+ze8rEBvkVxQV6g7kmLvgY0CdF ACm8w9fzmhAVA/jH6JYdjVFSo9eEwKRhjNcvbcbezzUSYpmZ/fdR2ZNiXNwn14saUIplwe i4xzpnqcW4uBEojSRul5HjSLbYImbu4TGxQ0Sxt8EhdlyZ5mhaBjZRwwBqrA+ErsH+OSLr 01sNPoKWB92+mPM4jS8DRmx6z3dHAEVamhN1lRHdvu4U8BPJW47jIXpWNoYJug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK1dB06JJzcqW; Sat, 18 Feb 2023 21:13: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 31ILDnFe070391; Sat, 18 Feb 2023 21:13:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31ILDnJs070390; Sat, 18 Feb 2023 21:13:49 GMT (envelope-from git) Date: Sat, 18 Feb 2023 21:13:49 GMT Message-Id: <202302182113.31ILDnJs070390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Koshy Subject: git: 8a3cca0d0862 - main - Sort a list of mentor/mentee relationships. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkoshy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a3cca0d086275c4bbc6ca561a15ce248b4e81ef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jkoshy: URL: https://cgit.FreeBSD.org/src/commit/?id=8a3cca0d086275c4bbc6ca561a15ce248b4e81ef commit 8a3cca0d086275c4bbc6ca561a15ce248b4e81ef Author: Joseph Koshy AuthorDate: 2023-02-17 20:51:27 +0000 Commit: Joseph Koshy CommitDate: 2023-02-18 21:11:59 +0000 Sort a list of mentor/mentee relationships. Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D38658 --- share/misc/committers-src.dot | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 4fa97bb4d76f..2dce9a542a23 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -553,18 +553,18 @@ gibbs -> whu glebius -> mav -gnn -> jinmei -gnn -> rrs -gnn -> ivoras -gnn -> vanhu -gnn -> lstewart -gnn -> np -gnn -> davide gnn -> arybchik +gnn -> davide gnn -> erj -gnn -> kp +gnn -> ivoras +gnn -> jinmei gnn -> jtl gnn -> karels +gnn -> kp +gnn -> lstewart +gnn -> np +gnn -> rrs +gnn -> vanhu gonzo -> jmcneill gonzo -> wulf From nobody Sat Feb 18 22:28:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK3HD5dc5z3ryD2; Sat, 18 Feb 2023 22:28: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 4PK3HD3P8Xz3mmx; Sat, 18 Feb 2023 22:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676759304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekhJHgt8c7mPmV8yD0rBFN5rR7nLK/QXDoae9ZeFDik=; b=H+cx6Tkdx+NRn+gJ8TW8rjrKsavyIJU+vqggnc8OyseApkfMMymX+LWASIJc8vc5LCp8UE h/p8NmmTFstSgLLrO4e6/QdQSTyTzXGW5LV/63jjsMWncMvyi0UdPEwcBoSJClRqjKpnjH XcGRSzY+LyQIMxBL63bTVB8ekbHn5vMqLLPQ6z+VieT2bR8yDFRV8ce9LG27RvMoTSFezi o1Bwe1D/NR0Zlp7sa56WjOe3cKdgAMrfv9y8no9OLYr9Nn4CVK251N3Lr9Rih7PP1wZZ9x dpRgsl6GlFon5WlGZw7U7/R9Q+f64hTD1dstV5AayUQY1YJn9UFlP/S2djqdLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676759304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekhJHgt8c7mPmV8yD0rBFN5rR7nLK/QXDoae9ZeFDik=; b=yeQujFSnbeicJWbiVeZbS/egpAl9VTpHYwf899TkQ31fKpvG/eZvP1PCYn4u9VHP2HGECw IllkeJ0Dd3rK0e3d1zPMPfb9o7cHc7PqfvjFyz7cG3jGIZe0/9MmBueJluL9SyUrzLUcUg 5K9DbLV4B7dGy4Xg0rdW8GWrBGKi/+Lb0kn7WDgvmief5F+h4IBjBCuwDBBwO/HUtBh5Dz JHnfrtdRj/JhBliZR4qtDfMVPVMgpZ9uVFDsELPZDn8gn+nfVzq4TLiAmIBwidngcveXjI Q8/QEGK65Np3NY1q2zx6nu9K4BQqkofC2pJaftZzz2P9j3M8W6ylXsUWYJcLAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676759304; a=rsa-sha256; cv=none; b=c1IRC0h49db4/S1yYd/4Hyi4sOnD3+nz3OVn8GmS8yfXeMF+jf3Zi3qftas2Y2JoseKBgo JsyWgF7Ih90fwA4PtlJpVtq/NJ8YdrQo0GkAG3sV0idEbRBRJOerS149V3inPCLYE/swAm KUfL6HwpUikvcSOY6xAJeBj77Q2hWBNcifcX8nm5ALXg0a2ddx45mcGxsaGrAxCHbItKBM o6SsnAXPrp3TApy5PIcvxz8mEnrF7UpHYhiC3G6aqdZ5bgn5gK3F62qTyBqvFplMtSj5tI 8iYB7fUro1++Gz4WSyFlu1kLhWChd27c5oX+DHw+7OpmNSLWO0RBma9IJnVBJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK3HD2TPyzf7G; Sat, 18 Feb 2023 22:28: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 31IMSO2I070397; Sat, 18 Feb 2023 22:28:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IMSOE9070396; Sat, 18 Feb 2023 22:28:24 GMT (envelope-from git) Date: Sat, 18 Feb 2023 22:28:24 GMT Message-Id: <202302182228.31IMSOE9070396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 79748cec1f1c - main - tests: fix netlink test_dump_ifaces_many test. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79748cec1f1c3437e49d7694e95fc7f438336805 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=79748cec1f1c3437e49d7694e95fc7f438336805 commit 79748cec1f1c3437e49d7694e95fc7f438336805 Author: Alexander V. Chernikov AuthorDate: 2023-02-18 22:26:32 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-18 22:28:01 +0000 tests: fix netlink test_dump_ifaces_many test. Consider only loopback interfaces when counting. Otherwise, if pf is loaded, 'pflog0' gets added to the vnet, breaking the test. MFC after: 2 weeks --- tests/sys/netlink/test_rtnl_iface.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/sys/netlink/test_rtnl_iface.py b/tests/sys/netlink/test_rtnl_iface.py index cbe5aed8b8ae..35015ea2ec6e 100644 --- a/tests/sys/netlink/test_rtnl_iface.py +++ b/tests/sys/netlink/test_rtnl_iface.py @@ -247,9 +247,7 @@ class TestRtNlIface(NetlinkTestTemplate, SingleVnetTestTemplate): """Tests if interface dummp is not missing interfaces""" ifmap = {} - for ifname in (self.vnet.iface_alias_map["if1"].name, "lo0"): - ifindex = socket.if_nametoindex(ifname) - ifmap[ifindex] = ifname + ifmap[socket.if_nametoindex("lo0")] = "lo0" for i in range(40): ifname = "lo{}".format(i + 1) @@ -300,7 +298,9 @@ class TestRtNlIface(NetlinkTestTemplate, SingleVnetTestTemplate): ifindex = rx_msg.base_hdr.ifi_index assert ifindex == rx_msg.base_hdr.ifi_index - kernel_ifmap[ifindex] = rx_msg.get_nla(IflattrType.IFLA_IFNAME).text + ifname = rx_msg.get_nla(IflattrType.IFLA_IFNAME).text + if ifname.startswith("lo"): + kernel_ifmap[ifindex] = ifname assert kernel_ifmap == ifmap #