From nobody Sat Feb 18 23:01:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK41Q1W2Dz3s1qL; Sat, 18 Feb 2023 23:01: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 4PK41Q0wzDz3qZh; Sat, 18 Feb 2023 23:01:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676761290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H4BlAQYs4VESBV4lbjoAtH2XtPfEO9i0gDdyCA1hX6w=; b=HWctTMv23/Ab8iI6vzfXbvenj5TfQ8O9rSbZ60ux7/dh+wKaVHy20Mj7uNi294D0iJMrGq sikM4XDSXWEE0JjoRFb94fJ+CPlAznBFwtjPL65VwoDMkGws9kAtsVSfifX+TP4OTK7/5w /tnzQAEIWRnvNqk6aS2u8VNps7TrUpKyRKj9sf3NhNYtLQhI6ugGZDBLK88s0qjUau4JvJ eaGVq1KzN3p5/11uxa/+d/JO/fN6fPLEpzpyW3unzqyeaBNr/J1nkX7BaSD2rOWCpYGO3l js3fqYu2j/+w8jYIznpxK/4raGLS7d+DxPpPIjrjHUBKh5howrtZS/ACmnXZ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676761290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H4BlAQYs4VESBV4lbjoAtH2XtPfEO9i0gDdyCA1hX6w=; b=sduZhjv5t7Oyv6oaok8bhvp6nwrfRpKJi3LSE7psbGgx+/o1e02Xc8G4DAh4izW6EIKZ5i jP4nnNssHOTquAp0JZCNBY0c8OCxTBkR8g//5y1cpnEWHqbS75W3Ms1eTcd5RndvPoAiup 5J+HRg4ILMVWkaBXJFK7YcqTYKC5r0d+PDeG8DBRKD42hGuUKVzKUwHbFSIdP66H1tlyDU R4x4meBmCe0xheygEftNM9kfASvnLopPkKxgArWc92X+HUILQvs5VmvOZwv9bJG85FOgy+ qJ4m0RtwUkCOgvKHSHtybVJW/dKq2t+H9kWoB5j2S4srZVxac32vHtFTaK5PoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676761290; a=rsa-sha256; cv=none; b=vRSMGWIPpPHeXJFNbtMN/F6Hss89tEg89aDaRj+rt1kzI2tXJ9IsKsVkCBFb5GK6hmnh2F a7v24xIuPk9DOGT7XpwepG79KFZcR+qxqcDeFdXeFbUZbNdpvr9Ml8xpV2N/J9INVTjliD k//aQW9/vCdHngwRH+yglfpZx7xi/Nw7GhNmUImSbgsoXmikyjBtylCB+OZbQEBwBTFret bbI/SKDR2+u7tdBhk2kv4XF6SJyK06gnhZEjjndMIpGh9c3/X59XGaizHhy7veQUe3L/J1 D0CgArmw4hTO4AYnzFZ+fW2sJ9BFZCkY4ZoJnFgkuT4NawPW60cXh3fYNG1HBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK41Q00pjzgXN; Sat, 18 Feb 2023 23:01: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 31IN1TZs025356; Sat, 18 Feb 2023 23:01:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31IN1T82025355; Sat, 18 Feb 2023 23:01:29 GMT (envelope-from git) Date: Sat, 18 Feb 2023 23:01:29 GMT Message-Id: <202302182301.31IN1T82025355@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: ed03776ca7f4 - main - nfsd: Enable the NFSD_VNET vnet front end macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed03776ca7f43de8275da80cfa89a9ecc4732f82 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ed03776ca7f43de8275da80cfa89a9ecc4732f82 commit ed03776ca7f43de8275da80cfa89a9ecc4732f82 Author: Rick Macklem AuthorDate: 2023-02-18 22:59:36 +0000 Commit: Rick Macklem CommitDate: 2023-02-18 22:59:36 +0000 nfsd: Enable the NFSD_VNET vnet front end macros Several commits have added front end macros for the vnet macros to the NFS server, krpc and kgssapi. These macros are now null, but this patch changes them to front end the vnet macros. With this commit, many global variables in the code become vnet'd, so that nfsd(8), nfsuserd(8), rpc.tlsservd(8) and gssd(8) can run in a vnet prison, once enabled. To run the NFS server in a vnet prison still requires a couple of patches (in D37741 and D38371) that allow mountd(8) to export file systems from within a vnet prison. Once these are committed to main, a small patch to kern_jail.c allowing "allow.nfsd" without VNET_NFSD defined will allow the NFS server to run in a vnet prison. One area that still needs to be settled is cleanup when a prison is removed. Without this, everything should work except there will be a leak of malloc'd data and mutex locks when a vnet prison is removed. MFC after: 3 months --- sys/fs/nfs/nfs_commonport.c | 2 +- sys/fs/nfs/nfsport.h | 26 +++++++++++++------------- sys/fs/nfsserver/nfs_fha_new.c | 4 ++-- sys/fs/nfsserver/nfs_nfsdport.c | 2 +- sys/kgssapi/gssapi_impl.h | 19 +++++++++---------- sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 2 +- sys/rpc/rpcsec_tls.h | 22 +++++++++------------- sys/rpc/rpcsec_tls/rpctls_impl.c | 2 +- 8 files changed, 37 insertions(+), 42 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 3a1f53340cd4..60131ab66184 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -899,7 +899,7 @@ nfs_vnetinit(const void *unused __unused) mtx_init(&NFSD_VNET(nfsrv_nfsuserdsock).nr_mtx, "nfsuserd", NULL, MTX_DEF); } -SYSINIT(nfs_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, +VNET_SYSINIT(nfs_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, nfs_vnetinit, NULL); extern int (*nfsd_call_nfscommon)(struct thread *, struct nfssvc_args *); diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index bf59aea285f1..3a07d140950c 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -181,19 +181,19 @@ */ #define NFSMUTEX_T struct mtx -/* Define the NFSD_VNET macros similar to !VIMAGE. */ -#define NFSD_VNET_NAME(n) n -#define NFSD_VNET_DECLARE(t, n) extern t n -#define NFSD_VNET_DEFINE(t, n) t n -#define NFSD_VNET_DEFINE_STATIC(t, n) static t n -#define NFSD_VNET(n) (n) - -#define CTLFLAG_NFSD_VNET 0 - -#define NFSD_CURVNET_SET(n) -#define NFSD_CURVNET_SET_QUIET(n) -#define NFSD_CURVNET_RESTORE() -#define NFSD_TD_TO_VNET(n) NULL +/* Just define the NFSD_VNETxxx() macros as VNETxxx() macros. */ +#define NFSD_VNET_NAME(n) VNET_NAME(n) +#define NFSD_VNET_DECLARE(t, n) VNET_DECLARE(t, n) +#define NFSD_VNET_DEFINE(t, n) VNET_DEFINE(t, n) +#define NFSD_VNET_DEFINE_STATIC(t, n) VNET_DEFINE_STATIC(t, n) +#define NFSD_VNET(n) VNET(n) + +#define CTLFLAG_NFSD_VNET CTLFLAG_VNET + +#define NFSD_CURVNET_SET(n) CURVNET_SET(n) +#define NFSD_CURVNET_SET_QUIET(n) CURVNET_SET_QUIET(n) +#define NFSD_CURVNET_RESTORE() CURVNET_RESTORE() +#define NFSD_TD_TO_VNET(n) TD_TO_VNET(n) #endif /* _KERNEL */ diff --git a/sys/fs/nfsserver/nfs_fha_new.c b/sys/fs/nfsserver/nfs_fha_new.c index 203e98d3ac86..6ae6884a4b74 100644 --- a/sys/fs/nfsserver/nfs_fha_new.c +++ b/sys/fs/nfsserver/nfs_fha_new.c @@ -62,8 +62,8 @@ SYSCTL_DECL(_vfs_nfsd); extern int newnfs_nfsv3_procid[]; -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); +VNET_SYSINIT(nfs_fhanew, SI_SUB_VNET_DONE, SI_ORDER_ANY, fhanew_init, NULL); +VNET_SYSUNINIT(nfs_fhanew, SI_SUB_VNET_DONE, SI_ORDER_ANY, fhanew_uninit, NULL); static void fhanew_init(void *foo) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 3912654515ef..7708f0325494 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -7103,7 +7103,7 @@ nfsrv_vnetinit(const void *unused __unused) nfsd_mntinit(); } -SYSINIT(nfsrv_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, +VNET_SYSINIT(nfsrv_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, nfsrv_vnetinit, NULL); /* diff --git a/sys/kgssapi/gssapi_impl.h b/sys/kgssapi/gssapi_impl.h index 72f379de4ebf..19d62a723c14 100644 --- a/sys/kgssapi/gssapi_impl.h +++ b/sys/kgssapi/gssapi_impl.h @@ -55,17 +55,16 @@ struct kgss_mech { LIST_HEAD(kgss_mech_list, kgss_mech); /* 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) +/* Just define the KGSS_VNETxxx() macros as VNETxxx() macros. */ +#define KGSS_VNET_DEFINE(t, n) VNET_DEFINE(t, n) +#define KGSS_VNET_DEFINE_STATIC(t, n) VNET_DEFINE_STATIC(t, n) +#define KGSS_VNET_DECLARE(t, n) VNET_DECLARE(t, n) +#define KGSS_VNET(n) VNET(n) -#define KGSS_CURVNET_SET(n) -#define KGSS_CURVNET_SET_QUIET(n) -#define KGSS_CURVNET_RESTORE() -#define KGSS_TD_TO_VNET(n) NULL +#define KGSS_CURVNET_SET(n) CURVNET_SET(n) +#define KGSS_CURVNET_SET_QUIET(n) CURVNET_SET_QUIET(n) +#define KGSS_CURVNET_RESTORE() CURVNET_RESTORE() +#define KGSS_TD_TO_VNET(n) TD_TO_VNET(n) extern struct mtx kgss_gssd_lock; extern struct kgss_mech_list kgss_mechs; diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c index d01ca1260a67..dc850996a592 100644 --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c @@ -219,7 +219,7 @@ svc_rpc_gss_init(void *arg) sx_init(&svc_rpc_gss_lock, "gsslock"); } } -SYSINIT(svc_rpc_gss_init, SI_SUB_VNET_DONE, SI_ORDER_ANY, +VNET_SYSINIT(svc_rpc_gss_init, SI_SUB_VNET_DONE, SI_ORDER_ANY, svc_rpc_gss_init, NULL); bool_t diff --git a/sys/rpc/rpcsec_tls.h b/sys/rpc/rpcsec_tls.h index ac2fee1b09fc..ba9a754bd276 100644 --- a/sys/rpc/rpcsec_tls.h +++ b/sys/rpc/rpcsec_tls.h @@ -90,19 +90,15 @@ bool rpctls_getinfo(u_int *maxlen, bool rpctlscd_run, #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 +/* Just define the KRPC_VNETxxx() macros as VNETxxx() macros. */ +#define KRPC_VNET_DEFINE(t, n) VNET_DEFINE(t, n) +#define KRPC_VNET_DEFINE_STATIC(t, n) VNET_DEFINE_STATIC(t, n) +#define KRPC_VNET(n) VNET(n) + +#define KRPC_CURVNET_SET(n) CURVNET_SET(n) +#define KRPC_CURVNET_SET_QUIET(n) CURVNET_SET_QUIET(n) +#define KRPC_CURVNET_RESTORE() CURVNET_RESTORE() +#define KRPC_TD_TO_VNET(n) TD_TO_VNET(n) #endif /* _KERNEL */ diff --git a/sys/rpc/rpcsec_tls/rpctls_impl.c b/sys/rpc/rpcsec_tls/rpctls_impl.c index 4e9d52bf5d48..92b8b9481666 100644 --- a/sys/rpc/rpcsec_tls/rpctls_impl.c +++ b/sys/rpc/rpcsec_tls/rpctls_impl.c @@ -106,7 +106,7 @@ rpctls_vnetinit(const void *unused __unused) 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, +VNET_SYSINIT(rpctls_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, rpctls_vnetinit, NULL); int From nobody Sun Feb 19 00:48:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK6P14097z3s8jJ; Sun, 19 Feb 2023 00:48: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 4PK6P13YSTz42vb; Sun, 19 Feb 2023 00:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pe6W+jOjQef5ECAM5pD/lJE8JptMrafghpwHmmUiI8Q=; b=F8LzHQGVf6ICaMsyGaeRtV0mi7VeP8yXXc9saXrhDYR8wyN0tDuDP/pi2lZV51ffylPi5e ssHVsEcuxcg+Iq32oi1XO8FWLfpPYOwy0ghEvMIr7w3SU7Ny8qwL+e/UoD4IOsbedbzeou o5zt3U9I05E42rc6E6fs4ZT52HNIrNgBR8o6ci54cqPMGdq91hcRK5Bh23AfJCqV/n7Vuq KsnDR3NPIF/kRvUvbc4MGvZHm4GouCfe2XrSXqckg3FpD9k87rlyf4xi4Hrz6WlmkqbfQb h7znWYsFylnfKFgwXtb8W5rUJb/HP15uY4+RfN2ExstEETB5N1EAjmG4XxTZ5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pe6W+jOjQef5ECAM5pD/lJE8JptMrafghpwHmmUiI8Q=; b=HCMF+ram5zTBZI9SmvKz0K2VqzuXKohrXkd5iXAkvrsZp2kPXZEMNB/BZY0oFhXt/c2jju Geb1R9mdTd7Y2Epg4my7IXJEYHsfyArabu8Xn3Me7qYOlL0yJXoViigSRCkKS+9UMErEe2 p48Z6Mk/DAqwgHyjLX2JVT48dlzlXBZiKG8079AAIQi8l7e2PLKFKhoLBwz+9z38sGMlCU 80+p1yDxrqzNNT1AOFeIOoUypy9vaPbc9cAi6EisClgr9Xsd2fDOcShwgjC5dKydUGo/3t 33/tZlSeaMtAbVZNk7Q0rQsy4ppjObnMpxJedRA+0dySwUcf70PLVYdSc7ATsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676767717; a=rsa-sha256; cv=none; b=oOzvlUI9XY/UBMnLABOZdeceoRcN5INzZosBZRkqwtBxomvok2ti7hdCTkg7jEgO0RpHdn Y13VvpuDPh3twh0oavdDNh7xo0aQa5+yv4hBbQs3ZbCx0us86D8Fep84C9x6SdV0rxb5XD LsplJdNZxZw4bKMPg2yAg+aN18IV4yyUhnhorufBTI8u2cfUO1U3e4lhbJkeDRHyoxqmbj 3rNh1ClDazfy1mwRrxrJ6wwe7qPjFU5OkfV2BO3YV+of0EG6Mk5Z0AZUY/m8iX7BXzp4+Z kh5EPOEH4vAASaPgWJQ5VHY3cfEiwHfRfLCPO9E3pCJZgnVtVvfw4Gbi0ockmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK6P12bthzj9K; Sun, 19 Feb 2023 00:48: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 31J0mbHP069581; Sun, 19 Feb 2023 00:48:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J0mbst069580; Sun, 19 Feb 2023 00:48:37 GMT (envelope-from git) Date: Sun, 19 Feb 2023 00:48:37 GMT Message-Id: <202302190048.31J0mbst069580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 9ad4c0468f19 - stable/13 - efivar: Try harder to find label's efimedia List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9ad4c0468f1924cf7bdb9830bb781de9ca095c61 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9ad4c0468f1924cf7bdb9830bb781de9ca095c61 commit 9ad4c0468f1924cf7bdb9830bb781de9ca095c61 Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 00:46:57 +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 (cherry picked from commit ccf2121d59ac51e1a0287d75262d48018d09cad6) --- 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 Sun Feb 19 00:48:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK6P253skz3s8vb; Sun, 19 Feb 2023 00:48: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 4PK6P24P6Qz431W; Sun, 19 Feb 2023 00:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j67+wlYgoy/Vw/5MakF+rhjcv259cn/3PRH3ma3Eju8=; b=mwDa59XodMIbiuYhUNZvxZgeIca5z99qBfq+rjUS8qWlrH6tP39CqfREq89rplyrOInrJI WasgZbZkthD6y+1lWO4ecjhj9y/b9Za+JaqLHMEWlLX3G/1EzxEAjN3j0iNN14b0Q8i7Q8 yJWDDDeq2Cync4zl9o0C1Yb1mJgQHstyEJESKSSLXC/U0s0VeX9PXtU3tk1A1RJj7OJwsj Pg9M2iGgiHLD5ZOwjwJVEM16Z8bQs+cadt6twCDt/gsJ98T1tcICnMdWYsy8aIHe3Apzd6 eqPToAh2uJE63XzdhyOjrK4JdE5TwsZEANVWJ8dCFkXnzus39ivfhXah8nAgtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j67+wlYgoy/Vw/5MakF+rhjcv259cn/3PRH3ma3Eju8=; b=Ai2iQKt7Tifvai7/wBQytuzR5/XqQrTNU1UnIhkLyuZts9hQtOssIuKp86C1dxsZVPfad4 vACC90XGGd3LMZvB/k/lPltRSeIbO9tXzn1YFMph/TXyLEz0fqHcyRskVp8+T4ev7ElUMb poGc/r8OFdBgK3MS5PXVZjueL12MOp8AX3Q95M5xq3wIy/5TOimOWGDrsI0bxCEPuaRJCn Z53uu2+07Nr3DizD+v+vcUN0MjkFz24INJ0jOUcbZYQHcqEI9SV3mDq5eR1AQdcRTNTNR5 V8O+I2SxLhtV0xjGftQHaOAm02kHR8aVUOHkQsrXjFku3tlVjtGpbyjFUflrUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676767718; a=rsa-sha256; cv=none; b=olo0oC9uKbW1XnicmYg+EO4Wf7nzwJsuCLLLbRXW09yMZ/TDvQhAFXM3uczy2p7QWTlYVr uUqCSO4980OF3EUEzS9oRjuuX8kbjWyb8MS/dDxflR8jhpVxRVbB3E1WNc1Z+JcJyeWBMk yXq0cFILwqaJLYO99MNY8BCx7mzfnxDu+2R42K/4BCP8YAgPPv3fTsrCslUPxcfu+Q5SJy 5IaHX0lnkmLU+2moGzaAsVXaQWk8yQ2m/i8SZ0syf9PFagE5igEg3S7aQgzt5hXy+1WyCV cq9hjshMfacbhEGaxZDLzQDHKnChnKjHVpEvtMI6yCh3Fz664sJIK5cFZO3zhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK6P23VFvzj9L; Sun, 19 Feb 2023 00:48: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 31J0mcbS069601; Sun, 19 Feb 2023 00:48:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J0mc77069600; Sun, 19 Feb 2023 00:48:38 GMT (envelope-from git) Date: Sun, 19 Feb 2023 00:48:38 GMT Message-Id: <202302190048.31J0mc77069600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 82c0aea8f3c2 - stable/13 - efivar: Allow NULL paths in build_dp List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 82c0aea8f3c270c6d20b093cf711d4bb1472237c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=82c0aea8f3c270c6d20b093cf711d4bb1472237c commit 82c0aea8f3c270c6d20b093cf711d4bb1472237c Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 00:46:57 +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 (cherry picked from commit 49fd6affdbfe6af53f119ebb27ff5e5e292e1f67) --- 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 Sun Feb 19 00:48:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK6P36MLxz3s8n4; Sun, 19 Feb 2023 00:48: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 4PK6P35lfGz43SY; Sun, 19 Feb 2023 00:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w6Hw62Xeby/cWqKrw+KjONxuR882dNDfoE4vEIKf8+I=; b=j6BC8abFi6TFr23DMrKXhOfTFTCxuBEEjshsaYah3pakxG9c7NxsggXl3zzVfatK1WWPgF ApAsVa6UNXm+qSIBe9tzYgpmmxMOw6s9V7epe4UCq5/eFnL2sQQN3DzDBTmz2BNSTrNCqV wwkaKmVU2MW+ww3oO7mlCS4GrDBh+FfMBPfBoKORKH1Vkl6REd9Cg++6CM0EsKWM+VW+V+ pWiEob5oe6YJ7sfHsQPcQr9jN6YeoVqus1ze3tg8oM5lnRD9eOdFiXKAKMkqnJygpt5hGF STfgYvpFDPGeidLpCza4MgxYoyIlYGHHEpELCxfWcn7BeG+3hXuR+3K7ggG91w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w6Hw62Xeby/cWqKrw+KjONxuR882dNDfoE4vEIKf8+I=; b=HnawUG3NZxBIZuUIgRJZqUep60VpC9204P5pqWfw6/LBu7L/p0+pi+fTzQ7hINLZZLE4sW 4Xh1V4RKGFZTnX/jQiPQEB3AbqEYnGqf1rDBM5pRMKkV8wEad6MqJnU4OpnSED5EYqamMD UWNM+Hzv1tBss4x+MsNW/HaPvGyBLjzLgVGXKe/qkaGFLnjV1woKAF6StvHX8nz0FfnxA/ 00Ji4AJlNhAk+8jHo8kuihmnJ3tv0c5Ex1tyV98jbXtA02WDo2nZSidBf1Fr8bWKOSQp61 sNnPyWKyHvk7K8XF3rsS8W6UANVaNugphN59r6etc0Yh7y6BwiBv8ON2FXHnNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676767719; a=rsa-sha256; cv=none; b=RPpCVwHeARpI6O+6g6Qij/BXR6dJ81Ky3R6EhdGwLsRg9Pvlu04ehm4DXvhOJxza2SWIEq nB073nc5LYlvDxYfibnPL16gDbXcG0N+sjtPUNwrzZqSJwSQ1s6q+NCPjBy+ogOnsoCxol f6SpR7GDfpkCgUqBNqNzQUwx0U6JFBYYOA5I8QMIZiNsO9XGoZhxo9rH2+XzxXYxbmcW7r yEofDFWfO6eI8WbzgYV/oTz8FwoN/8fzzzdUzDIOXsTsvbXhuRp4E1R6uf2t+P/2XjbRxA 2X28EmGxg+Vu9Q74ZCbzQkGjGW71BFy1Sn6tJ095JjjR50wru1P5iphr7r/T3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK6P34lDnzjbq; Sun, 19 Feb 2023 00:48: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 31J0mdXh069620; Sun, 19 Feb 2023 00:48:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J0mdl8069619; Sun, 19 Feb 2023 00:48:39 GMT (envelope-from git) Date: Sun, 19 Feb 2023 00:48:39 GMT Message-Id: <202302190048.31J0mdl8069619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: bae5c36257ec - stable/13 - efivar: support device paths as well as mounted paths in path_to_dp List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bae5c36257ec5289631abf49b33a4041acc84e3c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bae5c36257ec5289631abf49b33a4041acc84e3c commit bae5c36257ec5289631abf49b33a4041acc84e3c Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 00:46:57 +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 (cherry picked from commit 57d5ca4eeba6192e91044aad86fca4429966cfac) --- 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 Sun Feb 19 00:48:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK6P46vQKz3s8n7; Sun, 19 Feb 2023 00:48: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 4PK6P4683Hz43Yc; Sun, 19 Feb 2023 00:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8OVnPc55ftFg6noNkgLibc/d8pjXHFKKabMPg5Nbixs=; b=OFcUik54EY4TdErPjeuQt+rUebW/bgCdjBvlHP2hXdENsphBzV6IHUA8ka320Yovkt3put tHOQ12TbqxGqlpYLlCy5N5k1U6IxOgxRgmT08pj6gcVh/GEPBD/krFlg3glqxGZFKrYSp2 ISZ82q0iJljm6OUIxYoi3BIvqb7Mlfsmv7vnFudH2I0QkKAKeO+xeAv9DYyHrISRNtS3gh L1322Z9HW/YvA8EkMLJP9lpClwuXIPYveKoZiaRiogJuaiEPnV0DSTlcG74X+sBBXQiW4L 46G2Zkl9EdaJq84yYuHRwlfm5AB/26Bv6Q5ilrzJXwYZkegrn2DxDrZhLb0vuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8OVnPc55ftFg6noNkgLibc/d8pjXHFKKabMPg5Nbixs=; b=xt+n7696IwiLUTSYzbGF6GhyvYC+EcrdWvftph56ubpI4xGRKLt+wVilBJZSy+GYhasJom 8c1ETu9k6HKMqz+zyK8erpj0DEflUcyFvwFx5TZzHur1n72Gsfm9j0Vm9b2EKUEHFeBsZg 91/WbDXC9dXBVloAw9CRwu1KFu8B5PmqBZudny/qs/ZCj6OQXUK9tLQ672w8FJeNnSa//l fHWmiYT6NX/UK4n+/Z06p82BiTbbptq0AKHGpCV8KxCv10gMxh3C0jXPRi7NP1DzCFeLCd wjL+1E5OtsF18m6q10qLUnm1mtyjQWQb4C9bNe0kUSQHYlW7buEgvryLnBjRzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676767720; a=rsa-sha256; cv=none; b=M8nlrExz4mSnr+b5OaWNkwf9YhwkewZpSuyrR+SIuaP6XoiCsA9PvnCZu3xrNn+kfQZFEt 7GpH1keSRCpo7uiU5EZ/0m6faqPN9KldVOu8Q75KCqStcJlyRW4tzOM5b5pqCeG6cXIYl0 n4eJKLzVY3QAJlo3c0ASWaAOG0IZ+exu6P0ygr+O7ChNPaRgeWn2S1QHh/wQkTEvlc4oB0 1m7hVz3mGs+XbZRPPzahIzHPG9ro6d7DLTd2BD54IHeXt58m6GVu+Pjh7G1svPHKHK0bls 0Ivv1ZHARWUrjfB5TD1AgLPdtKrEAjwDZikh0SR8mkwpOfUdbqSgEPT3rNE3tA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK6P45C84zjdZ; Sun, 19 Feb 2023 00:48: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 31J0meL0069645; Sun, 19 Feb 2023 00:48:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J0meGG069644; Sun, 19 Feb 2023 00:48:40 GMT (envelope-from git) Date: Sun, 19 Feb 2023 00:48:40 GMT Message-Id: <202302190048.31J0meGG069644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 8ab17c6dd1d8 - stable/13 - efibootmgr: Add --efidev (-u) to discover UEFI's device path to a dev or file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8ab17c6dd1d8e8056e5354390f29e0f36cf4e406 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8ab17c6dd1d8e8056e5354390f29e0f36cf4e406 commit 8ab17c6dd1d8e8056e5354390f29e0f36cf4e406 Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 00:46:57 +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 (cherry picked from commit 9a7915299484a767fbffc7234b8dc45c29954cca) --- 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 Sun Feb 19 00:48:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK6P61TYJz3s8vf; Sun, 19 Feb 2023 00:48: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 4PK6P56hT9z43by; Sun, 19 Feb 2023 00:48:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GehJUUVawgy7JaIlcG3mmuAhZI+J9vmOpiX2apLK+mY=; b=xo2ntETRDc+yzMU6F0IV3Z/+bhMC0nStG0YuuXUZ2rojcXPgItHivG8QG63DnPXZxIwBAa dV0D/iBRPZ+WggV+Jr5RJhVVdmTbtdEHvT12FF2Fp8eCGRj6aMP5vgkiToPjV3E0h4rG1Q 5+4SCOpoVWifCt4/mwFepETjliyEPgY+/65fM4c/7kpy8sliE5Fi+d8/+OCrEHiB4yGcEn llYIL9aUTjjpmZd3FdZz817ZWwZWeZa/VMEXD8jfW2eZLqDv+ObPyZQYBWo1L+WTjgv+5B dHPgClYttNu1FWCBEL9jWlhGT/iNcZ4fKOhlLybFkhkbMLNLi3dbVBgL7uYmtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676767721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GehJUUVawgy7JaIlcG3mmuAhZI+J9vmOpiX2apLK+mY=; b=B+9I8wFpJiItlk6kh4uJQh34QJE6IL5B/YTTTG2QKWTAHN2WIR5iAS0P7NIoUruoimMLE4 lHHuCHgxydoS/PzK+2bvXj5PjsJp4Xdj2sgDIjkMh8rhsM36av2ePihiPbna1HVDKOtEhM nWNKaJPESr8/P9X2pV8zw0uUyBt9O1cWuYlqgRjdFOQixj0Rv+fGemdiNUrFg7qdlrv8By +vddq1NS5ycOm0q2fPtG/Wqc7h2UkV1JDo+pVtSMHbzP+ENx9cDG28Xpyeq0KbGy2i2JFJ FM1/cWVCL/xEWMsf0qPz6EInHYiqe7kHZKbPlZUJoI7b3ns9yv7NP9ShCWQN/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676767721; a=rsa-sha256; cv=none; b=oxihPRxD4dWi3ctvDIpQPCz2ewqWHUJnbDHupPSYgFuSXFIsLSZCVpC91yccLEd8lFU7MC NKH8pqYc3KhUc9xB7v113H8WMzR9ZJO5GgNLhartSJRVYAkYhSF/FDRVFIcKeTBtbIvWev C3iKuSA+4fyiDRK7GppokuGVdxdZKK8+/z6ezIphjfqKZxFyCng2+gYOYEKGzz9ioGKmSl /opzQU1TB46DZKZUWo3fXg7Rby4QJIVhJ8vJ5I6UNwNN+jjKjLJ2Bro250C4qJ4VDn7nf0 Afvsy5Sk7Gu/QjEPMdX8TL47ObFuu5pUU6cUW46B2VSexleBppQ2sFAlXeqoig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK6P55mZPzj9M; Sun, 19 Feb 2023 00:48: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 31J0mfdk069665; Sun, 19 Feb 2023 00:48:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J0mfX8069664; Sun, 19 Feb 2023 00:48:41 GMT (envelope-from git) Date: Sun, 19 Feb 2023 00:48:41 GMT Message-Id: <202302190048.31J0mfX8069664@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: f4d711e72090 - stable/13 - efivar: Really look for labels for the provider with right efimedia List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f4d711e7209073404c821c9c26c7c17b87b61997 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f4d711e7209073404c821c9c26c7c17b87b61997 commit f4d711e7209073404c821c9c26c7c17b87b61997 Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 00:46:58 +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 (cherry picked from commit 2b460910326c4f39068fe2158a0726dc3d362f68) --- 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 Sun Feb 19 03:10:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9Y268JDz3sKl2; Sun, 19 Feb 2023 03:10: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 4PK9Y23735z4J4n; Sun, 19 Feb 2023 03:10:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BqwUvXOkyDjO85p7mcv8m12kUe2Dk9ZAYx5xLeBpGhw=; b=r6zTrSLmfS4GPuoMZkkZ6RRathET2LQ24VdmtPJCvCri0MnHxNQfqst4EkwFZZBTNRgt0i 8+DrA67TO1zqmx0x+7QeERuflSdRoqUdiCWs5PmoVacL6OBDK4Q00ILHUWNBnHJJO1Tq8D 4wr2Gl1SGsDB1PYkuSvoaHc5tXUn/2Bp7Cb6kaESJctFpjap7CyEX56fM0vKsPmuo3wxEC 9q5/ui6RRRAf27z+kdTLL3IJ2ymzKbN3SK0GhUgw8/bd0EtSinVsjLe0DWNTuW7wAe41rd bRxhpv/5qzdq/7sBpkAMVhuMqW856gz9RHdKn6PM0QHCfhKIlZ5DCNbMdAJT3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BqwUvXOkyDjO85p7mcv8m12kUe2Dk9ZAYx5xLeBpGhw=; b=aj+yJSlJ48agI+cz10CL5+mRbYnOUqytDCPbLhGpJfvocJGMDyI7OafBVrbJhfe1CTwpK/ RwZblHAp3pBGWz3zB+W7QO+//aO4VP8oNgDDMhBspPCrYe+XTKtjHGBLWctwaDI595adw9 BmBliciTntQx6kz1WZ4B3gmp/wdW5jrEuCeGXI5tb1sGkbe0NOvoxslLAkHCR6j9zYBy7+ 5x4qMtq9ly6Baivyntd+/TgTzXXQiCOIgpGnFiMevrUe4bHR4pkS96GkMNLPufWO+FM/oz EGIFB+Q6hRZCGMh6RNkOyGFxWthwHZ9YiVuKNm+z+0cvIr3dCToxzy5LFW2mGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776246; a=rsa-sha256; cv=none; b=u6cdJAOIkL/kdm7ckhhNKoFMQ+bC56S00lESGSgDsFVA90xtSHhh9T4qO07NzBpILN/FNx CMR4KQgI3avFc0L0AfnBNB10CCYLiopzv1p7COkmz2tpfJ/yyUiOPMavKRyrb8DZaoJtHt d4WB2eShTsX/tHqoViYIWriW/u4acT2Kv4TtMAAqIOvAOMDuQJC+qd+8ChTu/foWeTxGuz hOdgr7Q9no3R/vb0Gh+h3RSQSSyb6Y1aRwcvIdg8swTyBL7t7qkQqGEeL+it2LFLWVAQgX VY/Ehfv9CBQoisalY8YVO6A81T5CZWMk9UfxpK2iTFhUKAzcLtCgtzEnx6wj4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9Xz70KgzmSn; Sun, 19 Feb 2023 03:10: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 31J3Ah41080915; Sun, 19 Feb 2023 03:10:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3AhBR080914; Sun, 19 Feb 2023 03:10:43 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:10:43 GMT Message-Id: <202302190310.31J3AhBR080914@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: e600bcfb871c - main - stand: Better documentation for full-test.sh List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e600bcfb871ccd70262a0bf0695e929331cae83d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e600bcfb871ccd70262a0bf0695e929331cae83d commit e600bcfb871ccd70262a0bf0695e929331cae83d Author: Warner Losh AuthorDate: 2023-02-19 02:52:01 +0000 Commit: Warner Losh CommitDate: 2023-02-19 02:53:19 +0000 stand: Better documentation for full-test.sh Update now that things have been pushed into the tree. Sponsored by: Netflix --- tools/boot/full-test.readme | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/boot/full-test.readme b/tools/boot/full-test.readme index 97e79171aa54..db1f12c7024b 100644 --- a/tools/boot/full-test.readme +++ b/tools/boot/full-test.readme @@ -1,36 +1,33 @@ First, you will need a few things. -(1) My latest branch at https://github.com/bsdimp/freebsd/tree/boot-linuxboot - (so the boot-linuxboot branch of my freebsd tree, it's sync to Friday). - -(2) a small cache of binaries. You'll need to put these into +(1) a small cache of binaries. You'll need to put these into ~/stand-test-root/cache. You can find the tarball at freefall.freebsd.org:~imp/cache.tar. You can just extract this in ~. These are the linux kernels I'm testing with. -(3) The latest qemu-system-aarch64 (I think ports/pkg version of emulators/qemu +(2) The latest qemu-system-aarch64 (I think ports/pkg version of emulators/qemu is recent enough). If not, I know the latest master of qemu project works. -(4) A recent enough universe that the building of stand will work for all the +(3) A recent enough universe that the building of stand will work for all the architectures that I build. You can hack the ARCHES line near the top of tools/boot/full-test.sh if need be, but you'll need at least amd64, arm64 and maybe riscv (I don't have a good way to filter arches in this script yet, since it's at an early state of development. -(5) Build the kernel for at least arm64 and use it as an 'override'. I do this +(4) Build the kernel for at least arm64 and use it as an 'override'. I do this by sudo -E make installkernel DESTDIR=$HOME/stand-test-root/override/arm64-aarch64 TARGET=arm64 after building the kernel. The script is designed to use kernels and binaries from the latest CDs to do the testing, but has a way to override the kernel and since we need to fix arm64... -(6) You'll need to build the images. If you've done 1-5 correctly (and I've not +(5) You'll need to build the images. If you've done 1-5 correctly (and I've not missed anything), then "cd /src; sh tools/boot/full-test.sh" will create all the images and scripts to run qemu. There should be no errors, though warnings about zfs.ko etc missing from powerpc is fine (and ignored by the script already). -(7) There will be a script to recreate this created in +(6) There will be a script to recreate this created in $HOME/stand-test-root/scripts/arm64-aarch64/linuxboot-test.sh. Just run it with 'sh'. And extra args are passed to qemu, so '-s -S' for gdb and '-d trace:gicv3\* -D /tmp/gic.log' for verbose gic tracing (spaces are important). From nobody Sun Feb 19 03:10:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9Y2691qz3sKl3; Sun, 19 Feb 2023 03:10: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 4PK9Y2406Pz4J7T; Sun, 19 Feb 2023 03:10:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q+PnzvZjNip6xqoIMft19wrAtWRPH/TUr3T70AvtJpg=; b=MWO8fOWLTs7hUNPO4fsGwN0JxapXBiSYvo5GQH/N+jtabF7TVrAbAsw/v8Qc4ygbpjPOyn iokuZ5U5LHThYRFXxkcWeCLhBG2lPzn1czEDgv3WFSM0jHx5MJ+/U0Dgk/x7l4lYjQgSXb wR05MycT870KAn4Le74xayJHVaH5nL5yLVMkDkRYin3MJtLi7R47meSkxqCIUw3gVq3Y8E oJWbmQLguFrtAeBa5pSx5BIlY5Zo8E0c8pa6x82MEK9p3wyIXWEay+LjSS5x87sN+03o33 DUyqrGxDWe6jQhJLOOn2gQpWyGZi19Q9NMzylX6ahtf8BEQYzUrU2qRAo13CKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q+PnzvZjNip6xqoIMft19wrAtWRPH/TUr3T70AvtJpg=; b=m1rOCXHfD/oVU8x5g1JYu1/duBQP0WRjtGX89iKHI+rw8XP3zrXTBdjKr+NmBuIJdciI9E V7Mnl9wCjNB89pijWF4hCv8MTf9qN7AkWjp67M6yovwqcT2+PWybbDCyWRCTtAzlinIYeh Svbki6wijqod/LWzMunLqgUQTaDVUlwzkUkRuFVwE+cXvukA5cyd5g/WAjn2COxq/Sx38g 9joxdLASpr3J47QY8ClNr21xTl7ZHdEmzfLw8AJN6dJ22MIh9/TcGVtXTV2hDrQ1YzxONs LWk0zP0X8HcmwLjgyujEgbya9LcPwwim2++QgnAmr2HfMGhnYo5GFQojG12W4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776246; a=rsa-sha256; cv=none; b=te+SR8bWHzVDxUEhvuL+lyc9T0BnvjjYXw+4wnPgC8S1oPMwqHnLbZxQkgy5FwfVRrWRtb hFAMsilqMLVeZ49EYsoanDjV8Wm5b7upn4gab1RuG3/reNPIFFlhCdhs2Fu0aCZu+cJCbk CtzHqUf0GZY61vbeIC2cQWrIG4vNYD9tfzC+qWaw4lj0u7W2A3/+WADrIGqdFrUJGhbE92 a2T0ZPwj+tGapU6IJH1qOGfNHgj0jBA6ZY98KSKWGsBpNxot9tk7bSt4lfxQxQidnYwIzP hMy1x9JmqeIDaninUODqkic9/fNxNogNHQPzcXzw9MRDWlcr9nGicv8+ozq8kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9Y10qLFzmqf; Sun, 19 Feb 2023 03:10: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 31J3AjIT080934; Sun, 19 Feb 2023 03:10:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3Aj1O080933; Sun, 19 Feb 2023 03:10:45 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:10:45 GMT Message-Id: <202302190310.31J3Aj1O080933@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: ef6f20ce4761 - main - tail: Retry kevent if the system call was interrupted List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef6f20ce47613db7cc615b45f4b6fa1eb99ae0ba Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ef6f20ce47613db7cc615b45f4b6fa1eb99ae0ba commit ef6f20ce47613db7cc615b45f4b6fa1eb99ae0ba Author: Warner Losh AuthorDate: 2023-02-19 03:04:29 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:09:26 +0000 tail: Retry kevent if the system call was interrupted kevent returns EINTR when I suspend / resume. This causes tail -f and tail -F to exit with interrupt system call. Ignore this error and try kevent again. Sponsored by: Netflix --- usr.bin/tail/forward.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 3897d115effd..6dbeb9cdd047 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -411,10 +411,16 @@ follow(file_info_t *files, enum STYLE style, off_t off) /* * In the -F case we set a timeout to ensure that * we re-stat the file at least once every second. + * If we've recieved EINTR, ignore it. Both reasons + * for its generation are transient. */ - n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); - if (n < 0) - err(1, "kevent"); + do { + n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); + if (n < 0 && errno == EINTR) + continue; + if (n < 0) + err(1, "kevent"); + } while (n < 0); if (n == 0) { /* timeout */ break; From nobody Sun Feb 19 03:16:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gd0btCz3sLDq; Sun, 19 Feb 2023 03:16: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 4PK9gc599dz4KHq; Sun, 19 Feb 2023 03:16:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJYuaptP3N49M5Z8Cn+Xvcu6lSLy9712NOS5vu6cA+I=; b=aT9C658TZyveCiEhOlLmERHUhgQ2apyPEJeL2bqztpTZhdi70xUW5kPzFnJiFxHz1rL2Oc WSfwcSuByBMqXqnYuU2PrvuS2cqIZFHVdr6Xab4k85+tRpbBo/FmL1lpmak2pjXDrU8dmU l6JjtRw5gcYTMbYU8Fb7lgjO07gSnobFgTHamZvlkOC2C87OVPft0RkTEQcg8vckoNe/M8 U2PB7b3kzxL9ZuWcmT9FklimdWyzeSTuAMEODhVvQDfwbYtfmLxT2/HzmalumvcYw5cgow rk6cjkkLxLS/l6EmzXcarcAXjBNMRjVpE8nn5FPekz4+wW39JHrzkby8Tf+chg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cJYuaptP3N49M5Z8Cn+Xvcu6lSLy9712NOS5vu6cA+I=; b=MIgvkXgaPHud49Yi17OyY7H4rCxEmWNmjJImbYfz4zZCiN3M5g80vNDilFcy09AKNy243o 6T0/MtD/kjWiPIkLfkmoWd9l/Be6eBcJzZP+UHcxs7nsu2W2BYl5ATLDUPNRD95M55+9qv w7bulUWqxZcGsR107is8B+ueYRRR9UxH9WpgHevggS67MMrZaPxBN2AAKcFk/xrmEUw5br klYmUrHGUxliTQDm9bgLjMhvudW7lX1v14fIcq7AUGn2WxpBBR5/i2Qibw6nnnT0MfCvyB zah9IgRALTXhswwbYpjgZ/8Hl322IEbih9NDHPjzssolLtHV76P+EEG174316A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776588; a=rsa-sha256; cv=none; b=b4W39+qFLjvg80rM/eW4ZDCRtsHV18I+EtG57oZrRqQhJMx91Q3SrD96hB12w6e2g1Zbu6 llkfE7NFcQzR8M3346XJ2xsR9SaS/uwY52advTkyzXpAxPi2pkK6f2eEVdC5PgBWTMWtUt vVLJeXktAIRX7agkxDPO2bE7H3iZbVU49p20c5QWgLq1/r+wxNqkKtgIezYNk+DfN+/Ekr 3MS3SME2dmoUQXZvsHqUiLBnptAXZkL7j20QHp+HpCP4uPXsgd8/brG7TOeqn0nzUk430W rokTgtpjo34QF+W5i17H70ZpeLUrXAOZ/tFQAFfGhuluL+/6Jz7BKixTtnzFVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gc4FtDzn2v; Sun, 19 Feb 2023 03:16: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 31J3GS8l083786; Sun, 19 Feb 2023 03:16:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3GSSH083785; Sun, 19 Feb 2023 03:16:28 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:28 GMT Message-Id: <202302190316.31J3GSSH083785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 83f1f44478fc - releng/13.2 - usb: Add Huawei 4G Modem devices (2022) to usbdevs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 83f1f44478fc52782a03a91e539fafad1f90717e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=83f1f44478fc52782a03a91e539fafad1f90717e commit 83f1f44478fc52782a03a91e539fafad1f90717e Author: Michael Paepcke AuthorDate: 2023-02-16 16:58:29 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:11:43 +0000 usb: Add Huawei 4G Modem devices (2022) to usbdevs ADD [sys/dev/usb/usbdevs] - add new Huawei 4G E3372_NCM 0x1505 - add new Huawei 4G E3372v153_NCM 0x155f - add new Huawei 4G E5573Cs322_NCM 0x155e - add new Huawei 4G E5573Cs322_ECM 0x14db - add new Huawei 4G E5573Cs322_ACM 0x1442 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/633 Approved by: re (cperciva) (cherry picked from commit 2c6b88da7174b02c98b87cd4b7251ccf9d7acbae) (cherry picked from commit 7324f2b89f2cacecb0ce73e06297205891e7929a) --- sys/dev/usb/usbdevs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 6960ac8a33e2..01612662fd4d 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2564,6 +2564,13 @@ product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial product HUAWEI E3272 0x1c1e LTE modem +product HUAWEI E3372_INIT 0x1f01 LTE modem initial +product HUAWEI E3372_NCM 0x1506 LTE modem in NCM mode +product HUAWEI E3372v153_INIT 0x14fe LTE modem initial +product HUAWEI E3372v153_NCM 0x155f LTE modem in NCM mode +product HUAWEI E5573Cs322_NCM 0x155e LTE AP modem NCM mode +product HUAWEI E5573Cs322_ECM 0x14db LTE AP modem ECM mode +product HUAWEI E5573Cs322_ACM 0x1442 LTE AP modem ACM mode /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g From nobody Sun Feb 19 03:16:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gf0x3gz3sLKy; Sun, 19 Feb 2023 03:16: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 4PK9gd6zndz4KCZ; Sun, 19 Feb 2023 03:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDkK7GP2b23YbAFzuhK8nE9s0csZhawgj/nnbVfsiyo=; b=U8+0A1Y6ssPHyr4Tz0ctx8GwyqjUqpa8zMnsKNeXOwERCyuzEb+EsPYodkYt5QEPYC0d5o Ygy5YqPZ7nUo8vQ2XkS36AEFMKMfk0yehK8Qb7fakgqaXw3NoBL8hJhNjsFytvDLZE9pK7 hL333K7dSgObpiGfq7iBOK/14tl3UuCcsxbMhgDtNW0DUje2e3fWuzbGodQdXt3NvudyF+ aueeqjPX5wT2Ea1POEJuzQipeLT/+/f8Ouu5swgKLC32HQ2e8qaxE8ZBI6HMcC6jxPFLXr gS5ZDxdfc3I7sB/Y7qEZJgaAGuxRouiGxXeSQfxZ7IY9qqiW6txRWpWSzFw2uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDkK7GP2b23YbAFzuhK8nE9s0csZhawgj/nnbVfsiyo=; b=BaqAT8BVjngVQ7q9Ave+MlEGk1wIgGzQO91LwSr7KE6LEk/GGWio8C0aUXm7BYDljUkssR kQdsc2/BP9QeoAy2niSf2HtnE27qNCpOgmPqLTISuVnf8HkWewPLaYsnjjoNtvLHuUAUXH fq4Fvj5EyYD0T3bLjzlvzdkenZa+0IgzxeR5/ykSlW21qF6LxKX5urabV6DmMnlGZGovpL pw/6ULi5xqU10WQp3Hoz+oCcqfEGM2Ikvi5dzAG4JO47ZAcA3dIfeHkx3+dR3WBGp1qIAi lVLw4kCZQvv0kB0aTDp52eWsl3aATYwNsEZt4jYeELtNGzIHbxfvAfj2nzTkfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776590; a=rsa-sha256; cv=none; b=p3EQv4O4HcJv4QTKLo6DeCb321r/N4bZ/cNSQJ8MFp4J/+9UO3ahTpK0CFhurJ/AqF7LpY Q7kHCOXaZHvK+RuDeoCrn3rOVEOTeMysE2jobGbndavFgK2cg2KfD6PADPziPsh2F0Erkr z57modOu8OfGWNqs7/D4jaiW9PpVni02WsAi2i0xmo7Scs05MLput5Vd3y1qXgxEyzqc6h XSvPu0dr4VdVAJ5rIJ9ofzbqdwTQQ9AmNeLV8OVrsmxPeCs+b9gRmnisuJcCULMB2c6fm8 u2A+VoDY0SqcGWUcmkGmFod1MjCUBM+GU1FZeLENZXAYQA9pzXCGaf3Ew2QOwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gd4tPmzmjt; Sun, 19 Feb 2023 03:16: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 31J3GTX9083805; Sun, 19 Feb 2023 03:16:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3GTpS083804; Sun, 19 Feb 2023 03:16:29 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:29 GMT Message-Id: <202302190316.31J3GTpS083804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: fb22c140cc11 - releng/13.2 - usb: add new scsi_huawei eject3 & eject4 quirks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: fb22c140cc11bec1e19f4825b54d1e8c8004fdf6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fb22c140cc11bec1e19f4825b54d1e8c8004fdf6 commit fb22c140cc11bec1e19f4825b54d1e8c8004fdf6 Author: Michael Paepcke AuthorDate: 2023-02-16 16:58:30 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:12:45 +0000 usb: add new scsi_huawei eject3 & eject4 quirks Add new scsi_huawei eject3 & eject4 mode driver to usb quirks Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/633 Approved by: re (cperciva) (cherry picked from commit 64fd867f8cdbad24d7af678ee17bd3893832b905) (cherry picked from commit 1d31c745cfe60d7a81fd91efdcfecd0405888af2) --- sys/dev/usb/quirk/usb_quirk.c | 2 ++ sys/dev/usb/quirk/usb_quirk.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 3dd2aa735fb3..bb02b90ba4bd 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -696,6 +696,8 @@ static const char *usb_quirk_str[USB_QUIRK_MAX] = { [UQ_MSC_EJECT_SAEL_M460] = "UQ_MSC_EJECT_SAEL_M460", [UQ_MSC_EJECT_HUAWEISCSI] = "UQ_MSC_EJECT_HUAWEISCSI", [UQ_MSC_EJECT_HUAWEISCSI2] = "UQ_MSC_EJECT_HUAWEISCSI2", + [UQ_MSC_EJECT_HUAWEISCSI3] = "UQ_MSC_EJECT_HUAWEISCSI3", + [UQ_MSC_EJECT_HUAWEISCSI4] = "UQ_MSC_EJECT_HUAWEISCSI4", [UQ_MSC_EJECT_TCT] = "UQ_MSC_EJECT_TCT", [UQ_BAD_MIDI] = "UQ_BAD_MIDI", [UQ_AU_VENDOR_CLASS] = "UQ_AU_VENDOR_CLASS", diff --git a/sys/dev/usb/quirk/usb_quirk.h b/sys/dev/usb/quirk/usb_quirk.h index 755465576684..399c8d3f65b4 100644 --- a/sys/dev/usb/quirk/usb_quirk.h +++ b/sys/dev/usb/quirk/usb_quirk.h @@ -108,6 +108,8 @@ enum { UQ_MSC_EJECT_SAEL_M460, /* ejects after Sael USB commands */ UQ_MSC_EJECT_HUAWEISCSI, /* ejects after Huawei SCSI command */ UQ_MSC_EJECT_HUAWEISCSI2, /* ejects after Huawei SCSI 2 command */ + UQ_MSC_EJECT_HUAWEISCSI3, /* ejects after Huawei SCSI 3 command */ + UQ_MSC_EJECT_HUAWEISCSI4, /* ejects after Huawei SCSI 4 command */ UQ_MSC_EJECT_TCT, /* ejects after TCT SCSI command */ UQ_BAD_MIDI, /* device claims MIDI class, but isn't */ From nobody Sun Feb 19 03:16:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gg1nmlz3sb4C; Sun, 19 Feb 2023 03:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK9gf725qz4K9t; Sun, 19 Feb 2023 03:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQynv5GrDUryHgI2q9i8krZ1ISsL2a2V/T1eEPJrJA8=; b=hpBmSeyWZWNSWdtFMkdKNim7WZg0CLtFlJ9zdY8fjyVTWOflfbvb1hAQhLZrFG0whRijhI TK7r9uqc7pxNyJr8XtD3QvuY0OvHOdYzBbXvTOnC+eXz6+g+Vh/VakfFl3TzY6zlz16dzw MQXLdPLCQuJeF4SKcedqTLsLVz9k/8eMfXVJ331eZuQcuOHzcdAyp78WSkfDan4SBhNYWU 9z1LeDFUARfIWWxRS7QDLxmpBHCRSLqZjmqJcsCwdTibPT2FHmfybMxW/jps6opStN3SPv jSvFmib+hd6ucaDSPllGMQozC+QrMCmzThg1bQW66iIZKFEF4y4Yq9gWswFPPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQynv5GrDUryHgI2q9i8krZ1ISsL2a2V/T1eEPJrJA8=; b=wGHBkh4nOp9glIOf+1XmmFC2+Yh5zlF21PFIJk16RLEDVFum8djDmCieb1FL427Q8DGvRw EIxykU6hcjCLiHA4lMQrlTyffCxYVq9rhpspQ+DpBchEWavGCIzqt0Epf8/bqgN3yzqKX0 mS18u02NNHhL7b8dnXymkC2OCgto+54A00M2voFJxQ0iOdHSQ4jePbpcwXJx3C543CgIb9 6CCaxFBotzwNapyPaqNwVfEwDseDykOPu4Ghfogxw1lZUVPnvdmLCb0tugwY8rMz+8qs6q hudgHAI67acwadxfPN0rEVJkKS+GC2m/iDJm1LGQgchROADMBN9pa/BsNT+Bjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776591; a=rsa-sha256; cv=none; b=cS2dujbglbScn9f9UU41R/icxmMQctzFhc7W4QCMXM/Ah2eHrRnAwij1quzqOPxf8QyXLR Qx3z4wnNXY+7I9HqdDMllxXvXcTl5n2A4wBoQi7hQnDHBaaPGeELDHw39dXEttlJm2wZ/U 07eKXMP/R8gC5gmc3f8J551XmIB9/V7GFtcO2Ptiufzpi4jaCKbKEamRp4fx8n0Mer0e9h mo1ECKfihcBPbqR7WuFKXE2/u6LpIi6lEROQN2qENoSKNyr1+cZ0g6fuI08kVKgbzxjv/t 2dnT2FrOkFBkZzNSLjuHnM2oF51KyCXXHtHQnKXezleTriKXx+9jM7QqjzoTBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gf5q1kzmTR; Sun, 19 Feb 2023 03:16: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 31J3GUgX083829; Sun, 19 Feb 2023 03:16:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3GUpT083828; Sun, 19 Feb 2023 03:16:30 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:30 GMT Message-Id: <202302190316.31J3GUpT083828@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: dbfdc2fdb092 - releng/13.2 - usb: add new scsi_huawei eject3 & eject4 sequences List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: dbfdc2fdb0924ae6810153a7fb030b2582a31a12 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dbfdc2fdb0924ae6810153a7fb030b2582a31a12 commit dbfdc2fdb0924ae6810153a7fb030b2582a31a12 Author: Michael Paepcke AuthorDate: 2023-02-16 16:58:30 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:12:56 +0000 usb: add new scsi_huawei eject3 & eject4 sequences Add new Huawei eject3 and eject4 command sequences. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/633 Approved by: re (cperciva) (cherry picked from commit 7d4b2b5834dba66732596d68d7f817d18affb67f) (cherry picked from commit 356e03eace327e3b255834d4a1e6a7278663ce85) --- sys/dev/usb/usb_msctest.c | 16 ++++++++++++++++ sys/dev/usb/usb_msctest.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/sys/dev/usb/usb_msctest.c b/sys/dev/usb/usb_msctest.c index 5dcf8d151119..338c17983d92 100644 --- a/sys/dev/usb/usb_msctest.c +++ b/sys/dev/usb/usb_msctest.c @@ -107,6 +107,12 @@ static uint8_t scsi_huawei_eject[] = { 0x11, 0x06, 0x00, 0x00, 0x00, 0x00, static uint8_t scsi_huawei_eject2[] = { 0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static uint8_t scsi_huawei_eject3[] = { 0x11, 0x06, 0x20, 0x00, 0x00, 0x01, + 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; +static uint8_t scsi_huawei_eject4[] = { 0x11, 0x06, 0x30, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; static uint8_t scsi_tct_eject[] = { 0x06, 0xf5, 0x04, 0x02, 0x52, 0x70 }; static uint8_t scsi_sync_cache[] = { 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -1005,6 +1011,16 @@ usb_msc_eject(struct usb_device *udev, uint8_t iface_index, int method) &scsi_huawei_eject2, sizeof(scsi_huawei_eject2), USB_MS_HZ); break; + case MSC_EJECT_HUAWEI3: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_huawei_eject3, sizeof(scsi_huawei_eject3), + USB_MS_HZ); + break; + case MSC_EJECT_HUAWEI4: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_huawei_eject4, sizeof(scsi_huawei_eject4), + USB_MS_HZ); + break; case MSC_EJECT_TCT: /* * TCTMobile needs DIR_IN flag. To get it, we diff --git a/sys/dev/usb/usb_msctest.h b/sys/dev/usb/usb_msctest.h index ba4e094bab60..08a7de1b5b9c 100644 --- a/sys/dev/usb/usb_msctest.h +++ b/sys/dev/usb/usb_msctest.h @@ -36,6 +36,8 @@ enum { MSC_EJECT_CMOTECH, MSC_EJECT_HUAWEI, MSC_EJECT_HUAWEI2, + MSC_EJECT_HUAWEI3, + MSC_EJECT_HUAWEI4, MSC_EJECT_TCT, }; From nobody Sun Feb 19 03:16:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gh1VZQz3sb6V; Sun, 19 Feb 2023 03:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK9gh0PG1z4KCv; Sun, 19 Feb 2023 03:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1OAvIfU6A2N2wLWLTwB9E7jqa4fgDtilHdgYNFT0S/A=; b=HU3AaL07wrsYK2FdPQCQqE8d/hzKCgUhDd9hJExOElf8jZb4ih1/IjEXLXwxsl1XGGNEpk 2Vwp8pv0Ps89HqXkjelNEW0vdFJzwTrCrtDeNifF2stcl8NCPN5XdV24k55Fzr24bmBzBf 6uO/aqMmjADjVFzoS7PESsn3Z83TYylltTfw3rd0AZeeb7+cd213QVJ6YR/aokAlubt+cm 133AvAxKfR71zXsZzQ6Fi12VjBNJlxw/spXEokoz4e1v6vo9x4zIp5GWGsJ+k42gos/jdK BWdDHV6cM0HWsJ8ujnW1Kv3aNNcVfv+cWqf1xVwS/slkqy4x1lFJwXFedIzMjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1OAvIfU6A2N2wLWLTwB9E7jqa4fgDtilHdgYNFT0S/A=; b=RQy31kZHPi8KJ8PvS6Ut1fsL5T8FFjqX6J0YEGjaqSJEDhRP4k21Gb7q3c6WIB75ktCoOe RtT4SGKg80SfK8hlsZxJ+rU0wXg+vqurqE1dW7Un0OhIdncFtW0ZcgPwAA8j6pGD9CYtRt /7CVxtoaSow/JLeBh7GWbmA3RHJONiKfdz5oKgUyG2QkcyV0oIKbp4VcAsKgDJE2vH3INs GVJsrjFMLQ34nPpWDI5924h47bjnP+8MDvQ+mP/I/DHdITCrPI8q6URrT6ILK7DyJ2ThXR dAfOEUUEv8kwltq7VNyawf2d4JjQn8VEVU4XKXLnWNby8uW7EBH3UgyOG4JlNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776592; a=rsa-sha256; cv=none; b=vj0WTOlk6kxSw0arPvxRXs0S5Kw8NSMPLg0Kc0MKPKIfz9shc4Gr1kdqyWntoAdFg/zCsi BmUf77uyp779RJwyX7GbvJhPmCWDd/61M2IE2PgFCTWvdOdQU4fw3Y4tfpYFKkoi9CxVvJ 5FzkTxw9YbwjqVG7gSd5SX46zXgFBNbTtYF+Sybb8GYNtJ5l11D2/eNaRBzq1n3R2YoD4s gDqwEVaeY7v9GXvJTDkFLRFYXwXKl3CF6hj8TJS8ieT8nqGnUYeJTp4wDqqP/MTRwemWoV ZBfhAU7vyJpey9rtIYcaOTjeuOCrcZQG4a0dx93m/bw7WXLzCQTqwNYYakSHuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gg6cZ0zmjv; Sun, 19 Feb 2023 03:16: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 31J3GVRZ083848; Sun, 19 Feb 2023 03:16:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3GVDJ083847; Sun, 19 Feb 2023 03:16:31 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:31 GMT Message-Id: <202302190316.31J3GVDJ083847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 97e58ca95015 - releng/13.2 - usb: add new scsi_huawei eject3 & eject4 driver support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 97e58ca95015fa4c3a73e335fe4dcf2390c2da69 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=97e58ca95015fa4c3a73e335fe4dcf2390c2da69 commit 97e58ca95015fa4c3a73e335fe4dcf2390c2da69 Author: Michael Paepcke AuthorDate: 2023-02-16 16:58:31 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:13:06 +0000 usb: add new scsi_huawei eject3 & eject4 driver support Add initialization for new Huawei 4G E3372_NCM, E3372v153_NCM, E5573Cs322_NCM, E5573Cs322_ECM, and E5573Cs322_ACM. Remove now-obsolete Huawei 3G E3131 init sequence. These devices are obsolete, share IDs with new devices and the 3G networks are shutdown. These old devices work correctly via the 4G code while still allowing the shared IDs to work differently for the new devices. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/633 Approved by:re (cperciva) (cherry picked from commit 1997d3a4a9f20a846cf762306fd5193526a1d603) (cherry picked from commit e20b6a8ec68e3f6805a5281d2691c2ac97f6bb93) --- sys/dev/usb/net/if_cdce.c | 2 ++ sys/dev/usb/serial/u3g.c | 24 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c index f3c73567b7ce..0b6445e5908d 100644 --- a/sys/dev/usb/net/if_cdce.c +++ b/sys/dev/usb/net/if_cdce.c @@ -266,6 +266,8 @@ static int cdce_driver_loaded(struct module *, int, void *); static const STRUCT_USB_HOST_ID cdce_switch_devs[] = { {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3272_INIT, MSC_EJECT_HUAWEI2)}, + {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3372v153_INIT, MSC_EJECT_HUAWEI2)}, + {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3372_INIT, MSC_EJECT_HUAWEI3)}, }; static const STRUCT_USB_HOST_ID cdce_host_devs[] = { diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index 0b020af53b71..0e20f42feb39 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -89,7 +89,9 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, CTLFLAG_RWTUN, #define U3GINIT_SAEL_M460 8 /* Requires vendor init */ #define U3GINIT_HUAWEISCSI 9 /* Requires Huawei SCSI init command */ #define U3GINIT_HUAWEISCSI2 10 /* Requires Huawei SCSI init command (2) */ -#define U3GINIT_TCT 11 /* Requires TCT Mobile init command */ +#define U3GINIT_HUAWEISCSI3 11 /* Requires Huawei SCSI init command (3) */ +#define U3GINIT_HUAWEISCSI4 12 /* Requires Huawei SCSI init command (4) */ +#define U3GINIT_TCT 13 /* Requires TCT Mobile init command */ enum { U3G_BULK_WR, @@ -319,8 +321,6 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(HUAWEI, E143F, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E173, 0), U3G_DEV(HUAWEI, E173_INIT, U3GINIT_HUAWEISCSI), - U3G_DEV(HUAWEI, E3131, 0), - U3G_DEV(HUAWEI, E3131_INIT, U3GINIT_HUAWEISCSI2), U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), @@ -343,6 +343,12 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(HUAWEI, ETS2055, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E3272_INIT, U3GINIT_HUAWEISCSI2), U3G_DEV(HUAWEI, E3272, 0), + U3G_DEV(HUAWEI, E3372_INIT, U3GINIT_HUAWEISCSI3), + U3G_DEV(HUAWEI, E3372v153_INIT, U3GINIT_HUAWEISCSI2), + U3G_DEV(HUAWEI, E3372v153_NCM, 0), + U3G_DEV(HUAWEI, E5573Cs322_NCM, 0), + U3G_DEV(HUAWEI, E5573Cs322_ECM, 0), + U3G_DEV(HUAWEI, E5573Cs322_ACM, 0), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), @@ -814,6 +820,10 @@ u3g_test_autoinst(void *arg, struct usb_device *udev, method = U3GINIT_HUAWEISCSI; else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI2)) method = U3GINIT_HUAWEISCSI2; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI3)) + method = U3GINIT_HUAWEISCSI3; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI4)) + method = U3GINIT_HUAWEISCSI4; else if (usb_test_quirk(uaa, UQ_MSC_EJECT_TCT)) method = U3GINIT_TCT; else if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa) == 0) @@ -837,6 +847,12 @@ u3g_test_autoinst(void *arg, struct usb_device *udev, case U3GINIT_HUAWEISCSI2: error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI2); break; + case U3GINIT_HUAWEISCSI3: + error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI3); + break; + case U3GINIT_HUAWEISCSI4: + error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI4); + break; case U3GINIT_SCSIEJECT: error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT); break; @@ -887,7 +903,7 @@ u3g_driver_loaded(struct module *mod, int what, void *arg) default: return (EOPNOTSUPP); } - return (0); + return (0); } static int From nobody Sun Feb 19 03:16:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gj3RMbz3sb03; Sun, 19 Feb 2023 03:16: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 4PK9gj2GFdz4KJd; Sun, 19 Feb 2023 03:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pZ0Tg36KCPAex6OyMUTEQen87vqwsl5GujZl8pvjI2c=; b=Xoy/txyB1G3X+zYYiqYNEPxQrLQ+bxNSHMggHAUvl6zDVBSuup55CAJ0jAuKEF2JKllpgK SJSBMAwunVFH1LLsSlSwrNI45awUUapyk7BsTkGzioOk9FtxKBzWotqW8UNsjZssSgOLG9 qjZCwiifXcypOFWNbaL8ZaEsXCXmk2EyFpLj9S5I3SUFpLgNQ80KL+wzj/ksrW/YmmUsIz jWRhYDWNL/1l3vdkAB1adjlTZ5cVQLd6MCOmZwLdEzMVz7zFO7ISPqwqKhaE3p9fsYHDR0 uCaP3BKukeLi6LNsyr416/pekSgBNV81Wer9Azogd8oSS6nzrJAidCQAngaXUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pZ0Tg36KCPAex6OyMUTEQen87vqwsl5GujZl8pvjI2c=; b=i0I1nFDp3Ql7F7oHG4qt9B9tsZlTE6FvKo78+ENGopWJT4sus91GouLCHn6FDr+9XVabKy BDlZw+w4ZmjazZqgoqT8NTC/DroLAg3yaQYjlGQOBmsoF/yNl+duhLwhzbLB7sGw2wwpJs uY5nedJQ4ybENiZBSNWjm8keplWrTo9fcdPjaaOV8Toek1GhuPMq6tYzXyJcSYRuTxC/4B coVna+FxfEKbWD/KIjRnCmacwG2NpWF+3UDTWCDEnmjG6wLBJzMgzgXJYqBERL29ob42A0 UAHeiRHFYK2D9+Y40B3i2O9VDFxkmIsewfWtH1B/hzNq8OzRAC1UzAkLvRgd7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776593; a=rsa-sha256; cv=none; b=UFoVLrnwwpet3tLdFW66Zc7QhWd4er7I+ThLES/LvNvXiqM37VsY6rq++y5RtmjiqmZrnd yccYwWIupmXBQx4+z4YNZwMZqqqWMDyLiy0u7dlmTY6fFBm27VMpYFp2raT5c/TqHnF/Mo AcE4EGrkXjEBqtVDdignEXc6j03vGIB2X7isntrETTDxxKwgxDcPfMtN5Z3Onqh7pY2Ytq OWpUr7xH3qMEXY6+bAmO1wb5sKX/lJDhqU436al5LgPLv1aVQ06QkRJyYa/nnWYa9W4TF0 QdsSep7od3Yfak8RB3KKkIXttXNyZWdAciNW7Bd4roLD5+L29+cHyYENeEjkAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gj0Hx0zmr5; Sun, 19 Feb 2023 03:16: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 31J3GWn9083867; Sun, 19 Feb 2023 03:16:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3GWdc083866; Sun, 19 Feb 2023 03:16:32 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:32 GMT Message-Id: <202302190316.31J3GWdc083866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: a9c1274c4202 - releng/13.2 - usb: add support for Huawei E5573Cs322 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: a9c1274c4202aaf89991e8607577879de8d6521a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9c1274c4202aaf89991e8607577879de8d6521a commit a9c1274c4202aaf89991e8607577879de8d6521a Author: Michael Paepcke AuthorDate: 2023-02-16 16:58:31 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:13:18 +0000 usb: add support for Huawei E5573Cs322 Switch the now added E5573Cs322_ECM (0x14db) as well per default to NCM. With this patch we default all devices to simple NCM mode to avoid the problem and get a consistent reliable behavior. No matter what firmware version and provider mix are involved. Rationale: Even the bigger SOC shows under complex load in ECM (double-nat) mode the same performance drop from 25Mbit to 2Mbit Line Speed, similar to E3372h. Reason: Thermal problems (reported via serial debug interface in ACM Mode) after 2-3 minutes load. Fix the root cause and bundle a working firmware is out of reach because Huawei sells the same hardware, different (crippled) firmware versions at different price points in different markets as strategy. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/633 Approved by: re (cperciva) (cherry picked from commit e66352013a67183dfeec14b2a22913305c26e838) (cherry picked from commit 623346ecb9b3f4390e9f13df4b19e6e41c4e53ee) --- sys/dev/usb/net/if_cdce.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c index 0b6445e5908d..bb2d08c2a282 100644 --- a/sys/dev/usb/net/if_cdce.c +++ b/sys/dev/usb/net/if_cdce.c @@ -267,7 +267,8 @@ static int cdce_driver_loaded(struct module *, int, void *); static const STRUCT_USB_HOST_ID cdce_switch_devs[] = { {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3272_INIT, MSC_EJECT_HUAWEI2)}, {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3372v153_INIT, MSC_EJECT_HUAWEI2)}, - {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3372_INIT, MSC_EJECT_HUAWEI3)}, + {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3372_INIT, MSC_EJECT_HUAWEI4)}, + {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E5573Cs322_ECM, MSC_EJECT_HUAWEI3)}, }; static const STRUCT_USB_HOST_ID cdce_host_devs[] = { From nobody Sun Feb 19 03:16:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gk3MHlz3sLCN; Sun, 19 Feb 2023 03:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK9gk1lY5z4KPh; Sun, 19 Feb 2023 03:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gq92igr0i8IoDljrn7MkOhleQTAulUQdabb3u7XVZjo=; b=H0WtTvyNNeH/paUrFOcRsslePG2CSk23j9HFN4iM3lxilzeAy1kjwceJVYorhoW99rk86M EsEHrwiEMopsLsAeoF8yqXVCP5RYoi6Y33WAD79ru9xKjvY6dT/xLFx6cN1Ixo5o4ZpmYi x2MrFSTj2tCfDFVxbrvvMI7Rhh5TiHBfZdPKPtRJK/aXpKlW+6MTqMwu6ZcoPC+IfDZssq uY0fMtmPgLvbFogyZ/wPf2rKMw15W+QbQaEipSmozjU+/mwlBPCLAF+bFCED0t/gEDEANH z8YnOs5pE8wlfgA0XAG+us4NldY8eaGxzLdW1JBkVGTx+nonX/VANwKHC3HZ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gq92igr0i8IoDljrn7MkOhleQTAulUQdabb3u7XVZjo=; b=PwzVgmnl4LzlW0t2mJqDJUQTgODM1ZHbNs8E24q5QmKxgfEBRDmBat7TPsNCYBkYPcDTNL QdqZlDtMa4YSelm42McHO3Ik3TAmuTS3IXKc6PLi78ybmSeJwuN6mQ2bIGLJa73cEvj5Xz 9gZkhxsbx+n1pRGL0ORn1gt8eXaS7tzikSOtwce5M6yQ4bJz+yOxZodQ+qkc6WoGSGXd3a 8xnxDdi4Y09iCYZKkYYWxMVqxMkc39Sq+L70l3BQz8a9o+dUIQ4BEaRQGwRtJEZGfl1Nt1 x0TSK850sbGKpgz3NMx6ffBl6/LKz29iKQojSWGuZCZMrWiU0dNxXIu9hw4ZOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776594; a=rsa-sha256; cv=none; b=hDVxTmFHINu2ffIl8QaOIzGutbBOEfR9KfTV6dLTsTioFkC7SL+J0mS1lxg8qeYBSmxaet HccW2jIF9vWe0giO+U1gSTVoL4IALHCOTQC8NArGhgd0ni6dmRnY7Z6VMtcmfMwL0JR576 u66y1jiB4tA82Z0Y2bZmZ1L8wT3s0GkfUAkPwonMRbDnWmY/VmjY9ZcFfoUVNataRNSKm3 3/jDM1s/ZMZXKS1G83xmu5qEQz3as8xs/iBOQ4p46qkdCMg1DLuHRRNX2yiMJlvqRGfUGH iVE4uQcsYSSuFsxLf0Mjgtyvh1pfxVl+StxN4ywh/4ahvSxIGe1JENssgaOLmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gk0s7yzmjw; Sun, 19 Feb 2023 03:16: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 31J3GYqX083893; Sun, 19 Feb 2023 03:16:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3GYhR083892; Sun, 19 Feb 2023 03:16:34 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:34 GMT Message-Id: <202302190316.31J3GYhR083892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e58ad0e8354f - releng/13.2 - usb: Remove obsolete Huawei 3G from usbdevs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: e58ad0e8354fd9a1155a415aa9f057ddbc265640 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e58ad0e8354fd9a1155a415aa9f057ddbc265640 commit e58ad0e8354fd9a1155a415aa9f057ddbc265640 Author: Michael Paepcke AuthorDate: 2023-02-16 16:58:31 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:13:33 +0000 usb: Remove obsolete Huawei 3G from usbdevs - remove Huawei 3G E3131 (E3131_INIT): - frees up 0x1505/0x14fe shared IDs => product is EOL (since...) - 3G networks are shutdown/scheduled - E3131 devices will still work the same via scsi_huawei_eject2 - new 4G devices will switch & report correctly now Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/633 Approved by: re (cperciva) (cherry picked from commit 848ac8451b08d09a81de7bac8ff8fbe0d35df8cb) (cherry picked from commit b9ddd053e800af8e8a4b06b96128f505d45f532f) --- sys/dev/usb/usbdevs | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 01612662fd4d..629b153f995c 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2549,9 +2549,7 @@ product HUAWEI K3770 0x14c9 3G modem product HUAWEI K3771 0x14ca K3771 product HUAWEI K3772 0x14cf K3772 product HUAWEI K3770_INIT 0x14d1 K3770 Initial -product HUAWEI E3131_INIT 0x14fe 3G modem initial product HUAWEI E392 0x1505 LTE modem -product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial product HUAWEI K4505_INIT 0x1521 K4505 Initial product HUAWEI K3772_INIT 0x1526 K3772 Initial From nobody Sun Feb 19 03:16:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gl4rxQz3sLDx; Sun, 19 Feb 2023 03:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK9gl3jHQz4KH9; Sun, 19 Feb 2023 03:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AljstLl0tR+U2ndUTXxXjT4yv+hu1YD3Cap96wspdp0=; b=BMtd9MU392wHO2KHUKagboWhqxZOggS5QekvmeduE4Ne6yMkU0tjC557HRTAoEKxTniKmB +JzdW6sb9HuHdqSwhD3RGVqzxcmwcSZ/DKePsmYJJyZufOVlEQM/EVyp5ta1ojIyXs/qWP lUKFt7aoFbX/GxlppklUFZa8RCsHMG6mGshMCJtbwllxorVWT8npO17l2ZnnaiEmo/6RUD vk2zWxw8dEshC5jkL9VrlJp9dzFqWqKuQzitJbq+trbKSvgcTHZI+UwSU/tK8wQnfCFtAW F7bLKxpEjKwJhm4kv5DFhlXKLVdaxQroIdYEnwfRUaWLNHFMHIGsSS2vNn6paQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AljstLl0tR+U2ndUTXxXjT4yv+hu1YD3Cap96wspdp0=; b=PnQabJe3s5hL4Yj8vqpzlDYLLkglIkeOpzE6Rgy6JzcGVP7zp+F97mFMrqOsKiAov/0WrD MBLSV6ayelnmtPqXHbLFFoHI1vkUH5akzyc7u9skDlSS5AQJGdcaVzmSurFN6c8qWh3RLv 7lrlpNc8jLoWZqJkcbrqAr0bOYpfQqlJvHRVxfdKu6RjJTrlx0LctTQh6Q+D3rzC2zl0QZ gZUCJNkJTXw0H1gxS4pYNXbtbSmBaseAf/sTdmOWMZZfLLBl0LM4IZIprmN1xUg29wrOjq Gc62bQ73LRxM4qJRPnZ+yvocpB7tiCYH1O91w6/bK8y3oEhCQMNvUi6z1zFiOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776595; a=rsa-sha256; cv=none; b=DrtfJjrxmCnTy3OnryZwZh0lAfu+U4jYU7kuMpV1/B/v6zdQZpnMR08RvBZHxyvKafLycZ h6ivbHmlEuOmJug1JG8MUKV0/fpi0OtO9bcMOs/w7+L32K9HdobatRwFwaD2sZ3IxEYSaH riMPH5hQ0VQWLhBl3cRkJZwNP0ryRfNhzXW4FcqQANC8hhnOqMq7WkR0SRolTIg8950hcZ j1qRW024OGh+fBVk7Ae2bUH8XiXl9FNf+gzadjt/7D2E+nn6ftKyeX6nJKUeiqOZ68MGdI X9jbuM5s6X8Xt0SlJe/jfwktLAI+LhUFC7H7R6voRDt8OvdGrcRTh3QvPVfywQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gl1Wpjzmjx; Sun, 19 Feb 2023 03:16: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 31J3GZj0083912; Sun, 19 Feb 2023 03:16:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3GZLP083911; Sun, 19 Feb 2023 03:16:35 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:35 GMT Message-Id: <202302190316.31J3GZLP083911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: b645d7ea3634 - releng/13.2 - u3g: Add new 4G Huawei devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: b645d7ea3634b38b2c2a85689b667668814d5b41 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b645d7ea3634b38b2c2a85689b667668814d5b41 commit b645d7ea3634b38b2c2a85689b667668814d5b41 Author: Michael Paepcke AuthorDate: 2023-02-16 16:58:32 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:13:43 +0000 u3g: Add new 4G Huawei devices New 4G devices. Longer description of new modes to follow. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/633 Approved by: re (cperciva) (cherry picked from commit 75d41cb6967bef0e534afd6d20ea5eeeb2435e36) (cherry picked from commit 9786ac44efd689018ee8dafa4fb231cdba366e94) --- share/man/man4/u3g.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/u3g.4 b/share/man/man4/u3g.4 index cf1152a6c1cb..91b3fc0761db 100644 --- a/share/man/man4/u3g.4 +++ b/share/man/man4/u3g.4 @@ -18,12 +18,12 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2018 +.Dd February 4, 2023 .Dt U3G 4 .Os .Sh NAME .Nm u3g -.Nd USB support for 3G datacards +.Nd USB support for 3G and 4G datacards .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -72,7 +72,7 @@ Qualcomm Inc. CDMA MSM .It QUECTEL EC25, EM05, EM12-G. .It -Huawei B190, E180v, E220 ('') +Huawei B190, E180v, E220, E3372, E3372v153, E5573Cs322, ('') .It Novatel U740, MC950D, X950D, etc. .It From nobody Sun Feb 19 03:16:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gm5Pf7z3sb0C; Sun, 19 Feb 2023 03:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK9gm3MBdz4KN9; Sun, 19 Feb 2023 03:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PNmxO0Ui4PmX8FDdLxtwtdMC6XzFFTs6PbQI68uO2/4=; b=NMKYxBIN/G+/d43qdQbS8FB7SresgksN7KWjcus/ELKb6ZvOT9Z0UHWYrDqKF69BAkaxhk YdD7vccypCcncNuiKcLJX+SdZ3pxkW9eP5QPxeuLLDQTjgGqBQ3W1dT/SIrbNGWv4frlrU +ldofSnz3pPe3VRnukWdcv6ydUpY/N2fquQZa5VBtTF4FrwW9CQ0OvNFggIKjMl3/iZzOV eZ7wxeIN4wSXUCPSzJsqt2uXcYUHiTlxwPzZ4CVfkxzJ0ub/KsK9q7aQ5nr7WKRPvtSdSY 614WpCZIzvVLzgkdntXBCMfQqcRgjro78zls/xXlnJ7prIYDmKBqcd+fVhzLMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PNmxO0Ui4PmX8FDdLxtwtdMC6XzFFTs6PbQI68uO2/4=; b=gVp9QkDjaXtmik+zOiaAe7zcrFuavOCyIPZTqPKR+u4tkHPLRAKs7hGrBpIZu5GAipxGQc upJCngkOIKoqpfCj6Bk+WBsjdP2iG0cbtw+KBgyLw4q6e/YQI9ss3W325oKGsf/u3qmS0E SoZp0qgZxFs1VQsXE0Rua0eaRbnwH5xjViMS8KmUDTKfhB9vHbb8Sh9CzS/5QTaDxncDur OMm6qwpRyRP/SnuiwXin0sT6jG+Nq0n2nBCv1fbzwaBIfeV/kEfNcsqxX+NaYFHGpWwLTv YRrKS4vCQmwHsUHWr++tGNmbYXHfUAf3DjZFaFOLCSK7hg2nrKNd9ggI6iMdyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776596; a=rsa-sha256; cv=none; b=uGQIglsToc6jtNEjIyLQGvQghnX9mmfZBxN7Ay5EgkTqKuugvnmnaNARfkl2JzabpBpjS5 YnZkE7Ti4uTmwYv6SgHWJLqmwZHH4pjwD9pWEQqbC1iiP/2SVgljtC8Z0EJHlqWpdRJ2RL nwPeFPvYalUCdoM7AsRgaCb8kO5UsUTH0Hc15sQ/aJidl3FDMccYeJMz+v6iBketFZq2Jr eikaZKNUaC/csiPFnJ5wV2wnaRYDll/8ZtDmsomqUrU2dTm1z19/Ib+UW3vRqFsnSc77ZR 81EH4ly3RcvmLlmWl8QCKMiFN9buBsqnIoJmaVcxCAQNFvalikvHasxLwKe+gQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gm2SsLzmvf; Sun, 19 Feb 2023 03:16: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 31J3GaQb083934; Sun, 19 Feb 2023 03:16:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3Gaow083933; Sun, 19 Feb 2023 03:16:36 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:36 GMT Message-Id: <202302190316.31J3Gaow083933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: ec9704eeaaa7 - releng/13.2 - usb/u3g: Add support for QUECTEL EP06-E 4G modem List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: ec9704eeaaa7552d1d6b83ac34fa894fa36f50bf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ec9704eeaaa7552d1d6b83ac34fa894fa36f50bf commit ec9704eeaaa7552d1d6b83ac34fa894fa36f50bf Author: ev AuthorDate: 2023-02-16 16:58:32 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:13:54 +0000 usb/u3g: Add support for QUECTEL EP06-E 4G modem Add QUECTEL EP06-E modem support via USB for FreeBSD. Tested and works like a ppp on FreeBSD-13. Reviewed by: imp PR: 269326 Approved by: re (cperciva) (cherry picked from commit 0cec5b99b3c0484925f3cc0813040c160987bd45) (cherry picked from commit 1256ad9b27b2eb34a066640e63039975ab4f8492) --- share/man/man4/u3g.4 | 2 +- sys/dev/usb/serial/u3g.c | 1 + sys/dev/usb/usbdevs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man4/u3g.4 b/share/man/man4/u3g.4 index 91b3fc0761db..c4d9b4ee3460 100644 --- a/share/man/man4/u3g.4 +++ b/share/man/man4/u3g.4 @@ -70,7 +70,7 @@ Vodafone Mobile Broadband K3772-Z .It Qualcomm Inc. CDMA MSM .It -QUECTEL EC25, EM05, EM12-G. +QUECTEL EC25, EM05, EM12-G, EP06-E. .It Huawei B190, E180v, E220, E3372, E3372v153, E5573Cs322, ('') .It diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index 0e20f42feb39..2186cd8e383d 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -514,6 +514,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(QUECTEL, EC25, 0), U3G_DEV(QUECTEL, EM05, 0), U3G_DEV(QUECTEL, EM12_G, 0), + U3G_DEV(QUECTEL, EP06_E, 0), U3G_DEV(SIERRA, AC402, 0), U3G_DEV(SIERRA, AC595U, 0), U3G_DEV(SIERRA, AC313U, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 629b153f995c..81abe91d93b4 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -3983,6 +3983,7 @@ product QUANTA RW6815R 0xf003 HP iPAQ rw6815 RNDIS /* Quectel products */ product QUECTEL EC25 0x0125 LTE modem product QUECTEL EM05 0x0127 LTE modem +product QUECTEL EP06_E 0x0306 LTE modem product QUECTEL EM12_G 0x0512 LTE modem /* Quickshot products */ From nobody Sun Feb 19 03:16:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gn5krzz3sLCV; Sun, 19 Feb 2023 03:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK9gn4KSKz4KXh; Sun, 19 Feb 2023 03:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EWlkHooiwbmC6dPA0szuzZ6YLKrOu9WdV3jcnxnYaGU=; b=d1If4WrI1C5kKG9talnbT70Fim7QcrpiSc8kAQbfkmE5LrgI9IVwiGeMbXyOsJmJ1kEa8q P1QNMcKAHV4fhYhNqbppvbG0Eqx37Mc4ryg1MahvCOK3+VQ6I3RIsfk5ESou9YfiVImRY9 ycWFmPBKUSkxw0fS8b/wSzJ09DNu3jaGuP2w0vHO0YtVusmae+gJtr7OMXRe5cRIF71sug UUiar049PaZ8vGOnD6GyhtWUsw+pL1y5Vjraf4QfBHTzic+O6th65pgRYi5Zu0OEwrlsqh trxOy6EqByrL8K0Sb2PfqkGN/8D3Gez+blo1UVLZ6gRng4Wr/LaMdqosCzEyXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EWlkHooiwbmC6dPA0szuzZ6YLKrOu9WdV3jcnxnYaGU=; b=PkR0lMWScC9rzBDPdfd+N7QjpngWYVDrzSfgL60LhGX1e6U8l0pEO1D6JqQJ+ZEsz6u8OK v+cAZS63kuOhLnJwwUrXohOV7sn9wxRRYejbX1Fi5P1xAai3JNeYIXHRPgGZpEe99nUmb8 Cy4IhTOcLE+RJqSlF4/SPWWphkl+a+ZQeEg1dFmPRrRLcPFzp4g4jjauwHgYTgye9Jjxtx y961hzjRSrdSdTCVzv8ntZxRa/l86Eoj3eUNp/O95Z91UUAMnEWx6TZ4JfuYwdlorxfPrs zwatJXBSk387pIXxcvh9VPHjkDnjAdtZNLfzBlGC8mI2bBUKNyT7+jxEA5+J3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776597; a=rsa-sha256; cv=none; b=f7efpIxaC6T7QRki3owo7006iYjVxI4oycj9NDyNK7uvQ/AuESDtO+hBSEzDhB6CVcAOsY hN1WQ4qONteW4v7vTa8YPhcn5y13U2TyKbSm7SKsQWh6yK7q081nkuYutJA/WciV+bQOpf wOSxLaFbARpr926xMYkCEDW4Qq5BrxuWfeI/u7ZKyXv59vbUe9lbN99TUQYuXmnvZzJsEh Ql30mviTqdfqCIrk8lMA0zrEdU3bahqfx5g4Wk3s/PzN27FzKBVQL3NtejOyx7MNaLU4fx zcNZpqcxw51lpdUIvs65pGyX/J8LNstXdhAmPGcDHOmgJ9dUgTFhy+UFLh0d2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gn3Nwbzn5n; Sun, 19 Feb 2023 03:16: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 31J3GbQH083956; Sun, 19 Feb 2023 03:16:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3Gbck083955; Sun, 19 Feb 2023 03:16:37 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:37 GMT Message-Id: <202302190316.31J3Gbck083955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: a642b1290d43 - releng/13.2 - u3g: add huawei device id List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: a642b1290d432021f341f65e87c1b7268873d66c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a642b1290d432021f341f65e87c1b7268873d66c commit a642b1290d432021f341f65e87c1b7268873d66c Author: Michael Paepcke AuthorDate: 2023-02-16 16:58:32 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:14:06 +0000 u3g: add huawei device id Add missing entry for E3372h Model already in NCM mode Noticed by: David BOYER Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/645 Approved by: re (cperciva) (cherry picked from commit 08ecb40e88a0d34cf6a177218a22f07431cadf3c) (cherry picked from commit 38a2e8fff2f7ede285fa66b765e5387026d779f6) --- sys/dev/usb/serial/u3g.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index 2186cd8e383d..d577508fff37 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -343,6 +343,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(HUAWEI, ETS2055, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E3272_INIT, U3GINIT_HUAWEISCSI2), U3G_DEV(HUAWEI, E3272, 0), + U3G_DEV(HUAWEI, E3372_NCM, 0), U3G_DEV(HUAWEI, E3372_INIT, U3GINIT_HUAWEISCSI3), U3G_DEV(HUAWEI, E3372v153_INIT, U3GINIT_HUAWEISCSI2), U3G_DEV(HUAWEI, E3372v153_NCM, 0), From nobody Sun Feb 19 03:16:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gq0gPKz3sLF5; Sun, 19 Feb 2023 03:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK9gp5PF4z4KL4; Sun, 19 Feb 2023 03:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=odsCElVQkDXfCUOysmTIP+lFyp16cZQHehiLvUjjV4M=; b=s/PcMNtAFD1kbbuYF7vMxH60VaNbGRJBYcog8PnmacyhFekBpQMcNZBS/a/57jEcB9BboH LNrPwImXq5L332G0QMxk/AvyDyPfdg9UEHr398t7tyXKHcSGJzLcihk+ZIdBagTw8O7VGn Dbe9IgXaAu/+HY2yne5BIE3/bmMQaHsSMTxRStQOuxSH8lqmp3iKAwnKz+1QPMjCQ1CywQ SFAp1Ur2pM9sgAVsxvdEtVJEYh4lOyB863h3FoIZ802fotA2l9Awp9Yu71KjTXXJrX9Im1 1nYvzJPuLow6RZVETq5joQL2cd1uPQhWu8PW0GU2tPDJpKjXWWJwCdDpUWhRNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=odsCElVQkDXfCUOysmTIP+lFyp16cZQHehiLvUjjV4M=; b=CGTWfPMQaSx7p7R+JbVDnm+/jLYtaqEHy33QFLusesyTaFUKdh3k86g+OAmclWhiWAuBNe QGEUNE23qrr3yYsfOQjUUmRVccR2rdwaiwzakQI/bQkRo0ncCSFPMqsQkxA5+nh8dpe0Dh owmdWY9hBuaEKHZa6zpwgjxUQjfY3MddS/MoD3UBbMI8iA38ENNPryRetD8zDRx+L+LdBS ONhKMWeUUbesZ9nzZw6f5QUxrv/DHaIy6onZkPZsQE9WsKXersI7hl4NHAlxvcXOKRDQls +vcZtkZ2phnwg8DjbpbZt4qEWNy/KGo7A9SsuaWUiOH5wsZHZUq3NV7SbGintA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776598; a=rsa-sha256; cv=none; b=hMjoctgFbMX3abIFVIvNt0/JYIog79nIf6iRVZwx7XYQ8ELWB4uyvFlQgy6+x9F/Qy1v/L 7kufTf/b47Q18h5LrGU71yATn/7mMcE12Xq0TzRzR81gxoJRlgymBK9G8Qm8h/qCEkayrO w1PYBfBH7l/CSmHAoBY6BKSdbjQ7I6oyIdFURc6IpPsYmyHCsAys3LmLuNjw7kNGICpTYJ C5nnrHdqKMBnMywR8VNu62EszG0Z/EdRBbUWRUJeFcGtVb12bKlAGv/AfLrnKBQmQ1+1gA yUKcej5nPykFLf8d+iedV6+foKf52kvzyk/BddkIkr0jo7gWtAPcZJvu3ce6ww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gp4JkRzn2w; Sun, 19 Feb 2023 03:16: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 31J3Gc60083977; Sun, 19 Feb 2023 03:16:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3GcNa083976; Sun, 19 Feb 2023 03:16:38 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:38 GMT Message-Id: <202302190316.31J3GcNa083976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 48b109db1edd - releng/13.2 - cdce: add to cdce.4 information about NCM network mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 48b109db1edd044a293dea7b77447de3773520c5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=48b109db1edd044a293dea7b77447de3773520c5 commit 48b109db1edd044a293dea7b77447de3773520c5 Author: Michael Paepcke AuthorDate: 2023-02-16 16:58:33 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:14:15 +0000 cdce: add to cdce.4 information about NCM network mode add a new section how to use NCM network mode and specify the required kernel modules Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/646 Approved by: re (cperciva) (cherry picked from commit 58e1d01022415e29d3e08c4d3936b6631c27406c) (cherry picked from commit 6c9ad7b8bc7dbc17f41ddab6779548fb2728608a) --- share/man/man4/cdce.4 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/share/man/man4/cdce.4 b/share/man/man4/cdce.4 index b27d89bc1639..99d04bd12d07 100644 --- a/share/man/man4/cdce.4 +++ b/share/man/man4/cdce.4 @@ -28,7 +28,7 @@ .\" $NetBSD: cdce.4,v 1.4 2004/12/08 18:35:56 peter Exp $ .\" $FreeBSD$ .\" -.Dd July 10, 2019 +.Dd February 10, 2023 .Dt CDCE 4 .Os .Sh NAME @@ -47,6 +47,13 @@ kernel configuration file: .Cd "device cdce" .Ed .Pp +Mobile Devices (eg. Huawei E3372, E5573 and others) +may need additionally the u3g command port: +.Bd -ragged -offset indent +.Cd "device ucom" +.Cd "device u3g" +.Ed +.Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : @@ -77,6 +84,13 @@ received and transmitted over separate USB bulk transfer endpoints. The .Nm driver does not support different media types or options. +.Pp +Mobile +.Nm +Network Devices may need a connect command sequence via u3g +serial command port before they activate the NCM/ECM/ACM network +interface. Example: echo 'AT^NDISUP=1,1,"internet"' > /dev/cuaU[0].0, +where "internet" is your providers apn name. .Sh HARDWARE The following devices are supported by the .Nm @@ -93,6 +107,8 @@ Terayon TJ-715 DOCSIS Cable Modem Realtek RTL8156 USB GBE/2.5G Ethernet Family Controller .It Planex USB-LAN2500R +.It +Huawei 3G/4G LTE (eg. E3372, E5573) and other mobile network devices .El .Sh DIAGNOSTICS .Bl -diag @@ -127,6 +143,8 @@ is running low on mbufs. .Xr netintro 4 , .Xr urndis 4 , .Xr usb 4 , +.Xr ucom 4 , +.Xr u3g 4 , .Xr ifconfig 8 .Rs .%T "Universal Serial Bus Class Definitions for Communication Devices" From nobody Sun Feb 19 03:16:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gr0y08z3sb1l; Sun, 19 Feb 2023 03:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PK9gq658vz4KdW; Sun, 19 Feb 2023 03:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bhlG3v3Q3GSc17LFsV6HeAOAjUd/DdVNJ8byEeRuDac=; b=Zj/GFxkB47PtcVyTqnK1T0UZ3MHJNM+rKNY8bFA3VcDkFeewDbDl89L7KEuWhqKtr0KlKL dF9K2b7+4KGXattSR1RFgj/6Sga8LgL5hz6LeFce5VM/alHUkoSTf6SDXN/EYttMGHPtMS uZbVUofxt1QpAAKGrtv6BeAU8JGVszbobLA2qRNPYdEBuiqsdAMZT2rSl0nthWKROxCkPD tsKHqWcAmGNRZ+keQ2aduMx4TTUjGlxJQoRNHja3TSkUTyCExRy+q8hIeWIdHfRvxL1Bwg P/s5Pni7BU2fS7iiE7O3NIig9JEyfwzo6XPGnN/LWV7456qNfrqwaM5cXzg4hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bhlG3v3Q3GSc17LFsV6HeAOAjUd/DdVNJ8byEeRuDac=; b=j70BeYBhi/eBc+cRWFC3HQgsWlWsd9zgMezzM+239jAdta08YTTuPiPusKp8Yb9pxDncbx JZD9YJ4DHaF5C2/c9tbYPdkkkkDRlITm5RRq82mrRhjknh7k5IQRs+/ZmYZ56nBAM4IWk3 VLEpfobajsbzL/S5u7Nqw0YpPaGwuA/7E+W2tGR92pWEdIYojB1FGKL5JoSW1I/kaOfhHE Rh3gNbby9xHxl+WtxYmgVUCyCDciAZle895wXRoEqnP81LVjIBKRv/ARmfNYcqc+42whPy 22ww3NFoSf5/8jnXHtYlHqGzbywbJfE1JkyfEpVqZnMDJyT9BxflDCjB7lPOiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776599; a=rsa-sha256; cv=none; b=BvXD7V0BQ3vEquQj8IWHIKwHwh3NFHMIDZOHy3t0MFWqaZdar6J7FdAxyo03eR01Zr2FVN 3C0MaZu2Mp3ISTcdj3hIo+8/n73rFPQwKfhKOwmVVS1GRoAHsc7p++dtv1J0SMpHih7vsi 5yv+NCTeeDK1wPB3ZW048+20AY18/NKGWfUmYnNF/+Be3wXN6TTieIht47KJZeLzWxA7u2 X0Ngvb9xSkGTi1bgr53SgI47n5btNI9L9wrh/i4tLpC6uIuhXfg/6BwH9azWq0C6kJX2sy JZhtjrehAGi0VXtRlCBO1WNGalPBG5bUTC51VbRPVjG0jeJprRPJNr5Bjfebhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gq5CBVzmvg; Sun, 19 Feb 2023 03:16: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 31J3Gd6O084002; Sun, 19 Feb 2023 03:16:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3GdQA084001; Sun, 19 Feb 2023 03:16:39 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:39 GMT Message-Id: <202302190316.31J3GdQA084001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 0b69409270e4 - releng/13.2 - powerpc: Drop old workaround for old gcc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0b69409270e47fc90fa7141098c2621e4df1c45c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0b69409270e47fc90fa7141098c2621e4df1c45c commit 0b69409270e47fc90fa7141098c2621e4df1c45c Author: Warner Losh AuthorDate: 2023-02-16 16:58:33 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:14:24 +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 Approved by: re (cperciva) (cherry picked from commit e35448a901aa56aa232efbc4fe7a73a9bdac3511) (cherry picked from commit a86b9ed22ece362331f44a933bbf5426a06f527a) --- 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 Sun Feb 19 03:16:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PK9gs2WcGz3sb4T; Sun, 19 Feb 2023 03:16: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 4PK9gs0kWwz4Kdp; Sun, 19 Feb 2023 03:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Npurq8e2zkw653xmo4X5i1WdourewXCrZGLNWTX7Teg=; b=vL3Gk1j19Ik27k5p2WUr5388g3Pj5oCe0bE46FKWQiRVhkaADhQUMuENp3mUN8kRDnq7dX Squo+i3MBoiRsrcggT+d3CRat8xI2qWDraPA22Dilpl/EvPIQtG7ny/0LaEdAWHkAo6Z7E s6Jr7MrxWtcOKvW8R0SvxsCv96aDxSDzyKwWgVHqj48Va6UqKraMHvSazV6SWgLmKYOLot H6zuNiGATCWDeoIL2JpSdkV3QP0ydGMLGvJ2pHD6+mA1ieDvnI/b2YU4W3ZjFRVbuwrHnO Sd9rWKBo/T7umh5IkbhfdWAWTi3JOSs1/ySny2mkibKuLyQyt1ed59iIiKznhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676776601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Npurq8e2zkw653xmo4X5i1WdourewXCrZGLNWTX7Teg=; b=AETPVp1OVlJgt0VFXI0K1Yow3jDK57pszjrGGXtTyqTGv0k0J9z4KrLCQa3Xxx2PrjPgQv Oi0zFrFMPfUacYh/VP4HvFRHF/iK8EMO927lp/6uC8oKwV51jKYxYDE9LkJn0jBbf2QCAG uWZhBSlAfMzytvlDDtqMSGVnD19gOH7flhqUBhREq0cr7XuLX+mkL+l/pFQIFGclbITaWm K81rH8x0EjOFptUf+wqTIK9f9z9c7zqT32c9Wxbncbk6nm5pJbFzOILUb/tkbG7viY7Ay2 vsw/Z4fV8wAFwqGi9bJc81UOY+3tze7bKFaS2mX9OKOTdUDEzT7CKe3tRvPnrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676776601; a=rsa-sha256; cv=none; b=PvyVC8KwV2yI9OuGpTjXYpE/MFtQe02MEiLokiiE8qhrEUL45cggBzjwWwifm/EKvOqfG4 YDmubNcKnN+zP5j7p2tAa6ZW5wxb+nUrdBx3Mj7FC/zweynuBlw4jwrrv9h1fIyTB8m+xv 4qTM+RG6bq77MP01lZweaGVskIgra0jgaBJx3N5KI8g9wkZiQu0uMQ2L0nyKkKGzh2rIgG Ik37tuYNReE+ud0ieBDImnX164yHjkCsHJbBtoSDKnLqU1z40N4eX3L/M00dVYJ0GAn6HA p3d7SN62/tlhijPabwdPUAdxr3N5awflCA7tK2TAm11KRIh+AvAiD11eyIDCFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PK9gr63f3zn2x; Sun, 19 Feb 2023 03:16: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 31J3GeRk084021; Sun, 19 Feb 2023 03:16:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J3Ge2V084020; Sun, 19 Feb 2023 03:16:40 GMT (envelope-from git) Date: Sun, 19 Feb 2023 03:16:40 GMT Message-Id: <202302190316.31J3Ge2V084020@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: bae5c73a5ffa - releng/13.2 - sys/_endian.h: Move powerpc workaround into _endian.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: bae5c73a5ffa237e437605bbf2216a574d1dbda2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bae5c73a5ffa237e437605bbf2216a574d1dbda2 commit bae5c73a5ffa237e437605bbf2216a574d1dbda2 Author: Warner Losh AuthorDate: 2023-02-16 16:58:33 +0000 Commit: Warner Losh CommitDate: 2023-02-19 03:14:36 +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 Approved by: re (cperciva) (cherry picked from commit 6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b) (cherry picked from commit 07e39710b170859ef6a57185f9a775973f3eeffe) --- 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 Sun Feb 19 05:47:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKF1b2bQtz3smRF; Sun, 19 Feb 2023 05: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 4PKF1b1mH5z3LCR; Sun, 19 Feb 2023 05:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676785635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Z1/E3XgaRH4GwIiQCssR4e0/IHr5DZoFH1glf8eFqo=; b=B6EZoPBpt1vskWbG3jtRbqmZ/qITF7maGCRgDfmt21ceDcOhnjZSY2ZwkLebJfrq+UXEQJ YBWVdMnoKFa+mjrz05vTjK/QO+B8SQbXbNgyLTQf7KVp82HhW7htaERQu0Yt6beszsGHC+ 7v1itouSLSwTaxAHDTCOA0kEDE+Dk8x96PoIumlWA9Wj6OnGeq6k5HM2drfAcBh/E4WQ1M rCnwVuPgQBuzR0i/xx0TGf5L3rIW28TIZiJF7KXbIrwq2Hs1VTuvcLZ+5oDSip9VwGTMlq yfMVgWxBDgHXPFx65j73jvnbZMRgGB9vjQZcy018nK7iHaAGMjGkSHzpq/CiZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676785635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Z1/E3XgaRH4GwIiQCssR4e0/IHr5DZoFH1glf8eFqo=; b=cp1SmBWrcp+jr7HUSWCENEUCF/m5wogbHu/BWHFa7yY7Amqri6jgGSgMOcvEI5fMhCuKLo HHKNkS3Ifg7OjQZojbDlI5Dee3ZbpThGUg6auTfZv6MFbTLMitBjFpkVPo3SJ83OABnlVv kVO4oCS4sgCFGCR9puoyVCgZa3mEf6Ym70t0oFhZE3nEVTP+PMbiZuYzANEUoShG/dx9Bc oszvIgGb0ihu3fU9Ua3fbekIXJVh8utb/Rza+trkePaAi/Vev0avplL24JP85Chstqq4Po BmAXrYkQNBOixzKcegksrTYx43+RI1SkNiCnY85DLdSVVMzIsXmQCM0Y64TKIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676785635; a=rsa-sha256; cv=none; b=Rlj8zH0cfDHed0gy5x0jTyVOjknygaZh7huvDCLhjZ/5iV9cmffNc2xAjrlN2eAFEM7+Nm mKAqIPoZXsVQ7xrIWXsE2gdw+7t8zz0G+ED1j7qoVs/Fym2YboOVwm4jUpD1JkBUbmgnxL OhiYLIvi0xJajv12gUTD7aKMx4bAcZMBYZp07s1SXbpDdlo1LVwRRM7qYEtrPoCqNu6nO/ 2/QzHTJccQypjD6NTSL3iq/WwerWduLgRmCQ06sLIsi75cNG3kzMpPJTBOtmKjPoNbe+Zg /ncg/HWSvm4j5YQhHEctGIOvo4N1ctmwrqX3sLm0hggZuocsJ4dp2W1cWBGIXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKF1b0kw9zrWM; Sun, 19 Feb 2023 05: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 31J5lENF097125; Sun, 19 Feb 2023 05: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 31J5lEXj097124; Sun, 19 Feb 2023 05:47:14 GMT (envelope-from git) Date: Sun, 19 Feb 2023 05:47:14 GMT Message-Id: <202302190547.31J5lEXj097124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 071a0b5b7058 - stable/13 - allocbuf(): convert direct panic() calls to KASSERT()s List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 071a0b5b7058b97b629e6aa49e7d03bb87615f5f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=071a0b5b7058b97b629e6aa49e7d03bb87615f5f commit 071a0b5b7058b97b629e6aa49e7d03bb87615f5f Author: Konstantin Belousov AuthorDate: 2023-02-11 18:03:22 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-19 05:16:25 +0000 allocbuf(): convert direct panic() calls to KASSERT()s (cherry picked from commit 020e8a4d0609d56cb49a9f35258ff07815d5e478) --- 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 abb9ebc7281b..6a479ed335ef 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -4343,8 +4343,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) { @@ -4361,11 +4362,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 Sun Feb 19 05:47:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKF1c5F6lz3smTL; Sun, 19 Feb 2023 05: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 4PKF1c2KTvz3L4R; Sun, 19 Feb 2023 05: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=1676785636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0dHiGKzlAUD3ajhgwVSRQ/GKqxPWnFD3rOhdUOCAxU=; b=QIryqUEpbZu7d5fDT0E+BP1sL+FOZuRJPS5/ddQtZ+80JBeJGnTIxUOt80lQJ2O0/jaDjW 6V60NpFbuE4FQIy14ofKFxr2h8XpxEVjVC9iKHkYr3/J7mXklaB9PLl0oLKhw70RsP/l6S ler7wAo+Qv14NoPxfZCkGwcXNENdNwfu0mjEYQgn/jwjXP0ieO1lvqMonBkq/AfNtaWc7b S+GcKvu1+65ZR+uWdsdis+annvu41XiYRXeMHfKrbxAPp2zcptDjOh7TwplNB0wV8AIQlJ Mwc+/nQQHOXvEAQOjCMFOn6ofHds7YNDDr/IbBnuAwXvPQXzlvT8IHj2hGYwbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676785636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0dHiGKzlAUD3ajhgwVSRQ/GKqxPWnFD3rOhdUOCAxU=; b=evxirZ3P0uczhfYI+lIlFqMeypRRfEsz/ZQpfCkpMGgSTzFcKL0jtiZO8JFE/o000jN3a3 S6tF3yj5MiAL/LuDrEG4F4nyYbRx52YhBfxtUALVE1DHKNpjRLQWTY79mfDZZhTyc4KjqX M3lU69x2dh8h78tIyBUS9dFfijkukj4IY5GQhoV8dMM10hwyRImhPfFcuxut9J+sBWrmrZ oZuvCuiMO0NIr3xgwPJGuZoz85I31V6Se+9sp86ZFm5QLEAbrXneQ0WKY8c8ugBdW0Y2Pr +/uVezC1k5S8S9mkWnbVfZVE0kiNV8w7uSc9YK715+WhwrRQoDXD4nt7Oj9ixA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676785636; a=rsa-sha256; cv=none; b=CZLrF2AdCOjB+zOlf6MMiVrjkRPVLRvrsef2snrLDZYiDv37suTxi0dxbbf4pTHUQVv5aT Znrgd+jfu0vssrg12bLp2agiVqlAKfyEb1B5jYAJZmf1JgalRZmSff7oDWfhDt8vctEAjW mP7oWHUw71NuMHNJyfkti3JWLFQE+JBD53DNi5AeB3a64czffBCQsgDDYQ7YyHOnbYltoA DYWQECXUgT6dqz2MiOI1Lluvx9HcUeL6hAMN0qFaX5c+labPY61T1vE1ALwxvOMQrsPZAZ TXUU2yXdjHWtv5hF/f6z6wwUOjLXGHoAU/rtHbXomAGnwJ3mRi2Ch0+1C0gF7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKF1c1NQVzrKj; Sun, 19 Feb 2023 05: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 31J5lG1j097144; Sun, 19 Feb 2023 05: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 31J5lGNW097143; Sun, 19 Feb 2023 05:47:16 GMT (envelope-from git) Date: Sun, 19 Feb 2023 05:47:16 GMT Message-Id: <202302190547.31J5lGNW097143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 64152225022b - stable/13 - msdosfs: correct handling of vnode pager size on file extension error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 64152225022bea784ca1948a67e7c040a8bb040a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=64152225022bea784ca1948a67e7c040a8bb040a commit 64152225022bea784ca1948a67e7c040a8bb040a Author: Konstantin Belousov AuthorDate: 2023-02-10 04:58:43 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-19 05:16:25 +0000 msdosfs: correct handling of vnode pager size on file extension error (cherry picked from commit e59180ea09a1d1d1463f2a269e94efa0f0b677c5) --- 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 030c96d6d354..8511d873ea50 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -384,10 +384,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 @@ -528,6 +526,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 Sun Feb 19 05:47:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKF1f1Z2Gz3smTP; Sun, 19 Feb 2023 05: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 4PKF1d4hQbz3L09; Sun, 19 Feb 2023 05: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=1676785637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n77TQaqrcPqBeqOplenIosibLJsbA2GM3wIVEnb9oc8=; b=OTNSILHqo2lg4EA6n7cSz+O8nWOqU3gY4gOl/vNjJoliyVuyu/W8Bd1LZfYzBaTwK9WZqe SHQt7qbEZuO+LwzxawxVgcLqZulkE41gjCfed+210wyjwEFu/XWPkrlb2DB0avwGxLDnXp 3bJ9iH4LnmuEqcLczealykFvsqjxK1To0j4D8V/0G4XWCD2kQfWRClPouUnOkX8QQFuha9 KxthFE4vdNmwLwyeqDAk7MjRzsk+ZDnrVHmsIXzwruVrIK98v2wXT1L1jMEuLIRKCEpM4y 13oR8B6s+BDULSWmxM7waYJsZ+o5l82ziSIdXSK+cNthoeEsk1gXBKmB9vtviw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676785637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n77TQaqrcPqBeqOplenIosibLJsbA2GM3wIVEnb9oc8=; b=HiKxAN2htqwtTgXv9lgF2Sb4JXwHoWKKgG5mZbshA8MvvMjUkQagSrra37xZVRyzFI5jsg UFxUtzjUReqKM7+eTeqYmnVa/5wo/kkIciYr7vti0DteeNb8xFsbs99yqGL10n933O17gF z/ZL4Zz6hLX2boDKINtKmHmZLC+7sJHNkHx8vKlKb2ibZ1In9+qzPSP56vCG/1HjES6U0o xNEcoSTwVl5pbrc9jXJCCN368Vfy99vXlu3oPU0BR3dXr3Ud66oUXBD2TdyzQf+HMev5hH 7OJBaGaCdweYgOclYdNl2Q2EKNAj8DRRidMiB/+tR/6WrmXSpiT7dOYxFr2JfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676785637; a=rsa-sha256; cv=none; b=hRbO872PaM+JtgzrM8VykBBcxBgJCibkWkU2W7X05aKl77B09f59rjzm1cZyqa6U34HHSM hDSFGug1nzNknGTL3rO4u1L0dVlm+TD3SvdtNMYoGRgK4A+95dOfl91ohrbiC9gXMWYtjC dpRKuaPVWQJNWxGZmEGQosoU6Mz7wFmkKrfia6hZ9AQHI/BcNKAQYpLMWvSvXYgqlqM06a vRI2C7tbkzIEhyVuvzRdrN0+IFboyh2uUcaDOsU5CiX95Cv95TVfnf5WcJAzphggEuVm7z 1llrS3iVdu/L4obNTIgoXWDtLjnIvO53sDWuNGqd+OH7WL94MrOQxvDDpcP/cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKF1d22wWzrTd; Sun, 19 Feb 2023 05:47: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 31J5lHOK097163; Sun, 19 Feb 2023 05: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 31J5lHR6097162; Sun, 19 Feb 2023 05:47:17 GMT (envelope-from git) Date: Sun, 19 Feb 2023 05:47:17 GMT Message-Id: <202302190547.31J5lHR6097162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 03562adbefb8 - stable/13 - msdosfs deextend(): memoize DETOV(dep) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03562adbefb80ba94bebe602fc051bbc4292cb37 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=03562adbefb80ba94bebe602fc051bbc4292cb37 commit 03562adbefb80ba94bebe602fc051bbc4292cb37 Author: Konstantin Belousov AuthorDate: 2023-02-11 18:05:14 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-19 05:16:25 +0000 msdosfs deextend(): memoize DETOV(dep) (cherry picked from commit 67dc1e7b0457ec014a1291c5874decdefe7bffdd) --- 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 8511d873ea50..003c710801ee 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -494,13 +494,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); /* @@ -526,10 +527,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 Sun Feb 19 05:47:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKF1g1hRfz3smWG; Sun, 19 Feb 2023 05: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 4PKF1f46TXz3L7L; Sun, 19 Feb 2023 05: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=1676785638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DL+zyS2qr3y7Sp8UUyNkoJmqsqby5FkQovdPdcDL9cg=; b=F+P3cu/XqO0KQf/8XVhpo9ox1xc/tZcjZrUOF/7GUGxwBsAIzvLYxOMNtDMuRDJim606QP gA7IUqu90fzm3va93c77O85ru/vHaRysPQBwnNwmIAPfFRJRkkdjISsK42AqL65fuL9pMX wIdMcti6OxrpiC7uM8jrv46B5edSYSJTRH7G3msoLE1P4drdgmIGP3y95+c1m8RqaT0lGl ZXw1Q0VnycTSn/7mcxshoxrAebvZTYyA6G7+yXk52Sv5nlGWlBTdTCcgBuCxsccgiy8Geq v5HfANmjOFq9Jcvq8X6NAnQHPV5SAit65q7/3HaE0eUDSWY0ygFbfzsZacggmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676785638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DL+zyS2qr3y7Sp8UUyNkoJmqsqby5FkQovdPdcDL9cg=; b=FwsY6tWBDe2emqBQHvh4gHHGkksSEfg5CzscKhonUXXALlLubg800P8Sipkut8Zi5W8Z77 ygEe1QB2qq5Kcod3RKQjQwXZyZZrdpqVm+aooklJmvbnxrFtLRhR7EqjY60UVijc76vIxJ sVowcQhKfjvjRbes80OTHWyo5yl1Mm3kolCboDuBV4BXdXqZbLshC3OWR9uym1ZjE6ncDK 7ItuWYZivIuMZLV6gmFxyzRnzYZ4UW9yv+uWv2nVZ44Kf2/Vle8AJPvx+oVcM+2c+amKdQ jPnt/n4CD4E+q4eJAueLwY+1t0M0knNnCU7CC4kGxV2KLxYKD7I2Oc66MnTAwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676785638; a=rsa-sha256; cv=none; b=Zre6M/ksUG9wawiwyMz+rX2wUu+TnZw9Q5Prm32XQ6jnToDK8dWaEvGg6q9D0cQtFBIlZd hczvesWv81icW9glHtVy4ZeryZTYHp4N0O+PYwNAKsgxrazyD7pvl+XkPL9yOg03I6rrGF RPPNNFHliT8YghFvwYQMBwkkHIQaZzty8k0dmjM0BYjkPRaXUt/tXLP6ReqrZHldJ7rKan PomXFbQq4Sd6RIT2DmmYAsXSzFA2kWf3avjdhK6bdzpV7Ih31nnbDFxMLx2Cp1yVpGyZUF Pn7oBybOclzKNVXbj6fQ0w1xhA9OfEvMIxdAosQ819ahi04p3LK5YfNhT9qovA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKF1f3DVtzqw8; Sun, 19 Feb 2023 05: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 31J5lIag097183; Sun, 19 Feb 2023 05:47:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J5lIvG097182; Sun, 19 Feb 2023 05:47:18 GMT (envelope-from git) Date: Sun, 19 Feb 2023 05:47:18 GMT Message-Id: <202302190547.31J5lIvG097182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c2ee668306bb - stable/13 - msdosfs deextend: validate pages of the partial buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c2ee668306bbe3edf4a05246ed3a88f52dfc94ae Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c2ee668306bbe3edf4a05246ed3a88f52dfc94ae commit c2ee668306bbe3edf4a05246ed3a88f52dfc94ae Author: Konstantin Belousov AuthorDate: 2023-02-11 18:09:30 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-19 05:16:25 +0000 msdosfs deextend: validate pages of the partial buffer PR: 269341 (cherry picked from commit 0152d453a08fa2bad694dc04a8184fce2b7faa10) --- 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 003c710801ee..51c2e3beaf39 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -495,6 +495,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; @@ -521,16 +522,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 Sun Feb 19 05:47:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKF1h0xTmz3smTR; Sun, 19 Feb 2023 05: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 4PKF1g5jtKz3L7b; Sun, 19 Feb 2023 05: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=1676785639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FDbOqbJ10Pit/hnGju47rsxLnkEcTrQTCnABjflnNmA=; b=C8xNigVgZvLu7WVXw4F3PTNu1zraHb5GhyykmbvlbKhB+ZwFrNVALZvZ2hhqcXt7ZEi82F n4aqpSJeGGZuegNn/0RilOwguRynMQ4WgkQf23a2gpx4ID2qRZR2X+XV3HiO2RPiXuvVTm Zwf5a4svjU8TroexV8PHU6V6n4jsMkwN1MulCTHd+kCkskkJC7oy/6dOdU91TT3jB5vHGL R/IvtkMi3Nly59mJ/TQ8V224hFRzM6BaOc1xEeM39roH4mqLFfNN0Q5guIXce3AFTPnk7p rLQn5+1Jp+HQWkfCoyujzWuhB4Nr4zsV/C7i7yILdzzU4uEcOeYErq7SU7NWaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676785639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FDbOqbJ10Pit/hnGju47rsxLnkEcTrQTCnABjflnNmA=; b=SSrC79xbN/j8qenWQGs1gHjtsVzkofPMaycg4knzEjueVXdCq9eJOrhkoARz03D5cuJ2dc K3GEfoHC9uT2qI38I8QTFCq4RihYj3CMh5SbrhmA+lGX4YM2QNQXKshxDjb8ChOIrS9Xtn BQC9uLzZh9Qm9ZbT5tmjjANL5RDKw9MU4/nTBj55+lmd2OlU2tO4gp/7yl1cN13XGqfeX5 tqmN0lZ0Ci172imPYHQet4ACLvjF0oIhpx+YTQxjsKex8rHJs9uxt6qoIIkU3+ALIpv8MC AyM9j+wSE2WjSJc6P9eNZwZ9jhKVlHd2kacoZ5UfCxY/0/EWauWLjaVsdC1H7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676785639; a=rsa-sha256; cv=none; b=Ru7SbIKOocNq2vc6TS7Jzad9C7YsOHyjBYaAndxA98lHnvYock8hXoBn5JIS9TzYHtn83/ 5W17klDoLL0uFvyrFH2SUehU/jG6giYP/RXkt+P2cG5KTtRsIhM/3OaI7agDiQ9oaGhLHZ 0Py6Wk26GRt77x+yD6Uz3w6pU7+FBBMiH5yqeo/YiW/wcjqFWWPaRqWtXJG4eQfn8u4gsQ p2OQ7TnrUw5V+0y54ZjYULbgR3zIR2e12GYUvi1KKz51XZI3C27EC8/jyevHoPvkQBKMYx ZyR+a2mDviArnKivxo3JVadoSYTqYXLnFbo89kuWksjAx494JpFfzIBfZGHQqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKF1g4D2czqsT; Sun, 19 Feb 2023 05: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 31J5lJos097202; Sun, 19 Feb 2023 05: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 31J5lJHQ097201; Sun, 19 Feb 2023 05:47:19 GMT (envelope-from git) Date: Sun, 19 Feb 2023 05:47:19 GMT Message-Id: <202302190547.31J5lJHQ097201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1889a973af24 - stable/13 - sys/param.h: Add _WANT_P_OSREL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1889a973af243373b1859827460910b1bee7495f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1889a973af243373b1859827460910b1bee7495f commit 1889a973af243373b1859827460910b1bee7495f Author: Konstantin Belousov AuthorDate: 2023-02-14 08:52:14 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-19 05:16:25 +0000 sys/param.h: Add _WANT_P_OSREL (cherry picked from commit 5942b4b6fde3f4ce6d0295fbcf135f552f92c607) --- 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 7c637fe1d6ba..fb5854910ee2 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 c5dc10f1c3b0..74329bdb9483 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 a6c4ee60c2d5..6fc6a2475075 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 5d97c0b2dffb..909ff0ef1d8b 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -78,7 +78,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 Sun Feb 19 05:47:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKF1j0qntz3smHr; Sun, 19 Feb 2023 05: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 4PKF1h684sz3LDf; Sun, 19 Feb 2023 05: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=1676785640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5R+H/pgBaZd/+gqAbOeVOq3IBKBm0Rafcyc01ArrCj8=; b=vBq3XvLn3i8nFFuwNlZ45HyvDNkloRPmK7Yshj3G/smUBP7EWdCLOvriuttSVs0aQ+3xwh pct1la34bXlHy1rxSLMdRfDJmogZ9db0f14+7fewYoRr/O6SeKAybxh9LM27gic4Vy7od5 vPk19hWPNkhwSkKp5767JXSJTAW2akrPCv05IzzDlnXRV0dbeD0b25aETtz8DjU/xvxl2e B4yWXRqKwE113zUHCKT3ebsz6+GxrGvszHP4h1e7EZ7Uc2a/+8y1qmS2Bmvj617CHRsp19 0Suje+VyW4+U+iKCv6sRilsdQnNQ59QL54Rd+8wGrm6h4cNejSvkN40uEeQHwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676785640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5R+H/pgBaZd/+gqAbOeVOq3IBKBm0Rafcyc01ArrCj8=; b=nxNDaNmxynokm39ty941PaYUA5iSo4HTix4d1XOlrdrI3bFU/mv6PlawwzM/NdfSOUZ8sv AC2RKw9QKnWec01cZMHLxzP8zHzTQS0ISZOJGXwnpc9RDeKvbXK6+pJNjhp2iLY/KXlzXU NNjkKpgC/whhytXKgmBMdNL2oSGU6aTN45cPLmJ2jivkR2KUMhsh8oo906r+DLPEVKKNpx 1WBMoVs8TWZCmjm7gBI6nY0fzdVO6BPKz62HzXa4+SH5Fhpdqdx/IoRK2F5Qifv8Y7Akqy HHKpG89TyXTpZpRviQLRp+h6TI0LL4+7z3NTtEYSVTA2gs/vZHTVN475mQlp4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676785640; a=rsa-sha256; cv=none; b=clxvwuMLKQEtYfmqin/GyBDY0M8xCxxrtF/LbAvmgLT/UP0wEdQtaSODvaQxrA7UW6q5D2 b9tOcr9/PcPVR8XLZFgBD+xTl/ndFeYLY7czdmADs7o64Yh1noAjzxuNKHFlxcDttsS505 155WbjakaMV0m2pX7L2J2Cnz41m+OGVAbOn9Ovzow15BhSXGWbe37c9imwiQnaO7yLLbe7 ZEvse2ayUWS85Mp20nqHodXmooJA6w0UMu9oBtwlCCI00DLksILJolDc7Q6Zl8zaO1Jd1i pRziRpKvv/G2cAx1z25/laaFXf00iFQ2MJxk4oLAzJmnwTBx/2P4dvEWcM+6+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 4PKF1h585TzqsV; Sun, 19 Feb 2023 05: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 31J5lKGr097228; Sun, 19 Feb 2023 05: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 31J5lKM8097227; Sun, 19 Feb 2023 05:47:20 GMT (envelope-from git) Date: Sun, 19 Feb 2023 05:47:20 GMT Message-Id: <202302190547.31J5lKM8097227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d152426ddf35 - stable/13 - tmpfs: remove bogus MPASS(VOP_ISLOCKED(vp)) asserts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d152426ddf35cf7fd69e95c024f6a00c582ef809 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d152426ddf35cf7fd69e95c024f6a00c582ef809 commit d152426ddf35cf7fd69e95c024f6a00c582ef809 Author: Konstantin Belousov AuthorDate: 2023-02-13 23:23:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-19 05:16:25 +0000 tmpfs: remove bogus MPASS(VOP_ISLOCKED(vp)) asserts (cherry picked from commit 9ff2fbdf2ded59e276fdbf7ef7d18c726386b6fb) --- sys/fs/tmpfs/tmpfs_subr.c | 3 ++- sys/fs/tmpfs/tmpfs_vnops.c | 23 ++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 1c0b4406e460..351530a56698 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1108,7 +1108,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 0074e3203bbb..aa4089b7c50d 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -222,11 +222,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); } @@ -549,7 +556,6 @@ tmpfs_setattr(struct vop_setattr_args *v) int error; - MPASS(VOP_ISLOCKED(vp)); ASSERT_VOP_IN_SEQC(vp); error = 0; @@ -592,8 +598,6 @@ tmpfs_setattr(struct vop_setattr_args *v) */ tmpfs_update(vp); - MPASS(VOP_ISLOCKED(vp)); - return (error); } @@ -723,8 +727,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); @@ -743,9 +745,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; @@ -794,7 +793,6 @@ tmpfs_link(struct vop_link_args *v) struct tmpfs_dirent *de; struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(dvp)); MPASS(cnp->cn_flags & HASBUF); MPASS(dvp != vp); /* XXX When can this be false? */ node = VP_TO_TMPFS_NODE(vp); @@ -986,8 +984,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))); MPASS(fcnp->cn_flags & HASBUF); MPASS(tcnp->cn_flags & HASBUF); @@ -1302,9 +1298,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 Sun Feb 19 05:47:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKF1k1zPsz3smWK; Sun, 19 Feb 2023 05: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 4PKF1j6zXRz3LQF; Sun, 19 Feb 2023 05: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=1676785642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4q6fVlxEmlUg6IV7lMRx7izikmqr9MQnvmOqvFYuCNg=; b=x1MgYvOi9jmTH/OfMOWa5jvgV6geS1f+0WtIRVhfPrrNSClIKThZvyTaAXuIPW5RDU++0N OFe2w7XbH4nzB8vYQgWofScGa+SK2UzHAwf0UysVZbYXsws8ff7tsDBcIyV8oySmAAQk4/ hoooJUhrLrnzJ5jGMXUcWUcijrbNiOSh36JrqaVjP0rl1pfu5z7O3641UHEcXgF/dHdOp3 EciuPVkwZ752NlwcT2oQ5uzRw2ms2Ayl3nRZv9n5KQ2vt804sP/SPmkhVFQUEK7fsc+K+p 1xqeyXN0kRp+p9XeafY5SkLJB4b6K4OUNCNvCJla0nL9rSLkiKqRg1smW2hY8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676785642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4q6fVlxEmlUg6IV7lMRx7izikmqr9MQnvmOqvFYuCNg=; b=AwZTvnxrc/nB+hIbs3Iz4iDZzdvDjgNyuEzDaHYyZ8gmiZW34P4f4lN4QYADTwT1err/VM AKes9aoyIdL0NoAZ6MQOSWvcdoWxqIkhtfCMdEgz3/0j5mpxGjNpCiKXMqqGDI7ajjTVdE u6BgKEr7ctL94dmC98KXunJ9xzL2DP3MdvS2e96OtaVu7JDlq6TQgk4zAdg5ptrQSuvGzf MvHVoQ25Mb4yP07EhGTtbaUtloI8841w3gBQcgZuplDYx+3oXu/XisQsR34mg4fEdj7POA emGtu9OydlQkVmLeSacHNroH6pltWhGDWkUrTgyodoUKa0rkHVBhp9x9nubKzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676785642; a=rsa-sha256; cv=none; b=T6bVghiHtP/2qAU1WW1asBoApFdmnbUX1gYeRXG53foliRYWhK88hxX8N16D5MRT8sS39C h3XctIiyVbBYfUWsQ8Ei4v9G/MARyFkTd4OGEQaWtJRSW07HHiRqVDxG5imPSJlYYN7e1z jp3UnK4+0fNgfhPq1b2jpbCDnDezcOlUCAtFzkqEks5Lw/dq7uPhU6lIvpEfE+cb/O2PXi tdnXRis/9g6p+koc6evNhMN/yxNPS0g0CLWKcMG3XBK1tkfLEKbWpEyicZGV8eMDEYbsZf Buena6+LFHIHXaXQf+S3EbU2X1pNH1paamKS9sLd3nqXnbb+RffUFDgRVOY4ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKF1j65shzr8m; Sun, 19 Feb 2023 05: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 31J5lLLg097247; Sun, 19 Feb 2023 05: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 31J5lLwC097246; Sun, 19 Feb 2023 05:47:21 GMT (envelope-from git) Date: Sun, 19 Feb 2023 05:47:21 GMT Message-Id: <202302190547.31J5lLwC097246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e6bc80a3dedc - stable/13 - tmpfs: remove IFF macro List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6bc80a3dedce1a45357880963695dc74bdc63cf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e6bc80a3dedce1a45357880963695dc74bdc63cf commit e6bc80a3dedce1a45357880963695dc74bdc63cf Author: Konstantin Belousov AuthorDate: 2023-02-13 23:47:44 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-19 05:16:25 +0000 tmpfs: remove IFF macro (cherry picked from commit b918ee2ce4850253ddd884e39dabecd6e96bf474) --- 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 30c80ad70d48..e7928d4bf9dd 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -490,7 +490,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 351530a56698..bc9e1f08391b 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 Sun Feb 19 06:48:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKGN90FF8z3sr6h; Sun, 19 Feb 2023 06:48: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 4PKGN86cMCz3jBD; Sun, 19 Feb 2023 06:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=foCrF3epjHpnw68BMvEQYSalEpQAEZcz3vxakhoVffk=; b=vp7kMHSYx2wuzpDFXLSrtA7RusQcTLXHPAG0En7b6CCDyhlB1o+e4f8md7v92rdnvFJlTu x0a4YV92DN19q0J+wlIw0ecuvX4zb8WSoKKx72fiZ33huuD6HA09rdLCLnrHytpJwcUg+f NlXw1zccypVG9QQoeCJdGZaAbFa6vnPcDdaI79vVMIwAng5SLuL9y+ehHFUcOpYnFa4WY1 oRzIEOWXvJoT1xGkiWq1tD5Mue7CHEWN5n2tDmXXrnQKodSqztIVn6Eo5ehobmdci5Npd9 +uXXSFixPDe5EoFpTMoSNrUXpQH6TRCGEPvv0FV3jvVXsRMw7m0xlEUOTgw0sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=foCrF3epjHpnw68BMvEQYSalEpQAEZcz3vxakhoVffk=; b=NACw71IOiBPf4Qm9hCWg1p1/7jmJPMZ7vd0snDHdrcav0DuBQp3Tc2i1E4GQyRtCnZh9PF VP5cme0u+aXtn6XMkq+AqtsT3dPhCq3XqG4800j5JfJvIMDEtiQXWh68sDcqcqEDErBXBH Y/ZqnlahMxs6+9m7tNbK6mdwG88MpmU4JvX2012uZHmt8r/CFLC5S6KLnxT4k6wEAYYmhf eTQoAC+e8/3qIF/LnamkScis3cmWvfsazyC/sChyB4trZoPa3QMWfOooFVRnD9uINjWFd7 2MZV67lu7yh0fVSQVI4/X4bJ4pA1SM2B4AUg7Cy5v/UVXo2ceJNxIetsxb34bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676789304; a=rsa-sha256; cv=none; b=xOAU6EpNZ0Py6uN837+MtuFcsy5uVtMD4nLs5PNOkHd72qv1EvhXRy2PoRn8Bu8K5yDZoV jrN3mcZMQrdBQgMc86My+mbOYI2WsOcbhfP7+xfYp/4446hcT80grEHeASO+IZ6B3qoyD/ PFfEMQQPB1tyAex4lVLWCQ+7+IZEFCKQQ6vwg5vAyiOBnhHckBmjDcoggwNmbwr/JzN0Cc cKasmINg4AtTL9RopUw+NxgGjWtG++ouZuRzYHgpa+J6U4n51FRgW0e4tzyavH8icdH1tI TVagV1KGQ/3KBaQFnGlnh665BkLJ0YQLpw/chH3hNjmH6hr+D3aQEXKmf/y47A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKGN85gYNzsLd; Sun, 19 Feb 2023 06:48: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 31J6mOlY082585; Sun, 19 Feb 2023 06:48:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J6mOiQ082584; Sun, 19 Feb 2023 06:48:24 GMT (envelope-from git) Date: Sun, 19 Feb 2023 06:48:24 GMT Message-Id: <202302190648.31J6mOiQ082584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 0c479a5c47db - releng/13.2 - efivar: Try harder to find label's efimedia List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0c479a5c47dbbba7b6ff3a867e0981749e3262a5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0c479a5c47dbbba7b6ff3a867e0981749e3262a5 commit 0c479a5c47dbbba7b6ff3a867e0981749e3262a5 Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 06:46:46 +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 Approved by: re@ (cperciva) (cherry picked from commit ccf2121d59ac51e1a0287d75262d48018d09cad6) (cherry picked from commit 9ad4c0468f1924cf7bdb9830bb781de9ca095c61) --- 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 Sun Feb 19 06:48:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKGNB1RzXz3sqqZ; Sun, 19 Feb 2023 06:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PKGNB0J9Rz3jJc; Sun, 19 Feb 2023 06:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=czW7vTZOBA5h1pId4uXmqubM6EyUCq0vErSeLvhZNj4=; b=CedqDT83J2LXbGclvbotAtdkHO2DABsvIswKqXB1f74cOAPP5cGZRLyV50Gs7xiu71hdJ0 N+8WBCnaWhhUgse5eooH2leyiMA0vY0WUNmA00ucs2KWX6t8rxZf2oKmysBuIl/f4l091/ /MtOOhA9bdfpbcrVaIrsYNsE7TRf4WnFGhOS4XygRW4CdyGfOg1f/huzZRi17upgbOEi9s hdof5suOU9tMpDg0O2+UZRSDX5b/h3ZvKOdBXpjbcDSm/6uwbUQv0QArthAB1AORihdhaa dmMvfaozGmY6sGMArbgSVRuUDHs1Hiivw2DMMBE5g4n8OlWDdWh00lihFq8QMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=czW7vTZOBA5h1pId4uXmqubM6EyUCq0vErSeLvhZNj4=; b=EIg8M2PbmeqJfq5/Z61K3HUb1jmZ7tnacSi3ryW3DZrY2qFjOHa0SKHEZwHUpGiIwq/g9V EESHGhBo/99gqzRK+K6AnEcrucZHWywdcph7F+zWQrUkQXZ3lzpSkT1gWHu733CkNy9MHE rCHlSeZ8/DGdbxN8IvJuoZV2nRhMP8z2rK8mN52rKgYPpTBNtCNLt+3AVQzH9/gvxKPHNU bVqlgPcHLGOTgIsUl9VGZ1IPw4NsQctPVc7qD3hcC+FgfAFO2c3Z8ljcvKDT6smuTRbz2O WvlxkQLBL0VFI1APrXFQfo52Lmpcs/zalqkx+IhK8vCtJuIC9TCzykF6UNR6tA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676789306; a=rsa-sha256; cv=none; b=SrQemRYOjF914zRD/qGzsONu8jmbOL6Z1vwkBW24+ZoPgCpx4MZlW5DQZxskdWtGBZ6/iv 9Djx3VMzDyA7sHgC8MjZJWQADMQRlVcG7/O13j4P2JpZfNinqcqm2yiqqbl876X1lJ73dX K4nqvqP7gkyTQgwhuKWWpVRUlRXsJAbm7TC7jcU4Bh7rPazXvq9bTB40TxbA8XXSc0h10C VhYpmbu1N9GsAkNmuCrqGsEAeIyIDkRnVjZKlCdh35q7EwvlBpxoPA+wyL/a/lG4WWp+Qe iwjjoUVFrrNZsHQ6v2GZZxUZZ3C7mPijod+B/xdEfDQWW7Oou9bg5tVS7Fr1+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 4PKGN96WCgzs5m; Sun, 19 Feb 2023 06:48: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 31J6mPEE082607; Sun, 19 Feb 2023 06:48:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J6mPIC082606; Sun, 19 Feb 2023 06:48:25 GMT (envelope-from git) Date: Sun, 19 Feb 2023 06:48:25 GMT Message-Id: <202302190648.31J6mPIC082606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: cd475287ee5a - releng/13.2 - efivar: Allow NULL paths in build_dp List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: cd475287ee5a24b994cfad80b08c3d2b533b5dd9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cd475287ee5a24b994cfad80b08c3d2b533b5dd9 commit cd475287ee5a24b994cfad80b08c3d2b533b5dd9 Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 06:47:04 +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 Approved by: re@ (cperciva) (cherry picked from commit 49fd6affdbfe6af53f119ebb27ff5e5e292e1f67) (cherry picked from commit 82c0aea8f3c270c6d20b093cf711d4bb1472237c) --- 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 Sun Feb 19 06:48:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKGNC2h70z3sr8m; Sun, 19 Feb 2023 06:48: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 4PKGNC1FmCz3jX0; Sun, 19 Feb 2023 06:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AlkOIgOPX1rxLe2sLiPOqWraX/6GAG0yC1lTHmsO5Ok=; b=tPnF1P/hIf5KontlsayTp/Myg2+Goza2SVtPhVbmq6ePX8lrwyNEnz5jm21CdnLy5+HlQg j9n94tOybAuiUP8AkvxI+iNNVoePs8htZF+QH8IarGNZTshj07amW3GR6gvbnk8fQIC60W JWzKGbX+d5bQ4KIY18hYVfmhJdpuGEyn8TatC3kLd2gneMsBW0NoDwrFfQ6GAxHysQG6gb DkX1fzJ0L1eRbWc9uXz5q7Sd1TIZGu9xp6bFLg6oGHQawEmqp8zDn+F1r/tTsTQ0iw6cve rMuCWH+X274afZK3joxYF/kiFZEV9YBY4viNDLmuQiGzujaoQzlfAb84w+UaLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AlkOIgOPX1rxLe2sLiPOqWraX/6GAG0yC1lTHmsO5Ok=; b=W4hIKPl3Q8/8Tm4T2cSGc//+bpsX69xWxVrfa9nLj7KFLxe9h8zoerRLN3+dnCKwuByTi3 8/K3l5UI25Qxmovr5ANo4chMNbcgz1QxXf7aWYqXATdT6LHE3npp27vgIvy/hc5gSv9dGQ OdKV5isDa0XqiW/WaJHiZVhCo7xSeOdQvN7cfo8JTx0iFnOf021EJ+CqKRwD3BR3QibI+n TpYj5WfGaAXHp3D3M2/Lc7X5OFQawXI2VOwJKNTrHKyIMGx7S04a2k6oFwzHIHXwvFM6Uz 80z7ELIjL1KTw6WWysrlFg8sw8PO6IEObJmPqxPuy0k5U2xBtxWw5baN5MazQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676789307; a=rsa-sha256; cv=none; b=BmT2IF9wmjtCgX8BulE5PKv2kTlyj1FnNtlJJJp8jHXJ7yWMPhBAw/WdwavCyw2vbtqNkI lgUGqKPuCULr7SU+Jy2vIrDMblPi2fYWW2zi0wvfh2qpcFL70M4bjryG992Hw+dTuvxgML VgGP4+NAUK8jLm49OGE42/GVDVgsKBWotDhF9MJNJ69mx3dbOvC9U27PPVkdOY7IMw59xK JC1BmWBvgLrtNyf7yi787oCAm1T4MXp9EPbtRfWVIv/GNE3VvdimZw7MmA1UvrcE9yLrnM Xt4BBHZbK/8jPuA85on/EW4RLpocc8OhnEE7zPpCmjgTP+YTPuW9SkBiMs3bZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKGNC0Lpqzslm; Sun, 19 Feb 2023 06:48: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 31J6mQhj082630; Sun, 19 Feb 2023 06:48:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J6mQ6j082629; Sun, 19 Feb 2023 06:48:26 GMT (envelope-from git) Date: Sun, 19 Feb 2023 06:48:26 GMT Message-Id: <202302190648.31J6mQ6j082629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 711c0ebd8342 - releng/13.2 - efivar: support device paths as well as mounted paths in path_to_dp List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 711c0ebd83428843cc88bb43bb6b78ef60c7b011 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=711c0ebd83428843cc88bb43bb6b78ef60c7b011 commit 711c0ebd83428843cc88bb43bb6b78ef60c7b011 Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 06:47:11 +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 Approved by: re@ (cperciva) (cherry picked from commit 57d5ca4eeba6192e91044aad86fca4429966cfac) (cherry picked from commit bae5c36257ec5289631abf49b33a4041acc84e3c) --- 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 Sun Feb 19 06:48:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKGND51Hnz3srCC; Sun, 19 Feb 2023 06:48: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 4PKGND1m3cz3jZy; Sun, 19 Feb 2023 06:48:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bvndZf6lbtAxtDi+srG0IfMRcU57l5Wzz3pWdyA+/UA=; b=t7hlbddPRfsoM29QZgYvDBzmbLDGd05LSSFF8ZUGvg4BDZmzSL0sfwWs3i2Fuizi9rDAsI qwuhybTxcZJRtk3y5yuzEIV+46DoV7RmjGOTHEUcacnL/NcsFAYqBoyuu6+Uvpd1qURRbs IX2Mz5v+t+9XUxqlVH8UADFcEOnQWFBG4mPjw4VU64WEnWfVY8zQXE5UQWXdRP+bjTYl4R fPDA5M3YVbqVJ1APzaeWRiVOKif5Ga8D7dvqQdI5NbwRvZgDw6grZzryjh8Nw5oqYBoWYe jKh+UNaJhBOVW6r3U5oLl3tY3qyQxYsabvM9jKrgXbaj5kwgw4CeUjrllR125g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bvndZf6lbtAxtDi+srG0IfMRcU57l5Wzz3pWdyA+/UA=; b=ShDnm+JMR+r9cFjUphtEHpw28j6Vh3Lzm/nmHahdXQOW+A62tGSSyZ56iNFECl7CEqHmft 14OGGhLmr4l0QM7FFZ5imJ3ph60aclbjj4dNFL2UNxWIZNpi0JoIz6+hgAiSxGrrOtNl48 f4DkMM3aNUf+7Lf/BZ6ROLANmd/vrxkRmOnQDSaBixf5cLxuJ/EiHfBxh5gecqFIuNDQ8/ Wi3+Gjc6UwBCegkB87+itpdNnuNGGzxEXTKdyaVK1qc5ga8KztVufRnY827Jm2peEjPlw5 jU30So01og0UDme2eopOYT1LcJ6cq2nK5PN5E8FeUOMoXhxQtOrDPXUgEg0USA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676789308; a=rsa-sha256; cv=none; b=nEvrVslTjgNZrv+zL7nOBwxYoXjKGS1A6itqBxN9izX9BWeRwYjptLy+DbDocUNr89k9yR eZJ7Gupe8nQCJ4b3Mirb0eNeKZkWG7Wf6e0XONhG3c0XfkpmnzW8as6KosXLMv7NP4+J4i extMCKDcDCiCUbCp9MWT/zOKk64VuP6iQkKPR7YMgvyfaTIgll1cchqkSDfHjBEmp4VGCZ 00nzgD9Z57A4E1U1+RPVaLO+Bnwpcz4zEyDkad9S3qIKoQMHjc8je6folPy6UZuZkOjYeF RxLvtyuxwnzhSJwgLM+KW24NGMpKIChRbUOe8ikr43AtAJaMmSjJO7CwHm8rIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKGND0rvyzsLf; Sun, 19 Feb 2023 06:48: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 31J6mSD7082649; Sun, 19 Feb 2023 06:48:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J6mSvI082648; Sun, 19 Feb 2023 06:48:28 GMT (envelope-from git) Date: Sun, 19 Feb 2023 06:48:28 GMT Message-Id: <202302190648.31J6mSvI082648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1a492583b50e - releng/13.2 - efibootmgr: Add --efidev (-u) to discover UEFI's device path to a dev or file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 1a492583b50e8f74a5834c1c4c5f030162190a85 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1a492583b50e8f74a5834c1c4c5f030162190a85 commit 1a492583b50e8f74a5834c1c4c5f030162190a85 Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 06:47:19 +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 Approved by: re@ (cperciva) (cherry picked from commit 9a7915299484a767fbffc7234b8dc45c29954cca) (cherry picked from commit 8ab17c6dd1d8e8056e5354390f29e0f36cf4e406) --- 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 Sun Feb 19 06:48:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKGNF6MZxz3sqqj; Sun, 19 Feb 2023 06:48: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 4PKGNF2YZjz3jS5; Sun, 19 Feb 2023 06:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rs2Y8Aq7DfiPh0SrVpiH5igSNbNcKyRK0jTrD+KgrrQ=; b=XWLSjHSLYjKWFmMoMO13EFvhst+YI0tkfgkczbgCdHo5xVakvHXYIuTQwEhsCTlwHwZZZx DeKd9t4jQJaJaqMxJk0sqitKCIc1vbccK/7GK1tb5NXD0fgp1Z7UwaJjlxR95tYNp3m8v7 HXcFVCII9Y3INpQWljlSFtOb2mG0tLcBVV9aiQScR+pXjigy2bKa3aZwf0A3Sz7k/vj5yZ kAaGttE6ptNUSvvt20gOIP350PtvUwmzN3gnrt2GgwLaSvrhVhn6m+6VGYHV9TIJ5I49um DWeKV8SYEXjJ99EWP0AVQAqUL2/EyLZvwmI+6CkKG4EAyTemAgCAlOAkRDxSgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676789309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rs2Y8Aq7DfiPh0SrVpiH5igSNbNcKyRK0jTrD+KgrrQ=; b=P8b8vXr0jvCrd8enMvdA922148KnZYIiEGpjatRbxeNUQXXkmHt7u2eEX2fpEbfhv0ciCH ubU3vuTZ8dc7VpHLp4Jui/cXyLyOVa01ocgnDFPFHRnr97+Hns4Jdk1RqT4baDLbIkPt08 /CimJnqHhjNnI4KulEwPzgIavkYh0X2rb2aA7PXWoF320Df2oJWByRGpU4zK6DEYEJ/DWN cjE6Peh+Kn2UelD2q0My4i1igroGLCB/LF1w95vsnA3iJUqyMp52AEmxP7j29aeBa0J0Xq JbEo11IzwiNTFsM7QUtPwzeKbG4mzgYOjht88dxD7QEFKMx9/MwzeosBJu+aiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676789309; a=rsa-sha256; cv=none; b=ppiM/o76czbcLAq0UycEufs0F/SpARk0DuD/+QeNBNVzMH6pX6ni1rMFBEg5RiavKZ1QfH BXHDAIMiC8OJraj8eqPUgnlS8IWv7B43mZhy/THrWs0ZggszcX2Ym9wrcX2fd23W4gZv1m WhgZ4gbsIVFYkEwTIFYQKxAwjXxgTssaBw2hx19VeNe5OyyJ3c0cOQ9XD3pXOwRmHV88Ok FuHnSpxCXfZn+eB6jD1PYEkK5n7d8q4GFggOfIuEOCZn8pxurBh6Hrh830IviOnxSNSEmM xjtL6f+QmGk5L2n+n/TPw0Xlhk5MMtca2h6b7xdFv9cnvKuXwd0Jo+g7pCLgBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKGNF1g0Yzs7y; Sun, 19 Feb 2023 06:48: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 31J6mTqv082671; Sun, 19 Feb 2023 06:48:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J6mT5G082670; Sun, 19 Feb 2023 06:48:29 GMT (envelope-from git) Date: Sun, 19 Feb 2023 06:48:29 GMT Message-Id: <202302190648.31J6mT5G082670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 3cfda2537654 - releng/13.2 - efivar: Really look for labels for the provider with right efimedia List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 3cfda25376542b65b459bc5af48b2fb0f200b552 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3cfda25376542b65b459bc5af48b2fb0f200b552 commit 3cfda25376542b65b459bc5af48b2fb0f200b552 Author: Warner Losh AuthorDate: 2023-02-16 16:36:03 +0000 Commit: Warner Losh CommitDate: 2023-02-19 06:47:25 +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 Approved by: re@ (cperciva) (cherry picked from commit 2b460910326c4f39068fe2158a0726dc3d362f68) (cherry picked from commit f4d711e7209073404c821c9c26c7c17b87b61997) --- 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 Sun Feb 19 07:04:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKGkl1cJwz3ss6K; Sun, 19 Feb 2023 07: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 4PKGkk6gMKz3mgK; Sun, 19 Feb 2023 07: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=1676790270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EEfRVJQaJ2P00Tr5DJn0b0DLgV6Aer/oIESflcA55fk=; b=IzsBHHSDVdgECIPqUx+UKoqW4jdLkxJRwXgqYHAj0HLjZ5aQaOhUzlGFafCpohmgtfRpHY Tok3n21//T6TRwA9Y/inPCyxfsyhXSKBPxVAo3xThDLecOa7XbBH/bO6PZE25aUYfI/2XW P1rQksfrdC0/PSU4ZTnDXOS0Swi+VeNRgmRWYxq+Cw+J370Aizh2TljjlrJtbVFlU3Jxpu Jie1vvX9qPqWGWRaUn4USExN+VcV7Z+Y8BI4eSI5OMnj/AXbtqwUoCB48Y1ueWeXc8+HcP JQ7U6jAGNTOECZhfT7D3t6eLZButLDxWW3eGk1FkT2+lsw55GPc26CnPnbRMvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676790270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EEfRVJQaJ2P00Tr5DJn0b0DLgV6Aer/oIESflcA55fk=; b=iLZuwEhIEoGRhIiaCQh76cMtlKkF6dyi982GTV/5zgFQrQuSfDVvZziPmi3HKXMH4lz9Sk XDREfcaSShklV28bnaVCQI1VOnzo+W5mYiDThoVvyLYFeLjpeHAX54LQsln1KlsLPjB6tT B6lMKIxTuZ7Zy1IRdX9xBDzwXM9oRpwxC/9oFLdufelyXR4qKFkaPlmCcZaaXGHIaKXQjK Cb7G0rZnrmuyG91pbNgAhV5RR/0/oC3RBVGgJBoWbt3iwdobdpXJgApC5VGAkiKca3Pusx VSueGyOjeOf1i7T3/9rBrEadawj7dfYtWRWHRWajgeLaEJ1KxAz2pT/YFuaWpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676790270; a=rsa-sha256; cv=none; b=nQna1f3Tk/lPww6od7YKMkfspJVAyPBqA7u0w05XaqhEBuayw8Rea7u6AgtUX3ezafXlyS V50ONtdB2dKe4rixFFt3KJLIOkC3+GVLRUpfbzZJHposdVdB8eXDVU+Kw7YAQX8pJuTVZe 8cPRFgY+7naro24A4gDRNhxldgY+b5eML9uk7l5ADxePYslWK2MnPiXYQayDVT9vclsZiR WnNDP4EdtrkNH7/CNiUohdm4l693FUdJZ9kS+S9QJ+Bcw3paqfUK8TJVyNrHAcUsfhPrSx 6VTSg9XrJylQ/G+hRfPXAS1C1Kns4ScZRhL8u1X2pDMam2v2FtYO7oud2iJV9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKGkk5jPgztFq; Sun, 19 Feb 2023 07: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 31J74ULY011667; Sun, 19 Feb 2023 07: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 31J74UAg011666; Sun, 19 Feb 2023 07:04:30 GMT (envelope-from git) Date: Sun, 19 Feb 2023 07:04:30 GMT Message-Id: <202302190704.31J74UAg011666@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: d04c86717c8c - main - bsd.sys.mk: Add NO_WSTRICT_PROTOTYPES like in kernel List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d04c86717c8ca3aa1bd9d8927a37a1f5443925b5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d04c86717c8ca3aa1bd9d8927a37a1f5443925b5 commit d04c86717c8ca3aa1bd9d8927a37a1f5443925b5 Author: Warner Losh AuthorDate: 2023-02-19 07:02:12 +0000 Commit: Warner Losh CommitDate: 2023-02-19 07:02:12 +0000 bsd.sys.mk: Add NO_WSTRICT_PROTOTYPES like in kernel Also add NO_WSTRICT_PROTOTYPES like we do for the kernel. Sponsored by: Netflix --- share/mk/bsd.sys.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 169f9fe50779..b4c053d053dc 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -127,6 +127,7 @@ CWARNFLAGS+= -Wno-misleading-indentation NO_WBITWISE_INSTEAD_OF_LOGICAL= -Wno-bitwise-instead-of-logical .endif .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150000 +NO_WSTRICT_PROTOTYPES= -Wno-strict-prototypes NO_WDEPRECATED_NON_PROTOTYPE=-Wno-deprecated-non-prototype .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 100100 From nobody Sun Feb 19 07:26:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKHCt4XP6z3st81; Sun, 19 Feb 2023 07:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PKHCt3Xkjz3pC3; Sun, 19 Feb 2023 07:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676791578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DMv8A0s2K38tt6VDzdK5oWFP/SH4QQZcVmxURWcwNks=; b=sJvyNanE04Pypfy+j3RhHu3Slg75TFQfP3eIMt8vps7fFhN2hM2tnVfQqiwCQrTnwwsB36 esyFM/KDAI4oDT1PvUpiY7nzhtLfSbTEF+n8SeIk+/qFNnTBaIYG2JdsKmciU3/RtRmIcn Gn4GQLWCBhbjL7CtCBQD93B+FMEPeF0vlOXpWsp9kkCliSNnyws2ee/6xcZAKfIpIteV/i ymszy2THGWPlp3dgl3IwCgSYwJQQ94BMXaWXh4v2VRAZYyLyasqe7i5Mk3HZczG1zGsEe/ yj2Sk+n6oLx7/Uoe+pt/Ev6KEPgveVWvQGEiF3Ypz5iKiAW7JqzvnF1yJe2+OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676791578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DMv8A0s2K38tt6VDzdK5oWFP/SH4QQZcVmxURWcwNks=; b=UlSV1uFdlLfpQvybs5o9NfG8PCUjRbuyfH7M7NLtsD0VH0tFvRz6OHYISpQ+jFUdGU7QtV Ky5s826A7rA7tPIkW8KgfbEpVjvPrO5gqxyVpswFpCbt62Iee/A/fmqY18cX4+XVsLhdxE o2aX5Pnx2EfSDIi/zJ6mT8HSqf67vSATOXclUtrNwr6vIIXctdJzG/+1ldp6/y8C7wIHHc BnBrMHGJ/TEIuZZ/ThheYSQ3S/KigmvXURnxJfiWn0yXdvU1O7wzKCwla42QgdECzuOzBI B6Wnye6cpvQhZ3k91OV3RKADyHkleJQ4iNwtdLT1Zm+9pJ763cVb8ocO7ALVAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676791578; a=rsa-sha256; cv=none; b=B1mqM3jmMV+37OqEcXe1eERBpRlsDjWew3TKU2CG78oY3dyUo2doyNhajalrx7M/JgpXY8 sKI2wKP3cghwx86qgTfs5FU/MXGgv1XfazTSK5eonxi6lL5gFUZFDXGT+omaD+Ud8Rvvf/ PXYorEanhsGePz7h4mCwsfSEVT9aewaHP9jrRgtpOcnxOR7jmyiJJTffD93KDB5JiC6APc k1jYFu0EizXF8FGXP935mgTB/4ot/sglT1pxg7QhsUSFM2nlXGaOAGt8NIUMpCYdBIRncJ fKXiTvko6Uxq9yMjB/rmOlhhsROWHUB+qpFQVtA8kFMQEEH5pNk7FcxrgSQ/og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKHCt2FKyzt6y; Sun, 19 Feb 2023 07:26: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 31J7QINJ039583; Sun, 19 Feb 2023 07:26:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31J7QIvG039582; Sun, 19 Feb 2023 07:26:18 GMT (envelope-from git) Date: Sun, 19 Feb 2023 07:26:18 GMT Message-Id: <202302190726.31J7QIvG039582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: f3f350c5c8e4 - stable/13 - cpuset: Add compat shim to the sched_affinity functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f3f350c5c8e4f6b0d3ff9806881b8f042a9ca925 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f3f350c5c8e4f6b0d3ff9806881b8f042a9ca925 commit f3f350c5c8e4f6b0d3ff9806881b8f042a9ca925 Author: Dmitry Chagin AuthorDate: 2023-02-15 09:23:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-19 07:26:06 +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 (cherry picked from commit cbc32e4c5e8427e0f1032d9d3aa5863dd1538c11) --- 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 61c1eb438142..78a75cc6284d 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 909ff0ef1d8b..d2fbad6c127b 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -91,6 +91,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 Sun Feb 19 16:42:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKWZ83dNdz3rQ4r; Sun, 19 Feb 2023 16:42:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PKWZ80PVDz3PH1; Sun, 19 Feb 2023 16:42:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 31JGggO5062801 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 19 Feb 2023 18:42:45 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 31JGggO5062801 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 31JGgg1X062800; Sun, 19 Feb 2023 18:42:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 19 Feb 2023 18:42:42 +0200 From: Konstantin Belousov To: Dmitry Chagin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: f3f350c5c8e4 - stable/13 - cpuset: Add compat shim to the sched_affinity functions Message-ID: References: <202302190726.31J7QIvG039582@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202302190726.31J7QIvG039582@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4PKWZ80PVDz3PH1 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sun, Feb 19, 2023 at 07:26:18AM +0000, Dmitry Chagin wrote: > The branch stable/13 has been updated by dchagin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f3f350c5c8e4f6b0d3ff9806881b8f042a9ca925 > > commit f3f350c5c8e4f6b0d3ff9806881b8f042a9ca925 > Author: Dmitry Chagin > AuthorDate: 2023-02-15 09:23:15 +0000 > Commit: Dmitry Chagin > CommitDate: 2023-02-19 07:26:06 +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 > > (cherry picked from commit cbc32e4c5e8427e0f1032d9d3aa5863dd1538c11) > --- > 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 61c1eb438142..78a75cc6284d 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 909ff0ef1d8b..d2fbad6c127b 100644 > --- a/sys/sys/param.h > +++ b/sys/sys/param.h > @@ -91,6 +91,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 Does it work to have 14.x osrel value for P_OSREL_TIDPID as compat selector on 13.x? > > #define P_OSREL_MAJOR(x) ((x) / 100000) > #endif From nobody Sun Feb 19 16:48:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKWhf3pYRz3rQNN; Sun, 19 Feb 2023 16:48: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 4PKWhf3HBkz3Q54; Sun, 19 Feb 2023 16:48:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676825314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JpHYV2v2WLFZnORx9W3IFXZKUJJ7oyk9uNcG0+Edo10=; b=qp5CmhoOGYnPQpnJCb5f4GwN6kyO9Y3jsPFvR6ipEZovIOC6jjiMTJ3UDjSIlg7RJg2u9b SYKl+gzcxZNRkd0nUEq1EjZ2s55WhvKGyXi0aPyuyPCf/rVaEPB/8BuPvPjgi8uFY3wI43 ck4VVmGySpuu7+xTHEWfCgbRgP3zdwtpZdKdoEhfyGP4ayKj+W/bLjhu4NnvHfVWobl8LT F/qcO0JrvGd29BgTeC2KFsmBnewmyu82J5V43HFJs3zOj5CcS+9lYYH4iKRd/gb4p4KC/v 7FpPI4jqp1GFbTe4jKM+6J5BpesAqEXCjtATscI8IKdOFxyvHI5d4yCsKhhfwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676825314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JpHYV2v2WLFZnORx9W3IFXZKUJJ7oyk9uNcG0+Edo10=; b=LdMiOVJAm0IfzThe5GslPI7KzS8t0/SY64qG7X1I4Fwl1nzsBQj31lAikKWkGazSWdt+s1 gFPgxsaZr7tTg0vIU6wSgOwVWSjcu1DMPF5DHvtrQh6RjUIEwWGyu1HUY6h86fpkG8LJRN ExTI7gh2qmMyZqjdpUv1bp6tEoS8IIAnmxI7azGAVaeANTEm/YxwaSrPba98JGtjLle1rI FPfHC5PoiiJQfCINmAbsxv1ZlAf9LegzO8iAVWhkEvwFNPIafCtEEj71OB8So+f2gPjtre tQRAhOVncUyt47+UozNTrZEfE+YjUx/45xvGnzr0gHh+OZW+8rh9nT2mWVJqBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676825314; a=rsa-sha256; cv=none; b=ocHmSii30uuu3GBShtZhIFAEAiBzCalmhHXjtl0Z+nN282JptO9VOHLU0TsZul9d/mNTIf fjwzmj800Wl2d9Ui8tPMO3cAbKDGpaO4UOmk8y6vmf4nFaSEJtnLtVuAwoSF/OK79XPQ79 p+pPnJc1CG9FiZr6Ax1m2gIhpGex9xAtccJ+aBGwqj8uWDuRh9v98xzAg6jDaFcEohBAR4 ksiwFNH8anYsIwygsxgleBdig+oe3PLjMehkT3faGb/3S5SCioLePgYjhjiXXGeK8liz8w J88rRXZOmkRTOKjtrT2/y5k0YWhQHv02qyHNbJCKSkrgn/g6gn+q/QcJOAJxPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKWhf2Kxsz17w2; Sun, 19 Feb 2023 16:48: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 31JGmYa0037858; Sun, 19 Feb 2023 16:48:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31JGmYfN037857; Sun, 19 Feb 2023 16:48:34 GMT (envelope-from git) Date: Sun, 19 Feb 2023 16:48:34 GMT Message-Id: <202302191648.31JGmYfN037857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 57756461548b - stable/13 - fusefs: fix some resource leaks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 57756461548b813c288e190900de31e847e412f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=57756461548b813c288e190900de31e847e412f9 commit 57756461548b813c288e190900de31e847e412f9 Author: Alan Somers AuthorDate: 2023-02-11 23:43:30 +0000 Commit: Alan Somers CommitDate: 2023-02-19 15:41:24 +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 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38526 (cherry picked from commit 1bdf879b97b686a8f36fdba050b68f9e7493f363) MFC Note: changes to VOP_DEALLOCATE are not MFCed, because that VOP does not exist in stable/13. --- sys/fs/fuse/fuse_vnops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index eaace113d67e..7fd96ff639ff 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -668,6 +668,7 @@ fuse_vnop_allocate(struct vop_allocate_args *ap) } } + fdisp_destroy(&fdi); return (err); } @@ -1104,6 +1105,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; From nobody Sun Feb 19 18:31:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKYzt5yDXz3rYYg; Sun, 19 Feb 2023 18:31: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 4PKYzt2MZCz3tbc; Sun, 19 Feb 2023 18:31:54 +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 31JIVjY6050046; Sun, 19 Feb 2023 21:31:45 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 31JIVjPA050042; Sun, 19 Feb 2023 21:31:45 +0300 (MSK) (envelope-from dchagin) Date: Sun, 19 Feb 2023 21:31:45 +0300 From: Dmitry Chagin To: Konstantin Belousov Cc: Dmitry Chagin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: f3f350c5c8e4 - stable/13 - cpuset: Add compat shim to the sched_affinity functions Message-ID: References: <202302190726.31J7QIvG039582@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4PKYzt2MZCz3tbc 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 19, 2023 at 06:42:42PM +0200, Konstantin Belousov wrote: > On Sun, Feb 19, 2023 at 07:26:18AM +0000, Dmitry Chagin wrote: > > The branch stable/13 has been updated by dchagin: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=f3f350c5c8e4f6b0d3ff9806881b8f042a9ca925 > > > > commit f3f350c5c8e4f6b0d3ff9806881b8f042a9ca925 > > Author: Dmitry Chagin > > AuthorDate: 2023-02-15 09:23:15 +0000 > > Commit: Dmitry Chagin > > CommitDate: 2023-02-19 07:26:06 +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 > > > > (cherry picked from commit cbc32e4c5e8427e0f1032d9d3aa5863dd1538c11) > > --- > > 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 61c1eb438142..78a75cc6284d 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 909ff0ef1d8b..d2fbad6c127b 100644 > > --- a/sys/sys/param.h > > +++ b/sys/sys/param.h > > @@ -91,6 +91,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 > Does it work to have 14.x osrel value for P_OSREL_TIDPID as compat selector > on 13.x? > sure, not perfect, but it will, ideally it should be something like below, being testing now, I'll post it on phab later: diff --git a/lib/libc/gen/sched_getaffinity.c b/lib/libc/gen/sched_getaffinity.c index fce47fbfc0d2..7c8f37a8cb64 100644 --- a/lib/libc/gen/sched_getaffinity.c +++ b/lib/libc/gen/sched_getaffinity.c @@ -38,9 +38,11 @@ int sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset) { cpuwhich_t which; - int error; + int error, osrel; - if (__getosreldate() < P_OSREL_TIDPID) { + osrel = __getosreldate(); + if (osrel < P_OSREL_TIDPID || + (P_OSREL_MAJOR(osrel) == 14 && osrel < 1400079)) { if (pid == 0 || pid > _PID_MAX) which = CPU_WHICH_TID; else diff --git a/lib/libc/gen/sched_setaffinity.c b/lib/libc/gen/sched_setaffinity.c index b878e1affc41..622021bab3cd 100644 --- a/lib/libc/gen/sched_setaffinity.c +++ b/lib/libc/gen/sched_setaffinity.c @@ -41,10 +41,12 @@ 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; + int error, lbs, cpu, osrel; size_t len, sz; - if (__getosreldate() < P_OSREL_TIDPID) { + osrel = __getosreldate(); + if (osrel < P_OSREL_TIDPID || + (P_OSREL_MAJOR(osrel) == 14 && osrel < 1400079)) { if (pid == 0 || pid > _PID_MAX) which = CPU_WHICH_TID; else diff --git a/sys/sys/param.h b/sys/sys/param.h index d2fbad6c127b..714c6cff5c90 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -91,7 +91,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_TIDPID 1302501 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif > > > > #define P_OSREL_MAJOR(x) ((x) / 100000) > > #endif From nobody Sun Feb 19 23:43:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKhvQ4NT7z3sF19; Sun, 19 Feb 2023 23:43: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 4PKhvQ3rYkz4Q1W; Sun, 19 Feb 2023 23:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676850210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iy8emTBlYOCTzsY+liw4ihATaatqVHA7QNSsTJyNnLA=; b=mMdd9i7330sYtIaHo+R2YwCwImKNIPhiHSBt8/+ZywltZxVrCBx1HB4jhMwdz68JA3kW0g 10MLESm/wew8Rtg2ZKuwteDs6/+1wt8j7hGEc6anIzVkTQlxUR9pkMOlShGJdEi2zQR5ET uS7cqdLv4t/yvav8sImC6+GUCSfWxhp6wwII/JeEfDO4fMYZaWs1IVSSrbSkoLUCnpTpRb 9U1pzd55rn9Li7uaUbyyPN8zpYbQ9EaFbjz2/gcJXJrPRZnHHy4cS9g6d/wPHXZxAxPd5K ocy/yQstrjKeTkNIFLBUZXgiR4xJB0Vgqxdhf0ti/4u43AT602pjZQeyBzJDZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676850210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iy8emTBlYOCTzsY+liw4ihATaatqVHA7QNSsTJyNnLA=; b=mzGqjjo0oqnCubh9BcPVbHv9A3PDseO0JdUp5SHkzcPQra6GLY0ytiA7JmFzIrOhep+W9P h4hOVWaI9IhKlUX8G0a3quXgV/9DV/pD3sPPhEbAI/Q4XQPtYfbpWnB5z0zEZcywIfTqDK RMxPSPzFxy9bOhZ2aiuQNIpDe/uzkhqJnvifR8A6HYMlWWqZpPntV0xlL6KRvT4Jzr9hs1 aRgO0WSLHGp6s9KXSZBAJ+iO78ho/d01YzSLRXCSJjVqZoZeo7SV8T3GfEjg0mfqLLk4Gz 7fOFTaSSmEIHKUlWlECwlXeStK27jdQ4/Cyt9cTxsR+dzqZZbWqbJf21nPjpXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676850210; a=rsa-sha256; cv=none; b=xS9ZLLYxprRKs4NwGAVM8ogA3vM5Yn+31ehIMK4xAKUS4Hh+rsOPOUSoPtcz9QSKQAu0KR fSpjZA3sc6DMrQN7NjXs2vuZ1aYfMItHe6ZIONs6uIzfOIu3kOETej7SFhkkOFVDhnpgLr OJd9LsQdsrdwP5JtYFCyLK1BeXOIImCY7iZBtVusCSlmKASoTY2tI9M/hOpXurdQSQ+eTz rrnsR+vMD7bXaMXiwB/V+AbblFkaouaDeNq5+ADsDmmGWaf3uHqoby+mkoq4a1m+gOcqXH fg6rUHnEVcUqSEv71SK5GBbHmNd/HnOk9vKDrJ6FYS2Y6zzfKgSNPantnC5IJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKhvQ2vwpzLKt; Sun, 19 Feb 2023 23:43: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 31JNhUuC035347; Sun, 19 Feb 2023 23:43:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31JNhUYR035346; Sun, 19 Feb 2023 23:43:30 GMT (envelope-from git) Date: Sun, 19 Feb 2023 23:43:30 GMT Message-Id: <202302192343.31JNhUYR035346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: fbb102b2cec5 - releng/13.2 - fusefs: fix some resource leaks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: fbb102b2cec57181d0b00d81e8de384021f60ab0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=fbb102b2cec57181d0b00d81e8de384021f60ab0 commit fbb102b2cec57181d0b00d81e8de384021f60ab0 Author: Alan Somers AuthorDate: 2023-02-11 23:43:30 +0000 Commit: Alan Somers CommitDate: 2023-02-19 23:42:32 +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 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38526 (cherry picked from commit 1bdf879b97b686a8f36fdba050b68f9e7493f363) MFC Note: changes to VOP_DEALLOCATE are not MFCed, because that VOP does not exist in stable/13. Approved by: re (cperciva) (cherry picked from commit 57756461548b813c288e190900de31e847e412f9) --- sys/fs/fuse/fuse_vnops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index eaace113d67e..7fd96ff639ff 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -668,6 +668,7 @@ fuse_vnop_allocate(struct vop_allocate_args *ap) } } + fdisp_destroy(&fdi); return (err); } @@ -1104,6 +1105,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; From nobody Mon Feb 20 06:16:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKscx3Bh0z3s1qh; Mon, 20 Feb 2023 06:16: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 4PKscx2kBdz3t82; Mon, 20 Feb 2023 06:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676873793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnH7jP/QY49LfWnhJ1iB0WVis1HV6nixvBd3aETp+M0=; b=Co3bVstxUztAER0L9AYPoO/ciATycExssu4+FEVVz3NFiopg1OJvU4UAri1KWwVerKSGQd O3qWbF32KPmQ4b6K7mKuYY1e4drYPZXmKFf4OIzfxV+SrH0sjKjulSiv68c0kG9B4c2uNc Ys9V6j38E49c7epXRfGLPHh4jBZaU0/P7+4vpxYkMVkOWg/l5R9iV1G3QmXAjgJOZ9+L0b rGjgAyGFejDLByqSWOLaqNyxLl7olJS+RZh5bSz0Dua+pNZNZl+NAE4WUAIrm5d0gQqdly 9E4fJhllRO8+hHWTNq2iMGmURzEafbtBd2uPPXDuCsLFecOMNX4LUeOhXUegmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676873793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnH7jP/QY49LfWnhJ1iB0WVis1HV6nixvBd3aETp+M0=; b=Ickk97Xv40q3h5e5v75Pm6+UlfhFMDrJDowpoXxFAFxBhQroQ3BQ+gME6ys4oiRU+nLq/c p3atid7z4RkYL+AaGMl9uy/MmwiuJLcrj4wN6DSiPExNsharwn2ix6HEbScZFXK78B1hEU uks5va9QkHz2G4eKL9pC6e0euO31whlQGoT/DNJQt9bUtFuYm1iRJXDHSpzpp7ZnKheA9q NAg7qYrNwpwo/FTs0fa/9vHpsk6O7zPpBsIZGvK69gr1l/M5eeg+6ornl3ognUgLI4yJr3 D/8hheSGKgOIQKMjqnKaSmRX9hwHmPY880DJ6QPNi15hqyM6yfBDHV5Hbtr+Uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676873793; a=rsa-sha256; cv=none; b=pidkdDmhG4/Mk+y3RnQNxtUNt2dkSpAgmQ4Ev/h1ZbtvBKKy+/tH8UXZSaSHuf+KEx97wu ihhFk9m0szTBXP0lqEFrYNy1xvOjqaCfk3wd0hvMfqnWFrr/gZflTtTgH6PvvLI0Hpik6P HnH2H90NWx9WDnLK7xkrWn1EUi05KZv4pLksAGlLBTPTyXH2LDRuQwEnDp2qzwiK9JuwZz ZMmEftx5a18XZagrBmMldKRzVu7Z3AGWw4l6wDy6wYOKQbLXi8i9jHakWIqbdv4wwP0m2D /wHNEmJwP1doCQ8EBLHkCy9vn/CnLj6eSIUNWnyCG0suKEdwfjncHCRmsw2uLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKscx1nwHzWMd; Mon, 20 Feb 2023 06:16: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 31K6GXiT091954; Mon, 20 Feb 2023 06:16:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31K6GXc2091953; Mon, 20 Feb 2023 06:16:33 GMT (envelope-from git) Date: Mon, 20 Feb 2023 06:16:33 GMT Message-Id: <202302200616.31K6GXc2091953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 0699f0d43416 - stable/13 - cleanvar: Be more careful when cleaning up /var. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0699f0d43416776d87d20d7953b7d686f1e2e572 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=0699f0d43416776d87d20d7953b7d686f1e2e572 commit 0699f0d43416776d87d20d7953b7d686f1e2e572 Author: Xin LI AuthorDate: 2023-02-13 04:56:17 +0000 Commit: Xin LI CommitDate: 2023-02-20 06:16:20 +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 (cherry picked from commit 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458) --- 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 20 07:18:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKv0C2Gd1z3s5vF; Mon, 20 Feb 2023 07:18: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 4PKv0C1PYSz3yH5; Mon, 20 Feb 2023 07:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676877499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3sPayIv40/dtoZQaXQurayq7cwafH+d/FkWULbNg3TA=; b=ZTPFYbUZktmOUcyI8d6yo6GBW+EyzvSgj20T5J7fblMDkmLjPKUMUsAh1Lwbm9DxScIl4/ 1s0ysFvjVFNeTp4eFI0QRQYtLoGQ5wvC5pswtvB8GuCIBLTTOfAwl9MuX/90FuRNs3UUp1 8g7tl9jTBSU/e9QtlETmFbagnTw3h21UgxMYqH0xleGDIY00jvEBLFXi9tAkRPcl8LTXMb Xk9MChjDpDi1HHc8eW7gnC73gLsRCrP1/IEKdHUMSinP9DBW6RlrPElxi4/LuxDDSf+13i CXVy4q3Bukb40cf7ctflWX13n9gS6zz8TLwrL+Zd7WuKgQPDPpJK6mKwevlvrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676877499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3sPayIv40/dtoZQaXQurayq7cwafH+d/FkWULbNg3TA=; b=v13N5jr2B/FXXsBQN7dXS960bIM0pIVWPjbO5VMG6fx8HXyJQt2NXXalikIww8zZs+HCzQ nFULMYOpIuoqho/Paqw3OAiO0x8ru4ls3ucKrWcD7QGIFIOqBauC6bCzSnDnyN+tecRh8a xDpGDCkj5yut8pDvo3Lp/VhAbOba/v824N8LrnjhX3jjvlSLJZipu0Jb7+urx4Vx/Thd1D Ez8emlFhmsu45icBtscmiIl2pdZK3ArUyW79+PzisYA5PTSiUw6P/M1kWUuE1BDyPRIvz4 83S5udLQJ7BMIBHuoXB5z77727Ezj6DIxwoJAlmVSup3eKj687rUvYeI5Mmebw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676877499; a=rsa-sha256; cv=none; b=o+ryCHdTVDUUwaP6xplmMz5B8LxfxHb2MwDV05T1oXCSLP6Cesk8x54wzdzaa+k2X3HTJH GBns/sdTKmDUlGhfbPBRGK661wx5Q33T3My8yi/JuF7Xyz4xtlYBB2EBcim8ovAGvXOBSA Ze//Un0y9k7jtZ/q5bTCloBZixPzXJcpXEhEXDgJHYguj4qPk5IWm7cUXcoQ2mzzqGzVTz dmJxni85pToCGeqZ/n+rmwbQ77bmgZJStG82ujBU0W5rZ49S9VTkrbDTDqZ7lWPHrgn0SH /I5eLbXqsO/1QxQxtlQ4VZKQm+WpizlBK5bGk/vJrHVXZywrNGnmJ6p2KScNnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKv0C0DmxzXXR; Mon, 20 Feb 2023 07:18: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 31K7II1H077354; Mon, 20 Feb 2023 07:18:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31K7II8G077353; Mon, 20 Feb 2023 07:18:18 GMT (envelope-from git) Date: Mon, 20 Feb 2023 07:18:18 GMT Message-Id: <202302200718.31K7II8G077353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 04b24c1069a5 - stable/12 - cleanvar: Be more careful when cleaning up /var. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 04b24c1069a546056dc33fab1ce7b11d9bf89f14 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=04b24c1069a546056dc33fab1ce7b11d9bf89f14 commit 04b24c1069a546056dc33fab1ce7b11d9bf89f14 Author: Xin LI AuthorDate: 2023-02-13 04:56:17 +0000 Commit: Xin LI CommitDate: 2023-02-20 07:18:06 +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 (cherry picked from commit 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458) --- 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 20 08:37:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKwmx0hNZz3sC24 for ; Mon, 20 Feb 2023 08:38:41 +0000 (UTC) (envelope-from bT.1fxwx6od30=goeikkb00wa3=8c508hg6c4@em790814.fubar.geek.nz) Received: from e2i580.smtp2go.com (e2i580.smtp2go.com [103.2.142.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PKwmw10BYz4CBB for ; Mon, 20 Feb 2023 08:38:40 +0000 (UTC) (envelope-from bT.1fxwx6od30=goeikkb00wa3=8c508hg6c4@em790814.fubar.geek.nz) Authentication-Results: mx1.freebsd.org; dkim=none ("invalid DKIM record") header.d=smtpservice.net header.s=mgy720.a1-4.dyn header.b=ZaLuhP9d; dkim=pass header.d=fubar.geek.nz header.s=s790814 header.b=IMZEHnd9; spf=pass (mx1.freebsd.org: domain of "bT.1fxwx6od30=goeikkb00wa3=8c508hg6c4@em790814.fubar.geek.nz" designates 103.2.142.68 as permitted sender) smtp.mailfrom="bT.1fxwx6od30=goeikkb00wa3=8c508hg6c4@em790814.fubar.geek.nz"; dmarc=pass (policy=none) header.from=fubar.geek.nz DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=mgy720.a1-4.dyn; x=1676883220; h=Feedback-ID: X-Smtpcorp-Track:To:Date:Subject:Message-Id:From:Reply-To:Sender: List-Unsubscribe; bh=amHu9OdxrEC9iyodXPla7AD71gqGAUsEp895wRuiFAA=; b=ZaLuhP9d B3HnL2XmHTxn1iRdiUPcT8ZPs/+gT5ogFtv6FTBp/8S5iQauVIGtgbyHXZLmn68BOA0VDnwuCOCBf 5mSfY94sENWjVx7pWnL/HOxPa4n0yAWRNaIS8onosp31HZmU0UwF1HoN9n2k53fKTDUDOHO2WOJjx Gzy5D/FUMf1lfXNgiG6lYcLFBr4n0pjgGuRg37/MK3lXvOuwL0CszjSnpVWDAYvEfb8K57nx+cddA rpamD8pMup76WyBSHAk6wkeNkkTKOQq0EOQag3HYoOLpEj+EQKW4JNzaB21z77wF8se8sDKq+n71n BVnD5PcTEM42BQVMiCYkUE5jaA==; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; i=@fubar.geek.nz; q=dns/txt; s=s790814; t=1676882320; h=from : subject : to : message-id : date; bh=amHu9OdxrEC9iyodXPla7AD71gqGAUsEp895wRuiFAA=; b=IMZEHnd9HVAaimWN88VwYz1z8liAB6CWy8MJY96RCgRjL5y/jkJvYxra2AKjR8AfWdldw ZZDXNcGTMqRGIJnOIG7+/l37nsr8ofc9NfbKrbjJcaKnGylfdbk+AK+ybJjVc+UGN21QEVH ZqzrP1Kc6biqLU0n6Kef8GTkRy2ihV6aT964fQApEmLscaiJ+0TR9ZN3FvJu/qdYbqQLGNW /P6ulpmgvE4iJR/FlxH+ml2+q82uX3ZOByxVYFA5Q5SuA0jP8ZItIWKnGptPPQKL1l3NTuQ LPhYGktse84TQmaudbWzuDCuWWNtLrSz71ozBqyIoR+W6MIbl4HTJpiC1/iw== Received: from [10.176.58.103] (helo=SmtpCorp) by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2-S2G) (envelope-from ) id 1pU1h0-qt4JL3-Hu; Mon, 20 Feb 2023 08:38:38 +0000 Received: from [10.162.55.164] (helo=morbo.fubar.geek.nz) by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96-S2G) (envelope-from ) id 1pU1h0-9ESI49-0v; Mon, 20 Feb 2023 08:38:38 +0000 Received: from smtpclient.apple (cpc91210-cmbg18-2-0-cust37.5-4.cable.virginm.net [81.102.44.38]) by morbo.fubar.geek.nz (Postfix) with ESMTPSA id AE6771D3EA; Mon, 20 Feb 2023 08:38:33 +0000 (UTC) From: Andrew Turner Message-Id: <4754F213-95F0-425D-AB48-E0C694B0C3CB@fubar.geek.nz> Content-Type: multipart/alternative; boundary="Apple-Mail=_2099DA77-5483-4ED9-AF5B-4D930D5143AF" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: git: f29942229d24 - main - Read the arm64 far early in el0 exceptions Date: Mon, 20 Feb 2023 08:37:02 +0000 In-Reply-To: <0E3AAA1E-0B3E-4C4F-A425-CEE13BAE8723@freebsd.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: Jessica Clarke References: <202302021648.312GmSXI049747@gitrepo.freebsd.org> <0E3AAA1E-0B3E-4C4F-A425-CEE13BAE8723@freebsd.org> X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Smtpcorp-Track: 1pl1h09ESm490v.8AGeByCQ74usq Feedback-ID: 790814m:790814amQcrys:790814sWeT5H4KTL X-Report-Abuse: Please forward a copy of this message, including all headers, to X-Spamd-Result: default: False [-2.90 / 15.00]; URI_COUNT_ODD(1.00)[9]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[fubar.geek.nz,none]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; FORGED_SENDER(0.30)[andrew@fubar.geek.nz,bT.1fxwx6od30=goeikkb00wa3=8c508hg6c4@em790814.fubar.geek.nz]; RCVD_IN_DNSWL_MED(-0.20)[103.2.142.68:from]; R_SPF_ALLOW(-0.20)[+ip4:103.2.140.0/22:c]; R_DKIM_ALLOW(-0.20)[fubar.geek.nz:s=s790814]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_PERMFAIL(0.00)[smtpservice.net:s=mgy720.a1-4.dyn]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_MIXED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[andrew@fubar.geek.nz,bT.1fxwx6od30=goeikkb00wa3=8c508hg6c4@em790814.fubar.geek.nz]; RCVD_COUNT_THREE(0.00)[4]; RWL_MAILSPIKE_POSSIBLE(0.00)[103.2.142.68:from]; DKIM_TRACE(0.00)[smtpservice.net:~,fubar.geek.nz:+]; ASN(0.00)[asn:23352, ipnet:103.2.140.0/22, country:US]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4PKwmw10BYz4CBB X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_2099DA77-5483-4ED9-AF5B-4D930D5143AF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 (Resend as previous attempt appears to have failed) > 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. That is outside of the scope of what I was trying to fix in this change. = Having recently talked with one of the Linux Arm kernel developers about = exception handlers raising debug exceptions I believe there are subtle = issues and moving saving the far register earlier is not enough. I=E2=80=99m planning on looking into the issue, but I=E2=80=99m unlikely = to have time in the next few weeks. A such I=E2=80=99d prefer to get a = fix for an issue that is being hit and I=E2=80=99m able to reproduce in = now, and to MFC it for 13.2 rather than wait until I have a fix for = both. Andrew= --Apple-Mail=_2099DA77-5483-4ED9-AF5B-4D930D5143AF Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
(Resend as previous attempt appears = to have failed)

On 2 Feb 2023, at 21:00, Jessica Clarke <jrtc27@freebsd.org> = wrote:

On 2 Feb 2023, at 16:48, Andrew Turner = <andrew@FreeBSD.org> = wrote:

The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=3Df29942229d24eb= b8b98f8c5d02f3c8632648007e

commit = f29942229d24ebb8b98f8c5d02f3c8632648007e
Author: =     Andrew Turner <andrew@FreeBSD.org>
AuthorDat= e: 2023-01-25 17:47:39 +0000
Commit:     Andrew = Turner <andrew@FreeBSD.org>
CommitDat= e: 2023-02-02 16:43:15 +0000

  Read the arm64 far early = in el0 exceptions

  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.

  Fix this be always = reading the fault address before dereferencing = the
  current thread pointer.

  Reported = by:    olivier@
  Reviewed by: =    markj
  Sponsored by:   Arm = Ltd
  Differential Revision:  https://reviews.freebsd.org/D3= 8196
---
sys/arm64/arm64/exception.S | 15 = +++++++++++++++
sys/arm64/arm64/trap.c =      | 26 +++++++-------------------
2 files = changed, 22 insertions(+), 19 deletions(-)

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)

ENTRY(handle_el0_syn= c)
+ = /*
+  * 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$");

/* Called from exception.S */
void = do_el1h_sync(struct thread *, struct trapframe *);

This did not address my feedback regarding = EL1 debug exceptions also
clobbering FAR.

That is outside of the scope of what = I was trying to fix in this change. Having recently talked with one of = the Linux Arm kernel developers about exception handlers raising debug = exceptions I believe there are subtle issues and moving saving the far = register earlier is not enough.

I=E2=80=99m planning on looking into = the issue, but I=E2=80=99m unlikely to have time in the next few weeks. = A such I=E2=80=99d prefer to get a fix for an issue that is being hit = and I=E2=80=99m able to reproduce in now, and to MFC it for 13.2 rather = than wait until I have a fix for both.

Andrew
= --Apple-Mail=_2099DA77-5483-4ED9-AF5B-4D930D5143AF-- From nobody Mon Feb 20 10:21:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKz3L43M5z3sKwx; Mon, 20 Feb 2023 10:21: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 4PKz3L3YDhz4Mxf; Mon, 20 Feb 2023 10:21:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676888478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4NdIL2ajb9JSnYwyPHABLYmm59dzL0LvdNPSgb5Bz78=; b=QzyqZTiJzUzIts8Q1sUXrveXWHWaJ50ckkckTk6XCeZ3gv3+tiTSez8Q4vzIjdslhQO0Wb Mj9yh3l+eKLzk5PY2fX+1TuWj+yYf6OUCWOF5wNmZ5BHt4a9HvXYLRD1FhHjZOgArLtPS2 VOeh0/y9YAH5CGDTVyo3PQcFWKn7V22TAkdQFr/cgWgMatHWvf6Ctj8F0xDz6AW9y++8qQ T1BZ7knqHVS1+/F04ASXuxtaREd8YXmu50YtdtAzdnE91i4R491ggA46O3BNg5GihjxWNC L1su5t/47Zmi6ygWLq4nn8uy9sfN04fkZ3biMWDpZfgWlF5T7H3divJA0uJ2tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676888478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4NdIL2ajb9JSnYwyPHABLYmm59dzL0LvdNPSgb5Bz78=; b=r50SxLoasQg9x5+uC+Oih9fAjB7914RGKg2W+ytq3Ja+wcj7V4KC0uBz/iuRSkWL/VO/tA jLW3jiDxVsB8EIRzOo8aQMzC9D5ZuMz8dhopzq1qbB/XigErI22v1xqrlULU9OmYwtPH9P DPCyZRkXf1VYcWL6+GxEBQs0poWbUGfX6FL0QfMWYvl4v9mSwTpcL9JeKpGuxjNryBClSP uV0UgqkejXYynFEc8J88lM209wyhFMptXU/aNEdUlC3cg10XLFxSQ1ETz+qJZPW+vhqzDH uZjnsqXxCrQ2o9jExypo1U5jM0tn2HisM/4x7Jx3ncEAhJwV9mpdRAoEvV8fhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676888478; a=rsa-sha256; cv=none; b=p3LzRjVFgnpeqQVqFigyUE5JjTpYDSnrH6Q9DZyALcxNCW3FNkyN2JslWlZYZyFpDJUdIi Z+3Dnk53+Dkjl1/XWm/qEC68NthCIsGCI0LF2tjeURBSQeVisI1e4IDJukAwKEAufBUOJW wje90tMzYdWjhmfQV6HJYkSTeqcGfx7EyfG+3lECHvspmha69lZckVctkMinwRQOt9m28Y /UtdOLUU8M29hYxNPw7s9IKgesIkmhM4JkvEV14jWnmldD8QVYfukiHbseBXX+lug4oHmg QZnRRRGSuMQwb2Qi+aBPby976vWZGswqRQKfRH6ODsZtv8isjM7gXO+Mb7fnbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKz3L2JT3zdLj; Mon, 20 Feb 2023 10:21: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 31KALI3P044528; Mon, 20 Feb 2023 10:21:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KALIIp044527; Mon, 20 Feb 2023 10:21:18 GMT (envelope-from git) Date: Mon, 20 Feb 2023 10:21:18 GMT Message-Id: <202302201021.31KALIIp044527@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: 828d3c6c4cc0 - main - tests: add netlink large dump buffer check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 828d3c6c4cc0b782e16abb1ae18023734a0b710f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=828d3c6c4cc0b782e16abb1ae18023734a0b710f commit 828d3c6c4cc0b782e16abb1ae18023734a0b710f Author: Alexander V. Chernikov AuthorDate: 2023-02-20 10:20:23 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 10:20:54 +0000 tests: add netlink large dump buffer check Differential Revision: https://reviews.freebsd.org/D38665 MFC after: 2 weeks --- tests/atf_python/sys/net/netlink.py | 20 +++++----- tests/sys/netlink/Makefile | 1 + tests/sys/netlink/test_rtnl_route.py | 76 ++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 9 deletions(-) diff --git a/tests/atf_python/sys/net/netlink.py b/tests/atf_python/sys/net/netlink.py index 16cb746157cc..ec5a7feef317 100644 --- a/tests/atf_python/sys/net/netlink.py +++ b/tests/atf_python/sys/net/netlink.py @@ -1609,18 +1609,20 @@ class NetlinkTestTemplate(object): self.helper = NlHelper() self.nlsock = Nlsock(netlink_family, self.helper) - def write_message(self, msg): - print("") - print("============= >> TX MESSAGE =============") - msg.print_message() + def write_message(self, msg, silent=False): + if not silent: + print("") + print("============= >> TX MESSAGE =============") + msg.print_message() + msg.print_as_bytes(bytes(msg), "-- DATA --") self.nlsock.write_data(bytes(msg)) - msg.print_as_bytes(bytes(msg), "-- DATA --") - def read_message(self): + def read_message(self, silent=False): msg = self.nlsock.read_message() - print("") - print("============= << RX MESSAGE =============") - msg.print_message() + if not silent: + print("") + print("============= << RX MESSAGE =============") + msg.print_message() return msg def get_reply(self, tx_msg): diff --git a/tests/sys/netlink/Makefile b/tests/sys/netlink/Makefile index 880e5e6e4007..b6b35d195726 100644 --- a/tests/sys/netlink/Makefile +++ b/tests/sys/netlink/Makefile @@ -9,6 +9,7 @@ ATF_TESTS_C += test_snl ATF_TESTS_PYTEST += test_nl_core.py ATF_TESTS_PYTEST += test_rtnl_iface.py ATF_TESTS_PYTEST += test_rtnl_ifaddr.py +ATF_TESTS_PYTEST += test_rtnl_route.py CFLAGS+= -I${.CURDIR:H:H:H} diff --git a/tests/sys/netlink/test_rtnl_route.py b/tests/sys/netlink/test_rtnl_route.py new file mode 100644 index 000000000000..71125343166a --- /dev/null +++ b/tests/sys/netlink/test_rtnl_route.py @@ -0,0 +1,76 @@ +import ipaddress +import socket + +import pytest +from atf_python.sys.net.netlink import NetlinkRtMessage +from atf_python.sys.net.netlink import NetlinkTestTemplate +from atf_python.sys.net.netlink import NlAttrIp +from atf_python.sys.net.netlink import NlConst +from atf_python.sys.net.netlink import NlmBaseFlags +from atf_python.sys.net.netlink import NlmGetFlags +from atf_python.sys.net.netlink import NlmNewFlags +from atf_python.sys.net.netlink import NlMsgType +from atf_python.sys.net.netlink import NlRtMsgType +from atf_python.sys.net.netlink import RtattrType +from atf_python.sys.net.vnet import SingleVnetTestTemplate + + +class TestRtNlRoute(NetlinkTestTemplate, SingleVnetTestTemplate): + IPV6_PREFIXES = ["2001:db8::1/64"] + + def setup_method(self, method): + super().setup_method(method) + self.setup_netlink(NlConst.NETLINK_ROUTE) + + @pytest.mark.timeout(20) + def test_buffer_override(self): + msg_flags = ( + NlmBaseFlags.NLM_F_ACK.value + | NlmBaseFlags.NLM_F_REQUEST.value + | NlmNewFlags.NLM_F_CREATE.value + ) + + num_routes = 1000 + base_address = bytearray(ipaddress.ip_address("2001:db8:ffff::").packed) + for i in range(num_routes): + base_address[7] = i % 256 + base_address[6] = i // 256 + prefix_address = ipaddress.IPv6Address(bytes(base_address)) + + msg = NetlinkRtMessage(self.helper, NlRtMsgType.RTM_NEWROUTE.value) + msg.nl_hdr.nlmsg_flags = msg_flags + msg.base_hdr.rtm_family = socket.AF_INET6 + msg.base_hdr.rtm_dst_len = 65 + msg.add_nla(NlAttrIp(RtattrType.RTA_DST, str(prefix_address))) + msg.add_nla(NlAttrIp(RtattrType.RTA_GATEWAY, "2001:db8::2")) + + self.write_message(msg, silent=True) + rx_msg = self.read_message(silent=True) + assert rx_msg.is_type(NlMsgType.NLMSG_ERROR) + assert msg.nl_hdr.nlmsg_seq == rx_msg.nl_hdr.nlmsg_seq + assert rx_msg.error_code == 0 + # Now, dump + msg = NetlinkRtMessage(self.helper, NlRtMsgType.RTM_GETROUTE.value) + msg.nl_hdr.nlmsg_flags = ( + NlmBaseFlags.NLM_F_ACK.value + | NlmBaseFlags.NLM_F_REQUEST.value + | NlmGetFlags.NLM_F_ROOT.value + | NlmGetFlags.NLM_F_MATCH.value + ) + msg.base_hdr.rtm_family = socket.AF_INET6 + self.write_message(msg) + num_received = 0 + while True: + rx_msg = self.read_message(silent=True) + if msg.nl_hdr.nlmsg_seq == rx_msg.nl_hdr.nlmsg_seq: + if rx_msg.is_type(NlMsgType.NLMSG_ERROR): + if rx_msg.error_code != 0: + raise ValueError( + "unable to dump routes: error {}".format(rx_msg.error_code) + ) + if rx_msg.is_type(NlMsgType.NLMSG_DONE): + break + if rx_msg.is_type(NlRtMsgType.RTM_NEWROUTE): + if rx_msg.base_hdr.rtm_dst_len == 65: + num_received += 1 + assert num_routes == num_received From nobody Mon Feb 20 10:33:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKzKd6VFkz3sbQL; Mon, 20 Feb 2023 10:33: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 4PKzKd6Cglz4Q7Y; Mon, 20 Feb 2023 10:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676889221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zBkOpzk3GZSj+Xup0kHd8uxnZdJjhNL14S6DWqaFAuA=; b=FwN6D3r1M3YGZPHK2D0uhJAm9415f2uA+/FsPsAZbgNI6ff+gNvRULutDfIjXGZ8QJL+l4 vw2J5ibD2TJN2TGHx6XEY/aAC2GdUputC1kTCXHKyRzXm5LX85G7KDRo6AUKTfhfb5GdKw jy9Nbu0yq0AKx5SzA2Y3qHzhj2pVjaIwE3c7YbXumga7g1EAxQFHfHKd0/DRs/gteBDP4g zw2XSPeLUdNthT5FiwWkrZIjyUgOo/lDnybm02wwIaZQkP7iR4xQK/coM5hMD0hgeOr52c V6tFbfzAH5tj+ghTThG+JSA1oBzvyu9LXa7l0/CmjLHIAvMkzaDGilfuq77mXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676889221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zBkOpzk3GZSj+Xup0kHd8uxnZdJjhNL14S6DWqaFAuA=; b=rUICokPnq2zML2DPW9FiGva5UYsf3HHi6YUix/j6+V/ELgFbH966AAfed2dhRiC6J1Cdmb qg3/5YpH8gnU3iK4xyhQJe16fTwxmutOyObN44uLEc0ZuYGn6akaUknTHFPs1juS3JLf8D axnfqxR5Q5iwknDDbI3rm5D7fvpw9CwDxXJ5dTcdNvTehSEz6Tm05GGxQFZmdO7bEVP0e8 Jz6AuVh5ihXHzzAvXNtasG6/r1aR895UxphIJhyY+Fy/ZQkMnQCWL5wbhSE4KgSee8lpJl qrAE03LE9ZdpupASkksRpqMREHgKNYvCM8Umf+VmxRjP0MdlFBu+Sh8B/w6xqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676889221; a=rsa-sha256; cv=none; b=YJJSKmQj5S++vqoyxm7A6J2tW0TC+0tW/j+1B+LZ/mJKLpl0RXA9txSOO7HjBl/2VEQQU3 v1u4BD4iIIr19tM3jazbjnWczTS8lsXo6TSxNQzn/Xexaj8/o0DXfX3k+u9AmJ0yDYyyCx dHCKS/aDjYbgXD+6Kz7MKqUnDgsThVs9/FJJ91Fchy9Z6rrmRzMAoFnGn79VBNFEBkDU/P jGD6ITSe58pi8yhRCsYN3704Z9Lwvdrvc3lGBwdWIp4vTaKFxkqYc0s1639w9GqPaVpDN3 pz3oP5hx+ADqhGkum0y2j3Uooi/XmuEMBZekPYjJ+RnqYwuSfwK9ylV1KGQeEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKzKd5G7Yzdqm; Mon, 20 Feb 2023 10:33: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 31KAXfEf061457; Mon, 20 Feb 2023 10:33:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KAXft0061456; Mon, 20 Feb 2023 10:33:41 GMT (envelope-from git) Date: Mon, 20 Feb 2023 10:33:41 GMT Message-Id: <202302201033.31KAXft0061456@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: 0343e90f39e0 - main - ping: Add ATF-Python tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0343e90f39e0eb2c0f9c3c9271db372cf9d9f454 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=0343e90f39e0eb2c0f9c3c9271db372cf9d9f454 commit 0343e90f39e0eb2c0f9c3c9271db372cf9d9f454 Author: Alexander V. Chernikov AuthorDate: 2023-02-20 10:23:24 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 10:31:38 +0000 ping: Add ATF-Python tests ping(8) is an old utility, which has received many changes and updates through the years. Some of these changes may have introduced small bugs, in part due to the lack of tests. Attempt to remedy the current situation by introducing a way to easily add tests. Differential Revision: https://reviews.freebsd.org/D38053 --- sbin/ping/tests/Makefile | 1 + sbin/ping/tests/test_ping.py | 940 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 941 insertions(+) diff --git a/sbin/ping/tests/Makefile b/sbin/ping/tests/Makefile index c6845ac57e5c..044687c03dc3 100644 --- a/sbin/ping/tests/Makefile +++ b/sbin/ping/tests/Makefile @@ -5,6 +5,7 @@ SRCS.in_cksum_test= in_cksum_test.c ../utils.c PACKAGE= tests +ATF_TESTS_PYTEST+= test_ping.py ATF_TESTS_SH+= ping_test # Exclusive because each injection test case uses the same IP addresses TEST_METADATA.ping_test+= is_exclusive="true" diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py new file mode 100644 index 000000000000..913948d18b3e --- /dev/null +++ b/sbin/ping/tests/test_ping.py @@ -0,0 +1,940 @@ +import pytest + +import logging +import os +import re +import subprocess + +from atf_python.sys.net.vnet import IfaceFactory +from atf_python.sys.net.vnet import SingleVnetTestTemplate +from atf_python.sys.net.tools import ToolsHelper +from typing import List +from typing import Optional + +logging.getLogger("scapy").setLevel(logging.CRITICAL) +import scapy.all as sc + + +def build_response_packet(echo, ip, icmp, oip_ihl, special): + icmp_id_seq_types = [0, 8, 13, 14, 15, 16, 17, 18, 37, 38] + oip = echo[sc.IP] + oicmp = echo[sc.ICMP] + load = echo[sc.ICMP].payload + oip[sc.IP].remove_payload() + oicmp[sc.ICMP].remove_payload() + oicmp.type = 8 + + # As if the original IP packet had these set + oip.ihl = None + oip.len = None + oip.id = 1 + oip.flags = ip.flags + oip.chksum = None + oip.options = ip.options + + # Inner packet (oip) options + if oip_ihl: + oip.ihl = oip_ihl + + # Special options + if special == "no-payload": + load = "" + if special == "tcp": + oip.proto = "tcp" + tcp = sc.TCP(sport=1234, dport=5678) + return ip / icmp / oip / tcp + if special == "udp": + oip.proto = "udp" + udp = sc.UDP(sport=1234, dport=5678) + return ip / icmp / oip / udp + if special == "warp": + # Build a package with a timestamp of INT_MAX + # (time-warped package) + payload_no_timestamp = sc.bytes_hex(load)[16:] + load = (b"\xff" * 8) + sc.hex_bytes(payload_no_timestamp) + if special == "wrong": + # Build a package with a wrong last byte + payload_no_last_byte = sc.bytes_hex(load)[:-2] + load = (sc.hex_bytes(payload_no_last_byte)) + b"\x00" + + if icmp.type in icmp_id_seq_types: + pkt = ip / icmp / load + else: + ip.options = "" + pkt = ip / icmp / oip / oicmp / load + return pkt + + +def generate_ip_options(opts): + if not opts: + return "" + + routers = [ + "192.0.2.10", + "192.0.2.20", + "192.0.2.30", + "192.0.2.40", + "192.0.2.50", + "192.0.2.60", + "192.0.2.70", + "192.0.2.80", + "192.0.2.90", + ] + routers_zero = [0, 0, 0, 0, 0, 0, 0, 0, 0] + if opts == "EOL": + options = sc.IPOption(b"\x00") + elif opts == "NOP": + options = sc.IPOption(b"\x01") + elif opts == "NOP-40": + options = sc.IPOption(b"\x01" * 40) + elif opts == "RR": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_RR(pointer=40, routers=routers) + elif opts == "RR-same": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_RR(pointer=3, routers=routers_zero) + elif opts == "RR-trunc": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_RR(length=7, routers=routers_zero) + elif opts == "LSRR": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_LSRR(routers=routers) + elif opts == "LSRR-trunc": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_LSRR(length=3, routers=routers_zero) + elif opts == "SSRR": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_SSRR(routers=routers) + elif opts == "SSRR-trunc": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_SSRR(length=3, routers=routers_zero) + elif opts == "unk": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption(b"\x9f") + elif opts == "unk-40": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption(b"\x9f" * 40) + else: + options = "" + return options + + +def pinger( + # Required arguments + # Avoid setting defaults on these arguments, + # as we want to set them explicitly in the tests + iface: str, + /, + src: sc.scapy.fields.SourceIPField, + dst: sc.scapy.layers.inet.DestIPField, + icmp_type: sc.scapy.fields.ByteEnumField, + icmp_code: sc.scapy.fields.MultiEnumField, + # IP arguments + ihl: Optional[sc.scapy.fields.BitField] = None, + flags: Optional[sc.scapy.fields.FlagsField] = None, + opts: Optional[str] = None, + oip_ihl: Optional[sc.scapy.fields.BitField] = None, + special: Optional[str] = None, + # ICMP arguments + # Match names with + icmp_pptr: sc.scapy.fields.ByteField = 0, + icmp_gwaddr: sc.scapy.fields.IPField = "0.0.0.0", + icmp_nextmtu: sc.scapy.fields.ShortField = 0, + icmp_otime: sc.scapy.layers.inet.ICMPTimeStampField = 0, + icmp_rtime: sc.scapy.layers.inet.ICMPTimeStampField = 0, + icmp_ttime: sc.scapy.layers.inet.ICMPTimeStampField = 0, + icmp_mask: sc.scapy.fields.IPField = "0.0.0.0", + request: Optional[str] = None, + # Miscellaneous arguments + count: int = 1, + dup: bool = False, +) -> subprocess.CompletedProcess: + """P I N G E R + + Echo reply faker + + :param str iface: Interface to send packet to + :keyword src: Source packet IP + :type src: class:`scapy.fields.SourceIPField` + :keyword dst: Destination packet IP + :type dst: class:`scapy.layers.inet.DestIPField` + :keyword icmp_type: ICMP type + :type icmp_type: class:`scapy.fields.ByteEnumField` + :keyword icmp_code: ICMP code + :type icmp_code: class:`scapy.fields.MultiEnumField` + + :keyword ihl: Internet Header Length, defaults to None + :type ihl: class:`scapy.fields.BitField`, optional + :keyword flags: IP flags - one of `DF`, `MF` or `evil`, defaults to None + :type flags: class:`scapy.fields.FlagsField`, optional + :keyword opts: Include IP options - one of `EOL`, `NOP`, `NOP-40`, `unk`, + `unk-40`, `RR`, `RR-same`, `RR-trunc`, `LSRR`, `LSRR-trunc`, `SSRR` or + `SSRR-trunc`, defaults to None + :type opts: str, optional + :keyword oip_ihl: Inner packet's Internet Header Length, defaults to None + :type oip_ihl: class:`scapy.fields.BitField`, optional + :keyword special: Send a special packet - one of `no-payload`, `tcp`, + `udp`, `wrong` or `warp`, defaults to None + :type special: str, optional + :keyword icmp_pptr: ICMP pointer, defaults to 0 + :type icmp_pptr: class:`scapy.fields.ByteField` + :keyword icmp_gwaddr: ICMP gateway IP address, defaults to "0.0.0.0" + :type icmp_gwaddr: class:`scapy.fields.IPField` + :keyword icmp_nextmtu: ICMP next MTU, defaults to 0 + :type icmp_nextmtu: class:`scapy.fields.ShortField` + :keyword icmp_otime: ICMP originate timestamp, defaults to 0 + :type icmp_otime: class:`scapy.layers.inet.ICMPTimeStampField` + :keyword icmp_rtime: ICMP receive timestamp, defaults to 0 + :type icmp_rtime: class:`scapy.layers.inet.ICMPTimeStampField` + :keyword icmp_ttime: ICMP transmit timestamp, defaults to 0 + :type icmp_ttime: class:`scapy.layers.inet.ICMPTimeStampField` + :keyword icmp_mask: ICMP address mask, defaults to "0.0.0.0" + :type icmp_mask: class:`scapy.fields.IPField` + :keyword request: Request type - one of `mask` or `timestamp`, + defaults to None + :type request: str, optional + :keyword count: Number of packets to send, defaults to 1 + :type count: int + :keyword dup: Duplicate packets, defaults to `False` + :type dup: bool + + :return: A class:`subprocess.CompletedProcess` with the output from the + ping utility + :rtype: class:`subprocess.CompletedProcess` + """ + tun = sc.TunTapInterface(iface) + subprocess.run(["ifconfig", tun.iface, "up"], check=True) + subprocess.run(["ifconfig", tun.iface, src, dst], check=True) + ip_opts = generate_ip_options(opts) + ip = sc.IP(ihl=ihl, flags=flags, src=dst, dst=src, options=ip_opts) + command = [ + "/sbin/ping", + "-c", + str(count), + "-t", + str(count), + "-v", + ] + if request == "mask": + command += ["-Mm"] + if request == "timestamp": + command += ["-Mt"] + if special: + command += ["-p1"] + if opts in [ + "RR", + "RR-same", + "RR-trunc", + "LSRR", + "LSRR-trunc", + "SSRR", + "SSRR-trunc", + ]: + command += ["-R"] + command += [dst] + with subprocess.Popen( + args=command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True + ) as ping: + for dummy in range(count): + echo = tun.recv() + icmp = sc.ICMP( + type=icmp_type, + code=icmp_code, + id=echo[sc.ICMP].id, + seq=echo[sc.ICMP].seq, + ts_ori=icmp_otime, + ts_rx=icmp_rtime, + ts_tx=icmp_ttime, + gw=icmp_gwaddr, + ptr=icmp_pptr, + addr_mask=icmp_mask, + nexthopmtu=icmp_nextmtu, + ) + pkt = build_response_packet(echo, ip, icmp, oip_ihl, special) + tun.send(pkt) + if dup is True: + tun.send(pkt) + stdout, stderr = ping.communicate() + return subprocess.CompletedProcess( + ping.args, ping.returncode, stdout, stderr + ) + + +def redact(output): + """Redact some elements of ping's output""" + pattern_replacements = [ + ("localhost \([0-9]{1,3}(\.[0-9]{1,3}){3}\)", "localhost"), + ("from [0-9]{1,3}(\.[0-9]{1,3}){3}", "from"), + ("hlim=[0-9]*", "hlim="), + ("ttl=[0-9]*", "ttl="), + ("time=[0-9.-]*", "time="), + ("[0-9\.]+/[0-9.]+", "/"), + ] + for pattern, repl in pattern_replacements: + output = re.sub(pattern, repl, output) + return output + + +class TestPing(SingleVnetTestTemplate): + IPV6_PREFIXES: List[str] = ["2001:db8::1/64"] + IPV4_PREFIXES: List[str] = ["192.0.2.1/24"] + + # Each param in testdata contains a dictionary with the command, + # and the expected outcome (returncode, redacted stdout, and stderr) + testdata = [ + pytest.param( + { + "args": "ping -4 -c1 -s56 -t1 localhost", + "returncode": 0, + "stdout": """\ +PING localhost: 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- localhost ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_4_c1_s56_t1_localhost", + ), + pytest.param( + { + "args": "ping -6 -c1 -s8 -t1 localhost", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim= time= ms + +--- localhost ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_6_c1_s8_t1_localhost", + ), + pytest.param( + { + "args": "ping -A -c1 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- 192.0.2.1 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_A_c1_192_0_2_1", + ), + pytest.param( + { + "args": "ping -A -c1 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_A_c1_192_0_2_2", + ), + pytest.param( + { + "args": "ping -A -c1 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 +16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms + +--- 2001:db8::1 ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_A_c1_2001_db8__1", + ), + pytest.param( + { + "args": "ping -A -c1 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_A_c1_2001_db8__2", + ), + pytest.param( + { + "args": "ping -A -c3 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +64 bytes from: icmp_seq=1 ttl= time= ms +64 bytes from: icmp_seq=2 ttl= time= ms + +--- 192.0.2.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_A_3_192_0.2.1", + ), + pytest.param( + { + "args": "ping -A -c3 192.0.2.2", + "returncode": 2, + "stdout": """\ +\x07\x07PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_A_c3_192_0_2_2", + ), + pytest.param( + { + "args": "ping -A -c3 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 +16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms +16 bytes from 2001:db8::1, icmp_seq=1 hlim= time= ms +16 bytes from 2001:db8::1, icmp_seq=2 hlim= time= ms + +--- 2001:db8::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_A_c3_2001_db8__1", + ), + pytest.param( + { + "args": "ping -A -c3 2001:db8::2", + "returncode": 2, + "stdout": """\ +\x07\x07PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_A_c3_2001_db8__2", + ), + pytest.param( + { + "args": "ping -c1 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- 192.0.2.1 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_c1_192_0_2_1", + ), + pytest.param( + { + "args": "ping -c1 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_c1_192_0_2_2", + ), + pytest.param( + { + "args": "ping -c1 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 +16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms + +--- 2001:db8::1 ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_c1_2001_db8__1", + ), + pytest.param( + { + "args": "ping -c1 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_c1_2001_db8__2", + ), + pytest.param( + { + "args": "ping -c1 -S127.0.0.1 -s56 -t1 localhost", + "returncode": 0, + "stdout": """\ +PING localhost from: 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- localhost ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_c1_S127_0_0_1_s56_t1_localhost", + ), + pytest.param( + { + "args": "ping -c1 -S::1 -s8 -t1 localhost", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim= time= ms + +--- localhost ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_c1_S__1_s8_t1_localhost", + ), + pytest.param( + { + "args": "ping -c3 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +64 bytes from: icmp_seq=1 ttl= time= ms +64 bytes from: icmp_seq=2 ttl= time= ms + +--- 192.0.2.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_c3_192_0_2_1", + ), + pytest.param( + { + "args": "ping -c3 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_c3_192_0_2_2", + ), + pytest.param( + { + "args": "ping -c3 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 +16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms +16 bytes from 2001:db8::1, icmp_seq=1 hlim= time= ms +16 bytes from 2001:db8::1, icmp_seq=2 hlim= time= ms + +--- 2001:db8::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_c3_2001_db8__1", + ), + pytest.param( + { + "args": "ping -c3 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_c3_2001_db8__2", + ), + pytest.param( + { + "args": "ping -q -c1 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes + +--- 192.0.2.1 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_q_c1_192_0_2_1", + ), + pytest.param( + { + "args": "ping -q -c1 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_q_c1_192_0_2_2", + ), + pytest.param( + { + "args": "ping -q -c1 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 + +--- 2001:db8::1 ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_q_c1_2001_db8__1", + ), + pytest.param( + { + "args": "ping -q -c1 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_q_c1_2001_db8__2", + ), + pytest.param( + { + "args": "ping -q -c3 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes + +--- 192.0.2.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_q_c3_192_0_2_1", + ), + pytest.param( + { + "args": "ping -q -c3 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_q_c3_192_0_2_2", + ), + pytest.param( + { + "args": "ping -q -c3 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 + +--- 2001:db8::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_q_c3_2001_db8__1", + ), + pytest.param( + { + "args": "ping -q -c3 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_q_c3_2001_db8__2", + ), + ] + + @pytest.mark.parametrize("expected", testdata) + def test_ping(self, expected): + """Test ping""" + ping = subprocess.run( + expected["args"].split(), + capture_output=True, + timeout=15, + text=True, + ) + assert ping.returncode == expected["returncode"] + assert redact(ping.stdout) == expected["stdout"] + assert ping.stderr == expected["stderr"] + + # Each param in ping46_testdata contains a dictionary with the arguments + # and the expected outcome (returncode, redacted stdout, and stderr) + # common to `ping -4` and `ping -6` + ping46_testdata = [ + pytest.param( + { + "args": "-Wx localhost", + "returncode": os.EX_USAGE, + "stdout": "", + "stderr": "ping: invalid timing interval: `x'\n", + }, + marks=pytest.mark.skip("XXX currently failing"), + id="_Wx_localhost", + ), + ] + + @pytest.mark.parametrize("expected", ping46_testdata) + def test_ping_46(self, expected): + """Test ping -4/ping -6""" + for version in [4, 6]: + ping = subprocess.run( + ["ping", f"-{version}"] + expected["args"].split(), + capture_output=True, + timeout=15, + text=True, + ) + assert ping.returncode == expected["returncode"] + assert redact(ping.stdout) == expected["stdout"] + assert ping.stderr == expected["stderr"] + + # Each param in pinger_testdata contains a dictionary with the keywords to + # `pinger()` and a dictionary with the expected outcome (returncode, + # stdout, stderr, and if ping's output is redacted) + pinger_testdata = [ + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "NOP-40", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +wrong total length 124 instead of 84 +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_NOP_40", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "unk", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +wrong total length 88 instead of 84 +unknown option 9f + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + marks=pytest.mark.skip("XXX currently failing"), + id="_0_0_opts_unk", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 3, + "icmp_code": 1, + "opts": "NOP-40", + }, + { + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +132 bytes from 192.0.2.2: Destination Host Unreachable +Vr HL TOS Len ID Flg off TTL Pro cks Src Dst + 4 f 00 007c 0001 0 0000 40 01 d868 192.0.2.1 192.0.2.2 01010101010101010101010101010101010101010101010101010101010101010101010101010101 + + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + "redacted": False, + }, + marks=pytest.mark.skip("XXX currently failing"), + id="_3_1_opts_NOP_40", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 3, + "icmp_code": 1, + "flags": "DF", + }, + { + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +92 bytes from 192.0.2.2: Destination Host Unreachable +Vr HL TOS Len ID Flg off TTL Pro cks Src Dst + 4 5 00 0054 0001 2 0000 40 01 b6a4 192.0.2.1 192.0.2.2 + + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + "redacted": False, + }, + marks=pytest.mark.skip("XXX currently failing"), + id="_3_1_flags_DF", + ), + ] + + @pytest.mark.parametrize("pinger_kargs, expected", pinger_testdata) + @pytest.mark.require_progs(["scapy"]) + @pytest.mark.require_user("root") + def test_pinger(self, pinger_kargs, expected): + """Test ping using pinger(), a reply faker""" + iface = IfaceFactory().create_iface("", "tun")[0].name + ping = pinger(iface, **pinger_kargs) + assert ping.returncode == expected["returncode"] + if expected["redacted"]: + assert redact(ping.stdout) == expected["stdout"] + else: + assert ping.stdout == expected["stdout"] + assert ping.stderr == expected["stderr"] From nobody Mon Feb 20 10:34:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKzM43Wp3z3sbbp; Mon, 20 Feb 2023 10:34: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 4PKzM43GzLz4QWK; Mon, 20 Feb 2023 10:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676889296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5k8TdsYO5n2GzNcysuYg+nJ6xzXasVJX3raLOtZJ4yQ=; b=dSnM5iFF7o6+Mx9fyLJP1Q6xLsft9xUNuU5JbQGNbySO6s9oX/esh23QeGF/8cRNwP+q3O rWe+ueWeFEsMHpSJaA8ZpWi/qkmQFEjF4fakWnu5T81Lc6DjTN7M3pSdNKM9kDJdEFLXis 34SHinnJemZlLH1srzAhPyXRfZFHYFuXIyebCu6tlEhUW6sgPb0B/YUyeoC729JwK0d8jO CDJq8nsFQs87PsJ7DdOrab2IRfJauARHW7kT4cHsaZLML0QzqCXlNM8ikeltA94vcbboJv EDdZQB3BZoN0rE9zYzXj0t+FL/j2bUiuVUMWP2gP+ujDsceQZqMpVYfxVkWFdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676889296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5k8TdsYO5n2GzNcysuYg+nJ6xzXasVJX3raLOtZJ4yQ=; b=kaTz0Cdqlb3rFFw4gGq/tqajBOQ0JDQDs63Ic4rJOXzu6SgTa8vCYpmZIa8Pxo97xlCDco x8PFS/Rxo2zDFglysQB9yRUCDsk8ImfYY+H8z7lenx4EEnYEviUAZvmdqZZY2Dz8/NHnOZ v6v7RbGOirCzrjvYi1yjc5+bPtxFMFlGXXhzTxi/vC2O1QHYaxfoFvMHonHJLMpG1A5qR6 9wFsewLG6Rgrv6zpqGESkVXwT+HZ3x2DF6SxQLGBvKWx3qGokro2qY/yEZQRseHsGbib3K s0wIp0Zkfh7aApPFb+YxwAuiB0yT9K7GGHs3Mpn167RWsbVOdjFjQJRtpAOhEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676889296; a=rsa-sha256; cv=none; b=TFPalPjn8/hcAbfjZycvRow2a7J5lHps2iqD9rTFuKB0IPkq4iPcrDE/JnDdij+JBfuzxa VkxnfrDDyDBrH68mfgwdRi//bi05QadrP3UONbPbFezYtBrcGFw44cDgSKKPc8CxicPwVA 9VpHh20islKDuxdDuKOugDJERmEbI4xJApLWnlAZ2lanCJInZClXIKcZL4udQgjT18BlVS Y7ZZDO9vnmtiouI4BAyP6Narvl6kWxvADyaynGvbr8tvvCTkBm+klj+mUNjJRFLjWGgpRy Wnln/IYwU225IHZo5GlzSXEW7YX8To6VOV67vPgP+vX3ntb4leUaxetlDyrDTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKzM42LKpzd5j; Mon, 20 Feb 2023 10:34: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 31KAYuCn061739; Mon, 20 Feb 2023 10:34:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KAYufD061738; Mon, 20 Feb 2023 10:34:56 GMT (envelope-from git) Date: Mon, 20 Feb 2023 10:34:56 GMT Message-Id: <202302201034.31KAYufD061738@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: 3d360ca49cf8 - main - Revert "ping: Add ATF-Python tests" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d360ca49cf86c6f645e2e75fbfc0dd5b2d83bb8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=3d360ca49cf86c6f645e2e75fbfc0dd5b2d83bb8 commit 3d360ca49cf86c6f645e2e75fbfc0dd5b2d83bb8 Author: Alexander V. Chernikov AuthorDate: 2023-02-20 10:34:09 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 10:34:09 +0000 Revert "ping: Add ATF-Python tests" This reverts commit 0343e90f39e0eb2c0f9c3c9271db372cf9d9f454. --- sbin/ping/tests/Makefile | 1 - sbin/ping/tests/test_ping.py | 940 ------------------------------------------- 2 files changed, 941 deletions(-) diff --git a/sbin/ping/tests/Makefile b/sbin/ping/tests/Makefile index 044687c03dc3..c6845ac57e5c 100644 --- a/sbin/ping/tests/Makefile +++ b/sbin/ping/tests/Makefile @@ -5,7 +5,6 @@ SRCS.in_cksum_test= in_cksum_test.c ../utils.c PACKAGE= tests -ATF_TESTS_PYTEST+= test_ping.py ATF_TESTS_SH+= ping_test # Exclusive because each injection test case uses the same IP addresses TEST_METADATA.ping_test+= is_exclusive="true" diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py deleted file mode 100644 index 913948d18b3e..000000000000 --- a/sbin/ping/tests/test_ping.py +++ /dev/null @@ -1,940 +0,0 @@ -import pytest - -import logging -import os -import re -import subprocess - -from atf_python.sys.net.vnet import IfaceFactory -from atf_python.sys.net.vnet import SingleVnetTestTemplate -from atf_python.sys.net.tools import ToolsHelper -from typing import List -from typing import Optional - -logging.getLogger("scapy").setLevel(logging.CRITICAL) -import scapy.all as sc - - -def build_response_packet(echo, ip, icmp, oip_ihl, special): - icmp_id_seq_types = [0, 8, 13, 14, 15, 16, 17, 18, 37, 38] - oip = echo[sc.IP] - oicmp = echo[sc.ICMP] - load = echo[sc.ICMP].payload - oip[sc.IP].remove_payload() - oicmp[sc.ICMP].remove_payload() - oicmp.type = 8 - - # As if the original IP packet had these set - oip.ihl = None - oip.len = None - oip.id = 1 - oip.flags = ip.flags - oip.chksum = None - oip.options = ip.options - - # Inner packet (oip) options - if oip_ihl: - oip.ihl = oip_ihl - - # Special options - if special == "no-payload": - load = "" - if special == "tcp": - oip.proto = "tcp" - tcp = sc.TCP(sport=1234, dport=5678) - return ip / icmp / oip / tcp - if special == "udp": - oip.proto = "udp" - udp = sc.UDP(sport=1234, dport=5678) - return ip / icmp / oip / udp - if special == "warp": - # Build a package with a timestamp of INT_MAX - # (time-warped package) - payload_no_timestamp = sc.bytes_hex(load)[16:] - load = (b"\xff" * 8) + sc.hex_bytes(payload_no_timestamp) - if special == "wrong": - # Build a package with a wrong last byte - payload_no_last_byte = sc.bytes_hex(load)[:-2] - load = (sc.hex_bytes(payload_no_last_byte)) + b"\x00" - - if icmp.type in icmp_id_seq_types: - pkt = ip / icmp / load - else: - ip.options = "" - pkt = ip / icmp / oip / oicmp / load - return pkt - - -def generate_ip_options(opts): - if not opts: - return "" - - routers = [ - "192.0.2.10", - "192.0.2.20", - "192.0.2.30", - "192.0.2.40", - "192.0.2.50", - "192.0.2.60", - "192.0.2.70", - "192.0.2.80", - "192.0.2.90", - ] - routers_zero = [0, 0, 0, 0, 0, 0, 0, 0, 0] - if opts == "EOL": - options = sc.IPOption(b"\x00") - elif opts == "NOP": - options = sc.IPOption(b"\x01") - elif opts == "NOP-40": - options = sc.IPOption(b"\x01" * 40) - elif opts == "RR": - ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption_RR(pointer=40, routers=routers) - elif opts == "RR-same": - ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption_RR(pointer=3, routers=routers_zero) - elif opts == "RR-trunc": - ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption_RR(length=7, routers=routers_zero) - elif opts == "LSRR": - ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption_LSRR(routers=routers) - elif opts == "LSRR-trunc": - ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption_LSRR(length=3, routers=routers_zero) - elif opts == "SSRR": - ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption_SSRR(routers=routers) - elif opts == "SSRR-trunc": - ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption_SSRR(length=3, routers=routers_zero) - elif opts == "unk": - ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption(b"\x9f") - elif opts == "unk-40": - ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption(b"\x9f" * 40) - else: - options = "" - return options - - -def pinger( - # Required arguments - # Avoid setting defaults on these arguments, - # as we want to set them explicitly in the tests - iface: str, - /, - src: sc.scapy.fields.SourceIPField, - dst: sc.scapy.layers.inet.DestIPField, - icmp_type: sc.scapy.fields.ByteEnumField, - icmp_code: sc.scapy.fields.MultiEnumField, - # IP arguments - ihl: Optional[sc.scapy.fields.BitField] = None, - flags: Optional[sc.scapy.fields.FlagsField] = None, - opts: Optional[str] = None, - oip_ihl: Optional[sc.scapy.fields.BitField] = None, - special: Optional[str] = None, - # ICMP arguments - # Match names with - icmp_pptr: sc.scapy.fields.ByteField = 0, - icmp_gwaddr: sc.scapy.fields.IPField = "0.0.0.0", - icmp_nextmtu: sc.scapy.fields.ShortField = 0, - icmp_otime: sc.scapy.layers.inet.ICMPTimeStampField = 0, - icmp_rtime: sc.scapy.layers.inet.ICMPTimeStampField = 0, - icmp_ttime: sc.scapy.layers.inet.ICMPTimeStampField = 0, - icmp_mask: sc.scapy.fields.IPField = "0.0.0.0", - request: Optional[str] = None, - # Miscellaneous arguments - count: int = 1, - dup: bool = False, -) -> subprocess.CompletedProcess: - """P I N G E R - - Echo reply faker - - :param str iface: Interface to send packet to - :keyword src: Source packet IP - :type src: class:`scapy.fields.SourceIPField` - :keyword dst: Destination packet IP - :type dst: class:`scapy.layers.inet.DestIPField` - :keyword icmp_type: ICMP type - :type icmp_type: class:`scapy.fields.ByteEnumField` - :keyword icmp_code: ICMP code - :type icmp_code: class:`scapy.fields.MultiEnumField` - - :keyword ihl: Internet Header Length, defaults to None - :type ihl: class:`scapy.fields.BitField`, optional - :keyword flags: IP flags - one of `DF`, `MF` or `evil`, defaults to None - :type flags: class:`scapy.fields.FlagsField`, optional - :keyword opts: Include IP options - one of `EOL`, `NOP`, `NOP-40`, `unk`, - `unk-40`, `RR`, `RR-same`, `RR-trunc`, `LSRR`, `LSRR-trunc`, `SSRR` or - `SSRR-trunc`, defaults to None - :type opts: str, optional - :keyword oip_ihl: Inner packet's Internet Header Length, defaults to None - :type oip_ihl: class:`scapy.fields.BitField`, optional - :keyword special: Send a special packet - one of `no-payload`, `tcp`, - `udp`, `wrong` or `warp`, defaults to None - :type special: str, optional - :keyword icmp_pptr: ICMP pointer, defaults to 0 - :type icmp_pptr: class:`scapy.fields.ByteField` - :keyword icmp_gwaddr: ICMP gateway IP address, defaults to "0.0.0.0" - :type icmp_gwaddr: class:`scapy.fields.IPField` - :keyword icmp_nextmtu: ICMP next MTU, defaults to 0 - :type icmp_nextmtu: class:`scapy.fields.ShortField` - :keyword icmp_otime: ICMP originate timestamp, defaults to 0 - :type icmp_otime: class:`scapy.layers.inet.ICMPTimeStampField` - :keyword icmp_rtime: ICMP receive timestamp, defaults to 0 - :type icmp_rtime: class:`scapy.layers.inet.ICMPTimeStampField` - :keyword icmp_ttime: ICMP transmit timestamp, defaults to 0 - :type icmp_ttime: class:`scapy.layers.inet.ICMPTimeStampField` - :keyword icmp_mask: ICMP address mask, defaults to "0.0.0.0" - :type icmp_mask: class:`scapy.fields.IPField` - :keyword request: Request type - one of `mask` or `timestamp`, - defaults to None - :type request: str, optional - :keyword count: Number of packets to send, defaults to 1 - :type count: int - :keyword dup: Duplicate packets, defaults to `False` - :type dup: bool - - :return: A class:`subprocess.CompletedProcess` with the output from the - ping utility - :rtype: class:`subprocess.CompletedProcess` - """ - tun = sc.TunTapInterface(iface) - subprocess.run(["ifconfig", tun.iface, "up"], check=True) - subprocess.run(["ifconfig", tun.iface, src, dst], check=True) - ip_opts = generate_ip_options(opts) - ip = sc.IP(ihl=ihl, flags=flags, src=dst, dst=src, options=ip_opts) - command = [ - "/sbin/ping", - "-c", - str(count), - "-t", - str(count), - "-v", - ] - if request == "mask": - command += ["-Mm"] - if request == "timestamp": - command += ["-Mt"] - if special: - command += ["-p1"] - if opts in [ - "RR", - "RR-same", - "RR-trunc", - "LSRR", - "LSRR-trunc", - "SSRR", - "SSRR-trunc", - ]: - command += ["-R"] - command += [dst] - with subprocess.Popen( - args=command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True - ) as ping: - for dummy in range(count): - echo = tun.recv() - icmp = sc.ICMP( - type=icmp_type, - code=icmp_code, - id=echo[sc.ICMP].id, - seq=echo[sc.ICMP].seq, - ts_ori=icmp_otime, - ts_rx=icmp_rtime, - ts_tx=icmp_ttime, - gw=icmp_gwaddr, - ptr=icmp_pptr, - addr_mask=icmp_mask, - nexthopmtu=icmp_nextmtu, - ) - pkt = build_response_packet(echo, ip, icmp, oip_ihl, special) - tun.send(pkt) - if dup is True: - tun.send(pkt) - stdout, stderr = ping.communicate() - return subprocess.CompletedProcess( - ping.args, ping.returncode, stdout, stderr - ) - - -def redact(output): - """Redact some elements of ping's output""" - pattern_replacements = [ - ("localhost \([0-9]{1,3}(\.[0-9]{1,3}){3}\)", "localhost"), - ("from [0-9]{1,3}(\.[0-9]{1,3}){3}", "from"), - ("hlim=[0-9]*", "hlim="), - ("ttl=[0-9]*", "ttl="), - ("time=[0-9.-]*", "time="), - ("[0-9\.]+/[0-9.]+", "/"), - ] - for pattern, repl in pattern_replacements: - output = re.sub(pattern, repl, output) - return output - - -class TestPing(SingleVnetTestTemplate): - IPV6_PREFIXES: List[str] = ["2001:db8::1/64"] - IPV4_PREFIXES: List[str] = ["192.0.2.1/24"] - - # Each param in testdata contains a dictionary with the command, - # and the expected outcome (returncode, redacted stdout, and stderr) - testdata = [ - pytest.param( - { - "args": "ping -4 -c1 -s56 -t1 localhost", - "returncode": 0, - "stdout": """\ -PING localhost: 56 data bytes -64 bytes from: icmp_seq=0 ttl= time= ms - ---- localhost ping statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - }, - id="_4_c1_s56_t1_localhost", - ), - pytest.param( - { - "args": "ping -6 -c1 -s8 -t1 localhost", - "returncode": 0, - "stdout": """\ -PING6(56=40+8+8 bytes) ::1 --> ::1 -16 bytes from ::1, icmp_seq=0 hlim= time= ms - ---- localhost ping6 statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/std-dev = /// ms -""", - "stderr": "", - }, - id="_6_c1_s8_t1_localhost", - ), - pytest.param( - { - "args": "ping -A -c1 192.0.2.1", - "returncode": 0, - "stdout": """\ -PING 192.0.2.1 (192.0.2.1): 56 data bytes -64 bytes from: icmp_seq=0 ttl= time= ms - ---- 192.0.2.1 ping statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - }, - id="_A_c1_192_0_2_1", - ), - pytest.param( - { - "args": "ping -A -c1 192.0.2.2", - "returncode": 2, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes - ---- 192.0.2.2 ping statistics --- -1 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_A_c1_192_0_2_2", - ), - pytest.param( - { - "args": "ping -A -c1 2001:db8::1", - "returncode": 0, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 -16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms - ---- 2001:db8::1 ping6 statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/std-dev = /// ms -""", - "stderr": "", - }, - id="_A_c1_2001_db8__1", - ), - pytest.param( - { - "args": "ping -A -c1 2001:db8::2", - "returncode": 2, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 - ---- 2001:db8::2 ping6 statistics --- -1 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_A_c1_2001_db8__2", - ), - pytest.param( - { - "args": "ping -A -c3 192.0.2.1", - "returncode": 0, - "stdout": """\ -PING 192.0.2.1 (192.0.2.1): 56 data bytes -64 bytes from: icmp_seq=0 ttl= time= ms -64 bytes from: icmp_seq=1 ttl= time= ms -64 bytes from: icmp_seq=2 ttl= time= ms - ---- 192.0.2.1 ping statistics --- -3 packets transmitted, 3 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - }, - id="_A_3_192_0.2.1", - ), - pytest.param( - { - "args": "ping -A -c3 192.0.2.2", - "returncode": 2, - "stdout": """\ -\x07\x07PING 192.0.2.2 (192.0.2.2): 56 data bytes - ---- 192.0.2.2 ping statistics --- -3 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_A_c3_192_0_2_2", - ), - pytest.param( - { - "args": "ping -A -c3 2001:db8::1", - "returncode": 0, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 -16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms -16 bytes from 2001:db8::1, icmp_seq=1 hlim= time= ms -16 bytes from 2001:db8::1, icmp_seq=2 hlim= time= ms - ---- 2001:db8::1 ping6 statistics --- -3 packets transmitted, 3 packets received, 0.0% packet loss -round-trip min/avg/max/std-dev = /// ms -""", - "stderr": "", - }, - id="_A_c3_2001_db8__1", - ), - pytest.param( - { - "args": "ping -A -c3 2001:db8::2", - "returncode": 2, - "stdout": """\ -\x07\x07PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 - ---- 2001:db8::2 ping6 statistics --- -3 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_A_c3_2001_db8__2", - ), - pytest.param( - { - "args": "ping -c1 192.0.2.1", - "returncode": 0, - "stdout": """\ -PING 192.0.2.1 (192.0.2.1): 56 data bytes -64 bytes from: icmp_seq=0 ttl= time= ms - ---- 192.0.2.1 ping statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - }, - id="_c1_192_0_2_1", - ), - pytest.param( - { - "args": "ping -c1 192.0.2.2", - "returncode": 2, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes - ---- 192.0.2.2 ping statistics --- -1 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_c1_192_0_2_2", - ), - pytest.param( - { - "args": "ping -c1 2001:db8::1", - "returncode": 0, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 -16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms - ---- 2001:db8::1 ping6 statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/std-dev = /// ms -""", - "stderr": "", - }, - id="_c1_2001_db8__1", - ), - pytest.param( - { - "args": "ping -c1 2001:db8::2", - "returncode": 2, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 - ---- 2001:db8::2 ping6 statistics --- -1 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_c1_2001_db8__2", - ), - pytest.param( - { - "args": "ping -c1 -S127.0.0.1 -s56 -t1 localhost", - "returncode": 0, - "stdout": """\ -PING localhost from: 56 data bytes -64 bytes from: icmp_seq=0 ttl= time= ms - ---- localhost ping statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - }, - id="_c1_S127_0_0_1_s56_t1_localhost", - ), - pytest.param( - { - "args": "ping -c1 -S::1 -s8 -t1 localhost", - "returncode": 0, - "stdout": """\ -PING6(56=40+8+8 bytes) ::1 --> ::1 -16 bytes from ::1, icmp_seq=0 hlim= time= ms - ---- localhost ping6 statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/std-dev = /// ms -""", - "stderr": "", - }, - id="_c1_S__1_s8_t1_localhost", - ), - pytest.param( - { - "args": "ping -c3 192.0.2.1", - "returncode": 0, - "stdout": """\ -PING 192.0.2.1 (192.0.2.1): 56 data bytes -64 bytes from: icmp_seq=0 ttl= time= ms -64 bytes from: icmp_seq=1 ttl= time= ms -64 bytes from: icmp_seq=2 ttl= time= ms - ---- 192.0.2.1 ping statistics --- -3 packets transmitted, 3 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - }, - id="_c3_192_0_2_1", - ), - pytest.param( - { - "args": "ping -c3 192.0.2.2", - "returncode": 2, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes - ---- 192.0.2.2 ping statistics --- -3 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_c3_192_0_2_2", - ), - pytest.param( - { - "args": "ping -c3 2001:db8::1", - "returncode": 0, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 -16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms -16 bytes from 2001:db8::1, icmp_seq=1 hlim= time= ms -16 bytes from 2001:db8::1, icmp_seq=2 hlim= time= ms - ---- 2001:db8::1 ping6 statistics --- -3 packets transmitted, 3 packets received, 0.0% packet loss -round-trip min/avg/max/std-dev = /// ms -""", - "stderr": "", - }, - id="_c3_2001_db8__1", - ), - pytest.param( - { - "args": "ping -c3 2001:db8::2", - "returncode": 2, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 - ---- 2001:db8::2 ping6 statistics --- -3 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_c3_2001_db8__2", - ), - pytest.param( - { - "args": "ping -q -c1 192.0.2.1", - "returncode": 0, - "stdout": """\ -PING 192.0.2.1 (192.0.2.1): 56 data bytes - ---- 192.0.2.1 ping statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - }, - id="_q_c1_192_0_2_1", - ), - pytest.param( - { - "args": "ping -q -c1 192.0.2.2", - "returncode": 2, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes - ---- 192.0.2.2 ping statistics --- -1 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_q_c1_192_0_2_2", - ), - pytest.param( - { - "args": "ping -q -c1 2001:db8::1", - "returncode": 0, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 - ---- 2001:db8::1 ping6 statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/std-dev = /// ms -""", - "stderr": "", - }, - id="_q_c1_2001_db8__1", - ), - pytest.param( - { - "args": "ping -q -c1 2001:db8::2", - "returncode": 2, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 - ---- 2001:db8::2 ping6 statistics --- -1 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_q_c1_2001_db8__2", - ), - pytest.param( - { - "args": "ping -q -c3 192.0.2.1", - "returncode": 0, - "stdout": """\ -PING 192.0.2.1 (192.0.2.1): 56 data bytes - ---- 192.0.2.1 ping statistics --- -3 packets transmitted, 3 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - }, - id="_q_c3_192_0_2_1", - ), - pytest.param( - { - "args": "ping -q -c3 192.0.2.2", - "returncode": 2, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes - ---- 192.0.2.2 ping statistics --- -3 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_q_c3_192_0_2_2", - ), - pytest.param( - { - "args": "ping -q -c3 2001:db8::1", - "returncode": 0, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 - ---- 2001:db8::1 ping6 statistics --- -3 packets transmitted, 3 packets received, 0.0% packet loss -round-trip min/avg/max/std-dev = /// ms -""", - "stderr": "", - }, - id="_q_c3_2001_db8__1", - ), - pytest.param( - { - "args": "ping -q -c3 2001:db8::2", - "returncode": 2, - "stdout": """\ -PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 - ---- 2001:db8::2 ping6 statistics --- -3 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - }, - id="_q_c3_2001_db8__2", - ), - ] - - @pytest.mark.parametrize("expected", testdata) - def test_ping(self, expected): - """Test ping""" - ping = subprocess.run( - expected["args"].split(), - capture_output=True, - timeout=15, - text=True, - ) - assert ping.returncode == expected["returncode"] - assert redact(ping.stdout) == expected["stdout"] - assert ping.stderr == expected["stderr"] - - # Each param in ping46_testdata contains a dictionary with the arguments - # and the expected outcome (returncode, redacted stdout, and stderr) - # common to `ping -4` and `ping -6` - ping46_testdata = [ - pytest.param( - { - "args": "-Wx localhost", - "returncode": os.EX_USAGE, - "stdout": "", - "stderr": "ping: invalid timing interval: `x'\n", - }, - marks=pytest.mark.skip("XXX currently failing"), - id="_Wx_localhost", - ), - ] - - @pytest.mark.parametrize("expected", ping46_testdata) - def test_ping_46(self, expected): - """Test ping -4/ping -6""" - for version in [4, 6]: - ping = subprocess.run( - ["ping", f"-{version}"] + expected["args"].split(), - capture_output=True, - timeout=15, - text=True, - ) - assert ping.returncode == expected["returncode"] - assert redact(ping.stdout) == expected["stdout"] - assert ping.stderr == expected["stderr"] - - # Each param in pinger_testdata contains a dictionary with the keywords to - # `pinger()` and a dictionary with the expected outcome (returncode, - # stdout, stderr, and if ping's output is redacted) - pinger_testdata = [ - pytest.param( - { - "src": "192.0.2.1", - "dst": "192.0.2.2", - "icmp_type": 0, - "icmp_code": 0, - }, - { - "returncode": 0, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes -64 bytes from: icmp_seq=0 ttl= time= ms - ---- 192.0.2.2 ping statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - "redacted": True, - }, - id="_0_0", - ), - pytest.param( - { - "src": "192.0.2.1", - "dst": "192.0.2.2", - "icmp_type": 0, - "icmp_code": 0, - "opts": "NOP-40", - }, - { - "returncode": 0, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes -64 bytes from: icmp_seq=0 ttl= time= ms -wrong total length 124 instead of 84 -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP -NOP - ---- 192.0.2.2 ping statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - "redacted": True, - }, - id="_0_0_opts_NOP_40", - ), - pytest.param( - { - "src": "192.0.2.1", - "dst": "192.0.2.2", - "icmp_type": 0, - "icmp_code": 0, - "opts": "unk", - }, - { - "returncode": 0, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes -64 bytes from: icmp_seq=0 ttl= time= ms -wrong total length 88 instead of 84 -unknown option 9f - ---- 192.0.2.2 ping statistics --- -1 packets transmitted, 1 packets received, 0.0% packet loss -round-trip min/avg/max/stddev = /// ms -""", - "stderr": "", - "redacted": True, - }, - marks=pytest.mark.skip("XXX currently failing"), - id="_0_0_opts_unk", - ), - pytest.param( - { - "src": "192.0.2.1", - "dst": "192.0.2.2", - "icmp_type": 3, - "icmp_code": 1, - "opts": "NOP-40", - }, - { - "returncode": 2, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes -132 bytes from 192.0.2.2: Destination Host Unreachable -Vr HL TOS Len ID Flg off TTL Pro cks Src Dst - 4 f 00 007c 0001 0 0000 40 01 d868 192.0.2.1 192.0.2.2 01010101010101010101010101010101010101010101010101010101010101010101010101010101 - - ---- 192.0.2.2 ping statistics --- -1 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - "redacted": False, - }, - marks=pytest.mark.skip("XXX currently failing"), - id="_3_1_opts_NOP_40", - ), - pytest.param( - { - "src": "192.0.2.1", - "dst": "192.0.2.2", - "icmp_type": 3, - "icmp_code": 1, - "flags": "DF", - }, - { - "returncode": 2, - "stdout": """\ -PING 192.0.2.2 (192.0.2.2): 56 data bytes -92 bytes from 192.0.2.2: Destination Host Unreachable -Vr HL TOS Len ID Flg off TTL Pro cks Src Dst - 4 5 00 0054 0001 2 0000 40 01 b6a4 192.0.2.1 192.0.2.2 - - ---- 192.0.2.2 ping statistics --- -1 packets transmitted, 0 packets received, 100.0% packet loss -""", - "stderr": "", - "redacted": False, - }, - marks=pytest.mark.skip("XXX currently failing"), - id="_3_1_flags_DF", - ), - ] - - @pytest.mark.parametrize("pinger_kargs, expected", pinger_testdata) - @pytest.mark.require_progs(["scapy"]) - @pytest.mark.require_user("root") - def test_pinger(self, pinger_kargs, expected): - """Test ping using pinger(), a reply faker""" - iface = IfaceFactory().create_iface("", "tun")[0].name - ping = pinger(iface, **pinger_kargs) - assert ping.returncode == expected["returncode"] - if expected["redacted"]: - assert redact(ping.stdout) == expected["stdout"] - else: - assert ping.stdout == expected["stdout"] - assert ping.stderr == expected["stderr"] From nobody Mon Feb 20 10:34:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKzM55TD0z3sbZZ; Mon, 20 Feb 2023 10:34: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 4PKzM53vmZz4QPK; Mon, 20 Feb 2023 10:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676889297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rVxq6INrQXFQRWrF7pTxl4MddN4LZAejj6CUhqJKEDE=; b=Jx/1t+Exi1f9HMhg9PMllNIzmyHGFBpLRkjJ9cMa8hyNS8c5AbfnFddC5433riMimCxCPG wQq2y7B0FbRsKR7mhDQUwHuYeF0l7Et8DTszzfwfVdiLjyHu0nweKHun9C4Vx6w0EUARUC 7pqJ/QzMa45cxxFm6nUUWaW2OvK5vNU3Q3m6EbndjHcGL8ZdYAVoxgmvvhdiXyDLL4I7e8 q03K8Q5ts0utgY7tqhpROdTGzV7veuGVKAKd0iWjlav5P5Qs/fqzLtD0UHNGalBTPDmMYa 7K2xQl2MR8WtKfACwz90uqVuOBww+LYJ5lk6DypJUrumwdUCZ11tuKrVWb0tGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676889297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rVxq6INrQXFQRWrF7pTxl4MddN4LZAejj6CUhqJKEDE=; b=yqITomicViveq+gdd6Fk067Yi7D8QQL6kLCzmoL12jKWr/AIgZOPv7utowUBgF0j/yY3pG 1Le6AIhWVxqoOv8zZTKipO1uchssmCCOFdSQJTP3wOzjmLk7qakbjrXLkE3WXDwymRrGFP 6AOwsVGyMAp0tPLkoojTMa3/8pw7YTVVG/zrhonR7Ac42uUULMA+AWZXrRHW+GRkRmsyec sh49K7+Z3Z6kDpEM1XmybahGMFWxDrjKaSzCds36gfc5eqGiOOHs1+HZQSec0Zq5mK7nev 5wXdUZ47mUGR0JvWbQ878CfqvjZv81VXDgVDDvNCtnga/Ib9YJZBKgiJyYgV5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676889297; a=rsa-sha256; cv=none; b=d62cSW+BAnm2juQJ/m6TzP0iOg7i7kiiMNywj/4W9X8KYCiSvUDLBQUhQZ+5pCalg1ge1V o0m+TddzwHhNgPHyL8etyba5m4qZAjuL07TIfJOpECl5eB25xxUZavpHlaRVaZpdsCO7oK Vf7VURT5DE3/lQJUw14zwdyncFtCIZJyTMB8+6XjMY1PoQ+HU4L1hLjbokYU2ojrIOBz4B o13BhLqC5v3IuXHP3GH7fs+mNGKH8k8oZAIN/7tmR1w1cjC9QTTlG1kjiXSxx9eo1PMl1M wuJL34iVdR4kIQguShkuvKjn/7Tpowe56yUDbH+JTWCWpP+fZd/QQONhkX/uVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PKzM52zvNzdMx; Mon, 20 Feb 2023 10:34: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 31KAYv3U061764; Mon, 20 Feb 2023 10:34:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KAYvTM061762; Mon, 20 Feb 2023 10:34:57 GMT (envelope-from git) Date: Mon, 20 Feb 2023 10:34:57 GMT Message-Id: <202302201034.31KAYvTM061762@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: 5b8af90fe332 - main - ping: Add ATF-Python tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b8af90fe33274dda4c342ee7727432fdf5501d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=5b8af90fe33274dda4c342ee7727432fdf5501d7 commit 5b8af90fe33274dda4c342ee7727432fdf5501d7 Author: Jose Luis Duran AuthorDate: 2023-02-20 10:23:24 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 10:34:33 +0000 ping: Add ATF-Python tests ping(8) is an old utility, which has received many changes and updates through the years. Some of these changes may have introduced small bugs, in part due to the lack of tests. Attempt to remedy the current situation by introducing a way to easily add tests. Differential Revision: https://reviews.freebsd.org/D38053 --- sbin/ping/tests/Makefile | 1 + sbin/ping/tests/test_ping.py | 940 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 941 insertions(+) diff --git a/sbin/ping/tests/Makefile b/sbin/ping/tests/Makefile index c6845ac57e5c..044687c03dc3 100644 --- a/sbin/ping/tests/Makefile +++ b/sbin/ping/tests/Makefile @@ -5,6 +5,7 @@ SRCS.in_cksum_test= in_cksum_test.c ../utils.c PACKAGE= tests +ATF_TESTS_PYTEST+= test_ping.py ATF_TESTS_SH+= ping_test # Exclusive because each injection test case uses the same IP addresses TEST_METADATA.ping_test+= is_exclusive="true" diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py new file mode 100644 index 000000000000..913948d18b3e --- /dev/null +++ b/sbin/ping/tests/test_ping.py @@ -0,0 +1,940 @@ +import pytest + +import logging +import os +import re +import subprocess + +from atf_python.sys.net.vnet import IfaceFactory +from atf_python.sys.net.vnet import SingleVnetTestTemplate +from atf_python.sys.net.tools import ToolsHelper +from typing import List +from typing import Optional + +logging.getLogger("scapy").setLevel(logging.CRITICAL) +import scapy.all as sc + + +def build_response_packet(echo, ip, icmp, oip_ihl, special): + icmp_id_seq_types = [0, 8, 13, 14, 15, 16, 17, 18, 37, 38] + oip = echo[sc.IP] + oicmp = echo[sc.ICMP] + load = echo[sc.ICMP].payload + oip[sc.IP].remove_payload() + oicmp[sc.ICMP].remove_payload() + oicmp.type = 8 + + # As if the original IP packet had these set + oip.ihl = None + oip.len = None + oip.id = 1 + oip.flags = ip.flags + oip.chksum = None + oip.options = ip.options + + # Inner packet (oip) options + if oip_ihl: + oip.ihl = oip_ihl + + # Special options + if special == "no-payload": + load = "" + if special == "tcp": + oip.proto = "tcp" + tcp = sc.TCP(sport=1234, dport=5678) + return ip / icmp / oip / tcp + if special == "udp": + oip.proto = "udp" + udp = sc.UDP(sport=1234, dport=5678) + return ip / icmp / oip / udp + if special == "warp": + # Build a package with a timestamp of INT_MAX + # (time-warped package) + payload_no_timestamp = sc.bytes_hex(load)[16:] + load = (b"\xff" * 8) + sc.hex_bytes(payload_no_timestamp) + if special == "wrong": + # Build a package with a wrong last byte + payload_no_last_byte = sc.bytes_hex(load)[:-2] + load = (sc.hex_bytes(payload_no_last_byte)) + b"\x00" + + if icmp.type in icmp_id_seq_types: + pkt = ip / icmp / load + else: + ip.options = "" + pkt = ip / icmp / oip / oicmp / load + return pkt + + +def generate_ip_options(opts): + if not opts: + return "" + + routers = [ + "192.0.2.10", + "192.0.2.20", + "192.0.2.30", + "192.0.2.40", + "192.0.2.50", + "192.0.2.60", + "192.0.2.70", + "192.0.2.80", + "192.0.2.90", + ] + routers_zero = [0, 0, 0, 0, 0, 0, 0, 0, 0] + if opts == "EOL": + options = sc.IPOption(b"\x00") + elif opts == "NOP": + options = sc.IPOption(b"\x01") + elif opts == "NOP-40": + options = sc.IPOption(b"\x01" * 40) + elif opts == "RR": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_RR(pointer=40, routers=routers) + elif opts == "RR-same": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_RR(pointer=3, routers=routers_zero) + elif opts == "RR-trunc": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_RR(length=7, routers=routers_zero) + elif opts == "LSRR": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_LSRR(routers=routers) + elif opts == "LSRR-trunc": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_LSRR(length=3, routers=routers_zero) + elif opts == "SSRR": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_SSRR(routers=routers) + elif opts == "SSRR-trunc": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption_SSRR(length=3, routers=routers_zero) + elif opts == "unk": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption(b"\x9f") + elif opts == "unk-40": + ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) + options = sc.IPOption(b"\x9f" * 40) + else: + options = "" + return options + + +def pinger( + # Required arguments + # Avoid setting defaults on these arguments, + # as we want to set them explicitly in the tests + iface: str, + /, + src: sc.scapy.fields.SourceIPField, + dst: sc.scapy.layers.inet.DestIPField, + icmp_type: sc.scapy.fields.ByteEnumField, + icmp_code: sc.scapy.fields.MultiEnumField, + # IP arguments + ihl: Optional[sc.scapy.fields.BitField] = None, + flags: Optional[sc.scapy.fields.FlagsField] = None, + opts: Optional[str] = None, + oip_ihl: Optional[sc.scapy.fields.BitField] = None, + special: Optional[str] = None, + # ICMP arguments + # Match names with + icmp_pptr: sc.scapy.fields.ByteField = 0, + icmp_gwaddr: sc.scapy.fields.IPField = "0.0.0.0", + icmp_nextmtu: sc.scapy.fields.ShortField = 0, + icmp_otime: sc.scapy.layers.inet.ICMPTimeStampField = 0, + icmp_rtime: sc.scapy.layers.inet.ICMPTimeStampField = 0, + icmp_ttime: sc.scapy.layers.inet.ICMPTimeStampField = 0, + icmp_mask: sc.scapy.fields.IPField = "0.0.0.0", + request: Optional[str] = None, + # Miscellaneous arguments + count: int = 1, + dup: bool = False, +) -> subprocess.CompletedProcess: + """P I N G E R + + Echo reply faker + + :param str iface: Interface to send packet to + :keyword src: Source packet IP + :type src: class:`scapy.fields.SourceIPField` + :keyword dst: Destination packet IP + :type dst: class:`scapy.layers.inet.DestIPField` + :keyword icmp_type: ICMP type + :type icmp_type: class:`scapy.fields.ByteEnumField` + :keyword icmp_code: ICMP code + :type icmp_code: class:`scapy.fields.MultiEnumField` + + :keyword ihl: Internet Header Length, defaults to None + :type ihl: class:`scapy.fields.BitField`, optional + :keyword flags: IP flags - one of `DF`, `MF` or `evil`, defaults to None + :type flags: class:`scapy.fields.FlagsField`, optional + :keyword opts: Include IP options - one of `EOL`, `NOP`, `NOP-40`, `unk`, + `unk-40`, `RR`, `RR-same`, `RR-trunc`, `LSRR`, `LSRR-trunc`, `SSRR` or + `SSRR-trunc`, defaults to None + :type opts: str, optional + :keyword oip_ihl: Inner packet's Internet Header Length, defaults to None + :type oip_ihl: class:`scapy.fields.BitField`, optional + :keyword special: Send a special packet - one of `no-payload`, `tcp`, + `udp`, `wrong` or `warp`, defaults to None + :type special: str, optional + :keyword icmp_pptr: ICMP pointer, defaults to 0 + :type icmp_pptr: class:`scapy.fields.ByteField` + :keyword icmp_gwaddr: ICMP gateway IP address, defaults to "0.0.0.0" + :type icmp_gwaddr: class:`scapy.fields.IPField` + :keyword icmp_nextmtu: ICMP next MTU, defaults to 0 + :type icmp_nextmtu: class:`scapy.fields.ShortField` + :keyword icmp_otime: ICMP originate timestamp, defaults to 0 + :type icmp_otime: class:`scapy.layers.inet.ICMPTimeStampField` + :keyword icmp_rtime: ICMP receive timestamp, defaults to 0 + :type icmp_rtime: class:`scapy.layers.inet.ICMPTimeStampField` + :keyword icmp_ttime: ICMP transmit timestamp, defaults to 0 + :type icmp_ttime: class:`scapy.layers.inet.ICMPTimeStampField` + :keyword icmp_mask: ICMP address mask, defaults to "0.0.0.0" + :type icmp_mask: class:`scapy.fields.IPField` + :keyword request: Request type - one of `mask` or `timestamp`, + defaults to None + :type request: str, optional + :keyword count: Number of packets to send, defaults to 1 + :type count: int + :keyword dup: Duplicate packets, defaults to `False` + :type dup: bool + + :return: A class:`subprocess.CompletedProcess` with the output from the + ping utility + :rtype: class:`subprocess.CompletedProcess` + """ + tun = sc.TunTapInterface(iface) + subprocess.run(["ifconfig", tun.iface, "up"], check=True) + subprocess.run(["ifconfig", tun.iface, src, dst], check=True) + ip_opts = generate_ip_options(opts) + ip = sc.IP(ihl=ihl, flags=flags, src=dst, dst=src, options=ip_opts) + command = [ + "/sbin/ping", + "-c", + str(count), + "-t", + str(count), + "-v", + ] + if request == "mask": + command += ["-Mm"] + if request == "timestamp": + command += ["-Mt"] + if special: + command += ["-p1"] + if opts in [ + "RR", + "RR-same", + "RR-trunc", + "LSRR", + "LSRR-trunc", + "SSRR", + "SSRR-trunc", + ]: + command += ["-R"] + command += [dst] + with subprocess.Popen( + args=command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True + ) as ping: + for dummy in range(count): + echo = tun.recv() + icmp = sc.ICMP( + type=icmp_type, + code=icmp_code, + id=echo[sc.ICMP].id, + seq=echo[sc.ICMP].seq, + ts_ori=icmp_otime, + ts_rx=icmp_rtime, + ts_tx=icmp_ttime, + gw=icmp_gwaddr, + ptr=icmp_pptr, + addr_mask=icmp_mask, + nexthopmtu=icmp_nextmtu, + ) + pkt = build_response_packet(echo, ip, icmp, oip_ihl, special) + tun.send(pkt) + if dup is True: + tun.send(pkt) + stdout, stderr = ping.communicate() + return subprocess.CompletedProcess( + ping.args, ping.returncode, stdout, stderr + ) + + +def redact(output): + """Redact some elements of ping's output""" + pattern_replacements = [ + ("localhost \([0-9]{1,3}(\.[0-9]{1,3}){3}\)", "localhost"), + ("from [0-9]{1,3}(\.[0-9]{1,3}){3}", "from"), + ("hlim=[0-9]*", "hlim="), + ("ttl=[0-9]*", "ttl="), + ("time=[0-9.-]*", "time="), + ("[0-9\.]+/[0-9.]+", "/"), + ] + for pattern, repl in pattern_replacements: + output = re.sub(pattern, repl, output) + return output + + +class TestPing(SingleVnetTestTemplate): + IPV6_PREFIXES: List[str] = ["2001:db8::1/64"] + IPV4_PREFIXES: List[str] = ["192.0.2.1/24"] + + # Each param in testdata contains a dictionary with the command, + # and the expected outcome (returncode, redacted stdout, and stderr) + testdata = [ + pytest.param( + { + "args": "ping -4 -c1 -s56 -t1 localhost", + "returncode": 0, + "stdout": """\ +PING localhost: 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- localhost ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_4_c1_s56_t1_localhost", + ), + pytest.param( + { + "args": "ping -6 -c1 -s8 -t1 localhost", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim= time= ms + +--- localhost ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_6_c1_s8_t1_localhost", + ), + pytest.param( + { + "args": "ping -A -c1 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- 192.0.2.1 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_A_c1_192_0_2_1", + ), + pytest.param( + { + "args": "ping -A -c1 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_A_c1_192_0_2_2", + ), + pytest.param( + { + "args": "ping -A -c1 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 +16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms + +--- 2001:db8::1 ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_A_c1_2001_db8__1", + ), + pytest.param( + { + "args": "ping -A -c1 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_A_c1_2001_db8__2", + ), + pytest.param( + { + "args": "ping -A -c3 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +64 bytes from: icmp_seq=1 ttl= time= ms +64 bytes from: icmp_seq=2 ttl= time= ms + +--- 192.0.2.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_A_3_192_0.2.1", + ), + pytest.param( + { + "args": "ping -A -c3 192.0.2.2", + "returncode": 2, + "stdout": """\ +\x07\x07PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_A_c3_192_0_2_2", + ), + pytest.param( + { + "args": "ping -A -c3 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 +16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms +16 bytes from 2001:db8::1, icmp_seq=1 hlim= time= ms +16 bytes from 2001:db8::1, icmp_seq=2 hlim= time= ms + +--- 2001:db8::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_A_c3_2001_db8__1", + ), + pytest.param( + { + "args": "ping -A -c3 2001:db8::2", + "returncode": 2, + "stdout": """\ +\x07\x07PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_A_c3_2001_db8__2", + ), + pytest.param( + { + "args": "ping -c1 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- 192.0.2.1 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_c1_192_0_2_1", + ), + pytest.param( + { + "args": "ping -c1 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_c1_192_0_2_2", + ), + pytest.param( + { + "args": "ping -c1 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 +16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms + +--- 2001:db8::1 ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_c1_2001_db8__1", + ), + pytest.param( + { + "args": "ping -c1 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_c1_2001_db8__2", + ), + pytest.param( + { + "args": "ping -c1 -S127.0.0.1 -s56 -t1 localhost", + "returncode": 0, + "stdout": """\ +PING localhost from: 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- localhost ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_c1_S127_0_0_1_s56_t1_localhost", + ), + pytest.param( + { + "args": "ping -c1 -S::1 -s8 -t1 localhost", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) ::1 --> ::1 +16 bytes from ::1, icmp_seq=0 hlim= time= ms + +--- localhost ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_c1_S__1_s8_t1_localhost", + ), + pytest.param( + { + "args": "ping -c3 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +64 bytes from: icmp_seq=1 ttl= time= ms +64 bytes from: icmp_seq=2 ttl= time= ms + +--- 192.0.2.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_c3_192_0_2_1", + ), + pytest.param( + { + "args": "ping -c3 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_c3_192_0_2_2", + ), + pytest.param( + { + "args": "ping -c3 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 +16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms +16 bytes from 2001:db8::1, icmp_seq=1 hlim= time= ms +16 bytes from 2001:db8::1, icmp_seq=2 hlim= time= ms + +--- 2001:db8::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_c3_2001_db8__1", + ), + pytest.param( + { + "args": "ping -c3 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_c3_2001_db8__2", + ), + pytest.param( + { + "args": "ping -q -c1 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes + +--- 192.0.2.1 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_q_c1_192_0_2_1", + ), + pytest.param( + { + "args": "ping -q -c1 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_q_c1_192_0_2_2", + ), + pytest.param( + { + "args": "ping -q -c1 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 + +--- 2001:db8::1 ping6 statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_q_c1_2001_db8__1", + ), + pytest.param( + { + "args": "ping -q -c1 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_q_c1_2001_db8__2", + ), + pytest.param( + { + "args": "ping -q -c3 192.0.2.1", + "returncode": 0, + "stdout": """\ +PING 192.0.2.1 (192.0.2.1): 56 data bytes + +--- 192.0.2.1 ping statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + }, + id="_q_c3_192_0_2_1", + ), + pytest.param( + { + "args": "ping -q -c3 192.0.2.2", + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes + +--- 192.0.2.2 ping statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_q_c3_192_0_2_2", + ), + pytest.param( + { + "args": "ping -q -c3 2001:db8::1", + "returncode": 0, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1 + +--- 2001:db8::1 ping6 statistics --- +3 packets transmitted, 3 packets received, 0.0% packet loss +round-trip min/avg/max/std-dev = /// ms +""", + "stderr": "", + }, + id="_q_c3_2001_db8__1", + ), + pytest.param( + { + "args": "ping -q -c3 2001:db8::2", + "returncode": 2, + "stdout": """\ +PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 + +--- 2001:db8::2 ping6 statistics --- +3 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + }, + id="_q_c3_2001_db8__2", + ), + ] + + @pytest.mark.parametrize("expected", testdata) + def test_ping(self, expected): + """Test ping""" + ping = subprocess.run( + expected["args"].split(), + capture_output=True, + timeout=15, + text=True, + ) + assert ping.returncode == expected["returncode"] + assert redact(ping.stdout) == expected["stdout"] + assert ping.stderr == expected["stderr"] + + # Each param in ping46_testdata contains a dictionary with the arguments + # and the expected outcome (returncode, redacted stdout, and stderr) + # common to `ping -4` and `ping -6` + ping46_testdata = [ + pytest.param( + { + "args": "-Wx localhost", + "returncode": os.EX_USAGE, + "stdout": "", + "stderr": "ping: invalid timing interval: `x'\n", + }, + marks=pytest.mark.skip("XXX currently failing"), + id="_Wx_localhost", + ), + ] + + @pytest.mark.parametrize("expected", ping46_testdata) + def test_ping_46(self, expected): + """Test ping -4/ping -6""" + for version in [4, 6]: + ping = subprocess.run( + ["ping", f"-{version}"] + expected["args"].split(), + capture_output=True, + timeout=15, + text=True, + ) + assert ping.returncode == expected["returncode"] + assert redact(ping.stdout) == expected["stdout"] + assert ping.stderr == expected["stderr"] + + # Each param in pinger_testdata contains a dictionary with the keywords to + # `pinger()` and a dictionary with the expected outcome (returncode, + # stdout, stderr, and if ping's output is redacted) + pinger_testdata = [ + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "NOP-40", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +wrong total length 124 instead of 84 +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP +NOP + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + id="_0_0_opts_NOP_40", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 0, + "icmp_code": 0, + "opts": "unk", + }, + { + "returncode": 0, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +64 bytes from: icmp_seq=0 ttl= time= ms +wrong total length 88 instead of 84 +unknown option 9f + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 1 packets received, 0.0% packet loss +round-trip min/avg/max/stddev = /// ms +""", + "stderr": "", + "redacted": True, + }, + marks=pytest.mark.skip("XXX currently failing"), + id="_0_0_opts_unk", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 3, + "icmp_code": 1, + "opts": "NOP-40", + }, + { + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +132 bytes from 192.0.2.2: Destination Host Unreachable +Vr HL TOS Len ID Flg off TTL Pro cks Src Dst + 4 f 00 007c 0001 0 0000 40 01 d868 192.0.2.1 192.0.2.2 01010101010101010101010101010101010101010101010101010101010101010101010101010101 + + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + "redacted": False, + }, + marks=pytest.mark.skip("XXX currently failing"), + id="_3_1_opts_NOP_40", + ), + pytest.param( + { + "src": "192.0.2.1", + "dst": "192.0.2.2", + "icmp_type": 3, + "icmp_code": 1, + "flags": "DF", + }, + { + "returncode": 2, + "stdout": """\ +PING 192.0.2.2 (192.0.2.2): 56 data bytes +92 bytes from 192.0.2.2: Destination Host Unreachable +Vr HL TOS Len ID Flg off TTL Pro cks Src Dst + 4 5 00 0054 0001 2 0000 40 01 b6a4 192.0.2.1 192.0.2.2 + + +--- 192.0.2.2 ping statistics --- +1 packets transmitted, 0 packets received, 100.0% packet loss +""", + "stderr": "", + "redacted": False, + }, + marks=pytest.mark.skip("XXX currently failing"), + id="_3_1_flags_DF", + ), + ] + + @pytest.mark.parametrize("pinger_kargs, expected", pinger_testdata) + @pytest.mark.require_progs(["scapy"]) + @pytest.mark.require_user("root") + def test_pinger(self, pinger_kargs, expected): + """Test ping using pinger(), a reply faker""" + iface = IfaceFactory().create_iface("", "tun")[0].name + ping = pinger(iface, **pinger_kargs) + assert ping.returncode == expected["returncode"] + if expected["redacted"]: + assert redact(ping.stdout) == expected["stdout"] + else: + assert ping.stdout == expected["stdout"] + assert ping.stderr == expected["stderr"] From nobody Mon Feb 20 11:06:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL03J3P3gz3sdfw; Mon, 20 Feb 2023 11:06: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 4PL03J2fz5z3G4C; Mon, 20 Feb 2023 11:06:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676891180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evYmJQD2JWEr5HkAHaQgv9be6iPhuMnBBspqS9W0Awg=; b=yDHfzP3bHBFNbAoFrwsDCvG/k0oqlv2tTljZ1VpHTlQd3xH23QrpDTy3Sd184Qti/qCbxE yYeMu67c1M9Jr0q20hVzSWz0Uq9dtbMXtai72ItftktKwIdiZyzbwzj4EZiN3/abeyF2y/ /DQbyc+3/w4R1EOBseR+ZBNOjN0UDzoFhc2NnYt17LngZ+bT4+pgIY6pXIsVep/nlpuUZ5 BtsTvSElSmjzyqwS9nUksz+zEqlaGk553sleqiCtUVQeVuPTTocWZYVbxgG1yaJZKP3Y7w L6n2//rNFBeI8GTugIeSzySQVM/jBGgPBGVFgs64lo2B/2SMDkTvFSl2O6zSpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676891180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evYmJQD2JWEr5HkAHaQgv9be6iPhuMnBBspqS9W0Awg=; b=my35BkPI7mbj6CfEbSm4v1Aqnj6yfTV/weFgA8TR2BNrJ1ByTcg3te6lcyiML9V27iaviK 57+ho4Qr3Qm9gqXj9lmHxnc+kUxcc8CgDJqVnpWp4dITjKQ89GgRJBrQFlZNxhEQS3AlDk Sj2X5N2tKze/ZDSHSRHcUiZj5JNKHmhCMYy7eirQlTubHTUj1VADuQttH7YnfUHbhUBuBv oDyHcr+Y4X0WAuIVsdwF0W5o50uHJ/mn57/IIDIW+q/ohy4s3PO2GQrp6UUOBkuuBvWQ8g Q5ILqxGxUjQoxBxGIvZBG8fGgRFMNcDR4PbsSwugz8DxFhHn9WYC0qYHoprTkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676891180; a=rsa-sha256; cv=none; b=H+XKExJ5cSqM0mJ0Mfu/kQBBDCJqvEva8Ec6sitTT8RHukD/WH5w/GddxX5QBLej5JbZdw pEC5vktA3++NTSX0Hpi5yRxW1dIPl7s+amuLf4N4gqTrhFK48dHZoHMswltbHk41RlyMaV Ezh6m7LaL5QyVXqrKZMaTsxAyudBOEkIrfxczKQ5bnCTeDjDm6QaNtYdODI6LdkxiWAwDB 7xf0MU2OVtRVa5FPdxtMc1sisJdRNDNRlx0uNxEyAgmJJxAt//2zTuE32UJMgeCZJiS5dM hIQ9GOBYRvkCXWY8hi+nFgl7haOaQjmD8sEpjnPX3emKm+8ObNzd98FU/DXFBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL03J1cX3zfK6; Mon, 20 Feb 2023 11:06: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 31KB6KIp005433; Mon, 20 Feb 2023 11:06:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KB6K9i005432; Mon, 20 Feb 2023 11:06:20 GMT (envelope-from git) Date: Mon, 20 Feb 2023 11:06:20 GMT Message-Id: <202302201106.31KB6K9i005432@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: 187f4fce3b34 - main - stress2: Added a fsck check to the scenario List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 187f4fce3b3445e69ab2da539c48e355981ae436 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=187f4fce3b3445e69ab2da539c48e355981ae436 commit 187f4fce3b3445e69ab2da539c48e355981ae436 Author: Peter Holm AuthorDate: 2023-02-20 11:04:24 +0000 Commit: Peter Holm CommitDate: 2023-02-20 11:04:24 +0000 stress2: Added a fsck check to the scenario --- tools/test/stress2/misc/newfs6.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/test/stress2/misc/newfs6.sh b/tools/test/stress2/misc/newfs6.sh index 5e887f1496a6..690170ceb938 100755 --- a/tools/test/stress2/misc/newfs6.sh +++ b/tools/test/stress2/misc/newfs6.sh @@ -38,6 +38,7 @@ mount | grep "on $mntpoint " | grep -q md$mdstart && mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 1g -u $mdstart || exit 1 +log=/tmp/newfs6.sh.log s=0 for opt in -O1 -O2 -U -j; do bs=4096 @@ -49,9 +50,15 @@ for opt in -O1 -O2 -U -j; do md$mdstart > /dev/null || { s=1; continue; } mount /dev/md$mdstart $mntpoint || s=2 && umount $mntpoint + fsck -fy /dev/md$mdstart > $log 2>&1 + grep -q "WAS MODIFIED" $log && { + s=3 + cat $log + } done bs=$((bs * 2)) done done mdconfig -d -u $mdstart +rm -f $log exit $s From nobody Mon Feb 20 11:16:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL0HH5tsTz3sfJg; Mon, 20 Feb 2023 11: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 4PL0HH5Pr7z3HWh; Mon, 20 Feb 2023 11: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=1676891803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4BVpxzyjMZ/RGb/U/Lcf/68/y46/n7riydnGNrAMOt8=; b=xWealB709iwxXi505NXQzdTM6oYRuffCI3rdan7CQoEhIT8p/682DEfRouC1Z1J09+QKMK rTwHMr2BOnpeaydSezE9g9irAb3u1X5kThbingsOcrG7ZZkfUrTSkw2a0VAu8KYvibMvd0 ergi0SWvcInK+pIEjJWe/drfvY6FTQFO8RjNGbdZOvK4Bzi97OtZ2cXfoAUNGm+RvKBesF ZMiZkYa8qcSUdXecVjv0euzj+RFsAONi8yEaCOrUNcBZH1+IcJ4N+r3GYdl/TJpFRHTSGh AcY2HPeHlBgTWHtDec+vKeEM1zJfjGNilkW7Hrg+ESnUjserd2TS+6u26hWczA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676891803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4BVpxzyjMZ/RGb/U/Lcf/68/y46/n7riydnGNrAMOt8=; b=IeVpE22fMmcBZjX7+rgZGuDcyNkEo7HzsDycYZ/RVVM2cZ2ePukFusKmJwC4CN40DyP0Ok zj7/KKxofSFkzVQEKWgLhcJPST/pWI9FQ24X7tGCA+juYzrpaQTWr/gpOaV78gEFFpPxXD URf5JABQ+jqsY+js9VTk6Ky2mcDwxG6QVolPV2ohv75xNyvBJtTdQuwP2alCY86Bt1anXp 9plD+F/7rExjUaRMwljPt0ZHzwgACRmEP44WrHgcTojPYYP3lvWABk+bMZSReWyZCEnThh 6tHEomjFB5znNOPvFpLUq3s/b1D2wdlDhYG/YKM0kSBjgf06U6yR60UTuWyGJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676891803; a=rsa-sha256; cv=none; b=mUeJQ8Tjcc1/gHmY48DaBoGSD8hu/FRIzjOyoWFvy0ZJTdx8fSLC92dRMbe/lH/n3sBsVJ OeKl1i+MhmelFl8ZZc8pvOZv0/QkzpJKnku4mzT+sYmnTHlfVK56gSoH892rODWij3dPVL mKkulahpNLVANXiC0MZOMfLs5kRF5WQPhrpyrgiUQPsricKD51n2lsf5ORrLRbvcIbUEeY RTSzwK332EEFp6fHjuKZqFiNhiGTyxUMYCrHWlfx/lscc2JlJpDoszSufmK+DIjQJilsbu tfBXxj/mgs8lIolkTnEA9yGpcMml+LzN2XlAjrJMOmkNwuDT+2yV59bg7tea0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL0HH4DYvzfgb; Mon, 20 Feb 2023 11:16: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 31KBGhaU020051; Mon, 20 Feb 2023 11: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 31KBGhU4020050; Mon, 20 Feb 2023 11:16:43 GMT (envelope-from git) Date: Mon, 20 Feb 2023 11:16:43 GMT Message-Id: <202302201116.31KBGhU4020050@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: e6ffcf4ac7bb - main - zless(1): handle uncompressed files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6ffcf4ac7bbfff95fdf7d6debc22880054abc76 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/src/commit/?id=e6ffcf4ac7bbfff95fdf7d6debc22880054abc76 commit e6ffcf4ac7bbfff95fdf7d6debc22880054abc76 Author: Fernando Apesteguía AuthorDate: 2023-02-19 16:31:11 +0000 Commit: Fernando Apesteguía CommitDate: 2023-02-20 10:15:09 +0000 zless(1): handle uncompressed files In the manual page for zmore(1) and zless(1) it is said that zless(1) is equivalent to zmore(1) except that it uses less(1) as a pager. However zmore(1) is able to handle uncompressed files transparently while zless(1) is not. Add another case to the switch in lesspipe.sh to handle non-compressed files. PR: 196437 Reported by: marquis@roble.com Approved by: mjg@ Differential Revision: https://reviews.freebsd.org/D38674 --- usr.bin/less/lesspipe.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/less/lesspipe.sh b/usr.bin/less/lesspipe.sh index 05df4d02b42c..079517679a6d 100644 --- a/usr.bin/less/lesspipe.sh +++ b/usr.bin/less/lesspipe.sh @@ -25,4 +25,6 @@ case "$1" in *.zst) exec zstd -d -q -c "$1" 2>/dev/null ;; + *) exec cat "$1" 2>/dev/null + ;; esac From nobody Mon Feb 20 12:30:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL1w81yPGz3skDw; Mon, 20 Feb 2023 12:30: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 4PL1w80k8qz3R7f; Mon, 20 Feb 2023 12:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676896216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lnkd8VgFHec62bV9PAaCpY5HYILYspD0Vspt0t9+ZR4=; b=yOotLUMPSmGY/gAzuMl19k/3adkcFcY5VYov6d+uEJx6GCF2sGQSLld7FUE/QtSJjJC+HQ uvvkR1Ojt7FMeuWsf4/AhsFyZTPfSe4aig5zY3DgqiLFh1TVGVjGqXH6TNydHVwQfMd8xs G7E2tgezKj1p35Py8lmGhbOj84Qcqv45zvJV0rX35MqWoxWel3SaiEQrdeR0mUjlfe/G9M MD+HSqJUXj5lfUG7Ie1LvdPpCvLw10qemWUTcuJlFydniJiHDffPNDryHv9SwqM+wsTs24 MWrWRUCu/laTXiOBE6TojqSMATEGtXhZaxfUCtUPv4xEZcqLoWmWBi0Hvzql/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676896216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lnkd8VgFHec62bV9PAaCpY5HYILYspD0Vspt0t9+ZR4=; b=FweY4WmdQds+/Au4eGLZz45UVZ7ftdyIsteeT2wLnC6mP/fQXMbPhRbi1hAL3ymDgitUk+ cTjOrPT3TX8AhLj7IcYOYNlh1HlLAGNX6hsowPgq8YpUkLhmjOW2q0Zr3y3Esf5hc7qITe 8eUKydHfkiOlG9ojDWmtEwW+vf7xUHzZ6aOTGHV252NUHNl5ZQRRd2djsAJBkDovBz/wtx BMZNoBgVkW8fUMKHuIX2Mc/W3DqwByAVaC3lpsPN+pyR3pK3AuESbWb+9eALk+NaVk3DEY ddb/DOC9j4JEMl6B1J+kSrp6ryHKmHP2GLCkpdQvmgg6gtr3kpehQy65fR0eVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676896216; a=rsa-sha256; cv=none; b=QHH8WciYuqxjnSNdpdvrR5D4TzWgaKfbjShuFXQdR1XjRnEgV2gfYVdkNwreCGpP8CTDC3 qTXiaaVlJb+yKpb81fkPyzGrpPef51WXCvAg6yovd+CCesD0YjhwKOIojFX/U+pqlnd/E0 Zjxmn2J14G9N1/WDA1vKM6n0XKknfbdMyczy54sH3JqrVrylTLEvv49ZwOxjz9F63t2Ut5 Gb4pZwxu/PGV74w83c08KtRvpKaM5V5Ur0f+osaTknitnRvjIcaCKD13cl2CemPu9Tv2gg 8MLDrYZ1Q7dFCzKdjRuYGfwgI67z97l3H3YLFptlROks7UoaP8qf4fsQUws7Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL1w76wTlzgnS; Mon, 20 Feb 2023 12:30: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 31KCUFla028276; Mon, 20 Feb 2023 12:30:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KCUFrJ028270; Mon, 20 Feb 2023 12:30:15 GMT (envelope-from git) Date: Mon, 20 Feb 2023 12:30:15 GMT Message-Id: <202302201230.31KCUFrJ028270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 8aad241ed0c5 - main - Add myself to the github code owners file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8aad241ed0c51c45370bd2879fc113170563a018 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8aad241ed0c51c45370bd2879fc113170563a018 commit 8aad241ed0c51c45370bd2879fc113170563a018 Author: Andrew Turner AuthorDate: 2023-02-06 09:30:34 +0000 Commit: Andrew Turner CommitDate: 2023-02-20 12:29:55 +0000 Add myself to the github code owners file --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9ae918446aa1..441774e12449 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -64,6 +64,8 @@ /sys/amd64/pci @bsdimp @bsdjhb /sys/amd64/vmm/ @bsdjhb @grehan-freebsd /sys/arm/allwinner @evadot +/sys/arm64/arm64 @zxombie +/sys/arm64/include @zxombie /sys/arm64/rockchip @evadot /sys/compat/linprocfs/ @dag-erling /sys/compat/linuxkpi @hselasky From nobody Mon Feb 20 12:30:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL1w91kphz3skL6; Mon, 20 Feb 2023 12:30:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PL1w91Ht1z3RBG; Mon, 20 Feb 2023 12:30:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676896217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oQTQzeOznnulg1LBZahYm+EHKLkk31nG+nLLPk2u/OI=; b=uNqtU8TEfBLwMbM+D/M/gIT+7jMsra+sCz3TVzfNQ9wtoPJzPJwb6ashPlv0lhX17iYj8k GuvfdD0g4l4wz07B6IGBwHCn+0tdemhCEQ9lzXXmlFrDHsheKD8iFWL9AwvqZt3kPrJY1D hc5FRjdEVqIM0/riao3+9DPbyK8c3WZ5vxYack+a3Bcp6Be0gX65L9hHvla3aII7leYSWe ubXpWbEbvgOfAsF5cv5v6u2ehcM5mWI41DbSgArSd7ZxjbuHV8rr47IpO/CTglsfwAJsdY U2AVqjRM1V4VnxFBiFtEWIGgy5QhdOHJfxtbRvRIcebRbm+1dzVL29Inv7N2QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676896217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oQTQzeOznnulg1LBZahYm+EHKLkk31nG+nLLPk2u/OI=; b=SjfENFUdNCjFg2B+hTM7AIc+cev5c5umNRA9eSKKj+ntYugOxKkpWmvKTeAlcOXSLFhlw5 8CIyMvvxJfnIav2xEI6TjYzbyKgC8eivrlqa7gxjGb17jFxGklwgj9IC6ZG5thkRcBknda 3emMLuyNtaT7x1ri4MbyIwpxpkRAtPsRw+04Ep6pRN7PGpi7W+BLQZxBDnFX5npu3adhU+ gHR+9SJhF/MSeZP51m5+9y/VNnVBGzWh8OkNYZHigTX833ZzdKAi+FoS7319AY59//FsTh GcgL3HCe1U73Ws8/YiGqa4OiiCjw836KzYVJMaZ/uWgdTLKZNRxM1zrxM55Mag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676896217; a=rsa-sha256; cv=none; b=E6Q7C90RlS6N4RH9Y4xR7Hr/pGrfDNgp1S1IXOgKAFLWTWnxIeyr8Q8tuK5lmhSxz0VyBt XSGVZ/lYCiKWYRjSxBeFtcboVfEwKXb/2nX/pnrawzZuHd6ZP/SUXz1veQouvo8U5KwE7H gdgqQN+eogGXlbeSFHHukJ1b0MJ8ZZLR16R50+jJExFa+3pkLZlAlJyx3EJ3tyvqsvjVYr NPXA7FmPtMGS0jUSJoDnZ1aU4mIwgQxqwYZZ5wTEKP4BpayFJTAz5gcIee9sZJXTW/c2ox p2iZSopfKxEfNfqNIGL2g4zv5+rBmuP4gpalzDM/KvGl9LExX6FD+inZEuq7IA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL1w90NRMzgnT; Mon, 20 Feb 2023 12:30: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 31KCUGj5028869; Mon, 20 Feb 2023 12:30:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KCUGjZ028862; Mon, 20 Feb 2023 12:30:16 GMT (envelope-from git) Date: Mon, 20 Feb 2023 12:30:16 GMT Message-Id: <202302201230.31KCUGjZ028862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 24abb6b82102 - main - When saving a context on arm call the vfp handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24abb6b82102eec577eff9bd8dd7726e8cab89f4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=24abb6b82102eec577eff9bd8dd7726e8cab89f4 commit 24abb6b82102eec577eff9bd8dd7726e8cab89f4 Author: Andrew Turner AuthorDate: 2023-02-20 12:22:11 +0000 Commit: Andrew Turner CommitDate: 2023-02-20 12:29:56 +0000 When saving a context on arm call the vfp handler When adding kernel VFP support on arm a comparison instruction was removed, however the branch to vfp_save_state was still conditional. Remove the conditional check and always call into vfp_save_state as it could cause unexpected results otherwise. Sponsored by: Arm Ltd --- sys/arm/arm/swtch-v6.S | 2 +- sys/arm/arm/swtch.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/arm/swtch-v6.S b/sys/arm/arm/swtch-v6.S index bff1bc8f3d35..b23fb2f7686f 100644 --- a/sys/arm/arm/swtch-v6.S +++ b/sys/arm/arm/swtch-v6.S @@ -325,7 +325,7 @@ ENTRY(cpu_switch) ldr r3, [r10, #(TD_PCB)] mov r1, r3 mov r0, r10 - blne _C_LABEL(vfp_save_state) + bl _C_LABEL(vfp_save_state) #endif /* diff --git a/sys/arm/arm/swtch.S b/sys/arm/arm/swtch.S index f7c2beaf4f3e..1856f8b1e97c 100644 --- a/sys/arm/arm/swtch.S +++ b/sys/arm/arm/swtch.S @@ -101,7 +101,7 @@ ENTRY(savectx) #ifdef VFP mov r1, r0 mov r0, #0 - blne _C_LABEL(vfp_save_state) + bl _C_LABEL(vfp_save_state) #endif add sp, sp, #4; ldmfd sp!, {pc} From nobody Mon Feb 20 14:17:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL4JL5dNsz3ssFJ; Mon, 20 Feb 2023 14:17: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 4PL4JL5RkFz3sGx; Mon, 20 Feb 2023 14:17:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676902674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZQ1/qOQbtxoZZHhUKRs5RV4qcddXi1O29UHcebSnazc=; b=NlZ1Yw4YErGNAoLQpWSkGTjaVftedp/nGBpDVv1l6ZY67cmQBWFyHOemzZM5rG9RifDZQ7 HSviTRt+Ehm/k25wLR8zZTeIMfYZy/w+ywwPf0bEsXTM1yuuFXXGlpNXRfjUnq8Mul8qt9 S8WISiC5XG69MUYJYsi599HwPDSCBlsLvafMSAUC45y9qbWyTPB5c2Ml5aQh3teItzUE43 oiFZ3UG5J8TY24zW5cH0+OPjRJj/j7oP57ujmDrNloWqlZBbzUPqmiLT4WSKvZMChVUMhm +djiZ8+cS51eQTXhs4+h/04azlksHsa9NO5pQqzW4egnwrt0Vkk+kY9/CbJP8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676902674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZQ1/qOQbtxoZZHhUKRs5RV4qcddXi1O29UHcebSnazc=; b=Dsd6ZomerJYwNvEaot1ldFPYD9mmargSlWNBL7mKHEt2ZUt7+uuBO7NGYQKsOJbudhVgks 5KSs+SJdJFaQPuZu4xrj06DRyIbZwmru++fxNUMybD83FhQm9xu8ktNjuDDBOZMkt5/x7J VbsTYXMtHGM5Ea5HrvSN73qsbEuJ0uUXFjIUYzBkayOLJ+2BpF4w9lgJ0iB/aYV2gFsoZy GXkreKN+VDFdNzx1+O9X07yp6EAp1zOA6YfxrWKoQbYXY6gmLDI6TsjeVz65VEv+J2Z/5N iswmhspDiOYqLD3hjfeWV+fdTP8qj5ZTFeYxZqlpXTCL7sJYh/EkD9yiVQkbxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676902674; a=rsa-sha256; cv=none; b=FFLAlvFqWiJeYkL913HHH5fWe/FPkTDIAKzNNQbFjSYWCm5oBM7mJcIZq/w4IHv64UjVIw /Zc3/Gssgu0MwEwgxl6PHbHhH67OWLbg2LoJJeFwnrvsm1LpFR3fzLA0pesU6I9b4USTK/ PmsSXee+aPOZGTzc2KeFtO+N5fxPksmS1iCdnbMFrJwMMfuqUzThMT+UbtYj/5LVXJoW/7 UnqgVXmQDlhchAG5SXtpJsVr1SYRdeiqAcHQKPRVryDbZ3Gza5sPhoNGn/nVN9cRu8oyEU +vPDtrrWvBxg8tiTDU9up+hcK2afv4hI8a3D0SCIaEh2zmwKcTwOt4BtWVHbQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL4JL4XXZzklt; Mon, 20 Feb 2023 14:17: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 31KEHsAC077588; Mon, 20 Feb 2023 14:17:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KEHsT4077587; Mon, 20 Feb 2023 14:17:54 GMT (envelope-from git) Date: Mon, 20 Feb 2023 14:17:54 GMT Message-Id: <202302201417.31KEHsT4077587@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: 0de03c306c2f - main - man9: Add an smr(9) manual page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0de03c306c2f95580e56c65b74ebf8c04c1416b3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0de03c306c2f95580e56c65b74ebf8c04c1416b3 commit 0de03c306c2f95580e56c65b74ebf8c04c1416b3 Author: Mark Johnston AuthorDate: 2023-02-20 13:58:19 +0000 Commit: Mark Johnston CommitDate: 2023-02-20 13:58:19 +0000 man9: Add an smr(9) manual page Also update the UMA manual page to mention its SMR-enabled functionality, and update locking.9 to mention both epoch and SMR. Details of its usage are provided in the SMR manual page. Reviewed by: Olivier Certner, mhorne, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38108 --- share/man/man9/Makefile | 9 ++ share/man/man9/locking.9 | 37 ++++-- share/man/man9/smr.9 | 294 +++++++++++++++++++++++++++++++++++++++++++++++ share/man/man9/zone.9 | 42 ++++++- 4 files changed, 373 insertions(+), 9 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index b2c141210ab9..ab6f146fa2a9 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -319,6 +319,7 @@ MAN= accept_filter.9 \ signal.9 \ sleep.9 \ sleepqueue.9 \ + smr.9 \ socket.9 \ stack.9 \ store.9 \ @@ -2051,6 +2052,14 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 \ sleepqueue.9 sleepq_type.9 \ sleepqueue.9 sleepq_wait.9 \ sleepqueue.9 sleepq_wait_sig.9 +MLINKS+=smr.9 smr_advance.9 \ + smr.9 smr_create.9 \ + smr.9 smr_destroy.9 \ + smr.9 smr_enter.9 \ + smr.9 smr_exit.9 \ + smr.9 smr_poll.9 \ + smr.9 smr_synchronize.9 \ + smr.9 smr_wait.9 MLINKS+=socket.9 soabort.9 \ socket.9 soaccept.9 \ socket.9 sobind.9 \ diff --git a/share/man/man9/locking.9 b/share/man/man9/locking.9 index 145ae6e9f1f5..e1e4ccd33664 100644 --- a/share/man/man9/locking.9 +++ b/share/man/man9/locking.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2022 +.Dd February 3, 2023 .Dt LOCKING 9 .Os .Sh NAME @@ -145,6 +145,32 @@ for this reason, they should be avoided. See .Xr lock 9 for details. +.Ss Non-blocking synchronization +The kernel has two facilities, +.Xr epoch 9 +and +.Xr smr 9 , +which can be used to provide read-only access to a data structure while one or +more writers are concurrently modifying the data structure. +Specifically, readers using +.Xr epoch 9 +and +.Xr smr 9 +to synchronize accesses do not block writers, in contrast with reader/writer +locks, and they help ensure that memory freed by writers is not reused until +all readers which may be accessing it have finished. +Thus, they are a useful building block in the construction of lock-free +data structures. +.Pp +These facilities are difficult to use correctly and should be avoided +in preference to traditional mutual exclusion-based synchronization, +except when performance or non-blocking guarantees are a major concern. +.Pp +See +.Xr epoch 9 +and +.Xr smr 9 +for details. .Ss Counting semaphores Counting semaphores provide a mechanism for synchronizing access to a pool of resources. @@ -394,8 +420,10 @@ At this time this is a rather easy to remember table. .Sh SEE ALSO .Xr lockstat 1 , .Xr witness 4 , +.Xr atomic 9 , .Xr BUS_SETUP_INTR 9 , .Xr condvar 9 , +.Xr epoch 9 , .Xr lock 9 , .Xr LOCK_PROFILING 9 , .Xr mtx_pool 9 , @@ -404,13 +432,8 @@ At this time this is a rather easy to remember table. .Xr rwlock 9 , .Xr sema 9 , .Xr sleep 9 , +.Xr smr 9 , .Xr sx 9 , .Xr timeout 9 -.Sh HISTORY -These -functions appeared in -.Bsx 4.1 -through -.Fx 7.0 . .Sh BUGS There are too many locking primitives to choose from. diff --git a/share/man/man9/smr.9 b/share/man/man9/smr.9 new file mode 100644 index 000000000000..7b2ed65b4368 --- /dev/null +++ b/share/man/man9/smr.9 @@ -0,0 +1,294 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2023 The FreeBSD Foundation +.\" +.\" This documentation was written by Mark Johnston +.\" 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. +.\" +.Dd January 17, 2023 +.Dt SMR 9 +.Os +.Sh NAME +.Nm smr +.Nd safe memory reclamation for lock-free data structures +.Sh SYNOPSIS +.In sys/smr.h +.Ft smr_seq_t +.Fo smr_advance +.Fa "smr_t smr" +.Fc +.Ft smr_t +.Fo smr_create +.Fa "const char *name" +.Fc +.Ft void +.Fo smr_destroy +.Fa "smr_t smr" +.Fc +.Ft void +.Fo smr_enter +.Fa "smr_t smr" +.Fc +.Ft void +.Fo smr_exit +.Fa "smr_t smr" +.Fc +.Ft bool +.Fo smr_poll +.Fa "smr_t smr" +.Fa "smr_seq_t goal" +.Fa "bool wait" +.Fc +.Ft void +.Fo smr_synchronize +.Fa "smr_t smr" +.Fc +.Ft bool +.Fo smr_wait +.Fa "smr_t smr" +.Fa "smr_seq_t goal" +.Fc +.Sh DESCRIPTION +Safe Memory Reclamation (SMR) is a facility which enables the implementation of +memory-safe lock-free data structures. +In typical usage, read accesses to an SMR-protected data structure, such as a +hash table or tree, are performed in a +.Dq read section +consisting of code bracketed by +.Fn smr_enter +and +.Fn smr_exit +calls, while mutations of the data structure are serialized by a traditional +mutex such as +.Xr mutex 9 . +In contrast with reader-writer locks such as +.Xr rwlock 9 , +.Xr rmlock 9 , +and +.Xr sx 9 , +SMR allows readers and writers to access the data structure concurrently. +Readers can always enter a read section immediately +.Po +.Fn smr_enter +never blocks +.Pc , +so mutations do not introduce read latency. +Furthermore, +.Fn smr_enter +and +.Fn smr_exit +operate only on per-CPU data and thus avoid some of the performance problems +inherent in the implementation of traditional reader-writer mutexes. +SMR can therefore be a useful building block for data structures which are +accessed frequently but are only rarely modified. +.Pp +Note that any SMR-protected data structure must be implemented carefully such +that operations behave correctly in the absence of mutual exclusion between +readers and writers. +The data structure must be designed to be lock-free; SMR merely facilitates +the implementation, for example by making it safe to follow dangling pointers +and by helping avoid the ABA problem. +.Pp +When shared accesses to and mutations of a data structure can proceed +concurrently, writers must take care to ensure that any items removed from the +structure are not freed and recycled while readers are accessing them in +parallel. +This requirement results in a two-phase approach to the removal of items: +first, the item is unlinked such that all pointers to the item are removed from +the structure, preventing any new readers from observing the item. +Then, the writer waits until some mechanism guarantees that no existing readers +are still accessing the item. +At that point the memory for that item can be freed and reused safely. +SMR provides this mechanism: readers may access a lock-free data structure in +between calls to the +.Fn smr_enter +and +.Fn smr_exit +functions, which together create a read section, and the +.Fn smr_advance , +.Fn smr_poll , +.Fn smr_wait , +and +.Fn smr_synchronize +functions can be used to wait for threads in read sections to finish. +All of these functions operate on a +.Ft smr_t +state block which holds both per-CPU and global state. +Readers load global state and modify per-CPU state, while writers must scan all +per-CPU states to detect active readers. +SMR is designed to amortize this cost by batching to give acceptable +performance in write-heavy workloads. +.Ss Readers +Threads enter a read section by calling +.Fn smr_enter . +Read sections should be short, and many operations are not permitted while in +a read section. +Specifically, context switching is disabled, and thus readers may not acquire +blocking mutexes such as +.Xr mutex 9 . +Another consequence of this is that the thread is pinned to the current CPU for +the duration of the read section. +Furthermore, read sections may not be nested: it is incorrect to call +.Fn smr_enter +with a given +.Ft smr_t +state block when already in a read section for that state block. +.Ss UMA Integration +To simplify the integration of SMR into consumers, the +.Xr uma 9 +kernel memory allocator provides some SMR-specified facilities. +This eliminates a good deal of complexity from the implementation of consumers +and automatically batches write operations. +.Pp +In typical usage, a UMA zone (created with the +.Dv UMA_ZONE_SMR +flag or initialized with the +.Fn uma_zone_set_smr +function) is coupled with a +.Ft smr_t +state block. +To insert an item into an SMR-protected data structure, memory is allocated +from the zone using the +.Fn uma_zalloc_smr +function. +Insertions and removals are serialized using traditional mutual exclusion +and items are freed using the +.Fn uma_zfree_smr +function. +Read-only lookup operations are performed in SMR read sections. +.Fn uma_zfree_smr +waits for all active readers which may be accessing the freed item to finish +their read sections before recycling that item's memory. +.Pp +If the zone has an associated per-item destructor, it will be invoked at some +point when no readers can be accessing a given item. +The destructor can be used to release additional resources associated with the +item. +Note however that there is no guarantee that the destructor will be invoked in +a bounded time period. +.Ss Writers +Consumers are expected to use SMR in conjunction with UMA and thus need only +make use of the +.Fn smr_enter +and +.Fn smr_exit +functions, and the SMR helper macros defined in +.Pa sys/smr_types.h . +However, an introduction to the write-side interface of SMR can be useful. +.Pp +Internally, SMR maintains a global +.Ql write sequence +number. +When entering a read section, +.Fn smr_enter +loads a copy of the write sequence and stores it in per-CPU memory, hence +.Ql observing +that value. +To exit a read section, this per-CPU memory is overwritten with an invalid +value, making the CPU inactive. +Writers perform two operations: advancing the write sequence number, and +polling all CPUs to see whether active readers have observed a given sequence +number. +These operations are performed by +.Fn smr_advance +and +.Fn smr_poll , +respectively, which do not require serialization between multiple writers. +.Pp +After a writer unlinks an item from a data structure, it increments the write +sequence number and tags the item with the new value returned by +.Fn smr_advance . +Once all CPUs have observed the new value, the writer can use +.Fn smr_poll +to deduce that no active readers have access to the unlinked item, and thus the +item is safe to recycle. +Because this pair of operations is relatively expensive, it is generally a good +idea to amortize this cost by accumulating a collection of multiple unlinked +items and tagging the entire batch with a target write sequence number. +.Pp +.Fn smr_poll +is a non-blocking operation and returns true only if all active readers are +guaranteed to have observed the target sequence number value. +.Fn smr_wait +is a variant of +.Fn smr_poll +which waits until all CPUs have observed the target sequence number value. +.Fn smr_synchronize +combines +.Fn smr_advance +with +.Fn smr_wait +to wait for all CPUs to observe a new write sequence number. +This is an expensive operation and should only be used if polling cannot be +deferred in some way. +.Ss Memory Ordering +The +.Fn smr_enter +function has acquire semantics, and the +.Fn smr_exit +function has release semantics. +The +.Fn smr_advance , +.Fn smr_poll , +.Fn smr_wait , +and +.Fn smr_synchronize +functions should not be assumed to have any guarantees with respect to memory +ordering. +In practice, some of these functions have stronger ordering semantics than +is stated here, but this is specific to the implementation and should not be +relied upon. +See +.Xr atomic 9 +for more details. +.Sh NOTES +Outside of +.Fx +the acronym SMR typically refers to a family of algorithms which enable +memory-safe read-only access to a data structure concurrent with modifications +to that data structure. +Here, SMR refers to a particular algorithm belonging to this family, as well as +its implementation in +.Fx . +See +.Pa sys/sys/smr.h +and +.Pa sys/kern/subr_smr.c +in the +.Fx +source tree for further details on the algorithm and the context. +.Pp +The acronym SMR is also used to mean "shingled magnetic recording", a +technology used to store data on hard disk drives which requires operating +system support. +These two uses of the acronym are unrelated. +.Sh SEE ALSO +.Xr atomic 9 , +.Xr locking 9 , +.Xr uma 9 +.Sh AUTHORS +The SMR algorithm and its implementation were provided by +.An Jeff Roberson Aq Mt jeff@FreeBSD.org . +This manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org . diff --git a/share/man/man9/zone.9 b/share/man/man9/zone.9 index 5c1b4d31d8aa..5f7f99b8f44f 100644 --- a/share/man/man9/zone.9 +++ b/share/man/man9/zone.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2022 +.Dd January 16, 2023 .Dt UMA 9 .Os .Sh NAME @@ -79,6 +79,8 @@ typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); .Fn uma_zalloc_pcpu "uma_zone_t zone" "int flags" .Ft "void *" .Fn uma_zalloc_pcpu_arg "uma_zone_t zone" "void *arg" "int flags" +.Ft "void *" +.Fn uma_zalloc_smr "uma_zone_t zone" "int flags" .Ft void .Fn uma_zfree "uma_zone_t zone" "void *item" .Ft void @@ -88,6 +90,8 @@ typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); .Ft void .Fn uma_zfree_pcpu_arg "uma_zone_t zone" "void *item" "void *arg" .Ft void +.Fn uma_zfree_smr "uma_zone_t zone" "void *item" +.Ft void .Fn uma_prealloc "uma_zone_t zone" "int nitems" .Ft void .Fn uma_zone_reserve "uma_zone_t zone" "int nitems" @@ -117,6 +121,10 @@ typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" .Ft void .Fn uma_zone_set_maxaction "uma_zone_t zone" "void (*maxaction)(uma_zone_t)" +.Ft smr_t +.Fn uma_zone_get_smr "uma_zone_t zone" +.Ft void +.Fn uma_zone_set_smr "uma_zone_t zone" "smr_t smr" .In sys/sysctl.h .Fn SYSCTL_UMA_MAX parent nbr name access zone descr .Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr @@ -330,6 +338,14 @@ Cached items that have not been used for a long period may also be freed from zone. When this flag is set, the system will not reclaim memory from the zone's caches. +.It Dv UMA_ZONE_SMR +Create a zone whose items will be synchronized using the +.Xr smr 9 +mechanism. +Upon creation the zone will have an associated +.Dt smr_t +structure which can be fetched using +.Fn uma_zone_get_smr . .El .Pp Zones can be destroyed using @@ -390,6 +406,17 @@ then does nothing. .Pp The +.Fn uma_zalloc_smr +and +.Fn uma_zfree_smr +functions allocate and free items from an SMR-enabled zone, that is, +a zone created with +.Dv UMA_ZONE_SMR +or a zone that has had +.Fn uma_zone_set_smr +called. +.Pp +The .Fn uma_zalloc_domain function allows callers to specify a fixed .Xr numa 4 @@ -535,6 +562,16 @@ Therefore, this function should do very little work (similar to a signal handler). .Pp The +.Fn uma_zone_set_smr +function associates an existing +.Xr smr 9 +structure with a UMA zone. +The effect is similar to creating a zone with the +.Dv UMA_ZONE_SMR +flag, except that a new SMR structure is not created. +This function must be called before any allocations from the zone are performed. +.Pp +The .Fn SYSCTL_UMA_MAX parent nbr name access zone descr macro declares a static .Xr sysctl 9 @@ -577,7 +614,8 @@ non-executable memory. .Sh SEE ALSO .Xr numa 4 , .Xr vmstat 8 , -.Xr malloc 9 +.Xr malloc 9 , +.Xr smr 9 .Rs .%A Jeff Bonwick .%T "The Slab Allocator: An Object-Caching Kernel Memory Allocator" From nobody Mon Feb 20 14:30:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL4Zj5p4wz3sslV; Mon, 20 Feb 2023 14:30: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 4PL4Zj5Fpbz3tRs; Mon, 20 Feb 2023 14:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IQAlIUTC4ngeJFR1DinTAY3v4BxTw721K7gDPvjXEyk=; b=sroK/6ON6oKn0x7dW2rbHI4Wzgq7gNb2B4xupGiSYSa9/K38iHViCghT9ZB8IUTaXCHfiy TUkY6NSLHMwfcTJsxXct1h0i/ca9bwUJgiZzf8MPq0oKqP062IKlU9tyTIgRE5dI+FF0qt 3LQxxXGyrI8LgndnEltZoq7JkKwSWuJNYAzEqnpTKQufnsCcI5ydsHKYry4phZ8Mdppy8I nxmgi2MUY0AtqR8+kP/FfQGsCkn8Jnp07RgJjiVeVaoI/48LIWEA3K4pFvUjxtZZjGu2Eu VhjasXNlNXzNIr12bZrcqNDEawuf7D48EUaT9JHfLbOlAonmtUE6vf6iB10ncw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IQAlIUTC4ngeJFR1DinTAY3v4BxTw721K7gDPvjXEyk=; b=a0T+ouiEbqUV1PfSB0fU4pnFOlC+FfUYCmZv66h4LtWRzwv/vSL7dPg0vATQzI+Ubj0lgg VwpaLjwdKt4JnB95eRdeLwjCWMDh6YyPIS+FSLP3Xfmbyog6DgjCB4dlabMt/Y/6VdDteh b7yOp4otyLuHRc0jan3t0CpvSrckqJ29pO8o/vBUFhUGyxS4FMC4sT+VsCU4Y+UOYhuyJb 5kGTSgpnQ8AGJvH5kyiRfF8Qt7oE1M5f54FSHwS6hckf+NFkqRUBSl93BfBevIoanafrie KrGFfMJXrtJLGKeptA90ySBh/MkpeUHpyh/GybCpbyV9Rh66bnQ9ScFSCKk5bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676903421; a=rsa-sha256; cv=none; b=bcDtiOJ3h/hi623ejYI0HyAguyMeBMrDaFqphdhc5/B82h0ETVD4OeLUmgO8hPZ+rzj48/ Fj3AXFa7T+NRNked+QXSQhMYrkSRQsIl7pE3qM5pcpOA3ac9aqPoVkePa1WfU5O+jia+o+ U+uHnNM2Bv0jMV/hTkqtKSAFRViQTuSmFw51FwfwWPDHUiKzhqFm0MGxa4wyrqgZkD6K0s UdCQiIS1Md5tahSGAMVlUP0FGVfu6oiTnVjq4pgj2/6NT/DmicFSYiVov8bdUP4WSzH6Dr nQw8BG4XT+z4ZyBNciTsJGWee+h3fYdtWTjNEJWSCLelDKT3AiwR4jjHUJYjfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL4Zj4DCczkq0; Mon, 20 Feb 2023 14:30: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 31KEULRk000504; Mon, 20 Feb 2023 14:30:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KEUL0E000503; Mon, 20 Feb 2023 14:30:21 GMT (envelope-from git) Date: Mon, 20 Feb 2023 14:30:21 GMT Message-Id: <202302201430.31KEUL0E000503@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: c7c348162101 - main - netlink: fix IPv6 route addition with link-local gateway List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7c348162101a70b1f99299578dabe1d3b100e48 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c7c348162101a70b1f99299578dabe1d3b100e48 commit c7c348162101a70b1f99299578dabe1d3b100e48 Author: Alexander V. Chernikov AuthorDate: 2023-02-20 14:24:01 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 14:29:48 +0000 netlink: fix IPv6 route addition with link-local gateway Currently kernel assumes that IPv6 gateway address is in "embedded" form - that is, for the link-local IPv6 addresses, interface index is embedded in bytes 2 and 3 of the address. Fix address embedding in netlink by wrapping nhop_set_gw() in the netlink-specific nl_set_nexthop_gw(), which does such embedding automatically. Reported by: Marek Zarychta MFC after: 3 days --- sys/netlink/route/nexthop.c | 42 ++++++++++++++++++++++++++++++++++++------ sys/netlink/route/route_var.h | 2 ++ sys/netlink/route/rt.c | 15 ++++++++++++--- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/sys/netlink/route/nexthop.c b/sys/netlink/route/nexthop.c index e9f008842644..63e491687249 100644 --- a/sys/netlink/route/nexthop.c +++ b/sys/netlink/route/nexthop.c @@ -741,8 +741,34 @@ newnhg(struct unhop_ctl *ctl, struct nl_parsed_nhop *attrs, struct user_nhop *un return (0); } +/* + * Sets nexthop @nh gateway specified by @gw. + * If gateway is IPv6 link-local, alters @gw to include scopeid equal to + * @ifp ifindex. + * Returns 0 on success or errno. + */ +int +nl_set_nexthop_gw(struct nhop_object *nh, struct sockaddr *gw, struct ifnet *ifp, + struct nl_pstate *npt) +{ +#ifdef INET6 + if (gw->sa_family == AF_INET6) { + struct sockaddr_in6 *gw6 = (struct sockaddr_in6 *)gw; + if (IN6_IS_ADDR_LINKLOCAL(&gw6->sin6_addr)) { + if (ifp == NULL) { + NLMSG_REPORT_ERR_MSG(npt, "interface not set"); + return (EINVAL); + } + in6_set_unicast_scopeid(&gw6->sin6_addr, ifp->if_index); + } + } +#endif + nhop_set_gw(nh, gw, true); + return (0); +} + static int -newnhop(struct nl_parsed_nhop *attrs, struct user_nhop *unhop) +newnhop(struct nl_parsed_nhop *attrs, struct user_nhop *unhop, struct nl_pstate *npt) { struct ifaddr *ifa = NULL; struct nhop_object *nh; @@ -750,17 +776,17 @@ newnhop(struct nl_parsed_nhop *attrs, struct user_nhop *unhop) if (!attrs->nha_blackhole) { if (attrs->nha_gw == NULL) { - NL_LOG(LOG_DEBUG, "missing NHA_GATEWAY"); + NLMSG_REPORT_ERR_MSG(npt, "missing NHA_GATEWAY"); return (EINVAL); } if (attrs->nha_oif == NULL) { - NL_LOG(LOG_DEBUG, "missing NHA_OIF"); + NLMSG_REPORT_ERR_MSG(npt, "missing NHA_OIF"); return (EINVAL); } if (ifa == NULL) ifa = ifaof_ifpforaddr(attrs->nha_gw, attrs->nha_oif); if (ifa == NULL) { - NL_LOG(LOG_DEBUG, "Unable to determine default source IP"); + NLMSG_REPORT_ERR_MSG(npt, "Unable to determine default source IP"); return (EINVAL); } } @@ -777,7 +803,11 @@ newnhop(struct nl_parsed_nhop *attrs, struct user_nhop *unhop) if (attrs->nha_blackhole) nhop_set_blackhole(nh, NHF_BLACKHOLE); else { - nhop_set_gw(nh, attrs->nha_gw, true); + error = nl_set_nexthop_gw(nh, attrs->nha_gw, attrs->nha_oif, npt); + if (error != 0) { + nhop_free(nh); + return (error); + } nhop_set_transmit_ifp(nh, attrs->nha_oif); nhop_set_src(nh, ifa); } @@ -839,7 +869,7 @@ rtnl_handle_newnhop(struct nlmsghdr *hdr, struct nlpcb *nlp, if (attrs.nha_group) error = newnhg(ctl, &attrs, unhop); else - error = newnhop(&attrs, unhop); + error = newnhop(&attrs, unhop, npt); if (error != 0) { free(unhop, M_NETLINK); diff --git a/sys/netlink/route/route_var.h b/sys/netlink/route/route_var.h index f1e522c7ae05..f3b1d7d929a5 100644 --- a/sys/netlink/route/route_var.h +++ b/sys/netlink/route/route_var.h @@ -104,6 +104,8 @@ void rtnl_iface_drivers_register(void); void rtnl_nexthops_init(void); struct nhop_object *nl_find_nhop(uint32_t fibnum, int family, uint32_t uidx, int nh_flags, int *perror); +int nl_set_nexthop_gw(struct nhop_object *nh, struct sockaddr *gw, + struct ifnet *ifp, struct nl_pstate *npt); #endif diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index aca69e75fea8..534186447b4d 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -736,7 +736,11 @@ create_nexthop_one(struct nl_parsed_route *attrs, struct rta_mpath_nh *mpnh, if (nh == NULL) return (ENOMEM); - nhop_set_gw(nh, mpnh->gw, true); + error = nl_set_nexthop_gw(nh, mpnh->gw, mpnh->ifp, npt); + if (error != 0) { + nhop_free(nh); + return (error); + } if (mpnh->ifp != NULL) nhop_set_transmit_ifp(nh, mpnh->ifp); nhop_set_rtflags(nh, attrs->rta_rtflags); @@ -800,8 +804,13 @@ create_nexthop_from_attrs(struct nl_parsed_route *attrs, *perror = ENOMEM; return (NULL); } - if (attrs->rta_gw != NULL) - nhop_set_gw(nh, attrs->rta_gw, true); + if (attrs->rta_gw != NULL) { + *perror = nl_set_nexthop_gw(nh, attrs->rta_gw, attrs->rta_oif, npt); + if (*perror != 0) { + nhop_free(nh); + return (NULL); + } + } if (attrs->rta_oif != NULL) nhop_set_transmit_ifp(nh, attrs->rta_oif); if (attrs->rtax_mtu != 0) From nobody Mon Feb 20 14:34:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL4g05s11z3st1L; Mon, 20 Feb 2023 14:34: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 4PL4g05NcYz3v9g; Mon, 20 Feb 2023 14:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JURvuk+fyxxB0p6gtbs1PF7VE6GQ6IL44akTUiG3Pww=; b=JP0qXbmDe2rwUT2uFWTE69DNIBniIrutmZsbzTaDplxqIiEGoSJEmqts9ll2yUVBA6eyB5 Vze1Knl5ubDBishL05kx6CMF4WGeF8oIiNz+t6f7AK398FyeTwnJnM+unLXMkY6OvzYmVr 1oxKWh/aG0W6PR4K0805MRVkjQQgElJKmpNpG/XDxcEyMVq4rGFkjNkYTj6c5KTJElNEDk kDRN1ZWWTrg2WdrrV7qDi8Sw4tjxH+qsR0Jxxx7+L0uzH3Ya3OCiL4AWBL3NwUW8N6c/m0 E0pG6MPWnLOI/9WrWeXI0lQtO+zGrLGO+XpaiH19IXbwpzQYylQRTVidp0Jelg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JURvuk+fyxxB0p6gtbs1PF7VE6GQ6IL44akTUiG3Pww=; b=o42Y2wxqT6rK+Zij377ltY1g8N3TUw4jUSYuP7wV2luO7R2u1Js3R8GuJjui0DTvRpohzz YDqsdaHDe1uY7aTSX3Lhb3Z+9dQyAMqzC6lvzj3wrK2kKNBb19SEwJClSxgq6AqhEdUOKZ 0YXvYr+z6b2OIjmpaDaJEVMM2YF6OqUFprq1Uo1rPUstO+c2k+EE2+eFCv+CcIXC5ffjbb 3+Ru/niTAwr+drETNXEJpHpHumPfe+czD1TNXr4PBhOHQqU7PESWPZ/DV/dYwrlGL2ODkI 0utaKpyEiqx8sLV4r4ZR8O04ELZLD71KkVHJdhSlP8BKiLGh0ohjQVwFMrawMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676903644; a=rsa-sha256; cv=none; b=vFVQ8EyFSl4sncUJO0GzNWquJ6nbExE0khn/4vZ465Hd89fXZMSGaGMBgcN33BDFdb9rao EiZ5AYBMCDf0tscHzU5Xq+CCU9HSweobq+hU3u3dceRxQf7ZlVAHH0w4Fmuj9X6vJ5toVS NMDP+aF5L8CFlpKvsCoM9dzdN0pGwU8DAzM9G/6q8L8cC+TXarhkH6u5EHGabBmQPdF3M1 VtdTw5WZ9I4N8Pgav7q8Shtx4a31H+Ozl/FXJMb+GcyXcaSk9/U6BSTnISVMtasRfHiDdq 6dp5+6nAcquORfjm06alg9fSy0zv/l2vV/Mh/pMfXD+NQ+Kl/iI1Xdc0DoKIgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL4g04SLLzl1C; Mon, 20 Feb 2023 14:34: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 31KEY4ma005707; Mon, 20 Feb 2023 14:34:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KEY4Sj005706; Mon, 20 Feb 2023 14:34:04 GMT (envelope-from git) Date: Mon, 20 Feb 2023 14:34:04 GMT Message-Id: <202302201434.31KEY4Sj005706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: ac40ea6fbb4e - stable/13 - netlink: call genetlink notification handler upon successful family search. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ac40ea6fbb4e6af98a4540fc8fd5a3e824cb181d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=ac40ea6fbb4e6af98a4540fc8fd5a3e824cb181d commit ac40ea6fbb4e6af98a4540fc8fd5a3e824cb181d Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:58:53 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 14:33:27 +0000 netlink: call genetlink notification handler upon successful family search. MFC after: 3 days (cherry picked from commit 7cbe771f013f6cf3316910648f6d46641cad7f44) --- 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 Mon Feb 20 14:34:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL4g16xf1z3st2v; Mon, 20 Feb 2023 14:34: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 4PL4g160spz3v0n; Mon, 20 Feb 2023 14:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9eAWJaDxP2MZierYFMGy6/6myB6BgWaKHlxRIy86ZeY=; b=n0tFeYNeuuOdOJrvBFRRf+9k/JOiVvDBy1O0PTQHoQcQXEWbOW69NFVEtxtRsSKGPezUCu FO+rHcTM5Mhg4lYuEGvewV0LIQUNRx5Fi5276JDXsXJ7vXd5Yi+oE9pu1Yo0ilgUCaqvrS FAK1YhZosQsYYjtI9bF+2np4R8leq3CEOJmAA1YoT2pJ9TzfwpMycbWVTjkHyx3aBKpi8b 86j7wMCxv4s0VMwjQEnBU3tWoosxMIK41nEyteMoj4uVngv32vE27YAYiuYhyiHvNZF+2e Ff7Mw22Id0ky4xVyxJFBojVP1JE74dFBi2nHd1lyex7QOqLPMEKGMfsU5Llmow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9eAWJaDxP2MZierYFMGy6/6myB6BgWaKHlxRIy86ZeY=; b=rVrMIeT/IS28aeaxkwfsRqTKiX87vepbyPgzeGjhBo7tXdkY2jmhu6/fNUBm99fNijAgKS 1jir6/b4FU1kr/ROi0d6NVcUceYYBv6abURHouMufT/o1FmahgelECz3wGZCmKPtAYArtM 6fFD9eesSllf4HG6nM71Fa8lO4YV7u09je+20e9ygb0TpbS9c/TPhbJv8PwmGuruF+2r6J M7JNq5rBOKSezeMwWRLCsEagzAsND6OY70BRjxqbxezenp5Wqu4xOr9mcUQHptiqjx12lZ VRcrJrpdglXjgcP4mEZ0g8svwpS8q8iYzubr0K2OAvuHEg67SG6IynKSbgiK9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676903645; a=rsa-sha256; cv=none; b=QkT2V5frpvWocKxUnZDg7wNqh/7nl5lbINbVXAhwkElK3rPuFFmPRAqEYArfRuyOdzYQjg 9qXbCWo4crl13H//NyMxRRc6iuQ/PlbnyYZTMrxTdFcDqQ39L8ZN592eaRZBCL6xri/9uy rsEM2PKwyEyYC0pdw+iITiYRsdJXgSUbQoo2Hb9aVJJ8vDPi8lPtQifo2pyzBANAk2P0V4 +g83mubD+60YNg9xggoZ8KRuoc2WSChgelrReInzFQU9VptP3jInqZOAD2VI0dZGV6CZXI XST2L1XZMyvOzQt44huz07WhpQHATB8joN2LXekOVWgfjv+/FXEvsKNj0UYlBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL4g156GKzkt6; Mon, 20 Feb 2023 14:34: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 31KEY5kt005729; Mon, 20 Feb 2023 14:34:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KEY5JJ005728; Mon, 20 Feb 2023 14:34:05 GMT (envelope-from git) Date: Mon, 20 Feb 2023 14:34:05 GMT Message-Id: <202302201434.31KEY5JJ005728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 72467b39f1db - stable/13 - netlink: return optional metadata with the operation result. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 72467b39f1db794f2ac54ac9baa1de3166507c6b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=72467b39f1db794f2ac54ac9baa1de3166507c6b commit 72467b39f1db794f2ac54ac9baa1de3166507c6b Author: Alexander V. Chernikov AuthorDate: 2023-02-09 14:53:44 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 14:33:28 +0000 netlink: return optional metadata with the operation result. Some operations like interface creation may need to return metadata - in this case, interface name - back to the caller if the operation is successful. This change implements attaching an `NLMSGERR_ATTR_COOKIE` nla to the operation reply message via `nlmsg_report_cookie()`. Additionally, on successful interface creation, interface index and interface name are returned in the `IFLA_NEW_IFINDEX` and `IFLA_IFNAME TLVs, encapsulated in the `NLMSGERR_ATTR_COOKIE`. Reviewed By: pauamma Differential Revision: https://reviews.freebsd.org/D38283 MFC after: 1 week (cherry picked from commit 25c2dd2f2c6c6144d59d463c95f0471301d6efaa) --- share/man/man4/netlink.4 | 4 ++ share/man/man4/rtnetlink.4 | 7 ++ sys/netlink/netlink_message_parser.c | 19 +++++ sys/netlink/netlink_message_parser.h | 4 ++ sys/netlink/netlink_message_writer.c | 6 +- sys/netlink/netlink_message_writer.h | 31 ++++++++ sys/netlink/route/iface_drivers.c | 37 ++++++++++ tests/atf_python/sys/net/netlink.py | 134 +++++++++++++++++++---------------- tests/sys/netlink/test_rtnl_iface.py | 35 +++++++++ 9 files changed, 213 insertions(+), 64 deletions(-) diff --git a/share/man/man4/netlink.4 b/share/man/man4/netlink.4 index 1894de5841fe..fdcc823b01a6 100644 --- a/share/man/man4/netlink.4 +++ b/share/man/man4/netlink.4 @@ -217,6 +217,10 @@ socket option is set, the kernel may add a string TLV with the textual error description, optionally followed by the .Dv NLMSGERR_ATTR_OFFS TLV, indicating the offset from the message start that triggered an error. +Some operations may return additional metadata encapsulated in the +.Dv NLMSGERR_ATTR_COOKIE +TLV. +The metadata format is specific to the operation. If the operation reply is a multipart message, then no .Dv NLMSG_ERROR reply is generated, only a diff --git a/share/man/man4/rtnetlink.4 b/share/man/man4/rtnetlink.4 index 5849508b74c2..2c601251f7b0 100644 --- a/share/man/man4/rtnetlink.4 +++ b/share/man/man4/rtnetlink.4 @@ -284,6 +284,13 @@ struct ifinfomsg { Creates a new interface. The only mandatory TLV is .Dv IFLA_IFNAME . +The following attributes are returned inside the nested +.Dv NLMSGERR_ATTR_COOKIE : +.Pp +.Bd -literal -offset indent -compact +IFLA_NEW_IFINDEX (uint32) created interface index +IFLA_IFNAME (string) created interface name +.Ed .Ss RTM_DELLINK Deletes the interface specified by .Dv IFLA_IFNAME . diff --git a/sys/netlink/netlink_message_parser.c b/sys/netlink/netlink_message_parser.c index dc0c38712613..e30138266d9d 100644 --- a/sys/netlink/netlink_message_parser.c +++ b/sys/netlink/netlink_message_parser.c @@ -78,6 +78,25 @@ nlmsg_report_err_offset(struct nl_pstate *npt, uint32_t off) return (true); } +void +nlmsg_report_cookie(struct nl_pstate *npt, struct nlattr *nla) +{ + MPASS(nla->nla_type == NLMSGERR_ATTR_COOKIE); + MPASS(nla->nla_len >= sizeof(struct nlattr)); + npt->cookie = nla; +} + +void +nlmsg_report_cookie_u32(struct nl_pstate *npt, uint32_t val) +{ + struct nlattr *nla = npt_alloc(npt, sizeof(*nla) + sizeof(uint32_t)); + + nla->nla_type = NLMSGERR_ATTR_COOKIE; + nla->nla_len = sizeof(*nla) + sizeof(uint32_t); + memcpy(nla + 1, &val, sizeof(uint32_t)); + nlmsg_report_cookie(npt, nla); +} + static const struct nlattr_parser * search_states(const struct nlattr_parser *ps, int pslen, int key) { diff --git a/sys/netlink/netlink_message_parser.h b/sys/netlink/netlink_message_parser.h index 94f0ca5260d7..083c93dcbf8d 100644 --- a/sys/netlink/netlink_message_parser.h +++ b/sys/netlink/netlink_message_parser.h @@ -71,6 +71,7 @@ struct nl_pstate { uint32_t err_off; /* error offset from hdr start */ int error; /* last operation error */ char *err_msg; /* Description of last error */ + struct nlattr *cookie; /* NLA to return to the userspace */ bool strict; /* Strict parsing required */ }; @@ -198,6 +199,9 @@ bool nlmsg_report_err_msg(struct nl_pstate *npt, const char *fmt, ...); bool nlmsg_report_err_offset(struct nl_pstate *npt, uint32_t off); +void nlmsg_report_cookie(struct nl_pstate *npt, struct nlattr *nla); +void nlmsg_report_cookie_u32(struct nl_pstate *npt, uint32_t val); + /* * Have it inline so compiler can optimize field accesses into * the list of direct function calls without iteration. diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c index 2187c40f2786..8a9315eedd1b 100644 --- a/sys/netlink/netlink_message_writer.c +++ b/sys/netlink/netlink_message_writer.c @@ -643,10 +643,6 @@ nlmsg_ack(struct nlpcb *nlp, int error, struct nlmsghdr *hdr, if ((npt->err_msg || npt->err_off) && nlp->nl_flags & NLF_EXT_ACK) nl_flags |= NLM_F_ACK_TLVS; - /* - * TODO: handle cookies - */ - NL_LOG(LOG_DEBUG3, "acknowledging message type %d seq %d", hdr->nlmsg_type, hdr->nlmsg_seq); @@ -662,6 +658,8 @@ nlmsg_ack(struct nlpcb *nlp, int error, struct nlmsghdr *hdr, nlattr_add_string(nw, NLMSGERR_ATTR_MSG, npt->err_msg); if (npt->err_off != 0 && nlp->nl_flags & NLF_EXT_ACK) nlattr_add_u32(nw, NLMSGERR_ATTR_OFFS, npt->err_off); + if (npt->cookie != NULL) + nlattr_add_raw(nw, npt->cookie); if (nlmsg_end(nw)) return; diff --git a/sys/netlink/netlink_message_writer.h b/sys/netlink/netlink_message_writer.h index 99f50fb94213..bb4bb759251a 100644 --- a/sys/netlink/netlink_message_writer.h +++ b/sys/netlink/netlink_message_writer.h @@ -163,6 +163,27 @@ _nlmsg_reserve_attr(struct nl_writer *nw, uint16_t nla_type, uint16_t sz) } #define nlmsg_reserve_attr(_ns, _at, _t) ((_t *)_nlmsg_reserve_attr(_ns, _at, NLA_ALIGN(sizeof(_t)))) +static inline bool +nlattr_add_nla(struct nl_writer *nw, const struct nlattr *nla_src) +{ + MPASS(nla_src->nla_len >= sizeof(struct nlattr)); + + int required_len = NLA_ALIGN(nla_src->nla_len); + if (__predict_false(nw->offset + required_len > nw->alloc_len)) { + if (!nlmsg_refill_buffer(nw, required_len)) + return (false); + } + + struct nlattr *nla = (struct nlattr *)(&nw->data[nw->offset]); + if ((nla_src->nla_len % 4) != 0) { + /* clear padding bytes */ + bzero((char *)nla + nla_src->nla_len - 4, 4); + } + memcpy(nla, nla_src, nla_src->nla_len); + nw->offset += required_len; + return (true); +} + static inline bool nlattr_add(struct nl_writer *nw, int attr_type, int attr_len, const void *data) { @@ -188,6 +209,16 @@ nlattr_add(struct nl_writer *nw, int attr_type, int attr_len, const void *data) return (true); } +static inline bool +nlattr_add_raw(struct nl_writer *nw, const struct nlattr *nla_src) +{ + int attr_len = nla_src->nla_len - sizeof(struct nlattr); + + MPASS(attr_len >= 0); + + return (nlattr_add(nw, nla_src->nla_type, attr_len, (const void *)(nla_src + 1))); +} + static inline bool nlattr_add_u8(struct nl_writer *nw, int attrtype, uint8_t value) { diff --git a/sys/netlink/route/iface_drivers.c b/sys/netlink/route/iface_drivers.c index 1b8c27bfca68..7cfaa5a6614b 100644 --- a/sys/netlink/route/iface_drivers.c +++ b/sys/netlink/route/iface_drivers.c @@ -109,6 +109,41 @@ modify_generic(struct ifnet *ifp, struct nl_parsed_link *lattrs, return (0); } +/* + * Saves the resulting ifindex and ifname to report them + * to userland along with the operation result. + * NLA format: + * NLMSGERR_ATTR_COOKIE(nested) + * IFLA_NEW_IFINDEX(u32) + * IFLA_IFNAME(string) + */ +static void +store_cookie(struct nl_pstate *npt, struct ifnet *ifp) +{ + int ifname_len = strlen(if_name(ifp)); + uint32_t ifindex = (uint32_t)ifp->if_index; + + int nla_len = sizeof(struct nlattr) * 3 + + sizeof(ifindex) + NL_ITEM_ALIGN(ifname_len + 1); + struct nlattr *nla_cookie = npt_alloc(npt, nla_len); + + /* Nested TLV */ + nla_cookie->nla_len = nla_len; + nla_cookie->nla_type = NLMSGERR_ATTR_COOKIE; + + struct nlattr *nla = nla_cookie + 1; + nla->nla_len = sizeof(struct nlattr) + sizeof(ifindex); + nla->nla_type = IFLA_NEW_IFINDEX; + memcpy(NLA_DATA(nla), &ifindex, sizeof(ifindex)); + + nla = NLA_NEXT(nla); + nla->nla_len = sizeof(struct nlattr) + ifname_len + 1; + nla->nla_type = IFLA_IFNAME; + strlcpy(NLA_DATA(nla), if_name(ifp), ifname_len + 1); + + nlmsg_report_cookie(npt, nla_cookie); +} + /* * Generic creation interface handler. * Responsible for creating interfaces w/o parameters and setting @@ -135,6 +170,8 @@ create_generic(struct nl_parsed_link *lattrs, const struct nlattr_bmask *bm, if (!success) return (EINVAL); error = modify_generic(ifp, lattrs, bm, nlp, npt); + if (error == 0) + store_cookie(npt, ifp); if_rele(ifp); } diff --git a/tests/atf_python/sys/net/netlink.py b/tests/atf_python/sys/net/netlink.py index 57c8582627cf..ba7d41c7cbf8 100644 --- a/tests/atf_python/sys/net/netlink.py +++ b/tests/atf_python/sys/net/netlink.py @@ -950,58 +950,68 @@ def prepare_attrs_map(attrs: List[AttrDescr]) -> Dict[str, Dict]: return ret -rtnl_route_attrs = [ - AttrDescr(RtattrType.RTA_DST, NlAttrIp), - AttrDescr(RtattrType.RTA_SRC, NlAttrIp), - AttrDescr(RtattrType.RTA_IIF, NlAttrIfindex), - AttrDescr(RtattrType.RTA_OIF, NlAttrIfindex), - AttrDescr(RtattrType.RTA_GATEWAY, NlAttrTable), - AttrDescr(RtattrType.RTA_VIA, NlAttrVia), - AttrDescr(RtattrType.RTA_NH_ID, NlAttrNhId), - AttrDescr( - RtattrType.RTA_METRICS, - NlAttrNested, - [ - AttrDescr(NlRtaxType.RTAX_MTU, NlAttrU32), - ], - ), -] - -nldone_attrs = [] - -nlerr_attrs = [ - AttrDescr(NlErrattrType.NLMSGERR_ATTR_MSG, NlAttrStr), - AttrDescr(NlErrattrType.NLMSGERR_ATTR_OFFS, NlAttrU32), -] - -rtnl_ifla_attrs = [ - AttrDescr(IflattrType.IFLA_ADDRESS, NlAttrMac), - AttrDescr(IflattrType.IFLA_BROADCAST, NlAttrMac), - AttrDescr(IflattrType.IFLA_IFNAME, NlAttrStr), - AttrDescr(IflattrType.IFLA_MTU, NlAttrU32), - AttrDescr(IflattrType.IFLA_PROMISCUITY, NlAttrU32), - AttrDescr(IflattrType.IFLA_OPERSTATE, NlAttrU8), - AttrDescr(IflattrType.IFLA_CARRIER, NlAttrU8), - AttrDescr(IflattrType.IFLA_IFALIAS, NlAttrStr), - AttrDescr(IflattrType.IFLA_STATS64, NlAttrIfStats), - AttrDescr( - IflattrType.IFLA_LINKINFO, - NlAttrNested, - [ - AttrDescr(IflinkInfo.IFLA_INFO_KIND, NlAttrStr), - AttrDescr(IflinkInfo.IFLA_INFO_DATA, NlAttr), - ], - ), -] - -rtnl_ifa_attrs = [ - AttrDescr(IfattrType.IFA_ADDRESS, NlAttrIp), - AttrDescr(IfattrType.IFA_LOCAL, NlAttrIp), - AttrDescr(IfattrType.IFA_LABEL, NlAttrStr), - AttrDescr(IfattrType.IFA_BROADCAST, NlAttrIp), - AttrDescr(IfattrType.IFA_ANYCAST, NlAttrIp), - AttrDescr(IfattrType.IFA_FLAGS, NlAttrU32), -] +rtnl_route_attrs = prepare_attrs_map( + [ + AttrDescr(RtattrType.RTA_DST, NlAttrIp), + AttrDescr(RtattrType.RTA_SRC, NlAttrIp), + AttrDescr(RtattrType.RTA_IIF, NlAttrIfindex), + AttrDescr(RtattrType.RTA_OIF, NlAttrIfindex), + AttrDescr(RtattrType.RTA_GATEWAY, NlAttrTable), + AttrDescr(RtattrType.RTA_VIA, NlAttrVia), + AttrDescr(RtattrType.RTA_NH_ID, NlAttrNhId), + AttrDescr( + RtattrType.RTA_METRICS, + NlAttrNested, + [ + AttrDescr(NlRtaxType.RTAX_MTU, NlAttrU32), + ], + ), + ] +) + +nldone_attrs = prepare_attrs_map([]) + +nlerr_attrs = prepare_attrs_map( + [ + AttrDescr(NlErrattrType.NLMSGERR_ATTR_MSG, NlAttrStr), + AttrDescr(NlErrattrType.NLMSGERR_ATTR_OFFS, NlAttrU32), + AttrDescr(NlErrattrType.NLMSGERR_ATTR_COOKIE, NlAttr), + ] +) + +rtnl_ifla_attrs = prepare_attrs_map( + [ + AttrDescr(IflattrType.IFLA_ADDRESS, NlAttrMac), + AttrDescr(IflattrType.IFLA_BROADCAST, NlAttrMac), + AttrDescr(IflattrType.IFLA_IFNAME, NlAttrStr), + AttrDescr(IflattrType.IFLA_MTU, NlAttrU32), + AttrDescr(IflattrType.IFLA_PROMISCUITY, NlAttrU32), + AttrDescr(IflattrType.IFLA_OPERSTATE, NlAttrU8), + AttrDescr(IflattrType.IFLA_CARRIER, NlAttrU8), + AttrDescr(IflattrType.IFLA_IFALIAS, NlAttrStr), + AttrDescr(IflattrType.IFLA_STATS64, NlAttrIfStats), + AttrDescr(IflattrType.IFLA_NEW_IFINDEX, NlAttrU32), + AttrDescr( + IflattrType.IFLA_LINKINFO, + NlAttrNested, + [ + AttrDescr(IflinkInfo.IFLA_INFO_KIND, NlAttrStr), + AttrDescr(IflinkInfo.IFLA_INFO_DATA, NlAttr), + ], + ), + ] +) + +rtnl_ifa_attrs = prepare_attrs_map( + [ + AttrDescr(IfattrType.IFA_ADDRESS, NlAttrIp), + AttrDescr(IfattrType.IFA_LOCAL, NlAttrIp), + AttrDescr(IfattrType.IFA_LABEL, NlAttrStr), + AttrDescr(IfattrType.IFA_BROADCAST, NlAttrIp), + AttrDescr(IfattrType.IFA_ANYCAST, NlAttrIp), + AttrDescr(IfattrType.IFA_FLAGS, NlAttrU32), + ] +) class BaseNetlinkMessage(object): @@ -1140,7 +1150,7 @@ class StdNetlinkMessage(BaseNetlinkMessage): raise return self - def _parse_attrs(self, data: bytes, attr_map): + def parse_attrs(self, data: bytes, attr_map): ret = [] off = 0 while len(data) - off >= 4: @@ -1157,7 +1167,7 @@ class StdNetlinkMessage(BaseNetlinkMessage): val = v["ad"].cls.from_bytes(data[off : off + nla_len], v["ad"].val) if "child" in v: # nested - attrs, _ = self._parse_attrs(data[off : off + nla_len], v["child"]) + attrs, _ = self.parse_attrs(data[off : off + nla_len], v["child"]) val = NlAttrNested(raw_nla_type, attrs) else: # unknown attribute @@ -1167,7 +1177,7 @@ class StdNetlinkMessage(BaseNetlinkMessage): return ret, off def parse_nla_list(self, data: bytes) -> List[NlAttr]: - return self._parse_attrs(data, self.nl_attrs_map) + return self.parse_attrs(data, self.nl_attrs_map) def print_message(self): self.print_nl_header(self.nl_hdr) @@ -1178,7 +1188,7 @@ class StdNetlinkMessage(BaseNetlinkMessage): class NetlinkDoneMessage(StdNetlinkMessage): messages = [NlMsgType.NLMSG_DONE.value] - nl_attrs_map = prepare_attrs_map(nldone_attrs) + nl_attrs_map = nldone_attrs @property def error_code(self): @@ -1197,7 +1207,7 @@ class NetlinkDoneMessage(StdNetlinkMessage): class NetlinkErrorMessage(StdNetlinkMessage): messages = [NlMsgType.NLMSG_ERROR.value] - nl_attrs_map = prepare_attrs_map(nlerr_attrs) + nl_attrs_map = nlerr_attrs @property def error_code(self): @@ -1217,6 +1227,10 @@ class NetlinkErrorMessage(StdNetlinkMessage): return nla.u32 return None + @property + def cookie(self): + return self.get_nla(NlErrattrType.NLMSGERR_ATTR_COOKIE) + def parse_base_header(self, data): if len(data) < sizeof(Nlmsgerr): raise ValueError("length less than nlmsgerr header") @@ -1257,7 +1271,7 @@ class NetlinkRtMessage(BaseNetlinkRtMessage): NlRtMsgType.RTM_DELROUTE.value, NlRtMsgType.RTM_GETROUTE.value, ] - nl_attrs_map = prepare_attrs_map(rtnl_route_attrs) + nl_attrs_map = rtnl_route_attrs def __init__(self, helper, nlm_type): super().__init__(helper, nlm_type) @@ -1297,7 +1311,7 @@ class NetlinkIflaMessage(BaseNetlinkRtMessage): NlRtMsgType.RTM_DELLINK.value, NlRtMsgType.RTM_GETLINK.value, ] - nl_attrs_map = prepare_attrs_map(rtnl_ifla_attrs) + nl_attrs_map = rtnl_ifla_attrs def __init__(self, helper, nlm_type): super().__init__(helper, nlm_type) @@ -1329,7 +1343,7 @@ class NetlinkIfaMessage(BaseNetlinkRtMessage): NlRtMsgType.RTM_DELADDR.value, NlRtMsgType.RTM_GETADDR.value, ] - nl_attrs_map = prepare_attrs_map(rtnl_ifa_attrs) + nl_attrs_map = rtnl_ifa_attrs def __init__(self, helper, nlm_type): super().__init__(helper, nlm_type) diff --git a/tests/sys/netlink/test_rtnl_iface.py b/tests/sys/netlink/test_rtnl_iface.py index 7cff592b1676..ecc932c6213e 100644 --- a/tests/sys/netlink/test_rtnl_iface.py +++ b/tests/sys/netlink/test_rtnl_iface.py @@ -17,6 +17,7 @@ from atf_python.sys.net.netlink import NlmBaseFlags from atf_python.sys.net.netlink import NlmNewFlags from atf_python.sys.net.netlink import NlMsgType from atf_python.sys.net.netlink import NlRtMsgType +from atf_python.sys.net.netlink import rtnl_ifla_attrs from atf_python.sys.net.vnet import SingleVnetTestTemplate @@ -91,6 +92,40 @@ class TestRtNlIface(NetlinkTestTemplate, SingleVnetTestTemplate): self.get_interface_byname("lo10") + @pytest.mark.require_user("root") + def test_create_iface_plain_retvals(self): + """Tests loopback creation w/o any parameters""" + 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, "lo10")) + 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) + assert rx_msg.error_code == 0 + assert rx_msg.cookie is not None + 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 IflattrType.IFLA_IFNAME.value in nla_map + assert nla_map[IflattrType.IFLA_IFNAME.value].text == "lo10" + assert IflattrType.IFLA_NEW_IFINDEX.value in nla_map + assert nla_map[IflattrType.IFLA_NEW_IFINDEX.value].u32 > 0 + + lo_msg = self.get_interface_byname("lo10") + assert ( + lo_msg.base_hdr.ifi_index == nla_map[IflattrType.IFLA_NEW_IFINDEX.value].u32 + ) + @pytest.mark.require_user("root") def test_create_iface_attrs(self): """Tests interface creation with additional properties""" From nobody Mon Feb 20 14:34:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL4g309x1z3st2x; Mon, 20 Feb 2023 14:34: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 4PL4g26jRjz3tvq; Mon, 20 Feb 2023 14:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tv/UAO4K6i/gORkw8IeDdEg7cXv+Zo3OHJApWRvqPxY=; b=xl+RVHUShapKciSSQ+pHI8z/BrCuxviCPS1Z0mZx410+fsTYm3voR+AIsyAS3nJ41CX0M/ L+rxevFa68u2JOQKrUCAu/9lzFivT0n9t4lwtyvE5CtZWxHZm3LCLhreVirD4tGbhRdgJu qCfAw0U5D28WpaYrdh4rFoo3mu34KgHHOcCmpIwMO46NIifcQzHBIRp25QN36wYIomyUV5 Oh1Xt3Tggg2n+UbWpdx96Epzonv2u6SF+0B42Xk5WYmA/YF7eICSnNmeSH0i5wA7ALfKEm eocqlvRD7yvFZgljOJ85AaEkaxycMIKP3WTxxENHIuyu4WrhomFBUH1exoVPKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tv/UAO4K6i/gORkw8IeDdEg7cXv+Zo3OHJApWRvqPxY=; b=EyPbRIvEfUDT8apt8/HQKhQ56UYpiY7pm5UDEuKIyvOal0ge9XMyARmBKaIxlgHlyU5PRJ 3gkFC9uNUGVFMcCNtyvvRvOyVm8Wy866xkhxDPe9duvbx/zDYvklgOE4L8Sj8+E9iquOis 85+9aAiZT65VCndbIRb5b2pyBUEn6Lz30bqCj8eQKdDtDbQzQNE2IeazfIXmPtJSE1Nptg Qy4gWymqtvUJw7vniGycHXzO7QfJr6yZwjxnfM71v1EU661RjMCw3nx0pKmg/GBoS2l+ST K/YM+9R5ONus4FSUmWGS3Nb+1xw6p8vrYBp+PKw5anHVyn/u7ad9SRHaxf701w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676903646; a=rsa-sha256; cv=none; b=xvqoJU3n8utGTm9wtxLUUqstenbdtyWti+Zut+d8qxwvm/MmTJIIcSQ3h8Wp+Fb6N1H2T1 Mi3QF+hBV2ShNEB6m/d+SwYGuhyFKHjra8vph5NC8QVP8Y+HOyrRLyd1ZErigOEuueQcVw QlZJvaMs9PjMhs+U19WI0sIva5x6uA7B+aKPsmUR01uKDVewzJERJ6yTS+AFd9N6HIUnzB ds3M30ZPV+937VEnFpepCvPJUkFSfOJvk0rfYHmHpuaY74CU0GId4M7l+Ot9O8NfRxHyhN CkPifZmBc8v4LYuXUIlL2y+gUD1XYLGAXnvV8sD5mkT8s+WI4q1ACLS57CmGRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL4g25kqqzknC; Mon, 20 Feb 2023 14:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31KEY61N005748; Mon, 20 Feb 2023 14:34:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KEY6fS005747; Mon, 20 Feb 2023 14:34:06 GMT (envelope-from git) Date: Mon, 20 Feb 2023 14:34:06 GMT Message-Id: <202302201434.31KEY6fS005747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: ed363bbc624e - stable/13 - fibs: restrict jail_attach(2) if process fibnum >= numfibs in the jail. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed363bbc624e3a69da1867e86f979b30668a0934 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=ed363bbc624e3a69da1867e86f979b30668a0934 commit ed363bbc624e3a69da1867e86f979b30668a0934 Author: Alexander V. Chernikov AuthorDate: 2023-02-11 15:43:23 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 14:33:28 +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 (cherry picked from commit 69e7d9b7e6b369b760e1f189af2e25587b56a102) --- 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 65829676d76f..406bedc4c769 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 Mon Feb 20 14:34:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL4g41FsQz3st5g; Mon, 20 Feb 2023 14:34:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PL4g40XmGz3vX2; Mon, 20 Feb 2023 14:34:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HoGQ6YLHLJU5kc4Bns/J7Lq9FxMMkVFcK+h1r285nlE=; b=klQ8XrJ4MiUA2votauypW0DxGoeRTdpX8q5wRb9Aume7u/hHf6F7ws4oLs6oloMZslRv4U yjpySXGSYTceZlyr8bFhvAbMaFn5m0ftTow7MUX9yQ9LSfcLxO4DQXAJSxsbLKt0KKChNT fdQ1rGaN9jPv3kXaaK+MuQRhHhKLztL7eSnrilx7OcdmwzAIgUjzr0k8MNZYd31oLeAtKJ ynooBfMZKzdt5T3KlJGM0lmFFx/SdFXaFB6vgv1kjbNHfgrsSMM9ZHx6SHCWyMXFmPEnKQ vTl0H7YSGuTumdYFtnRV5aqsItkMfuhWGSXdFksiOAH/2B5BsDzgyxhL7Dpa1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HoGQ6YLHLJU5kc4Bns/J7Lq9FxMMkVFcK+h1r285nlE=; b=EjpmEZIPwO3HCKNqUgoHFHhRsPJuPF9Z4N3fE89Fn4M51vFHIDhCU6nl/JYQaXbg9PPpVV TzoYVazekMDI6yYnkdmN0HLCMjwiHQmiJ8on+wVWWu2VUALz2uyQuS3ZMtIvPY8eAL1dRm bPy+U/g8BAaBxlH1/G/Fq7EZVMNzjrTX1PEDrVt9FFXtIUsEkurQZ20wGemS5wCGkqa8S2 e5WbNnQ3XSL8ip5ggqu2JDnaUN1Yh3UUUQc9iA2PCY2Y/EDVuAuIL6CKcVGGFE1ldehoAC 6VN4HXEDrcNHBKjTjD/lJxbH4y8GuT+ncDckMaoEbiiOf0epyGj/LGxZYCD+eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676903648; a=rsa-sha256; cv=none; b=mU++KmyL7Es2M8ORv2bN3qA8ILezpCgoDSPeirpRUGqQxTkncYQVMlOL805YPndKa9MKoa WTWxdsir+4L4rEceyOHwpWiVrRO7HMj6vRVE+lS00PSViTC6lfTPuBlJRFjtObX7Pf6zNr qVnVlDuivEIhCe+uE8WRtqfvn2a/71JeDkl6HMIUPg4BDfADaJp/AMJYgWOPorQtgqTQip obm1PbDi62ZcxpkPFWjBJzNszPhUnAFGRQmt6yZsNPfgYM6ddfb2Db5YCBMwMgThudf0zz /KTts0HvyWD6BFwBP1rXE+/JQsVaOrcdcbjrFuM7E8Bf9MXzVQ+PArDhvXueaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL4g36fWWzl8f; Mon, 20 Feb 2023 14:34: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 31KEY7iF005773; Mon, 20 Feb 2023 14:34:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KEY7Cc005772; Mon, 20 Feb 2023 14:34:07 GMT (envelope-from git) Date: Mon, 20 Feb 2023 14:34:07 GMT Message-Id: <202302201434.31KEY7Cc005772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: a800622765b1 - stable/13 - netlink: fix interface dump. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a800622765b1e7cab79fa857e9a671e6c0c1ccec Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a800622765b1e7cab79fa857e9a671e6c0c1ccec commit a800622765b1e7cab79fa857e9a671e6c0c1ccec Author: Alexander V. Chernikov AuthorDate: 2023-02-16 13:17:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 14:33:28 +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 (cherry picked from commit 86fd0bdba540132ae298457e160b651f61d1db6b) --- 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 Mon Feb 20 14:34:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL4g52sPbz3stND; Mon, 20 Feb 2023 14:34: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 4PL4g51Wpzz3vd0; Mon, 20 Feb 2023 14:34:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KTNPBpvI2zjtC2RwjLnV977tN5rzw/iSGYsxFLwHnfc=; b=WFIRdh/2vTt0SKGyISk7THXDjIxH3HgpqLz7y3Uquy/U22HvbjVa2FE4VbhkGhvT38whOM wFYi6QCTj6GmVpxTZ9Rs3qB48wB+D/B3VXQr6POVx77JIQw5CckmKgNuZee54ZEIZcpooJ XJ51K7gNvN9eb/o8xSuRq2v/5sn6UWS0bnWMaT+ShHEFbPgkPAg28upOfxx9SjpOsq06Wf zTOSfoWeg8egzeW2pH0T7MLMv/PClklSX5nrDbYx3B8XAschRVVxdUGD5hvBvypxxh/r9S Qk6hhxx0HRTwxuY51x6pBDaYw+dKe041Oxw2FST2AUuC3mraIBUIPFVZdMfg8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KTNPBpvI2zjtC2RwjLnV977tN5rzw/iSGYsxFLwHnfc=; b=BJXoJt48QKsGBKTQQbj3j6fbfxPmPEUOPnere5ggLG3UPRFVfdGT+Ean1oC1WgLiitrGzw Arkf+RnlqHFfnoX6ssKcrRPI8kkmBUEajr4kQE0Rv3Byu6SfmAcBFMuHaDqRKpwQ6OlQM4 49XiqDk4ZIj7nXrulDti8lodxc7oWx8TVyKEGBm1Um4lLwfJi5BVd2mDm55ZnEyklieSPF YQTgNek99EdR0sD96jzRGcJIQUGjRxPzBE2PLeMHD+xVv9lzBT6eH3dNE4EnDOgukhxFiy TxcqgfhdF7RQ4AhgsbMGwaZr7TXTjsSnwjvS2ikyLL3MOlU05+3PlnHYXenEUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676903649; a=rsa-sha256; cv=none; b=Jh40/Ujjg/kr9YFAWeDDZNyDLP+QBPYnMwBM3ucjQR15R6A2IxtnlBRrOKoGvS13cuPz7t Wy/V13Qs/1t5WJr8y1fHZbY0Dt2KMprrBzvjT/guh8mxi0LIA8J6Gkya/37AQKtF0JdR7t 4Efn90LjpGY9NKRzHGnUXejp1JSOazzhz0N/JAGO9NKSRzb6POTH2TH9lJgfgH9f6Jyofy UIR01YkkRne2rlhtkwmFobyjFuzMNkjXgmzAR92AlzdEvr8ztp3JfWw+/WV/T/7LxYKsaK lbSUh50zNzzE8C32NHYZbwDQCxxHBtU30guWepgxMnIts4bLFJ+HC73reCxucg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL4g50Tc7zknD; Mon, 20 Feb 2023 14:34: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 31KEY8i4005793; Mon, 20 Feb 2023 14:34:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KEY8IF005792; Mon, 20 Feb 2023 14:34:08 GMT (envelope-from git) Date: Mon, 20 Feb 2023 14:34:08 GMT Message-Id: <202302201434.31KEY8IF005792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 4c1ef49999c6 - stable/13 - netlink: simplify temporary address allocation in rtnl_handle_getlink(). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c1ef49999c6687905664eecd73ea9473ffe5fda Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=4c1ef49999c6687905664eecd73ea9473ffe5fda commit 4c1ef49999c6687905664eecd73ea9473ffe5fda Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:57:44 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 14:33:28 +0000 netlink: simplify temporary address allocation in rtnl_handle_getlink(). MFC after: 3 days (cherry picked from commit 45356a1864c79680c6911b48a18b14a88a7d07fa) --- 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 Mon Feb 20 14:34:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL4g64Q2jz3stF4; Mon, 20 Feb 2023 14:34: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 4PL4g62fLZz3vKK; Mon, 20 Feb 2023 14:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vtpf3TfhorvzVQMVpKRAWXN4Tl+nAWGwlgIIhBLXKg0=; b=bJqYjC/JLBHbhXtDMNNbpmMAqWX2swMG5T5bzfcsqGYr3CvkXpoP3HxIeFJLLgpZQtg1Re hVsESp/jANn6kCqF99efa+V8O73LdS/r4RITIplhvlKluVVsREMvUsJzQ7fO117+ikN/BN MMU+HOCnwr8oRntGwO9hGo6bUModsHuqxMlKuErvxtrwRsQfDIE37RRMxqKb3MYJRhL7Ii /n3ajMKDKZsLhBRDpveOq7oW4sF1ve6PM/jXkRUoBNn8QkL5wZO95ouCNhSN3jqDgRNwdA PmVJxqn0sz9AEJd1a7P4a3uoXoq6XWJOzIqJmW2iHOSAiDJWJcIZaBrh/f0feA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676903650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vtpf3TfhorvzVQMVpKRAWXN4Tl+nAWGwlgIIhBLXKg0=; b=Tzzq4m7uqgzzhFWSOcG9yBRGoRHL2iFkze4paeQlHKOOX0dKuwNdPncMtjskJH3zl2YZwP 2597FKZAd9loqh9nMNUOYAju/mNMre4xgLEzv0gTOoW66e8kFcWj+MIdpu09ugpZoDD7kT ajKhIul+RZyrJa90dRokbpRouhi8oDkrBc/b+VObYwcApDtkjLoxqaq76OKfnjHd0V7xcC wT4UTVdw7JynB3idK3HShnriG5GCWpRJSTU7kKCCx7jAZIjcrDcLZM7611ZGKq09FSFykA TQjVvVFV1CjMr17EKz8H7b2aveiiBN8o2OObet5njZKKjLXyfLLa4J3Qr+uHog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676903650; a=rsa-sha256; cv=none; b=x0GYIak2qDA4xlgWOnwoNTGAkTomVveq4xtorpxaVkF5mV17H68HU2CgfEa/jWpTnBxMqQ OkIaRFjh6n9ppaYwsZy3cJNdys0p648YrR+NNCWFRgMfudgK+x4JiPOsc4h5DPnJJ+946V ek8UDWDrNTes/rhQtK4CtOEshQCuyvp1du2lZBNbKGJ4map5y20kkqbp0CYpFm5xR/kkOF J2z+xUS/1O8JLpNn1egiCfFhtOFkHgewet/qR9zdJReDmJFAIvYghNiTeX3uasJQmZ2OQn rzNEJL1bYZerEQ0bBtgRDoozihHgwWWHEYXJnsrdNvCUchUeaiwrvN+H9DLgTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL4g61MfYzkW4; Mon, 20 Feb 2023 14:34: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 31KEYAfP005813; Mon, 20 Feb 2023 14:34:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KEYARa005812; Mon, 20 Feb 2023 14:34:10 GMT (envelope-from git) Date: Mon, 20 Feb 2023 14:34:10 GMT Message-Id: <202302201434.31KEYARa005812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: d9d596bb2ce0 - stable/13 - netlink: fix OOB read in genetlink List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d9d596bb2ce04bbec5ea811342efd4216c1fc2a3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=d9d596bb2ce04bbec5ea811342efd4216c1fc2a3 commit d9d596bb2ce04bbec5ea811342efd4216c1fc2a3 Author: Alexander V. Chernikov AuthorDate: 2023-02-18 17:24:59 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 14:33:30 +0000 netlink: fix OOB read in genetlink CID: 1498863 MFC after: 1 day (cherry picked from commit 8f7455a9265f4952f885b06c08c57fcce6f16e5c) --- 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 Mon Feb 20 15:25:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL5pd6fzhz3sxdF; Mon, 20 Feb 2023 15:25: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 4PL5pd697kz429h; Mon, 20 Feb 2023 15:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676906745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Izo2YSnHcd2MFpgJhq87ry0GqUjIBMOBEeG9/cObGI=; b=W2fpkviL4YngQpbFO+AdR+aWpAUmdGkMvcfUngQIrGyyINfM+jF3Tevk4o1mP/TS/o4jjN Fs9e1Go/29NZOCFhPkh2MlhT31U4VF02HBGmtJ41QyMzwvU+TnO3SrwpuQEsCwZGMQTqZs ytQmnQE8wuSzOTKhU02hv2uYcZoes3/Wxlj8N+o//bmtRfpSA0MuMmmGjSVRLtd1Y3OTT7 QWuriob6wMziVfRH5b7tWl/AdvHSWClqVcX+jvkH5cFOYGu6UI5/kfkiG7n8thjeDl6uLA /OI6i4aZ9kEU+NBBZl0/CL8nE3KnjldSLNv74UpXtXN4yv+qEa0rqQ/DL/ISzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676906745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Izo2YSnHcd2MFpgJhq87ry0GqUjIBMOBEeG9/cObGI=; b=amYwCAP+vhYIQ7jnS91zaWJQNXrbWDKJZQOgjYMJjBczLpwKyn9vY5jZuGMir1qGfeaUwX ELPyATg1VmFNdSOI/tP9V8C/qSWKfPp8wlzRus6DZPooNGsvEs+/0Brv6aRnb8Y3So8CGD Za1bzCTFI0mvm0KpWXRP7apVSFauJnyu1I6oolyhJaxkeeVmbzZbzvpNTK0tGH0gq0vnyr wamFeZzZRCfhU+hL2/nvgz4HKfSLb1o0zTLNvGiYSN2neMH+XGX/m9J71vo1Gf9n+sf6lj RRCgzlE0nYtQN791JRIvDd7stib1DlhVF/TcSHSln9wj8170DzUb4kYWEYnVRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676906745; a=rsa-sha256; cv=none; b=WflG+uBVlvZyPb2t9q7Mj5tmD6dOKEUKw3V+g3nEesQ49XyDCNmQ+Ynx+k6t9rRsYRzJSA UuDyWpRjzYGHHHnAnsKOndYCcddUSxJnzBuDTGUtC95PjaqaFiwGFWlX2moPWP1Nhrj6+A VR7Rw2BqAakyye/j9msvr8HFmPbvRFLtTJqXaQAW13a1ZQi2Pyx7zUg0mf9qw+rYicmFwn WeFb5bcNFeCLAHYlZfmzHGoWh3I2ggwMmDktJLxNLc4+iZfJiWYbGeA7WEQH7DkPH2Pgx0 84y6tIx0fONxJnswt4Pn3hHX+ySVM4uuHDwUt/HBvI5+McoVNFd3AAfGgsiohg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL5pd5GWVzmL2; Mon, 20 Feb 2023 15:25: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 31KFPjgJ078273; Mon, 20 Feb 2023 15:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KFPj9X078272; Mon, 20 Feb 2023 15:25:45 GMT (envelope-from git) Date: Mon, 20 Feb 2023 15:25:45 GMT Message-Id: <202302201525.31KFPj9X078272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: a38e2ff92458 - stable/13 - netinet6: Fix mbuf leak in NDP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a38e2ff92458b97db06fccf9036c6f74d80155a2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a38e2ff92458b97db06fccf9036c6f74d80155a2 commit a38e2ff92458b97db06fccf9036c6f74d80155a2 Author: Arseny Smalyuk AuthorDate: 2022-05-31 20:04:51 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 15:14:24 +0000 netinet6: Fix mbuf leak in NDP Mbufs leak when manually removing incomplete NDP records with pending packet via ndp -d. It happens because lltable_drop_entry_queue() rely on `la_numheld` counter when dropping NDP entries (lles). It turned out NDP code never increased `la_numheld`, so the actual free never happened. Fix the issue by introducing unified lltable_append_entry_queue(), common for both ARP and NDP code, properly addressing packet queue maintenance. Reviewed By: melifaro Differential Revision: https://reviews.freebsd.org/D35365 MFC after: 2 weeks (cherry picked from commit d18b4bec98f1cf3c51103a22c0c041e6238c44c7) --- sys/net/if_llatbl.c | 43 ++++++++++++++++++++++++++++++++++----- sys/net/if_llatbl.h | 2 ++ sys/netinet/icmp6.h | 1 + sys/netinet/if_ether.c | 23 ++++----------------- sys/netinet6/nd6.c | 53 ++++++++++--------------------------------------- usr.bin/netstat/inet6.c | 2 ++ 6 files changed, 58 insertions(+), 66 deletions(-) diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c index 05cd8ea24a46..9ada3af318f3 100644 --- a/sys/net/if_llatbl.c +++ b/sys/net/if_llatbl.c @@ -127,6 +127,41 @@ done: return (error); } +/* + * Adds a mbuf to hold queue. Drops old packets if the queue is full. + * + * Returns the number of held packets that were dropped. + */ +size_t +lltable_append_entry_queue(struct llentry *lle, struct mbuf *m, + size_t maxheld) +{ + size_t pkts_dropped = 0; + + LLE_WLOCK_ASSERT(lle); + + while (lle->la_numheld >= maxheld && lle->la_hold != NULL) { + struct mbuf *next = lle->la_hold->m_nextpkt; + m_freem(lle->la_hold); + lle->la_hold = next; + lle->la_numheld--; + pkts_dropped++; + } + + if (lle->la_hold != NULL) { + struct mbuf *curr = lle->la_hold; + while (curr->m_nextpkt != NULL) + curr = curr->m_nextpkt; + curr->m_nextpkt = m; + } else + lle->la_hold = m; + + lle->la_numheld++; + + return pkts_dropped; +} + + /* * Common function helpers for chained hash table. */ @@ -285,14 +320,12 @@ llentries_unlink(struct lltable *llt, struct llentries *head) size_t lltable_drop_entry_queue(struct llentry *lle) { - size_t pkts_dropped; - struct mbuf *next; + size_t pkts_dropped = 0; LLE_WLOCK_ASSERT(lle); - pkts_dropped = 0; - while ((lle->la_numheld > 0) && (lle->la_hold != NULL)) { - next = lle->la_hold->m_nextpkt; + while (lle->la_hold != NULL) { + struct mbuf *next = lle->la_hold->m_nextpkt; m_freem(lle->la_hold); lle->la_hold = next; lle->la_numheld--; diff --git a/sys/net/if_llatbl.h b/sys/net/if_llatbl.h index 143b000adc22..6af13660e344 100644 --- a/sys/net/if_llatbl.h +++ b/sys/net/if_llatbl.h @@ -221,6 +221,8 @@ void lltable_link(struct lltable *llt); void lltable_prefix_free(int, struct sockaddr *, struct sockaddr *, u_int); int lltable_sysctl_dumparp(int, struct sysctl_req *); +size_t lltable_append_entry_queue(struct llentry *, + struct mbuf *, size_t); struct lltable *in_lltable_get(struct ifnet *ifp); struct lltable *in6_lltable_get(struct ifnet *ifp); diff --git a/sys/netinet/icmp6.h b/sys/netinet/icmp6.h index d4fde01c7e88..d4a103d04f00 100644 --- a/sys/netinet/icmp6.h +++ b/sys/netinet/icmp6.h @@ -602,6 +602,7 @@ struct icmp6stat { uint64_t icp6s_tooshort; /* packet < sizeof(struct icmp6_hdr) */ uint64_t icp6s_checksum; /* bad checksum */ uint64_t icp6s_badlen; /* calculated bound mismatch */ + uint64_t icp6s_dropped; /* # of packets dropped waiting for a resolution */ /* * number of responses: this member is inherited from netinet code, but * for netinet6 code, it is already available in icp6s_outhist[]. diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 59a7c78cb03b..d252d8be9a99 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -465,8 +465,6 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flags, struct mbuf *m, struct llentry **plle) { struct llentry *la = NULL, *la_tmp; - struct mbuf *curr = NULL; - struct mbuf *next = NULL; int error, renew; char *lladdr; int ll_len; @@ -534,6 +532,7 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flags, struct mbuf *m, } renew = (la->la_asked == 0 || la->la_expire != time_uptime); + /* * There is an arptab entry, but no ethernet address * response yet. Add the mbuf to the list, dropping @@ -541,24 +540,10 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flags, struct mbuf *m, * setting. */ if (m != NULL) { - if (la->la_numheld >= V_arp_maxhold) { - if (la->la_hold != NULL) { - next = la->la_hold->m_nextpkt; - m_freem(la->la_hold); - la->la_hold = next; - la->la_numheld--; - ARPSTAT_INC(dropped); - } - } - if (la->la_hold != NULL) { - curr = la->la_hold; - while (curr->m_nextpkt != NULL) - curr = curr->m_nextpkt; - curr->m_nextpkt = m; - } else - la->la_hold = m; - la->la_numheld++; + size_t dropped = lltable_append_entry_queue(la, m, V_arp_maxhold); + ARPSTAT_ADD(dropped, dropped); } + /* * Return EWOULDBLOCK if we have tried less than arp_maxtries. It * will be masked by ether_output(). Return EHOSTDOWN/EHOSTUNREACH diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 924727d598de..be881b6291ac 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -139,7 +139,6 @@ static void nd6_free(struct llentry **, int); static void nd6_free_redirect(const struct llentry *); static void nd6_llinfo_timer(void *); static void nd6_llinfo_settimer_locked(struct llentry *, long); -static void clear_llinfo_pqueue(struct llentry *); static int nd6_resolve_slow(struct ifnet *, int, int, struct mbuf *, const struct sockaddr_in6 *, u_char *, uint32_t *, struct llentry **); static int nd6_need_cache(struct ifnet *); @@ -805,18 +804,19 @@ nd6_llinfo_timer(void *arg) /* Send NS to multicast address */ pdst = NULL; } else { - struct mbuf *m = ln->la_hold; - if (m) { - struct mbuf *m0; + struct mbuf *m; + ICMP6STAT_ADD(icp6s_dropped, ln->la_numheld); + + m = ln->la_hold; + if (m != NULL) { /* * assuming every packet in la_hold has the * same IP header. Send error after unlock. */ - m0 = m->m_nextpkt; + ln->la_hold = m->m_nextpkt; m->m_nextpkt = NULL; - ln->la_hold = m0; - clear_llinfo_pqueue(ln); + ln->la_numheld--; } nd6_free(&ln, 0); if (m != NULL) { @@ -2149,6 +2149,7 @@ nd6_grab_holdchain(struct llentry *ln) chain = ln->la_hold; ln->la_hold = NULL; + ln->la_numheld = 0; if (ln->ln_state == ND6_LLINFO_STALE) { /* @@ -2368,6 +2369,7 @@ nd6_resolve_slow(struct ifnet *ifp, int family, int flags, struct mbuf *m, struct in6_addr *psrc, src; int send_ns, ll_len; char *lladdr; + size_t dropped; NET_EPOCH_ASSERT(); @@ -2434,28 +2436,8 @@ nd6_resolve_slow(struct ifnet *ifp, int family, int flags, struct mbuf *m, * packet queue in the mbuf. When it exceeds nd6_maxqueuelen, * the oldest packet in the queue will be removed. */ - - if (lle->la_hold != NULL) { - struct mbuf *m_hold; - int i; - - i = 0; - for (m_hold = lle->la_hold; m_hold; m_hold = m_hold->m_nextpkt){ - i++; - if (m_hold->m_nextpkt == NULL) { - m_hold->m_nextpkt = m; - break; - } - } - while (i >= V_nd6_maxqueuelen) { - m_hold = lle->la_hold; - lle->la_hold = lle->la_hold->m_nextpkt; - m_freem(m_hold); - i--; - } - } else { - lle->la_hold = m; - } + dropped = lltable_append_entry_queue(lle, m, V_nd6_maxqueuelen); + ICMP6STAT_ADD(icp6s_dropped, dropped); /* * If there has been no NS for the neighbor after entering the @@ -2650,19 +2632,6 @@ nd6_rem_ifa_lle(struct in6_ifaddr *ia, int all) lltable_delete_addr(LLTABLE6(ifp), LLE_IFADDR, saddr); } -static void -clear_llinfo_pqueue(struct llentry *ln) -{ - struct mbuf *m_hold, *m_hold_next; - - for (m_hold = ln->la_hold; m_hold; m_hold = m_hold_next) { - m_hold_next = m_hold->m_nextpkt; - m_freem(m_hold); - } - - ln->la_hold = NULL; -} - static int nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) { diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index b8d954dbd939..2724590de7d3 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -994,6 +994,8 @@ icmp6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) "{N:/bad checksum%s}\n"); p(icp6s_badlen, "\t{:dropped-bad-length/%ju} " "{N:/message%s with bad length}\n"); + p(icp6s_dropped, "{:dropped-no-entry/%ju} " + "{N:/total packet%s dropped due to failed NDP resolution}\n"); #define NELEM (int)(sizeof(icmp6stat.icp6s_inhist)/sizeof(icmp6stat.icp6s_inhist[0])) for (first = 1, i = 0; i < NELEM; i++) if (icmp6stat.icp6s_inhist[i] != 0) { From nobody Mon Feb 20 15:25:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL5pg1BwQz3sxFq; Mon, 20 Feb 2023 15:25: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 4PL5pf74Clz42Zc; Mon, 20 Feb 2023 15:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676906747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RtpRj/kP7h9HFNzi57Qwwp5LszITgqKxJMx65a1MU1I=; b=KF6XZe+ZHKCgX/n7goT+2Klvw4eUEGD3CuDp52xtzragRpnUm9E0XsNediEGmq2+0oHI8D IWf/7hQNt2TnrfT1eDfANHskJHpOhJLPG4KfxqQnCiA20e7CGtVdxBAYOYs/lu7vGkEFBN 4iOC2/jkRQfxHBMWl0BAh261C+8teYCuJL2/3UyD6cZ3BH1SZK+Xww1Zi5ET/E22cAfRbr ks7vyvsvCnuRV1C6TnlMmnXHU5Wyox1FQ89bMSy/AvKQVSIt5vuX7TpEUXJZiAnTTb8me/ KWz6N7Z6qNaPqyGdZfSpBCFi1Mw5Ad2CuYTxb07j18DaAc81X1PedE8IGc4k+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676906747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RtpRj/kP7h9HFNzi57Qwwp5LszITgqKxJMx65a1MU1I=; b=prS+8GjLlimnG3WdeHc4KAFEDXMyo1yUrhgxdcDkQ0EuLPsL961veTVBPr2NTlFe/bO7WU F12c8pNZwMP4xXlVeFdM0o0IBg4AiZ7sxiWa300JexwNxB2k67Di13ojcVJP3i9BVOYymQ OB396bcC/wSiwc5KE1JdIW+u3FRX25zXwYz1Vt6Vny38GPdwNsrIhiGi8Wuv5bGR3Wpi+n /7mMCta+2XbLWzltM1AEnlX7GYBNYgWnmd0JcLLrTvvOYjcETz9DyrVQ+uc2OZO90mzVWp CG73fuuqUgxwKH0GvzvZKmaamr1X/8vIJosDLWbDUn5fFGE5UKuGkUkzSZJNuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676906747; a=rsa-sha256; cv=none; b=vGoldIDlR2e01sR7IFakyOvWEWjv/yxgk9JqNCC1wiQPHkPhsjVc0kqnyEttMJhOrHqFcx 4Ax7kN5Atgj4mNRDOuAfZCMFK3Ph2w0iIhRX5f+W/oWernX5SCuvxAN6lO0mh8bc1AuZVT zemVgYwBoZfiph5dF73wFxhV3w0QvW2JZ3ZqF9MQB9xUf2/KtRvfU6EaLLaEBLOk9x71FW hXitQ6lulJh3HVwoML315kI9Byt6Y872XNc7JzEb0Xd80wh9GKrhYKeeZjDVtYQS3iwK6g l4XWQtNBT20x4wsY4+xMnYAsZBer2BgMh1uXIeT5UJiwABN7oEeMPdyR4kolrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL5pf68Y7zmHh; Mon, 20 Feb 2023 15:25: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 31KFPk5H078292; Mon, 20 Feb 2023 15:25:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KFPkXL078291; Mon, 20 Feb 2023 15:25:46 GMT (envelope-from git) Date: Mon, 20 Feb 2023 15:25:46 GMT Message-Id: <202302201525.31KFPkXL078291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 27ee5625a829 - stable/13 - nd6: fix panic in lltable_drop_entry_queue() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 27ee5625a829acfa0db0e1fbd0b695fa91aadc6c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=27ee5625a829acfa0db0e1fbd0b695fa91aadc6c commit 27ee5625a829acfa0db0e1fbd0b695fa91aadc6c Author: Alexander V. Chernikov AuthorDate: 2023-01-15 15:10:48 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 15:15:30 +0000 nd6: fix panic in lltable_drop_entry_queue() nd6_resolve_slow() can be called without mbuf. If the LLE entry is not reachable, nd6_resolve_slow() will add this NULL mbuf to the holdchain via lltable_append_entry_queue, which will "append" NULL to the end of the queue (effectively no-op) and bump la_numhold value. When this entry gets freed, the kernel will panic due to the inconsistency between the amount of mbufs in the queue and the value of la_numhold. Fix the panic by checking of mbuf is not NULL prior to inserting it into the holdchain. Reported by: kib MFC after: 3 days (cherry picked from commit 6468b6b23e08d9bd02c8cb74ec0ff389ed74c3bb) --- sys/netinet6/nd6.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index be881b6291ac..de35127bd17d 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -2369,7 +2369,6 @@ nd6_resolve_slow(struct ifnet *ifp, int family, int flags, struct mbuf *m, struct in6_addr *psrc, src; int send_ns, ll_len; char *lladdr; - size_t dropped; NET_EPOCH_ASSERT(); @@ -2436,8 +2435,12 @@ nd6_resolve_slow(struct ifnet *ifp, int family, int flags, struct mbuf *m, * packet queue in the mbuf. When it exceeds nd6_maxqueuelen, * the oldest packet in the queue will be removed. */ - dropped = lltable_append_entry_queue(lle, m, V_nd6_maxqueuelen); - ICMP6STAT_ADD(icp6s_dropped, dropped); + if (m != NULL) { + size_t dropped; + + dropped = lltable_append_entry_queue(lle, m, V_nd6_maxqueuelen); + ICMP6STAT_ADD(icp6s_dropped, dropped); + } /* * If there has been no NS for the neighbor after entering the From nobody Mon Feb 20 15:30:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL5wZ4WG8z3sxvm; Mon, 20 Feb 2023 15:30:54 +0000 (UTC) (envelope-from zlei@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 4PL5wZ4JSXz433j; Mon, 20 Feb 2023 15:30:54 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676907054; 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=uaRXEZgG2MxmMz76g+qOATZtJ/mAlIZuddCuGXwu43M=; b=OUctbLM+KQOInm8nVrtu/mitqto9PZaddpoFJivG3ejYxpSkPXWvEmN3OIfMnxd9xV77cC c2GTKkdUn6hXf7Ug6lDN7TLGMQMJ5cLm/LvVnaQzQO4eDoG8zpN3/v1G8rg+YuSjgI7cUt Npcp0K15tbjYnUX4M+dufHTVE9oGYdAWwCU3ell3covPwPVUjxe+UDa5EdC6SWm/j2FYNT LnSAQK7uIb/z/ubqjkvWW/KBBzD1OeyZtXrKzT76vDSJRLcqdeEwj3ATl9SwIv82pBNf4I mVRZf1728KW7w8Xd2TJU67hLJCZfPlrTfgN9/oWWHpbf18Yd15mmFcPJPOVIZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676907054; 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=uaRXEZgG2MxmMz76g+qOATZtJ/mAlIZuddCuGXwu43M=; b=CBWEV7MwdSY0ObQcCY+5+qZviTQg1gsPLZ2mbJoFHs1W6/yDUmxTqHvw9yfrsJwL9IPM2y dtUdOKXI/txzvkt6RLvCQT6FeNYENbIa6hRm1t84WHRn3svwFV4LqWSpnqL3jVlwk2aNDU hqDFUwcwtO99if/vWcORSwxYsWLynJ7/uyPvQ+jEnh+onrYrxAePe3SgEXgSr0d+ZqNrVK mtuX4hIPGox2jKM+lCGcL9YVGZTwTXCh0W5LK6vrQqtO2fHsfZMlBq+JE+xSb9GRy4BllN mPwjWczy7YSrJCNSzuRAVyiNFE40QPJljluqoS/tx+IZL9O9qBFNAN1RW/pflQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676907054; a=rsa-sha256; cv=none; b=xqe5CE7csYBjIemOF3Nt0qH7N1hJ23GzOk2knFUvQ9/XhWchVAQnHNzC5or9MiKnn5sAB3 tAXGEgplc3Yutymp3oiym5CIR35YwoGR08qUUl1YKKpMiCbXoBJbOaEIe9wOjiXgMJxKjY +8YWwyCz4GbbzqMompcMHkJfWjwS4XGqFlSM8st53P1I6ndOlLflajLMrcrNS2HK4MKSRp QJh3NSORKRGml036daO/f5MMIfiGlL9InetGXO69vAQq9ltTlFzmy0SUqX+8/9d4KLQtFT R887uRKOcA//A/EtA6sbghjyrV3KC09egj09L5nNlB4yI3wuptfFrgT88MF+Fg== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PL5wX5JMhz17WX; Mon, 20 Feb 2023 15:30:52 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.2\)) Subject: Re: git: 0de03c306c2f - main - man9: Add an smr(9) manual page From: Zhenlei Huang In-Reply-To: <202302201417.31KEHsT4077587@gitrepo.freebsd.org> Date: Mon, 20 Feb 2023 23:30:46 +0800 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: <202302201417.31KEHsT4077587@gitrepo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3696.120.41.1.2) X-ThisMailContainsUnwantedMimeParts: N Hi, Glad to have this manual page ! Best regards, Zhenlei > On Feb 20, 2023, at 10:17 PM, Mark Johnston wrote: >=20 > The branch main has been updated by markj: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D0de03c306c2f95580e56c65b74ebf8c0= 4c1416b3 >=20 > commit 0de03c306c2f95580e56c65b74ebf8c04c1416b3 > Author: Mark Johnston > AuthorDate: 2023-02-20 13:58:19 +0000 > Commit: Mark Johnston > CommitDate: 2023-02-20 13:58:19 +0000 >=20 > man9: Add an smr(9) manual page >=20 > Also update the UMA manual page to mention its SMR-enabled > functionality, and update locking.9 to mention both epoch and SMR. > Details of its usage are provided in the SMR manual page. >=20 > Reviewed by: Olivier Certner, mhorne, kib > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D38108 > --- > share/man/man9/Makefile | 9 ++ > share/man/man9/locking.9 | 37 ++++-- > share/man/man9/smr.9 | 294 = +++++++++++++++++++++++++++++++++++++++++++++++ > share/man/man9/zone.9 | 42 ++++++- > 4 files changed, 373 insertions(+), 9 deletions(-) >=20 > diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile > index b2c141210ab9..ab6f146fa2a9 100644 > --- a/share/man/man9/Makefile > +++ b/share/man/man9/Makefile > @@ -319,6 +319,7 @@ MAN=3D accept_filter.9 \ > signal.9 \ > sleep.9 \ > sleepqueue.9 \ > + smr.9 \ > socket.9 \ > stack.9 \ > store.9 \ > @@ -2051,6 +2052,14 @@ MLINKS+=3Dsleepqueue.9 init_sleepqueues.9 \ > sleepqueue.9 sleepq_type.9 \ > sleepqueue.9 sleepq_wait.9 \ > sleepqueue.9 sleepq_wait_sig.9 > +MLINKS+=3Dsmr.9 smr_advance.9 \ > + smr.9 smr_create.9 \ > + smr.9 smr_destroy.9 \ > + smr.9 smr_enter.9 \ > + smr.9 smr_exit.9 \ > + smr.9 smr_poll.9 \ > + smr.9 smr_synchronize.9 \ > + smr.9 smr_wait.9 > MLINKS+=3Dsocket.9 soabort.9 \ > socket.9 soaccept.9 \ > socket.9 sobind.9 \ > diff --git a/share/man/man9/locking.9 b/share/man/man9/locking.9 > index 145ae6e9f1f5..e1e4ccd33664 100644 > --- a/share/man/man9/locking.9 > +++ b/share/man/man9/locking.9 > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 29, 2022 > +.Dd February 3, 2023 > .Dt LOCKING 9 > .Os > .Sh NAME > @@ -145,6 +145,32 @@ for this reason, they should be avoided. > See > .Xr lock 9 > for details. > +.Ss Non-blocking synchronization > +The kernel has two facilities, > +.Xr epoch 9 > +and > +.Xr smr 9 , > +which can be used to provide read-only access to a data structure = while one or > +more writers are concurrently modifying the data structure. > +Specifically, readers using > +.Xr epoch 9 > +and > +.Xr smr 9 > +to synchronize accesses do not block writers, in contrast with = reader/writer > +locks, and they help ensure that memory freed by writers is not = reused until > +all readers which may be accessing it have finished. > +Thus, they are a useful building block in the construction of = lock-free > +data structures. > +.Pp > +These facilities are difficult to use correctly and should be avoided > +in preference to traditional mutual exclusion-based synchronization, > +except when performance or non-blocking guarantees are a major = concern. > +.Pp > +See > +.Xr epoch 9 > +and > +.Xr smr 9 > +for details. > .Ss Counting semaphores > Counting semaphores provide a mechanism for synchronizing access > to a pool of resources. > @@ -394,8 +420,10 @@ At this time this is a rather easy to remember = table. > .Sh SEE ALSO > .Xr lockstat 1 , > .Xr witness 4 , > +.Xr atomic 9 , > .Xr BUS_SETUP_INTR 9 , > .Xr condvar 9 , > +.Xr epoch 9 , > .Xr lock 9 , > .Xr LOCK_PROFILING 9 , > .Xr mtx_pool 9 , > @@ -404,13 +432,8 @@ At this time this is a rather easy to remember = table. > .Xr rwlock 9 , > .Xr sema 9 , > .Xr sleep 9 , > +.Xr smr 9 , > .Xr sx 9 , > .Xr timeout 9 > -.Sh HISTORY > -These > -functions appeared in > -.Bsx 4.1 > -through > -.Fx 7.0 . > .Sh BUGS > There are too many locking primitives to choose from. > diff --git a/share/man/man9/smr.9 b/share/man/man9/smr.9 > new file mode 100644 > index 000000000000..7b2ed65b4368 > --- /dev/null > +++ b/share/man/man9/smr.9 > @@ -0,0 +1,294 @@ > +.\" SPDX-License-Identifier: BSD-2-Clause > +.\" > +.\" Copyright (c) 2023 The FreeBSD Foundation > +.\" > +.\" This documentation was written by Mark Johnston = > +.\" 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. > +.\" > +.Dd January 17, 2023 > +.Dt SMR 9 > +.Os > +.Sh NAME > +.Nm smr > +.Nd safe memory reclamation for lock-free data structures > +.Sh SYNOPSIS > +.In sys/smr.h > +.Ft smr_seq_t > +.Fo smr_advance > +.Fa "smr_t smr" > +.Fc > +.Ft smr_t > +.Fo smr_create > +.Fa "const char *name" > +.Fc > +.Ft void > +.Fo smr_destroy > +.Fa "smr_t smr" > +.Fc > +.Ft void > +.Fo smr_enter > +.Fa "smr_t smr" > +.Fc > +.Ft void > +.Fo smr_exit > +.Fa "smr_t smr" > +.Fc > +.Ft bool > +.Fo smr_poll > +.Fa "smr_t smr" > +.Fa "smr_seq_t goal" > +.Fa "bool wait" > +.Fc > +.Ft void > +.Fo smr_synchronize > +.Fa "smr_t smr" > +.Fc > +.Ft bool > +.Fo smr_wait > +.Fa "smr_t smr" > +.Fa "smr_seq_t goal" > +.Fc > +.Sh DESCRIPTION > +Safe Memory Reclamation (SMR) is a facility which enables the = implementation of > +memory-safe lock-free data structures. > +In typical usage, read accesses to an SMR-protected data structure, = such as a > +hash table or tree, are performed in a > +.Dq read section > +consisting of code bracketed by > +.Fn smr_enter > +and > +.Fn smr_exit > +calls, while mutations of the data structure are serialized by a = traditional > +mutex such as > +.Xr mutex 9 . > +In contrast with reader-writer locks such as > +.Xr rwlock 9 , > +.Xr rmlock 9 , > +and > +.Xr sx 9 , > +SMR allows readers and writers to access the data structure = concurrently. > +Readers can always enter a read section immediately > +.Po > +.Fn smr_enter > +never blocks > +.Pc , > +so mutations do not introduce read latency. > +Furthermore, > +.Fn smr_enter > +and > +.Fn smr_exit > +operate only on per-CPU data and thus avoid some of the performance = problems > +inherent in the implementation of traditional reader-writer mutexes. > +SMR can therefore be a useful building block for data structures = which are > +accessed frequently but are only rarely modified. > +.Pp > +Note that any SMR-protected data structure must be implemented = carefully such > +that operations behave correctly in the absence of mutual exclusion = between > +readers and writers. > +The data structure must be designed to be lock-free; SMR merely = facilitates > +the implementation, for example by making it safe to follow dangling = pointers > +and by helping avoid the ABA problem. > +.Pp > +When shared accesses to and mutations of a data structure can proceed > +concurrently, writers must take care to ensure that any items removed = from the > +structure are not freed and recycled while readers are accessing them = in > +parallel. > +This requirement results in a two-phase approach to the removal of = items: > +first, the item is unlinked such that all pointers to the item are = removed from > +the structure, preventing any new readers from observing the item. > +Then, the writer waits until some mechanism guarantees that no = existing readers > +are still accessing the item. > +At that point the memory for that item can be freed and reused = safely. > +SMR provides this mechanism: readers may access a lock-free data = structure in > +between calls to the > +.Fn smr_enter > +and > +.Fn smr_exit > +functions, which together create a read section, and the > +.Fn smr_advance , > +.Fn smr_poll , > +.Fn smr_wait , > +and > +.Fn smr_synchronize > +functions can be used to wait for threads in read sections to finish. > +All of these functions operate on a > +.Ft smr_t > +state block which holds both per-CPU and global state. > +Readers load global state and modify per-CPU state, while writers = must scan all > +per-CPU states to detect active readers. > +SMR is designed to amortize this cost by batching to give acceptable > +performance in write-heavy workloads. > +.Ss Readers > +Threads enter a read section by calling > +.Fn smr_enter . > +Read sections should be short, and many operations are not permitted = while in > +a read section. > +Specifically, context switching is disabled, and thus readers may not = acquire > +blocking mutexes such as > +.Xr mutex 9 . > +Another consequence of this is that the thread is pinned to the = current CPU for > +the duration of the read section. > +Furthermore, read sections may not be nested: it is incorrect to call > +.Fn smr_enter > +with a given > +.Ft smr_t > +state block when already in a read section for that state block. > +.Ss UMA Integration > +To simplify the integration of SMR into consumers, the > +.Xr uma 9 > +kernel memory allocator provides some SMR-specified facilities. > +This eliminates a good deal of complexity from the implementation of = consumers > +and automatically batches write operations. > +.Pp > +In typical usage, a UMA zone (created with the > +.Dv UMA_ZONE_SMR > +flag or initialized with the > +.Fn uma_zone_set_smr > +function) is coupled with a > +.Ft smr_t > +state block. > +To insert an item into an SMR-protected data structure, memory is = allocated > +from the zone using the > +.Fn uma_zalloc_smr > +function. > +Insertions and removals are serialized using traditional mutual = exclusion > +and items are freed using the > +.Fn uma_zfree_smr > +function. > +Read-only lookup operations are performed in SMR read sections. > +.Fn uma_zfree_smr > +waits for all active readers which may be accessing the freed item to = finish > +their read sections before recycling that item's memory. > +.Pp > +If the zone has an associated per-item destructor, it will be invoked = at some > +point when no readers can be accessing a given item. > +The destructor can be used to release additional resources associated = with the > +item. > +Note however that there is no guarantee that the destructor will be = invoked in > +a bounded time period. > +.Ss Writers > +Consumers are expected to use SMR in conjunction with UMA and thus = need only > +make use of the > +.Fn smr_enter > +and > +.Fn smr_exit > +functions, and the SMR helper macros defined in > +.Pa sys/smr_types.h . > +However, an introduction to the write-side interface of SMR can be = useful. > +.Pp > +Internally, SMR maintains a global > +.Ql write sequence > +number. > +When entering a read section, > +.Fn smr_enter > +loads a copy of the write sequence and stores it in per-CPU memory, = hence > +.Ql observing > +that value. > +To exit a read section, this per-CPU memory is overwritten with an = invalid > +value, making the CPU inactive. > +Writers perform two operations: advancing the write sequence number, = and > +polling all CPUs to see whether active readers have observed a given = sequence > +number. > +These operations are performed by > +.Fn smr_advance > +and > +.Fn smr_poll , > +respectively, which do not require serialization between multiple = writers. > +.Pp > +After a writer unlinks an item from a data structure, it increments = the write > +sequence number and tags the item with the new value returned by > +.Fn smr_advance . > +Once all CPUs have observed the new value, the writer can use > +.Fn smr_poll > +to deduce that no active readers have access to the unlinked item, = and thus the > +item is safe to recycle. > +Because this pair of operations is relatively expensive, it is = generally a good > +idea to amortize this cost by accumulating a collection of multiple = unlinked > +items and tagging the entire batch with a target write sequence = number. > +.Pp > +.Fn smr_poll > +is a non-blocking operation and returns true only if all active = readers are > +guaranteed to have observed the target sequence number value. > +.Fn smr_wait > +is a variant of > +.Fn smr_poll > +which waits until all CPUs have observed the target sequence number = value. > +.Fn smr_synchronize > +combines > +.Fn smr_advance > +with > +.Fn smr_wait > +to wait for all CPUs to observe a new write sequence number. > +This is an expensive operation and should only be used if polling = cannot be > +deferred in some way. > +.Ss Memory Ordering > +The > +.Fn smr_enter > +function has acquire semantics, and the > +.Fn smr_exit > +function has release semantics. > +The > +.Fn smr_advance , > +.Fn smr_poll , > +.Fn smr_wait , > +and > +.Fn smr_synchronize > +functions should not be assumed to have any guarantees with respect = to memory > +ordering. > +In practice, some of these functions have stronger ordering semantics = than > +is stated here, but this is specific to the implementation and should = not be > +relied upon. > +See > +.Xr atomic 9 > +for more details. > +.Sh NOTES > +Outside of > +.Fx > +the acronym SMR typically refers to a family of algorithms which = enable > +memory-safe read-only access to a data structure concurrent with = modifications > +to that data structure. > +Here, SMR refers to a particular algorithm belonging to this family, = as well as > +its implementation in > +.Fx . > +See > +.Pa sys/sys/smr.h > +and > +.Pa sys/kern/subr_smr.c > +in the > +.Fx > +source tree for further details on the algorithm and the context. > +.Pp > +The acronym SMR is also used to mean "shingled magnetic recording", a > +technology used to store data on hard disk drives which requires = operating > +system support. > +These two uses of the acronym are unrelated. > +.Sh SEE ALSO > +.Xr atomic 9 , > +.Xr locking 9 , > +.Xr uma 9 > +.Sh AUTHORS > +The SMR algorithm and its implementation were provided by > +.An Jeff Roberson Aq Mt jeff@FreeBSD.org . > +This manual page was written by > +.An Mark Johnston Aq Mt markj@FreeBSD.org . > diff --git a/share/man/man9/zone.9 b/share/man/man9/zone.9 > index 5c1b4d31d8aa..5f7f99b8f44f 100644 > --- a/share/man/man9/zone.9 > +++ b/share/man/man9/zone.9 > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd February 15, 2022 > +.Dd January 16, 2023 > .Dt UMA 9 > .Os > .Sh NAME > @@ -79,6 +79,8 @@ typedef void (*uma_free)(void *item, vm_size_t size, = uint8_t pflag); > .Fn uma_zalloc_pcpu "uma_zone_t zone" "int flags" > .Ft "void *" > .Fn uma_zalloc_pcpu_arg "uma_zone_t zone" "void *arg" "int flags" > +.Ft "void *" > +.Fn uma_zalloc_smr "uma_zone_t zone" "int flags" > .Ft void > .Fn uma_zfree "uma_zone_t zone" "void *item" > .Ft void > @@ -88,6 +90,8 @@ typedef void (*uma_free)(void *item, vm_size_t size, = uint8_t pflag); > .Ft void > .Fn uma_zfree_pcpu_arg "uma_zone_t zone" "void *item" "void *arg" > .Ft void > +.Fn uma_zfree_smr "uma_zone_t zone" "void *item" > +.Ft void > .Fn uma_prealloc "uma_zone_t zone" "int nitems" > .Ft void > .Fn uma_zone_reserve "uma_zone_t zone" "int nitems" > @@ -117,6 +121,10 @@ typedef void (*uma_free)(void *item, vm_size_t = size, uint8_t pflag); > .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" > .Ft void > .Fn uma_zone_set_maxaction "uma_zone_t zone" "void = (*maxaction)(uma_zone_t)" > +.Ft smr_t > +.Fn uma_zone_get_smr "uma_zone_t zone" > +.Ft void > +.Fn uma_zone_set_smr "uma_zone_t zone" "smr_t smr" > .In sys/sysctl.h > .Fn SYSCTL_UMA_MAX parent nbr name access zone descr > .Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr > @@ -330,6 +338,14 @@ Cached items that have not been used for a long = period may also be freed from > zone. > When this flag is set, the system will not reclaim memory from the = zone's > caches. > +.It Dv UMA_ZONE_SMR > +Create a zone whose items will be synchronized using the > +.Xr smr 9 > +mechanism. > +Upon creation the zone will have an associated > +.Dt smr_t > +structure which can be fetched using > +.Fn uma_zone_get_smr . > .El > .Pp > Zones can be destroyed using > @@ -390,6 +406,17 @@ then > does nothing. > .Pp > The > +.Fn uma_zalloc_smr > +and > +.Fn uma_zfree_smr > +functions allocate and free items from an SMR-enabled zone, that is, > +a zone created with > +.Dv UMA_ZONE_SMR > +or a zone that has had > +.Fn uma_zone_set_smr > +called. > +.Pp > +The > .Fn uma_zalloc_domain > function allows callers to specify a fixed > .Xr numa 4 > @@ -535,6 +562,16 @@ Therefore, > this function should do very little work (similar to a signal = handler). > .Pp > The > +.Fn uma_zone_set_smr > +function associates an existing > +.Xr smr 9 > +structure with a UMA zone. > +The effect is similar to creating a zone with the > +.Dv UMA_ZONE_SMR > +flag, except that a new SMR structure is not created. > +This function must be called before any allocations from the zone are = performed. > +.Pp > +The > .Fn SYSCTL_UMA_MAX parent nbr name access zone descr > macro declares a static > .Xr sysctl 9 > @@ -577,7 +614,8 @@ non-executable memory. > .Sh SEE ALSO > .Xr numa 4 , > .Xr vmstat 8 , > -.Xr malloc 9 > +.Xr malloc 9 , > +.Xr smr 9 > .Rs > .%A Jeff Bonwick > .%T "The Slab Allocator: An Object-Caching Kernel Memory Allocator" From nobody Mon Feb 20 16:22:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL74P0XXkz3t2DQ; Mon, 20 Feb 2023 16:22: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 4PL74N5SNCz4BqH; Mon, 20 Feb 2023 16:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vMPUo/plhFW2Y3Aq9npiuBDx7UlvRbaNexuvoEXR9cU=; b=rMIzZko7BHP2rN4BEUNgJ96HRDMeZbKQuW1yf65hFlQ0hbnMoWSTtvuAdWtDzmPltwBzET mFWof+tG5TwLIIqwBSQMhH9g4L+AN9Owk+pUlAOapbzmT1bEhraJlSVzpqRx/itRblO1DK tuft/Z1axhtar8/DWNSWbmUlTCLhJSaQrPlqL6aTjjcxr+AGaPNxmJngs0qMG9v2kB/Mh0 cxpHdYEDOn5Z0p0uPCdfy4h6bIiTJhgsJScuk3h1GAr0zU/+yaqBWHc2X49zGxBI3RZaFV rik1pxN9/bMUwQsQmNIT94lR1QxnnStZsSPARWCoEQxSYNbcIB/BvhQ1EPbyLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vMPUo/plhFW2Y3Aq9npiuBDx7UlvRbaNexuvoEXR9cU=; b=kTBy45I+OM9qecw9n2QybfQSQp0upIVLyfKkOvic4tB/O2hMW+qpQqICrEp6sd+8VthVjp Xu6y/fNYCQv42M7/ow5gT3bLnM7jPSHcXXixSW6dQT6SrcE0NUNLKaop8Fm1eKJfVmVPlG UfVNke+r2ss2HNVV2oKpnJktPpG0aIcO0EzDE0IFpaLzIKokMvgbiuK4JMY1sSk9dVJNIU hQO0R/UMzMw5cicDg0CjovIxnwzcF8xf3fxlw8kb5/TGEXVqOqyXNYsRdg7H5aaC7ZqqfI jH0r72cEXWBUBYU5ohC7u8pgr8h8HjaxDDMOouKrWLOj3vmmIUtID69ZeKYCBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676910164; a=rsa-sha256; cv=none; b=QepcKDqXVY2k2FnFBTOJBLv7DGnxqayvy0B8O8dTgKN0PXiGCl0PzW+YNOtyb7pEEo9xBy eknqjJWNhOs1VX8XWK7LNnExboAZ9gJykfq9fb41LVl7uH/SXzgQN0/XEozAB9L6l+iUhh PLOJzPBGR/cXyR1JP+W1Y+wRdy7g/ybVVEucgRczyjjAevGnV5eJ13opu2NEIav7G+vfx0 APdox+1rmiX9e5YI9EApvbB8AcKnxFkAzmBAdqxongwSbcgdWaDpVgViaQU8dzGgYap485 dBdIRK4w5ci8df4b4PCU/rX5GPUKyZaH8ydeLvW7XALZyKIebaqk79rfsRYLtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL74N4Xg4zncy; Mon, 20 Feb 2023 16:22: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 31KGMiDS064300; Mon, 20 Feb 2023 16:22:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KGMiON064299; Mon, 20 Feb 2023 16:22:44 GMT (envelope-from git) Date: Mon, 20 Feb 2023 16:22:44 GMT Message-Id: <202302201622.31KGMiON064299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 402df99daa87 - stable/13 - stand: Update mfc notes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 402df99daa878af0cb6d83b7ca7f6cd42cddd18c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=402df99daa878af0cb6d83b7ca7f6cd42cddd18c commit 402df99daa878af0cb6d83b7ca7f6cd42cddd18c Author: Warner Losh AuthorDate: 2023-02-20 16:09:07 +0000 Commit: Warner Losh CommitDate: 2023-02-20 16:21:08 +0000 stand: Update mfc notes Using some automation I found a few mistakes in my earlier list and also a change merged without a cherry-pick -x (and evidentally changed as well, since git log --cherry didn't know it had been merged). Fix them so I can use this list with my experimental mfc script. Sponsored by: Netflix This is a direct commit to stable/13 --- stand/mfc-notes.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stand/mfc-notes.txt b/stand/mfc-notes.txt index 89dca26af4d0..338ff70c2500 100644 --- a/stand/mfc-notes.txt +++ b/stand/mfc-notes.txt @@ -23,12 +23,16 @@ c7046f76c2c0 blake workarounds merged f993fff68979 sorting these is useless to merge if the lists aren't already the same 8a744de27eef let's leave firewire in place 0163de282e31 These depend on newer OpenZFS so not needed and conflicts -ed68931c3f9c geliboot: Use the multi-block functions for AES-XTS. -399b56c46c1c stand: delete zstd_shim.c -- dependent changes nor merged 119c786f7b5a +df76778ad5e0 stand: delete zstd_shim.c -- dependent changes nor merged 119c786f7b5a 03bbe1845de7 mips is still in stable/13 20b23ae74b2b mips is still in stable/13 8cc2156f85bb We're not 14, yet 44796b7e822e beri uses this, it seems, and is still in stable/13 +d51cc252a062 userboot gfx stubs were combined with others +5666643a9538 skip merging the typos due to scope of typo fix +b15636233845 geliboot multiblock functions +5c73b3e0a3db entropy MFC'd w/o the -x & with changes as dd6c1475a63a7 +e36c256040f9 merged with other man page changes, apparently silently Also, BERI was removed with the permission of the originators since all that hardware has been retired. From nobody Mon Feb 20 16:22:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL74Q1cBDz3t2DS; Mon, 20 Feb 2023 16:22: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 4PL74P6LnYz4BqJ; Mon, 20 Feb 2023 16:22:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r11Sp0upfU6RNoI5BTA7L+VqW37dUazY5Ruowyg/ZKo=; b=PYI4M7jG4I8BHUs5VUF3uF31sWFg1EaNCiHnyY6V3nojHvToDnmFSP9G04zqt0RUH4lik6 TAxw/QecDCKZirm1dmDV/eHsl2K2eV1N81asGZGGgBombEP/iGyspc/di1GhfHM/sAek/D +pEzjDCfWPSqhmYU9156WUcUUsW+9Lmm54k/sYQTVp62NKm7OKXr9agHnagfOYOMLhzCzq HC4mwsC2efGaqHenVcILMzIBcFQQg+VqAry9EFmSw47jbasn3zRoXPJnSL4yR9fxK0nc3f QXLFRIbG712tbkQTBuy97w0n0niXESi4xu35R8uEOzH6XYuChA8Lq4fXFf2iTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r11Sp0upfU6RNoI5BTA7L+VqW37dUazY5Ruowyg/ZKo=; b=pr8p1Y3kL3xV6qavXMva8jYaxeDSzfsf4ngiRiKBYua1Nge97+B1lexZPcdLfTTCngNerB IfuAyA3YeI1Ay+be5kjLrKikk5W8XN/yu4HOpfyUk/R6nhuzRF9YSffLnSl0tDpVLlPM3X kgmc4Ph/Q6h7d9I6AsBuHEM/vhMGQOQqI/mbMu+9yyMV+LeZtS4xupxI/4/GGXyb7UW8bh FJBcXjRfOc6An0s9Zqmopf1Od7tPuXcvJ0oTN3Pvpma8cWu0xW43P+3B0yDq2gi4+3P5/7 QBSIUGHt/mFbIBLSNeVwhYl/9tUFInhOfixFOmozogzX3f0MYiVZWOUlrtEAaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676910165; a=rsa-sha256; cv=none; b=MT7wNXnzYgjZ+q7UEak+Ls6yc/9IQxMmbcOPQYBsVfwQPjyFOzZBwm+fvpgA+mhe205TTO IcBLOp0Uha2FDTXmyJdLXwHXtu2OYhzmq8mJ5KW+tiqKic4aN5hhOQlUZ0FftSASjdWIhc wELS7w7S9lqeY4sg9LN0oQ6ux/dxVw+IDfq7VMTAfojimadZShlXnRPalLZlmtDk4PLtda eUO1UedbDHzSzchoWVxGKtLftWjWFV8jAy67onnZLTWGfcs0NThTvFIHzG5wvMspY2SpmX q3NhnVkWp62dYyqep7ygUHC6j42lR9ndDI0CXM8HvqgfowizvTeVfBGaM3bwqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL74P5SmqznX5; Mon, 20 Feb 2023 16:22: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 31KGMjeu064319; Mon, 20 Feb 2023 16:22:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KGMj2J064318; Mon, 20 Feb 2023 16:22:45 GMT (envelope-from git) Date: Mon, 20 Feb 2023 16:22:45 GMT Message-Id: <202302201622.31KGMj2J064318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 06d74a746eb1 - stable/13 - lua: reduce diffs between luaconf.h copies List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 06d74a746eb1a8d62bc5669763f5f48d2441d382 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=06d74a746eb1a8d62bc5669763f5f48d2441d382 commit 06d74a746eb1a8d62bc5669763f5f48d2441d382 Author: Ed Maste AuthorDate: 2023-02-20 16:19:35 +0000 Commit: Warner Losh CommitDate: 2023-02-20 16:21:08 +0000 lua: reduce diffs between luaconf.h copies Upstream luaconf.h is contrib/lua/src/luaconf.h.dist, while userland lua and loader lua have copies in lib/liblua/luaconf.h and stand/liblua/luaconf.h. Adjust whitespace, VCS tags, etc. to match upstream's version, for ease of comparison. Reviewed By: imp Sponsored By: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38206 (cherry picked from commit ec965063070e5753c166cf592c9336444b74720a) --- lib/liblua/luaconf.h | 6 +++--- stand/liblua/luaconf.h | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/liblua/luaconf.h b/lib/liblua/luaconf.h index 892ac3a0c8f3..d5ac628e3052 100644 --- a/lib/liblua/luaconf.h +++ b/lib/liblua/luaconf.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* ** $Id: luaconf.h $ ** Configuration file for Lua @@ -83,7 +82,7 @@ */ #define LUAI_IS32INT ((UINT_MAX >> 30) >= 3) -/* }================================================================== */ +/* }================================================================== */ @@ -203,6 +202,7 @@ #define LUA_LDIR "!\\lua\\" #define LUA_CDIR "!\\" #define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\" + #if !defined(LUA_PATH_DEFAULT) #define LUA_PATH_DEFAULT \ LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ @@ -211,7 +211,7 @@ ".\\?.lua;" ".\\?\\init.lua" #endif -#if !define(LUA_CPATH_DEFAULT) +#if !defined(LUA_CPATH_DEFAULT) #define LUA_CPATH_DEFAULT \ LUA_CDIR"?.dll;" \ LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ diff --git a/stand/liblua/luaconf.h b/stand/liblua/luaconf.h index 8a0ad782e5e1..d5c222ce30be 100644 --- a/stand/liblua/luaconf.h +++ b/stand/liblua/luaconf.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /* -** $Id: luaconf.h,v 1.259 2016/12/22 13:08:50 roberto Exp $ +** $Id: luaconf.h $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -218,7 +217,7 @@ #define LUA_LDIR LUA_ROOT "share/" #define LUA_CDIR LUA_ROOT "lib/" -#ifndef LUA_PATH_DEFAULT +#if !defined(LUA_PATH_DEFAULT) #define LUA_PATH_DEFAULT \ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ @@ -433,6 +432,7 @@ #define lua_str2number(s,p) strtof((s), (p)) + #elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE /* }{ long double */ #define LUA_NUMBER long double @@ -783,3 +783,4 @@ #endif + From nobody Mon Feb 20 16:24:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL76F0V1Pz3t20w; Mon, 20 Feb 2023 16:24: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 4PL76D710pz4CtR; Mon, 20 Feb 2023 16:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H0VAJMs8ss6MtHAUDPirjl0NhNe3ApfXw5Yzyu26EpE=; b=dzD0pkggPcjQVHwRlef/eFM18/sSw7BLWmOBJ0lLSJVbhYGs/0PX3oWN+jtkueBDETo0Sz pSyYAoTxcqCkkAwxqH/5rs26yPR8Pd0fQnjP0NbrbP7zZQmDhxoECabRqxHNyRXMsRgH0d YMIM5B8jS5u/O5TCLTqkCFSFNl75370IX8rRhnAkPuAx+zoGm7Lx2n2TMblzrJ7nY3aqhr tOftT6edxD0bwYNkQmg0Rt/U60i2jD5phjGKHfCk7XwQXHUrTArcQnes3E1IEZ1u2VpKoS WAggvV6A73H7/Bqkb+E6ls1zWdzgE69T+acuOvkZ97fqeHCAUuXaOqMJwnm+tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H0VAJMs8ss6MtHAUDPirjl0NhNe3ApfXw5Yzyu26EpE=; b=QeVJ3A9grWRLGnPbYyD6bfZJ/1JqTWqMnp/vSubarv/r5LW6t5K9NLwMeYSs5p0Si9FXvH lgrKCd9Z9XzHkKmSSXVOnRQyknzV1TOx5FUnyz1RsEHUMV78UNMqrutLqJXfJr6tgH0FaH mYkSs/Iwyb1fJ/2qc/S0iEYtf+RhL2CW6fss+2OIPKoEAYEhJCrDiQA08VUhupBII4jboX 5aQjRozYiQ90lstqLvXgB6v/+8sMznUy/CAbT8+dnj+AYRdnareLa4h4aQR5VXdtTNGLG0 R5So7WpUjJtoWBQV2QaD8Se1PwgWtOQdDc4TS9fWMKyt7MkNa+2fEW7ia06Blw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676910261; a=rsa-sha256; cv=none; b=u9bNbMykdTWW0tVRRmHEG4ajl2nAjjlS+kYAtqfxpE7NvCOxr5zCsyFbShddLpwN/b4ODE iCi+SqdJQNF3qoijQc4YyQSQ7Nau4Qfzwg7QqJm7rRHkVQe/BHF07qHgsSKJtuJLTsJkyx Bm0Ctb4W38DdF+YMXx0HOVb1d1VBvPcc7qTKKU/Raj1j/pIH38NZHnNeVjHaBCzXFzpOyO 6fn6kfqQyyUhZ87vc8hCahn6JV7JuvOmT/3rgrfz7RJPYSfYbNEZuWd1zUEw2Wy9xKm4ta T3baqGut9fWFv1+zGYeOZXxbToodLTxVEBvpb52k6Kk8xD4+kj69mLiD0uy9NA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL76D64xnznm9; Mon, 20 Feb 2023 16:24: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 31KGOKj3064635; Mon, 20 Feb 2023 16:24:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KGOK2j064634; Mon, 20 Feb 2023 16:24:20 GMT (envelope-from git) Date: Mon, 20 Feb 2023 16:24:20 GMT Message-Id: <202302201624.31KGOK2j064634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 74631b842197 - stable/13 - shm: Document shm_create_largepage() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 74631b842197d520b5889b3f24863f5037bbc5d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=74631b842197d520b5889b3f24863f5037bbc5d8 commit 74631b842197d520b5889b3f24863f5037bbc5d8 Author: Mark Johnston AuthorDate: 2023-02-03 15:55:30 +0000 Commit: Mark Johnston CommitDate: 2023-02-20 16:24:08 +0000 shm: Document shm_create_largepage() While here, move notes about FreeBSD-specific functionality to the COMPATIBILITY section, and document the ECAPMODE error for shm_open(). Reviewed by: pauamma, kib MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38282 (cherry picked from commit 5f03f96fbefbb5c68a5d7d06728ff5b4a05f87b0) --- lib/libc/sys/Makefile.inc | 1 + lib/libc/sys/shm_open.2 | 173 +++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 163 insertions(+), 11 deletions(-) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 5c30f7d6b796..6f663158d840 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -484,6 +484,7 @@ MLINKS+=setuid.2 setegid.2 \ setuid.2 setgid.2 MLINKS+=shmat.2 shmdt.2 MLINKS+=shm_open.2 memfd_create.3 \ + shm_open.2 shm_create_largepage.3 \ shm_open.2 shm_unlink.2 \ shm_open.2 shm_rename.2 MLINKS+=sigwaitinfo.2 sigtimedwait.2 diff --git a/lib/libc/sys/shm_open.2 b/lib/libc/sys/shm_open.2 index ec12f9f2c0b7..061f0b126c53 100644 --- a/lib/libc/sys/shm_open.2 +++ b/lib/libc/sys/shm_open.2 @@ -28,11 +28,11 @@ .\" .\" $FreeBSD$ .\" -.Dd September 26, 2019 +.Dd January 30, 2023 .Dt SHM_OPEN 2 .Os .Sh NAME -.Nm memfd_create , shm_open , shm_rename, shm_unlink +.Nm memfd_create , shm_create_largepage , shm_open , shm_rename, shm_unlink .Nd "shared memory object operations" .Sh LIBRARY .Lb libc @@ -43,6 +43,14 @@ .Ft int .Fn memfd_create "const char *name" "unsigned int flags" .Ft int +.Fo shm_create_largepage +.Fa "const char *path" +.Fa "int flags" +.Fa "int psind" +.Fa "int alloc_policy" +.Fa "mode_t mode" +.Fc +.Ft int .Fn shm_open "const char *path" "int flags" "mode_t mode" .Ft int .Fn shm_rename "const char *path_from" "const char *path_to" "int flags" @@ -51,8 +59,8 @@ .Sh DESCRIPTION The .Fn shm_open -system call opens (or optionally creates) a -.Tn POSIX +function opens (or optionally creates) a +POSIX shared memory object named .Fa path . The @@ -114,9 +122,7 @@ see and .Xr fcntl 2 . .Pp -As a -.Fx -extension, the constant +The constant .Dv SHM_ANON may be used for the .Fa path @@ -143,6 +149,131 @@ will fail with All other flags are ignored. .Pp The +.Fn shm_create_largepage +function behaves similarly to +.Fn shm_open , +except that the +.Dv O_CREAT +flag is implicitly specified, and the returned +.Dq largepage +object is always backed by aligned, physically contiguous chunks of memory. +This ensures that the object can be mapped using so-called +.Dq superpages , +which can improve application performance in some workloads by reducing the +number of translation lookaside buffer (TLB) entries required to access a +mapping of the object, +and by reducing the number of page faults performed when accessing a mapping. +This happens automatically for all largepage objects. +.Pp +An existing largepage object can be opened using the +.Fn shm_open +function. +Largepage shared memory objects behave slightly differently from non-largepage +objects: +.Bl -bullet -offset indent +.It +Memory for a largepage object is allocated when the object is +extended using the +.Xr ftruncate 2 +system call, whereas memory for regular shared memory objects is allocated +lazily and may be paged out to a swap device when not in use. +.It +The size of a mapping of a largepage object must be a multiple of the +underlying large page size. +Most attributes of such a mapping can only be modified at the granularity +of the large page size. +For example, when using +.Xr munmap 2 +to unmap a portion of a largepage object mapping, or when using +.Xr mprotect 2 +to adjust protections of a mapping of a largepage object, the starting address +must be large page size-aligned, and the length of the operation must be a +multiple of the large page size. +If not, the corresponding system call will fail and set +.Va errno +to +.Er EINVAL . +.El +.Pp +The +.Fa psind +argument to +.Fn shm_create_largepage +specifies the size of large pages used to back the object. +This argument is an index into the page sizes array returned by +.Xr getpagesizes 3 . +In particular, all large pages backing a largepage object must be of the +same size. +For example, on a system with large page sizes of 2MB and 1GB, a 2GB largepage +object will consist of either 1024 2MB pages, or 2 1GB pages, depending on +the value specified for the +.Fa psind +argument. +The +.Fa alloc_policy +parameter specifies what happens when an attempt to use +.Xr ftruncate 2 +to allocate memory for the object fails. +The following values are accepted: +.Bl -tag -offset indent -width SHM_ +.It Dv SHM_LARGEPAGE_ALLOC_DEFAULT +If the (non-blocking) memory allocation fails because there is insufficient free +contiguous memory, the kernel will attempt to defragment physical memory and +try another allocation. +The subsequent allocation may or may not succeed. +If this subsequent allocation also fails, +.Xr ftruncate 2 +will fail and set +.Va errno +to +.Er ENOMEM . +.It Dv SHM_LARGEPAGE_ALLOC_NOWAIT +If the memory allocation fails, +.Xr ftruncate 2 +will fail and set +.Va errno +to +.Er ENOMEM . +.It Dv SHM_LARGEPAGE_ALLOC_HARD +The kernel will attempt defragmentation until the allocation succeeds, +or an unblocked signal is delivered to the thread. +However, it is possible for physical memory to be fragmented such that the +allocation will never succeed. +.El +.Pp +The +.Dv FIOSSHMLPGCNF +and +.Dv FIOGSHMLPGCNF +.Xr ioctl 2 +commands can be used with a largepage shared memory object to get and set +largepage object parameters. +Both commands operate on the following structure: +.Bd -literal +struct shm_largepage_conf { + int psind; + int alloc_policy; +}; + +.Ed +The +.Dv FIOGSHMLPGCNF +command populates this structure with the current values of these parameters, +while the +.Dv FIOSSHMLPGCNF +command modifies the largepage object. +Currently only the +.Va alloc_policy +parameter may be modified. +Internally, +.Fn shm_create_largepage +works by creating a regular shared memory object using +.Fn shm_open , +and then converting it into a largepage object using the +.Dv FIOSSHMLPGCNF +ioctl command. +.Pp +The .Fn shm_rename system call atomically removes a shared memory object named .Fa path_from @@ -162,10 +293,6 @@ Return an error if an shm exists at .Fa path_to , rather than unlinking it. .El -.Fn shm_rename -is also a -.Fx -extension. .Pp The .Fn shm_unlink @@ -235,6 +362,17 @@ All functions return -1 on failure, and set to indicate the error. .Sh COMPATIBILITY The +.Fn shm_create_largepage +and +.Fn shm_rename +functions are +.Fx +extensions, as is support for the +.Dv SHM_ANON +value in +.Fn shm_open . +.Pp +The .Fa path , .Fa path_from , and @@ -377,6 +515,18 @@ and are specified and the named shared memory object does exist. .It Bq Er EACCES The required permissions (for reading or reading and writing) are denied. +.It Bq Er ECAPMODE +The process is running in capability mode (see +.Xr capsicum 4 ) +and attempted to create a named shared memory object. +.El +.Pp +.Fn shm_create_largepage +can fail for the reasons listed above. +It also fails with these error codes for the following conditions: +.Bl -tag -width Er +.It Bq Er ENOTTY +The kernel does not support large pages on the current platform. .El .Pp The following errors are defined for @@ -424,6 +574,7 @@ requires write permission to the shared memory object. .Xr close 2 , .Xr fstat 2 , .Xr ftruncate 2 , +.Xr ioctl 2 , .Xr mmap 2 , .Xr munmap 2 , .Xr sendfile 2 From nobody Mon Feb 20 16:24:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL76G1BRtz3t212; Mon, 20 Feb 2023 16:24: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 4PL76G0l7yz4CxL; Mon, 20 Feb 2023 16:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ho/p8JZDhghFicpoShR48r4LKbB2y85Hxbf0jcGxJVc=; b=XX8u5tilBCF1jzZIqxKwdY7J7f53DnrliwQxRvu1l+q/2VBIOREWHe2W8QBZY/4RwQz7AX Yp2uNK4npW29zP5Xw6GXbO+s5dkF10OycmNKa3VotcItubmcbh+KmlwB6Zpvda5698vsn1 WY+OL72xSlzzWEjCd4qpIstRzuMzNiPVPz/D4LFgFMLszrsUnMf6AR3Mon+nI2EbrJ+k4m 78ssT7F6ijErghYW/BLHM4K/Llyi19GRTXizsougG2+oWuNF8i95oQ0/zhisq+Fhdzov26 YHj2ON5fbNizCDTBuDyBKvbpvFHafyqpILNHzB1kYli3WK0oJsB/canX6Mwshg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ho/p8JZDhghFicpoShR48r4LKbB2y85Hxbf0jcGxJVc=; b=XtROzDhDIiwHyoQVsRn6whuSx2UyDgyYW8lhHFgtI7ua21wMKbVd96VUsme3uPI59IulUY 7WgppTyaj3XPHbsk7kRCEvKcEficmtMuLnQL23GS3wUoDAs5/QwaPQASXEfSXPoRORA0TR jSsF+oyJ5HedmXJPfmZnfXD3DjqR7g5f9Y7KDa+Z/Ga/Hm/aOX6wz4CW7XPkfZe4//nvq0 yitJfGZbvKG4fMZUyl5L8I9NkumfAk/uufzGpkDjbC5oMgE0K7yyu78skmzl2JMuUK5ObV 3/4RjN8J8z69c6UmhTQmG7nC9VxxzOAFRc+3j0/GbgFdQR9rgJ2rWzaSeFIVhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676910262; a=rsa-sha256; cv=none; b=rm184EnK3WvwWDZ9uR22Djwll2mkoK/EmrSxzunnxsLYc+c5VDiRk2NWqHXlRZjUelNpBC jZ+897F40JgdGLs/ocfYHRTTQWyK6UAotgrp/wPcTX4ePE2qyqN6CPEmF6hK2/QHWHrgXc pWFX+N5QibZPJZ6VLap1/dNjNsgImiSMopzSM+c13Mh8tDNR+XOjtk0PoPvk/wFudiN3vw T/GXZxUDZXpCdQ7gkDuK26k3AyBslGN0s15dYf9yzpj0Nd/OW0Pv55UgdysOTW7pHNJhuP YH001GziUcHRpFhgVpsm4PbQi++E9uzIRYU25R3EhLB/ChJgE/ggQYffLEz8AA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL76F6vw3znZR; Mon, 20 Feb 2023 16:24: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 31KGOLpF064654; Mon, 20 Feb 2023 16:24:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KGOLCC064653; Mon, 20 Feb 2023 16:24:21 GMT (envelope-from git) Date: Mon, 20 Feb 2023 16:24:21 GMT Message-Id: <202302201624.31KGOLCC064653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: dadfe099255d - stable/13 - libc: Fall back to rdtsc when using pvclock and rdtscp is not available List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dadfe099255d38c96ce91a9b246294853aace3ea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dadfe099255d38c96ce91a9b246294853aace3ea commit dadfe099255d38c96ce91a9b246294853aace3ea Author: Mark Johnston AuthorDate: 2023-02-03 15:53:20 +0000 Commit: Mark Johnston CommitDate: 2023-02-20 16:24:08 +0000 libc: Fall back to rdtsc when using pvclock and rdtscp is not available In preparation for a follow-up revision wherein kvmclock may export timekeeping info to userspace even in the absence of AMDID_RDTSCP, fall back to using rdtsc when rdtscp isn't available. This mimics pvclock_read_time_info() in the kernel. Reviewed by: kib Tested by: Shrikanth R Kamath MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38341 (cherry picked from commit 26d105199ec89d6eaec8a9ca70e3b05ca65e3aac) --- lib/libc/x86/sys/__vdso_gettc.c | 42 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/lib/libc/x86/sys/__vdso_gettc.c b/lib/libc/x86/sys/__vdso_gettc.c index b3f3de9f4203..7159d46c0113 100644 --- a/lib/libc/x86/sys/__vdso_gettc.c +++ b/lib/libc/x86/sys/__vdso_gettc.c @@ -101,6 +101,13 @@ rdtsc32_mb_lfence(void) return (rdtsc32()); } +static uint64_t +rdtsc_mb_lfence(void) +{ + lfence(); + return (rdtsc()); +} + static u_int rdtsc32_mb_mfence(void) { @@ -108,38 +115,62 @@ rdtsc32_mb_mfence(void) return (rdtsc32()); } +static uint64_t +rdtsc_mb_mfence(void) +{ + mfence(); + return (rdtsc()); +} + static u_int rdtsc32_mb_none(void) { return (rdtsc32()); } +static uint64_t +rdtsc_mb_none(void) +{ + return (rdtsc()); +} + static u_int rdtscp32_(void) { return (rdtscp32()); } +static uint64_t +rdtscp_(void) +{ + return (rdtscp()); +} + struct tsc_selector_tag { u_int (*ts_rdtsc32)(void); + uint64_t (*ts_rdtsc)(void); u_int (*ts_rdtsc_low)(const struct vdso_timehands *); }; static const struct tsc_selector_tag tsc_selector[] = { [0] = { /* Intel, LFENCE */ .ts_rdtsc32 = rdtsc32_mb_lfence, + .ts_rdtsc = rdtsc_mb_lfence, .ts_rdtsc_low = rdtsc_low_mb_lfence, }, [1] = { /* AMD, MFENCE */ .ts_rdtsc32 = rdtsc32_mb_mfence, + .ts_rdtsc = rdtsc_mb_mfence, .ts_rdtsc_low = rdtsc_low_mb_mfence, }, [2] = { /* No SSE2 */ - .ts_rdtsc32 = rdtsc32_mb_none, - .ts_rdtsc_low = rdtsc_low_mb_none, + .ts_rdtsc32 = rdtsc32_mb_none, + .ts_rdtsc = rdtsc_mb_none, + .ts_rdtsc_low = rdtsc_low_mb_none, }, [3] = { /* RDTSCP */ .ts_rdtsc32 = rdtscp32_, + .ts_rdtsc = rdtscp_, .ts_rdtsc_low = rdtscp_low, }, }; @@ -193,6 +224,11 @@ DEFINE_UIFUNC(static, u_int, __vdso_gettc_rdtsc32, (void)) return (tsc_selector[tsc_selector_idx(cpu_feature)].ts_rdtsc32); } +DEFINE_UIFUNC(static, uint64_t, __vdso_gettc_rdtsc, (void)) +{ + return (tsc_selector[tsc_selector_idx(cpu_feature)].ts_rdtsc); +} + #define HPET_DEV_MAP_MAX 10 static volatile char *hpet_dev_map[HPET_DEV_MAP_MAX]; @@ -325,7 +361,7 @@ __vdso_pvclock_gettc(const struct vdso_timehands *th, u_int *tc) version = atomic_load_acq_32(&ti->version); stable = (ti->flags & th->th_x86_pvc_stable_mask) != 0; if (stable) { - tsc = rdtscp(); + tsc = __vdso_gettc_rdtsc(); } else { (void)rdtscp_aux(&cpuid_ti); ti = &pvclock_timeinfos[cpuid_ti]; From nobody Mon Feb 20 16:24:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL76H1vf3z3t23g; Mon, 20 Feb 2023 16:24: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 4PL76H1Sljz4Crs; Mon, 20 Feb 2023 16:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4sGq0QZnhkcGO2+5AsTGpgn94wJF8jQcMd18CGIkKg=; b=aoM7qc5r97hmoFhszP45qrRBAtkjUHS6NF1qQUJs41KixONvnUSY9v6ozE9SluCoZtaWmP wIO+/Xi20olaAU6kS6J/VSzJh7wuv6Be+7EyCyEV1LbeoJl4zXyJ1He25doKpZCeh/PC8g tdNnuXVKob5UDKg8vjDQGRhFsomCER6IWFKYxP0VJZY7ubAN1lfrZ9coJAtGW6J+MBKqeB jDzHI6oElcrP9P3g/gSY+HbQeWag92PoA9nvhX/pAGDMKrLB0TuFhhMzOSmd372EvVbudE oEQQKaZvjg2NCQB9RlPRTGgPepr4PGVtzIzOq2puwA2WYpbu+H7tQD6TMn7vDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4sGq0QZnhkcGO2+5AsTGpgn94wJF8jQcMd18CGIkKg=; b=uFqRlqvKZx2SiLmymuZnR3rsjGWbcrhLd5ItVw/nysKYe1P80GGjxT8BkKOAZuT/OcmKSv H0eIfzNhiSqVU5fTPxHczJs2wxEcO7fYlUvAmCVSjD63iwSAaIXMDnPrvLcB8vjtfkOHfl +EJc4kGH1V0KISIKB1F/HxkQJCGoZ9Sl1Zuz5ZSteoM+3gZ++qfRyo7hCzWnt7tNLamdsv J/pSjVuw/AQMLkw9H2d0qp2SjxReUIdLoOfB/4LUFcHdVWIdbWz6l56yRkMNCNCdd8fzg5 k86Pg7P5UricDBjdzfPT8i/Jiex5ei7CpkhVlv64hdeJGQPMklE4YlFJyS94BA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676910263; a=rsa-sha256; cv=none; b=KeV9wHAQG1xiPBHDY4ewonVUjnJX794t9P3gt6uiriclOi0q0ELox+6Au7pyWNfw2224fj HfjrmYMEgqBIKrwmSR4RpNRIyN1yI+h+HLnMZkbceAUX6LFh+gDZrc33vKrk7KsVJe9Hn7 BfUf0zFq7QC3hhMr7pzPQ9riTLjGaVgsOFA4y5mAIHJC7YhGZ6ZSzdW7+wswDmNoHFTQln ZoRv2oREhE7IQDgKD6r+7gac3ngsY/kTLn/KjWtEOtctkAVPiR2pqn3Ndoa/9AdUTfhobf eH+o2K6Zr4NrjDU8j632bRcR5Ohyo0i6F0D/ZMEtDTlb3XJY3FjTXQbSlnm/rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL76H0XdXznX8; Mon, 20 Feb 2023 16:24: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 31KGON97064673; Mon, 20 Feb 2023 16:24:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KGONOK064672; Mon, 20 Feb 2023 16:24:23 GMT (envelope-from git) Date: Mon, 20 Feb 2023 16:24:23 GMT Message-Id: <202302201624.31KGONOK064672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 14d014c3a9b7 - stable/13 - pvclock: Export a vDSO page even without rdtscp available List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 14d014c3a9b7966db0557462e773298c8bf70dc2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=14d014c3a9b7966db0557462e773298c8bf70dc2 commit 14d014c3a9b7966db0557462e773298c8bf70dc2 Author: Mark Johnston AuthorDate: 2023-02-03 15:54:23 +0000 Commit: Mark Johnston CommitDate: 2023-02-20 16:24:08 +0000 pvclock: Export a vDSO page even without rdtscp available When the cycle counter is "stable", i.e., synchronized across vCPUs by the hypervisor, userspace can use a serialized rdtsc instead of relying on rdtscp, just like the kernel timecounter does. This can be useful for performance in guests where the hypervisor hides rdtscp for some reason. To avoid breaking compatibility with older userspace which expects rdtscp to be usable when pvclock exports timekeeping info, hide this feature behind a sysctl. Reviewed by: kib Tested by: Shrikanth R Kamath MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38342 (cherry picked from commit 2bed14192cec1abcdc4e02ca7b18dafd868095ef) --- sys/x86/include/pvclock.h | 1 + sys/x86/x86/pvclock.c | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/sys/x86/include/pvclock.h b/sys/x86/include/pvclock.h index 023acdb80d9c..1306f11fc960 100644 --- a/sys/x86/include/pvclock.h +++ b/sys/x86/include/pvclock.h @@ -121,6 +121,7 @@ struct pvclock { /* Private; initialized by the 'pvclock' API: */ bool vdso_force_unstable; + bool vdso_enable_without_rdtscp; struct timecounter tc; struct cdev *cdev; }; diff --git a/sys/x86/x86/pvclock.c b/sys/x86/x86/pvclock.c index cc2377bdbcf0..3da3373bb2ee 100644 --- a/sys/x86/x86/pvclock.c +++ b/sys/x86/x86/pvclock.c @@ -224,6 +224,9 @@ pvclock_tc_vdso_timehands(struct vdso_timehands *vdso_th, { struct pvclock *pvc = tc->tc_priv; + if (pvc->cdev == NULL) + return (0); + vdso_th->th_algo = VDSO_TH_ALGO_X86_PVCLK; vdso_th->th_x86_shift = 0; vdso_th->th_x86_hpet_idx = 0; @@ -232,7 +235,9 @@ pvclock_tc_vdso_timehands(struct vdso_timehands *vdso_th, vdso_th->th_x86_pvc_stable_mask = !pvc->vdso_force_unstable && pvc->stable_flag_supported ? PVCLOCK_FLAG_TSC_STABLE : 0; bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); - return (pvc->cdev != NULL && amd_feature & AMDID_RDTSCP); + return ((amd_feature & AMDID_RDTSCP) != 0 || + ((vdso_th->th_x86_pvc_stable_mask & PVCLOCK_FLAG_TSC_STABLE) != 0 && + pvc->vdso_enable_without_rdtscp)); } #ifdef COMPAT_FREEBSD32 @@ -242,6 +247,9 @@ pvclock_tc_vdso_timehands32(struct vdso_timehands32 *vdso_th, { struct pvclock *pvc = tc->tc_priv; + if (pvc->cdev == NULL) + return (0); + vdso_th->th_algo = VDSO_TH_ALGO_X86_PVCLK; vdso_th->th_x86_shift = 0; vdso_th->th_x86_hpet_idx = 0; @@ -250,7 +258,9 @@ pvclock_tc_vdso_timehands32(struct vdso_timehands32 *vdso_th, vdso_th->th_x86_pvc_stable_mask = !pvc->vdso_force_unstable && pvc->stable_flag_supported ? PVCLOCK_FLAG_TSC_STABLE : 0; bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); - return (pvc->cdev != NULL && amd_feature & AMDID_RDTSCP); + return ((amd_feature & AMDID_RDTSCP) != 0 || + ((vdso_th->th_x86_pvc_stable_mask & PVCLOCK_FLAG_TSC_STABLE) != 0 && + pvc->vdso_enable_without_rdtscp)); } #endif @@ -284,6 +294,18 @@ pvclock_init(struct pvclock *pvc, device_t dev, const char *tc_name, "vdso_force_unstable", CTLFLAG_RW, &pvc->vdso_force_unstable, 0, "Forcibly deassert stable flag in vDSO codepath"); + /* + * Make it possible to use the vDSO page even when the hypervisor does + * not support the rdtscp instruction. This is disabled by default for + * compatibility with old libc. + */ + pvc->vdso_enable_without_rdtscp = false; + SYSCTL_ADD_BOOL(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "vdso_enable_without_rdtscp", CTLFLAG_RWTUN, + &pvc->vdso_enable_without_rdtscp, 0, + "Allow the use of a vDSO when rdtscp is not available"); + /* Set up timecounter and timecounter-supporting members: */ pvc->tc.tc_get_timecount = pvclock_tc_get_timecount; pvc->tc.tc_poll_pps = NULL; From nobody Mon Feb 20 16:24:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL76K1Tyrz3t2Xy; Mon, 20 Feb 2023 16:24: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 4PL76J2r2Zz4Cvj; Mon, 20 Feb 2023 16:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u0uFX+rhsYcD6kDVRW/thGrA42dtMKx0RwmBLnKl76I=; b=n/Pg8wKxSkj+gz500X4qJk8jwBlu6ni6uEBUPiDhXaw+o4fPuIm9KD6VRwpWt1TckEgwQx +/y22s0TKh7FdWFBxhDM4UruBXldC4PK9MPnMZoMmAt2CNauQc+A57tZujFlMEJcJNxQEL sfMRWbvhUVSLshirxU+cN7oyVh5r4mERgonITHUOzT1ci5as/pfiPXKH402xXZeDpdVvcF VRb09pYwfTk1Y2YzwJclx2UiDALdfUIaC1vNQWI1hrqOfZwWMkb+PoXT3ujwxH2ApM7rXX VxzdBizfE/x4M8POZvehS35tTabOnFebRWBMl22MrmgxuSgGLFz5P2jC2aX7AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u0uFX+rhsYcD6kDVRW/thGrA42dtMKx0RwmBLnKl76I=; b=j1ANHg6ZjzPbJu+FUWASHIs+6aaZNu1un+9kDCOlb2SCA3FVwIpvVnOZ86zlonmshUHOYC pB6w3q2qcqzyU7m2j4RTrye5s+qXMQbOGnCvYOkJsKpdSDIBBXcYKYc38tX7J4WhpN83ND AGCaBrPSk8+FoUAluo7C9IKZ2KRj3TIOsa+TVcPXu9FInXOhH5ddIQcFGm5GcXfFo4VE1J 9c2v9qcPbxpDoE2baKKpxZPNn9olT3xhBu4SLsDx3IRoepJgiTNRtuP2e7/Q/oupSueCEJ 6xkwttcaJIGu6kcsd8SaJBJldYH0URn6CkpsbpaG7ElEICaivt8HBI8Io0WzRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676910264; a=rsa-sha256; cv=none; b=wc/m2ytXdja1lfmrURAnHmaMB1W45LDtavDkFi4S/uF2ZXzXt8XIYhx1xpEXl2WDqaP+Up 9UwieTtw0vplFtJ7k7Fv5r2+Bl9RSSN/KS+TXCr7sJriB/vnRLzUUNM1+cojiU2DKf+8+z Y0fSKcwFmXoRhhaav5qjrjbZ4LrtAM3ZH5shYPt0tE/8DzhGo/X4AQSiwJhdMsxTrQ3/1C BQY9vopP01r6ll8ZidQKu7NTVX6bqk9U0Znq1ZyTA+j0NCkoFAGhybSdAXxO2lcsj43WKP T/d/2ini5bHpQCyJlIepTT59UFqUXwXUg+4m4V/+cRe7VWK1WJVUqY1f77h6gQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL76J1T5GznJ0; Mon, 20 Feb 2023 16:24: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 31KGOOaC064692; Mon, 20 Feb 2023 16:24:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KGOO6V064691; Mon, 20 Feb 2023 16:24:24 GMT (envelope-from git) Date: Mon, 20 Feb 2023 16:24:24 GMT Message-Id: <202302201624.31KGOO6V064691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 460e41a24baf - stable/13 - man4: Add a manual page for kvmclock List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 460e41a24baf03b910364e77bfce02baf3047891 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=460e41a24baf03b910364e77bfce02baf3047891 commit 460e41a24baf03b910364e77bfce02baf3047891 Author: Mark Johnston AuthorDate: 2023-02-03 15:54:50 +0000 Commit: Mark Johnston CommitDate: 2023-02-20 16:24:08 +0000 man4: Add a manual page for kvmclock Reviewed by: pauamma, imp, kib MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38343 (cherry picked from commit a2286a1f4651f9369cacb82bb1777920f5a86fdc) --- share/man/man4/Makefile | 2 + share/man/man4/kvmclock.4 | 96 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 0af0246f9328..a8064d12fc0d 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -273,6 +273,7 @@ MAN= aac.4 \ ktls.4 \ ktr.4 \ kue.4 \ + ${_kvmclock.4} \ lagg.4 \ le.4 \ led.4 \ @@ -846,6 +847,7 @@ _igc.4= igc.4 _imcsmb.4= imcsmb.4 _io.4= io.4 _itwd.4= itwd.4 +_kvmclock.4= kvmclock.4 _mgb.4= mgb.4 _nda.4= nda.4 _ndis.4= ndis.4 diff --git a/share/man/man4/kvmclock.4 b/share/man/man4/kvmclock.4 new file mode 100644 index 000000000000..55ee5fc1cb42 --- /dev/null +++ b/share/man/man4/kvmclock.4 @@ -0,0 +1,96 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2023 Klara, Inc. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd February 1, 2023 +.Dt KVMCLOCK 4 +.Os +.Sh NAME +.Nm kvmclock +.Nd Para-virtualized clock driver for x86 KVM guests +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device kvm_clock" +.Ed +.Sh DESCRIPTION +This driver reads time-keeping information from the para-virtualized clock +device provided by the KVM hypervisor on Linux hosts. +The +.Nm +driver is only implemented on i386 and amd64 platforms. +It acts as a +.Xr timecounters 4 +device and is preferred over the Time Stamp Counter (TSC) when available. +The driver exports timekeeping information via +.Pa /dev/pvclock , +enabling the implementation of +.Xr clock_gettime 2 +and related functions without entering the kernel. +.Pp +The +.Nm +driver works by accessing a per-vCPU timekeeping structure maintained by the +hypervisor. +It uses a combination of TSC readings and information from the shared structure +to produce a high-resolution timecounter which is invariant under hypervisor +events such as vCPU migration and live VM migration. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va dev.kvmclock.0.vdso_enable_without_rdtscp +By default, timekeeping information is exported to userspace only when the +(virtual) CPU announces support for the +.Dq rdtscp +instruction. +Setting this sysctl to 1 overrides this behavior, allowing timekeeping +information to be exported even in the absence of +.Dq rdtscp +support. +However, this breaks compatibility with copies of +.Pa /lib/libc.so.7 +released prior to +.Fx 14.0 , +and statically linked binaries which embed a copy of the system C library. +Thus, this sysctl value should not be changed if the system may execute +binaries older than +.Fx 14.0 . +.It Va dev.kvmclock.0.vdso_force_unstable +Mark the timecounter as unstable for userspace consumers. +This is mostly useful for debugging the driver and userspace timekeeping code, +and generally should not be touched. +.El +.Sh SEE ALSO +.Xr timecounters 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 13.1 . From nobody Mon Feb 20 16:24:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL76K44G9z3t2bV; Mon, 20 Feb 2023 16:24: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 4PL76K3d7Sz4D76; Mon, 20 Feb 2023 16:24:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awHrR4sTByWmchjbqeMOVS61h5kEo94KMejM1GD9tRU=; b=pNlvoSkY/pcyQ6cjPf9P54VrJL6jxzan0EGhd14Jv+X0p8HhrtN54zO8pkM48RVyeMpqTA sarT1yxmHtjGNjt2jBIcggrbrWJ/LQsPBay4e7OZSy0uf32h8sDvL4HPrhbWoDyOSHjHQa Mh8m8n7L9aKI+y157kAFs7ewtXKKUHULDKqaqPMqyq4H5EJEOhvLbjaMnbVI8r/N0+B/24 RRRe/2Fr4+1QNV7+J1PJwg4Fu6PCgvy/4rNJtEbwCHGI9qxatrEsoFk6fHQ+IUgzPgAkZr UTQrnX6IZ643RNQzvXewTJR7CvYymWBux0keODDsQhuhuvFIM453hcs7RCBi4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676910265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=awHrR4sTByWmchjbqeMOVS61h5kEo94KMejM1GD9tRU=; b=LFUchTR8bwLvjcGIO1STkz4cGXYMjwDW2/ma+lme73t3ADoCk07xrDzFFT3BJeYbFGMOpx 0oRmi5vdzimS+TLQuiwgwzZMhRITqXMT18mdxvEmV6VjHpUhHFJUrjpOWc77eAY/Vd9JLR YgdLC67ACT+ay/iU44I5Bb8wqVTrpxSEFAttfj114H2MKT9lzjxxrFrtknPq2bZ+eMBpVR XxNDicR2HyNPEyYBlAascrX3NNBtDiHYeBlwYCae0k/JIDlhs/rYFc4Av1wghiL7dzwShL FR/cgNvQr8X83XsN45kH9OQz967gEk+0e3XsfIlpPGiVXhszca37Ok2uaAkDdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676910265; a=rsa-sha256; cv=none; b=H8sUG4CBD91/LB0BJ/VPZu+o2HPJuBNwlEVrzHBdQxIRwdCWP27/dOpHzdIJ45GHq+pW33 OB86hgYJdiKaJ5GLVivJtnYpJrjcFBLxLQPx4NDl+cF/GyfST6irsJbQ8aR+znFdgViu7M glO/npN/C/6dyySoG78bK/kE7tE4GmlwolSXrKonOah2JqEbYeVFRGIEgr97u7qTlAoo5p JYv8wpp04dv9PyBHEn7hhwr7y+ZT8J+wucHhk6MblFKGiDErEhd0ca8UPSPx2x3dMpD/se xcde0QCbUjWcFgmR/0inNQnil4cqLkgZyXz8cu4cBwmltZPpYvVBu1aZHx4CTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL76K2dtZznKx; Mon, 20 Feb 2023 16:24: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 31KGOPge064718; Mon, 20 Feb 2023 16:24:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KGOPJ3064717; Mon, 20 Feb 2023 16:24:25 GMT (envelope-from git) Date: Mon, 20 Feb 2023 16:24:25 GMT Message-Id: <202302201624.31KGOPJ3064717@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5a33e9990b67 - stable/13 - pcb: Move an assignment into in_pcbdisconnect() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a33e9990b6745b5b659229ab33661b4811f8ddb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5a33e9990b6745b5b659229ab33661b4811f8ddb commit 5a33e9990b6745b5b659229ab33661b4811f8ddb Author: Mark Johnston AuthorDate: 2023-02-03 15:57:37 +0000 Commit: Mark Johnston CommitDate: 2023-02-20 16:24:09 +0000 pcb: Move an assignment into in_pcbdisconnect() All callers of in_pcbdisconnect() clear the local address, so let's just do that in the function itself. Note that the inp's local address is not a parameter to the inp hash functions. No functional change intended. Reviewed by: glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D38362 (cherry picked from commit 2589ec0f365777faacf36bd1eb24706538836b17) --- sys/netinet/in_pcb.c | 1 + sys/netinet/udp_usrreq.c | 3 --- sys/netinet6/in6_pcb.c | 3 ++- sys/netinet6/udp6_usrreq.c | 3 --- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index d9247f50d32b..55fa795457cb 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1499,6 +1499,7 @@ in_pcbdisconnect(struct inpcb *inp) INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo); + inp->inp_laddr.s_addr = INADDR_ANY; inp->inp_faddr.s_addr = INADDR_ANY; inp->inp_fport = 0; in_pcbrehash(inp); diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index cb7d10f68c48..1289ba7c5d2f 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1544,7 +1544,6 @@ udp_abort(struct socket *so) if (inp->inp_faddr.s_addr != INADDR_ANY) { INP_HASH_WLOCK(pcbinfo); in_pcbdisconnect(inp); - inp->inp_laddr.s_addr = INADDR_ANY; INP_HASH_WUNLOCK(pcbinfo); soisdisconnected(so); } @@ -1664,7 +1663,6 @@ udp_close(struct socket *so) if (inp->inp_faddr.s_addr != INADDR_ANY) { INP_HASH_WLOCK(pcbinfo); in_pcbdisconnect(inp); - inp->inp_laddr.s_addr = INADDR_ANY; INP_HASH_WUNLOCK(pcbinfo); soisdisconnected(so); } @@ -1750,7 +1748,6 @@ udp_disconnect(struct socket *so) } INP_HASH_WLOCK(pcbinfo); in_pcbdisconnect(inp); - inp->inp_laddr.s_addr = INADDR_ANY; INP_HASH_WUNLOCK(pcbinfo); SOCK_LOCK(so); so->so_state &= ~SS_ISCONNECTED; /* XXX */ diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index bc7c0a2bebf5..02fd3dff2ad7 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -500,7 +500,8 @@ in6_pcbdisconnect(struct inpcb *inp) INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo); - bzero((caddr_t)&inp->in6p_faddr, sizeof(inp->in6p_faddr)); + memset(&inp->in6p_laddr, 0, sizeof(inp->in6p_laddr)); + memset(&inp->in6p_faddr, 0, sizeof(inp->in6p_faddr)); inp->inp_fport = 0; /* clear flowinfo - draft-itojun-ipv6-flowlabel-api-00 */ inp->inp_flow &= ~IPV6_FLOWLABEL_MASK; diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 5166c0a2cbbc..ff7227cb99f3 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1019,7 +1019,6 @@ udp6_abort(struct socket *so) if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { INP_HASH_WLOCK(pcbinfo); in6_pcbdisconnect(inp); - inp->in6p_laddr = in6addr_any; INP_HASH_WUNLOCK(pcbinfo); soisdisconnected(so); } @@ -1155,7 +1154,6 @@ udp6_close(struct socket *so) if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { INP_HASH_WLOCK(pcbinfo); in6_pcbdisconnect(inp); - inp->in6p_laddr = in6addr_any; INP_HASH_WUNLOCK(pcbinfo); soisdisconnected(so); } @@ -1316,7 +1314,6 @@ udp6_disconnect(struct socket *so) INP_HASH_WLOCK(pcbinfo); in6_pcbdisconnect(inp); - inp->in6p_laddr = in6addr_any; INP_HASH_WUNLOCK(pcbinfo); SOCK_LOCK(so); so->so_state &= ~SS_ISCONNECTED; /* XXX */ From nobody Mon Feb 20 17:29:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PL8Xt6tcnz3rNdj; Mon, 20 Feb 2023 17:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PL8Xt6MYHz4Pr0; Mon, 20 Feb 2023 17:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676914142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=59WdTgjfYwmNHOeXnkhu/GDaENLp6VqDpOXGL6F50/Y=; b=xAXmyGYW56qNK07l5Fc/PoOT6vXOPX7hw1hiL1NTuR+4F69Izsl7Ar8iGD7ee+OgJCmH2B rrxhVFL7l61dYG3Kf/PZLuY3Pdl2JyIvAFtCneBMvT1uMUEPZe9j4urZWmO6K3/eKfnbuc h1KOFy5bgcqb30uhx2Lczzc0dNAAXBO9ctyMATXBHzehmxjl9LHFpEL1cMzH58/LrnSwwf sFRQT8ZN/kV6HYadqjiXvVxIswuLI36Ag1klwuYqogM7syVB6jiAMoyzfrlinm99Hetid9 LVam2OWQgULrFgOG8Tmik4ITg2DX53BgvZQom1juxMwk90bkC9+9BI2VxdG94Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676914142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=59WdTgjfYwmNHOeXnkhu/GDaENLp6VqDpOXGL6F50/Y=; b=EYe81scMY6LO2yJXHftHEhQ+QaciC1DVs1cNjSho6e4Cj+T02Q6sbLbGKDENLKLSGnR8fJ Yc4WfMbgiwLjXh5z8Zxo9Pose08WIvq6cksG8K6e5QHhAxc+h2uNznoOc0gZJNWzwbiNHf Bs1nbyc8BfR3nWpVj3SSnqy7b7AjIaxMmrEdqyOHXWhk2qgGDPYXjodMkzl+fnGKTjjye2 3SnT/Y9p63wlblvB7Wonoor3EM7Ula6ogVNp9DGqKgOZRKVTeA6mXaCAH+ZjwG/gPzHU+u eDxhYxoTrs4jyCklb3zgh6bRcrT/b9ev1B6Sp+ukdZFFuV9KhdFg2HpYmGqiYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676914142; a=rsa-sha256; cv=none; b=HNgVC/YBCCUgUWkgLZaDT5zOYgQ/2XaA8xAD1yOEvA2yVehWgLyBMzSZE+8VO5Hi0oCmlw lvTnC9B6hnTYttFdW/hFs3KHyWl9yZUiesu7mlDOWj1dTHjl6m3f7D+B5oNUpQL1pXnO5U ENGTqNunt7W862XQFjKwF3xYPbXszniU++njl7tnJGo0YzblUO74T+5OnREYHNbKDPbm7h uY2Kmsgzmu1CFyjtIh1OsfFMOmxxo1ygZ7OvXTfJy1bpYdJRiMl9CKsnbxMoxseKfck8bx Hg7pQYaq8WkyvPHlhr1htSUXlqFjg2/OCaxyD0/7SJCqeRB75H9Ev8p5Urhjtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PL8Xt5QD9zpvP; Mon, 20 Feb 2023 17:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31KHT2sT051909; Mon, 20 Feb 2023 17:29:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KHT2rj051908; Mon, 20 Feb 2023 17:29:02 GMT (envelope-from git) Date: Mon, 20 Feb 2023 17:29:02 GMT Message-Id: <202302201729.31KHT2rj051908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 24a7d1392823 - stable/13 - cpuset: Adapt sched_affinity compat shims to the stable/13 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 24a7d13928234ff989bdbf8a5f1397b94f086bdd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=24a7d13928234ff989bdbf8a5f1397b94f086bdd commit 24a7d13928234ff989bdbf8a5f1397b94f086bdd Author: Dmitry Chagin AuthorDate: 2023-02-20 17:28:36 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-20 17:28:36 +0000 cpuset: Adapt sched_affinity compat shims to the stable/13 Use compat shims to run the stable/13 world on a kernels which does not support CPU_WHICH_TIDPID. This is direct commit to the stable/13. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38677 --- lib/libc/gen/sched_getaffinity.c | 6 ++++-- lib/libc/gen/sched_setaffinity.c | 6 ++++-- sys/sys/param.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/sched_getaffinity.c b/lib/libc/gen/sched_getaffinity.c index fce47fbfc0d2..0275a2190afa 100644 --- a/lib/libc/gen/sched_getaffinity.c +++ b/lib/libc/gen/sched_getaffinity.c @@ -38,9 +38,11 @@ int sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset) { cpuwhich_t which; - int error; + int error, osrel; - if (__getosreldate() < P_OSREL_TIDPID) { + osrel = __getosreldate(); + if (osrel < P_OSREL_TIDPID_13 || (osrel < P_OSREL_TIDPID && + P_OSREL_MAJOR(osrel) == P_OSREL_MAJOR(P_OSREL_TIDPID))) { if (pid == 0 || pid > _PID_MAX) which = CPU_WHICH_TID; else diff --git a/lib/libc/gen/sched_setaffinity.c b/lib/libc/gen/sched_setaffinity.c index b878e1affc41..7fbebbfe6b6e 100644 --- a/lib/libc/gen/sched_setaffinity.c +++ b/lib/libc/gen/sched_setaffinity.c @@ -41,10 +41,12 @@ 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; + int error, lbs, cpu, osrel; size_t len, sz; - if (__getosreldate() < P_OSREL_TIDPID) { + osrel = __getosreldate(); + if (osrel < P_OSREL_TIDPID_13 || (osrel < P_OSREL_TIDPID && + P_OSREL_MAJOR(osrel) == P_OSREL_MAJOR(P_OSREL_TIDPID))) { if (pid == 0 || pid > _PID_MAX) which = CPU_WHICH_TID; else diff --git a/sys/sys/param.h b/sys/sys/param.h index d2fbad6c127b..6c95088e783d 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -92,6 +92,7 @@ #define P_OSREL_CK_INODE 1300005 #define P_OSREL_POWERPC_NEW_AUX_ARGS 1300070 #define P_OSREL_TIDPID 1400079 +#define P_OSREL_TIDPID_13 1302501 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif From nobody Mon Feb 20 18:55:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLBSS6d4Cz3rW4H; Mon, 20 Feb 2023 18:55: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 4PLBSS67Brz4lNx; Mon, 20 Feb 2023 18:55:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676919320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KWxJ+j0K2cvwAiZKyw2NfZw4DZ/7NT5eZBqFmGPSqC0=; b=hogCHH1Q9mAbjsrJeR9ZWFT+3t+rEaRd49Pp4iIR12V0DpLCKW3QrZ3wRjf+q15NsZnWbD dNd3G62ZIlcgLKuxJpSf6rIBwZg3ro/OMBbqgBwmZgDFQsvhZiVGpoIwvjJnC5qv7GntqN swcq6MpAkpINTdS9onGUUucsGsZM7ICtjfvWjvIDnNpqra6IXVR3Wl64g8Oxv0M+mNhZ67 1pHNkidlP3Vr2R5DQw4bJ8z3sol421p+si9/ifIAHpKrDJP/2gWk/Ikt6SLLYiL1ufJbIr CaW0HpdwseUD+OuAG+GBg6DrGR7vp2SWBe5antQrqZ6s/ToVk0orDc5gg1992A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676919320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KWxJ+j0K2cvwAiZKyw2NfZw4DZ/7NT5eZBqFmGPSqC0=; b=g8SDB5NqZjjrg8QHpnJXwh05e6n5FbBgzETkyHoYbYyuYodADaywxP3cJjDv822a8l5iAM rEIDnBvgzBMF6JHTV8+EBUWvXateYY+utW5OCSow2pJniGJEH60lCgw2hH51/AO2nfvFpp 4PAnhUtL1xFmR2ps74i/ZAMDjv0sgtZ1+LeHJ4MBTHOPSNdoeD3DJRBhmIlSDTUlps+BgX QsjvJAlsnFw38dyjLfzP4r5ixpjxUlD4lX7k2LA46+g6jizMVA03vUi9w1dAAuV7tBHwUq /LOuHqnTRX4brjaV0s2j5oykKAf+Zg8f6mhUo/G9GjoEZBnzmrq+3TXYPvpY3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676919320; a=rsa-sha256; cv=none; b=PIdFC5dasxDeS1R16/wQAPjyFmt+HngWxqv4oV/jdfoJmceA+BXW4/b2L02jd9SDhDRUT6 bnsUlrTNxfM1/galkKGG/x6G+MZZmmOibRgvTLZ2qa/g36pCeajVIFZGKnvkzv0Z6KrIAa ToI1gIxCC5hEu/V6VrjesdvA9InZBMVz5XFs49xOzm62aMLYjBBxJrk3sCoulSUU7+LHWW pewTy9R1P1+7BeKSzbRFVvs84y6h2pr7dtTVMtsUiiuSPv26QT1NCRzn73rFefykWyweIe 2WKc8muW34Ym381q1Khw8g5njAUeky2j9N0zTFTK9Xtecmp9h+191FHoRLXoJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLBSS5BH9zs10; Mon, 20 Feb 2023 18:55: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 31KItKlr079892; Mon, 20 Feb 2023 18:55:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KItK45079891; Mon, 20 Feb 2023 18:55:20 GMT (envelope-from git) Date: Mon, 20 Feb 2023 18:55:20 GMT Message-Id: <202302201855.31KItK45079891@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: cd73914b01a1 - main - kern: physmem: don't truncate addresses in DEBUG output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd73914b01a1f2300e587f802383cc563f2e7103 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=cd73914b01a1f2300e587f802383cc563f2e7103 commit cd73914b01a1f2300e587f802383cc563f2e7103 Author: Kyle Evans AuthorDate: 2023-02-20 18:54:00 +0000 Commit: Kyle Evans CommitDate: 2023-02-20 18:55:04 +0000 kern: physmem: don't truncate addresses in DEBUG output Make it consistent with the above region printing, otherwise it appears to be somewhat confusing. --- sys/kern/subr_physmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c index bb6af5a580aa..d371e1e166c5 100644 --- a/sys/kern/subr_physmem.c +++ b/sys/kern/subr_physmem.c @@ -149,10 +149,10 @@ physmem_dump_tables(int (*prfunc)(const char *, ...)) #ifdef DEBUG prfunc("Avail lists:\n"); for (i = 0; phys_avail[i] != 0; ++i) { - prfunc(" phys_avail[%d] 0x%08x\n", i, phys_avail[i]); + prfunc(" phys_avail[%d] 0x%08jx\n", i, phys_avail[i]); } for (i = 0; dump_avail[i] != 0; ++i) { - prfunc(" dump_avail[%d] 0x%08x\n", i, dump_avail[i]); + prfunc(" dump_avail[%d] 0x%08jx\n", i, dump_avail[i]); } #endif } From nobody Mon Feb 20 19:41:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLCTc51RQz3rZbR for ; Mon, 20 Feb 2023 19:41:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLCTc2XZLz3HCT for ; Mon, 20 Feb 2023 19:41:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f46.google.com with SMTP id m14-20020a7bce0e000000b003e00c739ce4so1585654wmc.5 for ; Mon, 20 Feb 2023 11:41:24 -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=HhE35hr5pPHlCZeelTHBDpAyICNQpLQCBSyywLcv3Ns=; b=FaImxp0H5I5nopRwGP6c/1Z3S5smswgJVdlMz1sQjSejsJtrNCJrqh+hVdGtziwOD/ yUyNC2Js5S1Judbo4eAj+2xx+6+hIxet+hYYXOO5pI/nT/NmHZ7n0lGe3eep8qL6iMBZ X3jElSrKJg/kGRZxkmqYFIvCFbMysNSuIe9zDL7J7SfdRecAfi0zxNhkUZu+wgrENqf/ 5dfKkj95EO0gUO+85ZUcVgn2WLqw+/JXupOqcvGrckkFt4KvuXlHIZGgL123y9cxIeu9 XLAsMnVvvdExZKTB8RgHQDPRqRI/hWKL2DBDyJBXTzU4PkE6ta2p9k0erVfhssqHTT4I dzvw== X-Gm-Message-State: AO0yUKXus0rQxiz/QVkgtI8UI1OFo7rn2zaYGn33lTmhVEKf3Y6HWIhi ilsj4ZqcElnZyySfcpqIneav4dJn57RR/Qqyw30= X-Google-Smtp-Source: AK7set9sgvvsCuKvRUfubs2qoATAIRzAT+HkLAu9iGOV9edze9DjS0N0l9W0WsTr6gNlZUBJKsCpyA== X-Received: by 2002:a05:600c:747:b0:3dc:5823:d6c0 with SMTP id j7-20020a05600c074700b003dc5823d6c0mr8018317wmn.6.1676922082376; Mon, 20 Feb 2023 11:41:22 -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 ay38-20020a05600c1e2600b003dff870ce0esm11348672wmb.2.2023.02.20.11.41.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Feb 2023 11:41:21 -0800 (PST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: cd73914b01a1 - main - kern: physmem: don't truncate addresses in DEBUG output From: Jessica Clarke In-Reply-To: <202302201855.31KItK45079891@gitrepo.freebsd.org> Date: Mon, 20 Feb 2023 19:41:21 +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: <870983EF-591C-4685-A133-1E0E37CF0B98@freebsd.org> References: <202302201855.31KItK45079891@gitrepo.freebsd.org> To: Kyle Evans X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4PLCTc2XZLz3HCT 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 20 Feb 2023, at 18:55, Kyle Evans wrote: >=20 > The branch main has been updated by kevans: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dcd73914b01a1f2300e587f802383cc56= 3f2e7103 >=20 > commit cd73914b01a1f2300e587f802383cc563f2e7103 > Author: Kyle Evans > AuthorDate: 2023-02-20 18:54:00 +0000 > Commit: Kyle Evans > CommitDate: 2023-02-20 18:55:04 +0000 >=20 > kern: physmem: don't truncate addresses in DEBUG output >=20 > Make it consistent with the above region printing, otherwise it = appears > to be somewhat confusing. > --- > sys/kern/subr_physmem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c > index bb6af5a580aa..d371e1e166c5 100644 > --- a/sys/kern/subr_physmem.c > +++ b/sys/kern/subr_physmem.c > @@ -149,10 +149,10 @@ physmem_dump_tables(int (*prfunc)(const char *, = ...)) > #ifdef DEBUG > prfunc("Avail lists:\n"); > for (i =3D 0; phys_avail[i] !=3D 0; ++i) { > - prfunc(" phys_avail[%d] 0x%08x\n", i, phys_avail[i]); > + prfunc(" phys_avail[%d] 0x%08jx\n", i, phys_avail[i]); You need to actually cast them though for 32-bit. Jess > } > for (i =3D 0; dump_avail[i] !=3D 0; ++i) { > - prfunc(" dump_avail[%d] 0x%08x\n", i, dump_avail[i]); > + prfunc(" dump_avail[%d] 0x%08jx\n", i, dump_avail[i]); > } > #endif > } From nobody Mon Feb 20 19:58:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLCsk3ldrz3rbLw; Mon, 20 Feb 2023 19: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 4PLCsk3FPhz3J38; Mon, 20 Feb 2023 19: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=1676923130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iuTkFG1j9ApwVCORuQsTdiZtPrzzVlWMrpwqpG4VUZ8=; b=kYyYOQB0K4XFfxxXZ622X4LYLSQflPtmugWqMgseTb9H0ovSZnL1h9O1hmjb3MsDlLQSRP nMsV/4iEAuTv3AWFXI/Cg7SYws0qqqxjUphDPvx9cz52zSucbLZCzzIp7skTzyadK0KBNP qNn8fwmnaBDNbWIKiPJOQabl0neHL0vhQ38e+Nv/s+zPeDQp/5fy+tU2I9kjWmzH7SQzl1 zIK1sqnFTD1mYUIqp9EfEfnwxi0gi3Px/Xji3VqJKqn0cxePZbFFUAoQjQxKqRgu3kOzy2 5cO1YIpzOjo4dqT/a46NnNj45wLB72/X3el1QcowWpcJTuX0/qSW+SQoPdGw/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iuTkFG1j9ApwVCORuQsTdiZtPrzzVlWMrpwqpG4VUZ8=; b=YNzlZ+5gf0CyMOqSROAXUHjehj/U8GaoZaADmMw9dF8HSlGTGgSZ9KrN9yoKgt8c2ZZEh2 kgltpOgwgduTNOGk+eMkfDs9BZwHPEysdPu4gRjeV0Fp+h9GCLbJUY1XEZsEtGV7sLOdmM WFV7ZhVcjT09cwXtWuz50mo7TcNIXfb0l+twz20A2FFAVV40g4qfZoYVu77LwoyafxvVjX j24cjLQZgacOXilf38IugkpRfUO8kJV+ImQqi2WmeTEk+xBhPbKkW9STRbqx4aW8WfwIKn Fl1Q4rjWSDDJUCh977XF+NTnGfNbyaR2lt833khWtUqQgYR82pk1kXWbBDw1Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676923130; a=rsa-sha256; cv=none; b=fvf/CX5OdD0eQXH6qnjUlNAqJ3k3ylDWWijylEU6Sd1p5r5FFAa15NGh6+bjF01KGVJUfv ve6yYbikjfuGEymmX/+S/NjTMHHm9R3xwsvNl4LWY5ZRa9WXPmlvMrgc2JpmbBSasiykW2 O/fFdeTg2Sf55BmlPdPEleD0CbL+2gLXPPg0gUNlzIvaCXTVM4Th36OQpxw2uaGC/bve9f xGWt3HMP3B/NFRGFTfHVIxKTLjW3R+ZlMoAIat653EzOkFRNCTnVTNVfx7247oJjYjy8Bf mh5ZJJqOO4o+PUEo/+9nXzAHDkYaou92fwJdNxB4eQtXm15L35UzV8adJ1xBIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLCsk2JzTztXW; Mon, 20 Feb 2023 19: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 31KJwoO1065865; Mon, 20 Feb 2023 19: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 31KJwodl065864; Mon, 20 Feb 2023 19:58:50 GMT (envelope-from git) Date: Mon, 20 Feb 2023 19:58:50 GMT Message-Id: <202302201958.31KJwodl065864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 13f1d1bd8647 - stable/13 - kern: physmem: improve region coalescing logic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 13f1d1bd86476393b8a2ec2c79cb0b1637fcdec6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=13f1d1bd86476393b8a2ec2c79cb0b1637fcdec6 commit 13f1d1bd86476393b8a2ec2c79cb0b1637fcdec6 Author: Kyle Evans AuthorDate: 2021-10-28 04:40:08 +0000 Commit: Kyle Evans CommitDate: 2023-02-20 19:58:20 +0000 kern: physmem: improve region coalescing logic The existing logic didn't take into account newly inserted mappings wholly contained by an existing region (or vice versa), nor did it account for weird overlap scenarios. The latter is probably unlikely to happen, but the former may happen in UEFI: BootServicesData allocated within a large chunk of ConventionalMemory. This situation blows up vm initialization. While we're here, remove the "exact match" logic as it's likely wrong; if an exact match exists with conflicting flags, for instance, then we should probably be doing something else. The new logic takes into account exact matches as part of the overlapping efforts. Reviewed by: kib, mhorne (both earlier version) Differential Revision: https://reviews.freebsd.org/D32701 (cherry picked from commit 7771f2a0c94fc2f7b9ce1565a49e52dba1e7381d) --- sys/kern/subr_physmem.c | 92 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c index 99b4c2141612..2c7837019ea2 100644 --- a/sys/kern/subr_physmem.c +++ b/sys/kern/subr_physmem.c @@ -295,6 +295,67 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, size_t maxavail, return (acnt); } +/* + * Check if the region at idx can be merged with the region above it. + */ +static size_t +merge_upper_regions(struct region *regions, size_t rcnt, size_t idx) +{ + struct region *lower, *upper; + vm_paddr_t lend, uend; + size_t i, mergecnt, movecnt; + + lower = ®ions[idx]; + lend = lower->addr + lower->size; + + /* + * Continue merging in upper entries as long as we have entries to + * merge; the new block could have spanned more than one, although one + * is likely the common case. + */ + for (i = idx + 1; i < rcnt; i++) { + upper = ®ions[i]; + if (lend < upper->addr || lower->flags != upper->flags) + break; + + uend = upper->addr + upper->size; + if (uend > lend) { + lower->size += uend - lend; + lend = lower->addr + lower->size; + } + + if (uend >= lend) { + /* + * If we didn't move past the end of the upper region, + * then we don't need to bother checking for another + * merge because it would have been done already. Just + * increment i once more to maintain the invariant that + * i is one past the last entry merged. + */ + i++; + break; + } + } + + /* + * We merged in the entries from [idx + 1, i); physically move the tail + * end at [i, rcnt) if we need to. + */ + mergecnt = i - (idx + 1); + if (mergecnt > 0) { + movecnt = rcnt - i; + if (movecnt == 0) { + /* Merged all the way to the end, just decrease rcnt. */ + rcnt = idx + 1; + } else { + memmove(®ions[idx + 1], ®ions[idx + mergecnt + 1], + movecnt * sizeof(*regions)); + rcnt -= mergecnt; + } + } + return (rcnt); +} + /* * Insertion-sort a new entry into a regions list; sorted by start address. */ @@ -303,19 +364,38 @@ insert_region(struct region *regions, size_t rcnt, vm_paddr_t addr, vm_size_t size, uint32_t flags) { size_t i; + vm_paddr_t nend, rend; struct region *ep, *rp; + nend = addr + size; ep = regions + rcnt; for (i = 0, rp = regions; i < rcnt; ++i, ++rp) { - if (rp->addr == addr && rp->size == size) /* Pure dup. */ - return (rcnt); if (flags == rp->flags) { - if (addr + size == rp->addr) { + rend = rp->addr + rp->size; + if (addr <= rp->addr && nend >= rp->addr) { + /* + * New mapping overlaps at the beginning, shift + * for any difference in the beginning then + * shift if the new mapping extends past. + */ + rp->size += rp->addr - addr; rp->addr = addr; - rp->size += size; + if (nend > rend) { + rp->size += nend - rend; + rcnt = merge_upper_regions(regions, + rcnt, i); + } return (rcnt); - } else if (rp->addr + rp->size == addr) { - rp->size += size; + } else if (addr <= rend && nend > rp->addr) { + /* + * New mapping is either entirely contained + * within or it's overlapping at the end. + */ + if (nend > rend) { + rp->size += nend - rend; + rcnt = merge_upper_regions(regions, + rcnt, i); + } return (rcnt); } } From nobody Mon Feb 20 20:13:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLDB84Ly5z3s6Zm; Mon, 20 Feb 2023 20:13: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 4PLDB83rNCz3KQn; Mon, 20 Feb 2023 20:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pvLxZVpU7J899SfCq7fbANtylY71RigAEwO3VFeU99c=; b=T7kEGQ+p6kgw31CRc74qctcYtBcuwTyeipJx6m9WBkJ/QGMhyHkoIGKgELX8DLbasZ64r8 osNwrSWOBpknDv2+RsIzaGaU123ZVh/kR5ITcVQinU6fXeALFZHkvyWKwt7l45GuTpRUJa 2Y64HCX39ReqgId3ejMatFkad2LYWlJ+fXg0YUhBUDBzPy5ABinaU0K+Lp0ijPVl54RPAw 66NT+SU/mxoiAaQ0MhAfYhLxdiGPRsaEqZ2ab0tW9wY9oDypylLcljXk/2T4hGQuYuGPz7 9gdoEGjude+NhEndX828uejADSSKjUc34hsbo2qdx89iPBrlbuM3uhD0a93HzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pvLxZVpU7J899SfCq7fbANtylY71RigAEwO3VFeU99c=; b=RX3Nd7PGcZ2XkDa834npvkz2P3cNcveEHxQaB0d7izWNwjzbpZ7rBmatMQgMeQvFsYCFkX spEfolfSyIvEr6uWWnoAaPgnkUcE07Am892kqREHl3YlQ3hUCN2u9YEYzLFzOraZ9kNnh2 eRmHwHlrgroWPXkOdI+gqP3cvicVhfu2thT/fAzaxCbIUpKue3vXFiEeqxA7MKGMpIVTrY Xyu3EqOJxLoluwU28jQIuyN016V8vWIgmThZPuYBqLuZNb19w2YA7W3s95z8/dWfd15LgV w+JlTrbp3yrMY2JNv7p88ED8iFKyjFiMFlHaurQK+c04Bca6zM6D//jzYzq6WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676923984; a=rsa-sha256; cv=none; b=rTGRejjZ6qdiEtA/pDKLXHy9peWS2WrYofezMps3k5uQApeaBt7LoNZ4i1o5is0mOIGNhk 2oGM6O14KLRL6s6nYMLKp5guvE2GRkT1D0RbfZXAF2uRPkA2yETp/KfF5lCSwHfRmabNzY wmWAY66oDKAZMcF5U28tDz30qZmYLfssJ5s2SRkHhjkI7M/nKfCc2nTc2kwVLGC8rtIIUt kCGE/qu0yWwZv4xP2gw8tTpgkR45t8xQ0l9kmorCcCg0q6lG05MB6MAf1ta/xApPzqRih4 vo5Go+WN9RP6p98ZjtMPLlPD/jMDEpr/ZGCGVhZ3PsaPaiQOQ0SxhBVHUb2yog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLDB82vpgztx0; Mon, 20 Feb 2023 20:13: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 31KKD4Sq094031; Mon, 20 Feb 2023 20:13:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KKD4Xw094030; Mon, 20 Feb 2023 20:13:04 GMT (envelope-from git) Date: Mon, 20 Feb 2023 20:13:04 GMT Message-Id: <202302202013.31KKD4Xw094030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 5eaad7c9c593 - releng/13.2 - netlink: Zero-initialize mbuf messages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 5eaad7c9c593908dfd4ab7e665b66e0e19542e60 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=5eaad7c9c593908dfd4ab7e665b66e0e19542e60 commit 5eaad7c9c593908dfd4ab7e665b66e0e19542e60 Author: Mark Johnston AuthorDate: 2023-01-17 14:36:54 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 19:47:42 +0000 netlink: Zero-initialize mbuf messages Some users of nlmsg_reserve_object() and nlmsg_reserve_data() are not careful to fully initialize pad and reserved fields, allowing uninitialized bytes to leak to userspace. For example, dump_nhgrp() doesn't set nhm->resvd = 0. Meanwhile, nlmsg_get_ns_buf() and nlmsg_get_ns_lbuf() zero-initialize the buffer, so nlmsg_get_ns_mbuf() is inconsistent. Let's just make them all behave the same here. Reported by: KMSAN Reviewed by: melifaro Approved by: re(cperciva) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38098 (cherry picked from commit d91be0f1211b0196a0087cdfa237a6a0d2a43b65) (cherry picked from commit 13e997289240c4697536f904167720a29abf7a58) --- sys/netlink/netlink_message_writer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c index 37414703c6f6..6573394eb881 100644 --- a/sys/netlink/netlink_message_writer.c +++ b/sys/netlink/netlink_message_writer.c @@ -215,6 +215,7 @@ nlmsg_get_ns_mbuf(struct nl_writer *nw, int size, bool waitok) nw->malloc_flag = mflag; nw->num_messages = 0; nw->enomem = false; + memset(nw->data, 0, size); NL_LOG(LOG_DEBUG2, "alloc mbuf %p req_len %d alloc_len %d data_ptr %p", m, size, nw->alloc_len, nw->data); return (true); From nobody Mon Feb 20 20:13:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLDB95HWgz3s6Xl; Mon, 20 Feb 2023 20:13: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 4PLDB94nRtz3KdC; Mon, 20 Feb 2023 20:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+6lTaX3bXlzbFDOiRMlIooPQtHFDysDCJLHvPWQ/pE=; b=IbejJLRDmliNEu7IVnMAPbGa+DvOrl2TdX8sCUeuYyymKuwI3UabriyVWFwCvEzmRj1JGu EJDTnsOVujLnyKeo1PEPKaOXRrTCeI9WGpOaxgCRjnMg1A1JFIp3KnngLpXDAA1T7YPa3W 01dp7PZT9IhmzryjNmXl5Md6cVu6ioMi758j9TPwm3MG0p4QQrm9WNFVgj/o7uQBg0T0iq hC1ijKvglzSUkrF+9V7pAT6JXXwFaS/agAtnGvxjJ4sWpK1ODQdm40opcM+RWOlVrCzBPp RR1SGCytv/5anfnZpcODnGuHhMjYgG1kkqv5F0MBfXVzyDT1WLzkYl9oLvFy+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+6lTaX3bXlzbFDOiRMlIooPQtHFDysDCJLHvPWQ/pE=; b=heN0hlmr33F2eDkxx7xDCOw04s6D7UdgpIdU6QaqV29JRFavjAH5Cv//STqhcRF781QiYD Unj/3idAoRBNz00hQ35XDGqwEqwXRDYnkGInW2oCJisdeqmPnXwoRIUWVd4KZBUwSTB1mr w9Cw2tzoeoCJqbiKWuKdqOG4zAzeZMINiEkJ16lTJt0BbQmcbTtGc/P1O0K8Vay11glagT 4mPs1XG1S5geHK2BpUKjSsQEK7+L0cOvI8ZbmTTjx9pl1Kdlu9DKa7MeP2QdfFZyFo8yPm rcVZSO6R00nDiav3dia0s84vJ6OiIQseOzejV2t0X8NsRUaURUsD+ukNbHD9+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676923985; a=rsa-sha256; cv=none; b=NDHt3sEx7heB47MlB9WTlhL6Mft8ist+qkpdq9bHO8sFEiiOx0hrbF5c33pl8kO3ZHqYCv WSGKj9CGTgut/epKIyrSf5WBBeI59PBHERmozUNczOWO87TWXzA0bwyA5dzffoA9sde5/O IYo6cDP2suKMIBZBK7BSbrNxSz+JdMeChPd9UNe2Sk3lXrfqnGZ5qfrfllQYIgJmnyN1BC KIbsgiwNIAcj+YtKi0ZXXzy1G5dEhb0DyJnhWferpuBTS5yDkATxEWiz3hTRO5AbFP14G0 CzTQib/Ue6JDKHISN4rRNpr6wfz6N8m305od/2JgFmxbOB59ROMxaQ/JYvWrSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLDB93qVbzv4y; Mon, 20 Feb 2023 20:13: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 31KKD5lw094050; Mon, 20 Feb 2023 20:13:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KKD5UZ094049; Mon, 20 Feb 2023 20:13:05 GMT (envelope-from git) Date: Mon, 20 Feb 2023 20:13:05 GMT Message-Id: <202302202013.31KKD5UZ094049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 2e847957c50c - releng/13.2 - netlink: Zero-initialize writer structures allocated on the stack List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 2e847957c50c63ebecdd6825b9466e3d979fac9b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=2e847957c50c63ebecdd6825b9466e3d979fac9b commit 2e847957c50c63ebecdd6825b9466e3d979fac9b Author: Mark Johnston AuthorDate: 2023-01-26 15:46:19 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 19:48:12 +0000 netlink: Zero-initialize writer structures allocated on the stack The prevailing pattern seems to be to simply initialize all fields to zero. Without this, it's possible to trigger a branch on uninitialized memory, specifically, when testing nw->ignore_limit in nlmsg_refill_buffer(). Initialize the writer structure in a couple of functions where this is necessary. Reported by: KMSAN Reviewed by: melifaro Approved by: re(cperciva) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38213 (cherry picked from commit 7a78ae88659e0f6a901574d17672d1ccdc3e971b) (cherry picked from commit 2de541757e0a2e25ce974b3c4c29bc8b753b8b6a) --- sys/netlink/route/rt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 48a6b0928cab..59b34c53ad4b 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -341,9 +341,9 @@ static void report_operation(uint32_t fibnum, struct rib_cmd_info *rc, struct nlpcb *nlp, struct nlmsghdr *hdr) { - struct nl_writer nw; - + struct nl_writer nw = {}; uint32_t group_id = family_to_group(rt_get_family(rc->rc_rt)); + if (nlmsg_get_group_writer(&nw, NLMSG_SMALL, NETLINK_ROUTE, group_id)) { struct route_nhop_data rnd = { .rnd_nhop = rc_get_nhop(rc), @@ -926,10 +926,9 @@ rtnl_handle_getroute(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate * void rtnl_handle_route_event(uint32_t fibnum, const struct rib_cmd_info *rc) { + struct nl_writer nw = {}; int family, nlm_flags = 0; - struct nl_writer nw; - family = rt_get_family(rc->rc_rt); /* XXX: check if there are active listeners first */ From nobody Mon Feb 20 20:13:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLDBB6GxKz3s6xS; Mon, 20 Feb 2023 20:13: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 4PLDBB5h32z3KZT; Mon, 20 Feb 2023 20:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vcsztzpf7wrhsq8kEWO2wTwg7hWrWVqskB95zSa1XIE=; b=CEaqDWknLwj1cYTAf2sw14z9oHV2efIFd4GhRsY/uyqIE7t89U5B6OUZA6pwWzl4tiqDpU 9H7LevQNqE5Wh9Jx44K6nTIPjhA/ekBoEmY14rf/VWbiDtG9PtsSEBuyMiT7tm11eeWgtL DffJNEiiIkNFfzSff06TU3+O/NbdjP+ySly3pAXx9Eztcado3qqe/U46Z3zNbFGn2vEDgQ M5/UrR1DBCilnsWJDyBbr49vZouoOV4ysRwzTUfg1pml/m883Ixip48leFllVetfXARUNW dj+oeSN5VQYm70N/ps4n67IXOsRDy3IQCoTD4OHAw+6jk7O6mBUWYNyva9cE0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vcsztzpf7wrhsq8kEWO2wTwg7hWrWVqskB95zSa1XIE=; b=xykX7d93MidCxIXvTJr9kggUNutAaYj2QST+cqL0W5lDMJX23PEH4NWb+QAWEyIBX2PRgo iEegzvaS7TTlui2D2vrHz1VDEHHoOWRUyb39nd1WcVLhqRYafYyF98UDKuZwHwMStSPYx8 pyT9Y/x1CJ0SbAH01wCYO/5kTglalSk+csF2grparXmcJlp4KvNGm7MderpUSSMgu7CwKb fsv/G2sn7pATUAuiueY4NbhvY+XLMUdzQPZtgvqMnUdmUsSploJQJWSNUUlCAXPUI73b1F ClhyGXUPDxgjKrkyJfmC/WmKtAzyVimDkv2z3rn6RceVlgFBWYMEOBpJJJuDdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676923986; a=rsa-sha256; cv=none; b=e4Ytwr7uG6O+X3k+r8Y1K8c2zlYZbyHchOzOX6XjrQUJknZ60B082nr4DOxfdIrIil+QQo HHgoylh7F9asWy7XdWSQw/Jjy9WqhQjOqYKkH1Z6uffJCZGyh303l1CFLVQLs3TB8d8PWe I4HPKu1TvkOiBBiHiS9y60s/HIEc8Xt87EJE1F9aHTkV+O7mlLB0VPbKL16ZwFxhds072C Zq18lhiDx8hMJDJ6OQk+HCbfrm7JEI6xwNW41XSO1/o2F0TXOVLNniA8KlTTo1xzUAXkCZ D7XmouTzLBK2LrhY6R0jfVrb0nb92s0EnVehPggQRkKg26Vt5pT12CP/A6EvuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLDBB4nGzztQ7; Mon, 20 Feb 2023 20:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31KKD6sK094069; Mon, 20 Feb 2023 20:13:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KKD6XN094068; Mon, 20 Feb 2023 20:13:06 GMT (envelope-from git) Date: Mon, 20 Feb 2023 20:13:06 GMT Message-Id: <202302202013.31KKD6XN094068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: d8198bd81ed0 - releng/13.2 - netlink: add forgotten pru_rcvd handler. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: d8198bd81ed00fe9364ba5ef7ca764a585c95521 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=d8198bd81ed00fe9364ba5ef7ca764a585c95521 commit d8198bd81ed00fe9364ba5ef7ca764a585c95521 Author: Alexander V. Chernikov AuthorDate: 2023-02-18 11:48:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 19:48:17 +0000 netlink: add forgotten pru_rcvd handler. There were changes in -HEAD domain/protosw setup logic and .pru_rcvd netlink handler was missed when performing the merge. Lack of this handler resulted in userland being waiting forever when performing large dumps of data. This change restores the handler as direct commit to stable/13. Reported by: Marek Zarychta Approved by: re(cperciva) (cherry picked from commit 4a081cc5a44e97794df5dae3df4a49c177b9ae4b) --- sys/netlink/netlink_domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index de96818d5e35..c451274b1e63 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -710,6 +710,7 @@ struct pr_usrreqs nl_usrreqs = { .pru_detach = nl_pru_detach, .pru_disconnect = nl_pru_disconnect, .pru_peeraddr = nl_pru_peeraddr, + .pru_rcvd = nl_pru_rcvd, .pru_send = nl_pru_send, //.pru_soreceive = soreceive_dgram, //.pru_sosend = sosend_dgram, From nobody Mon Feb 20 20:13:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLDBD05KNz3s6lP; Mon, 20 Feb 2023 20:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLDBC6bQMz3L0Z; Mon, 20 Feb 2023 20:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwzThnnVSw3dTLv53Rz+D58XBSSSpGZTymK8eOyBFAQ=; b=AkTJrJX8vbXxW/JCz1gOg8YkFuVAdsTq4ebVAdy6sAILkY+NzgkGDX7IC0HcinvXT1Vn+i CSx1V1C5S08XkHLbmrJbs4fLJRi0+ZwOJLrZIZ/ejthEXe5V8Q0be/goPCnN4zX/6hOzQb Jr6A4EzJwikzWo8RpXngBr4hXzuhiELbtFUcoDIHcujwtubFLObu9IW4xUGjCNQYg5YSGq 5/DiFVpEc/DBRtHExTusPz6je/fLnNj5V0CpJc5qMg87DWmoct1kfHNhs+z4mg29Hc2+vl rOC5BO4FrhYniE9ZE8YuloMAsCB0kPi5u/wOs11ALEscRHoNBi7NofOmebM78A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwzThnnVSw3dTLv53Rz+D58XBSSSpGZTymK8eOyBFAQ=; b=Ujug6fz67uJFeAZbQSq4voonKACoKxEViadeR+GrbzAInAvvKHxPukFUGulLdYv/YUqShn n+1JYgFmj70Mivnx4movpJjWvFWrEnRqpZyYyoNGAsOkXsZo56WagCiSuZ4fBtdCRUvWV0 SJ6tsCRDukJKUl/OEOv9SbvWLFDsvPNsO6HmuUOD7Nw/4velV48XyGlNZbilJkt4QQQhrE 7OxtmKOBMwTRh0sr3G29iub5Ra+9+Xd9FWy+OEqf3/RSaqyn1HllOzuTQZSnl+10BwEcFB +WTzox9a3lgnMl0yzgRTWAllwtlX4z88ylvk2W27IE8OoFX+pHSwN5Y9lsdzcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676923987; a=rsa-sha256; cv=none; b=aJMWckmJ5js7r6hg3ZbUxSdd+DrYPRkrP8i60i2R7G48B5pcxrphKxvPnDfhGLM1wnZ97f i7jUUHnoC11TEhkmOTsktbogAL6j0FqaT1C3sXpEO4cM2Ze43S/TdCPPOep9MdByiFClT7 GWp/4IAK7Y0vW5l+OT4wJ52CMnGhY/B8n3CflmqM0Ffb9lJxXQBOQnNJnkf/TwEAfQ2Wl5 zY/SrUlUBtOCPFUba8Lqq+U1wlr8zG/4IEQ+z3k5+yGzYMR2+Aw27NqkHHWqjPrAqKLN+c +5cm1XJWOHIeBXTVA7TztsqZWK15gWUigCiq4Ln1z5qMmprEUmHK8QEwFepBCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLDBC5hMHztQ8; Mon, 20 Feb 2023 20:13: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 31KKD72s094088; Mon, 20 Feb 2023 20:13:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KKD7aF094087; Mon, 20 Feb 2023 20:13:07 GMT (envelope-from git) Date: Mon, 20 Feb 2023 20:13:07 GMT Message-Id: <202302202013.31KKD7aF094087@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 816aebf69c3d - releng/13.2 - netlink: fix if_allocdescr() malloc options argument. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 816aebf69c3dfabef3e9d7fca799438fcd5760ad Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=816aebf69c3dfabef3e9d7fca799438fcd5760ad commit 816aebf69c3dfabef3e9d7fca799438fcd5760ad Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:35:28 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 19:48:22 +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 Approved by: re(cperciva) (cherry picked from commit 6694cb1f5784d6ceacd684d29b3e3012e1e4e4d5) (cherry picked from commit 8c60d469d3faa98f6b0e49173f16a8603c4c4654) --- 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 7f098b808743..1b8c27bfca68 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 Mon Feb 20 20:13:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLDBF1tkpz3s6jb; Mon, 20 Feb 2023 20:13: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 4PLDBD6Vy4z3KvK; Mon, 20 Feb 2023 20:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FVIKiuyX6gcV1AdDNPXjuRWrnZ1LCjdHpB4dO/xVCYc=; b=fxBGWKdqTpggUqERBAZdtnAA3nc+8UfbFWyKv3nZpDLYGMm0Xex9TTQTWNOkeqNG+smI2Z UmajjmJ1ztfGCBI3hG5zSE1rJnb0rEZggQ/up4OQhFVdUp1z3unXpIy9gqqQDn+sNx8A/c AGnfv/aYsf0t2N2BUM7ZXwzPS7p0vY5O6W1ddnapQvw2EzRTjT01z+JI62enGflZw6eG3N qptaCTdG2+hbcuX6yNfg8iwbMxJb4HJ/PXP/kwJTtb9c9d4/0HvCHcek772zFD/bq2HFhX TmeLJUR5Iy+UPs2kML9VLEI9CSBCzIUJALwTjyaQHdZOAs1Lq2Tt6JuC9psreg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FVIKiuyX6gcV1AdDNPXjuRWrnZ1LCjdHpB4dO/xVCYc=; b=bob1bZYQYffP7iH8wx21wP2jWkucnSN7+gJfNiarMEKVrJfk9XUBhy4X1vOszxfv1yRSX5 wSUmOim7UrGAqCrvOxbpLeH4rE7OvujKTbXwuZzOzlIdp7VYgXVXoehW/kp/OyTROUHt5+ 0Az9gDPL8PShuKBBQT+ts2n6f5RGkif9GJqDHXv9TzLK6WksF3DykDuQ2zJyeZOQWKCrIn 0wT/wqHWAvXTs7guAO4JvSl4h1MfRY5cClfZX2CUk9fbl4ROglHhMyvdf5w5JbedZd8tyl kkFa0vR+H2uVySsMQRmgIBmQ2ppdJODHjop+DOFWdvQ3p+0r5JqiBu0UBKUqqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676923988; a=rsa-sha256; cv=none; b=rGs9ezmDd4UDIeQJrIN2Vk2Za3fMLEzz+G1IEiTcfFK4O7dJ+qwQZ/2F6jTm0d3CIm1C94 poxvg3Y8iFMK2/CIMjPOj8gpl6TdtcYVmqKThbwfXE51/Eb98jikjWZXJ+PK/CzC8Sr/5g AA8Jog3XPlnwlJu33yjI+/QIeQ7ZIiNVF/3TvCoyZdvZPyVXr2iomyO4bY74ToYtLHUwiX s0bG9hUok74kyq9xwKFLAp/Nr0AB+vDEmzimUy2G0G1HxIMPYEEU4MaAigu+LHkq1GM18N KmLFsU3ENxKeN9dqGdvQDngTg9BYWbKCQQ/5i43qLI8VS4k+RNOUEZVXOMy+Xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLDBD5cQbzv50; Mon, 20 Feb 2023 20:13: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 31KKD8RO094115; Mon, 20 Feb 2023 20:13:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KKD8ew094114; Mon, 20 Feb 2023 20:13:08 GMT (envelope-from git) Date: Mon, 20 Feb 2023 20:13:08 GMT Message-Id: <202302202013.31KKD8ew094114@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 94eb891ce9f5 - releng/13.2 - netlink: use ifmedia to provide vlan interface operstate. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 94eb891ce9f58b650a6a0219a2c7d55ed7fb358b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=94eb891ce9f58b650a6a0219a2c7d55ed7fb358b commit 94eb891ce9f58b650a6a0219a2c7d55ed7fb358b Author: Alexander V. Chernikov AuthorDate: 2023-02-15 20:22:47 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 19:48:26 +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 Approved by: re(cperciva) MFC after: 3 days (cherry picked from commit 5dd48f718433959c283a8a4d6e46512426f1e200) (cherry picked from commit c169fb625ee0800ad1e6046440d67eef598581c2) --- 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 Mon Feb 20 20:13:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLDBG2vMRz3s6d3; Mon, 20 Feb 2023 20:13: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 4PLDBG0bKJz3Kvd; Mon, 20 Feb 2023 20:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XggDYwgBWmc+QLObOokGuLx2xNkachrx2p0i5ltH5OM=; b=aKXeWc2RqmCUio5KntmdCmFx1otSS/vAbw3dmamYrOpYMbrRWVq74ZEmZ9gIsvkLzhex45 g7iQfwPfm2bRUE06y2CWhuCoXKptVJiXVB8h+MLjlzPHdpDfY1ydrcOhJ3kYHsOT7diTLh 8bRBS9LpGxvk8b+SscAC/B6C7hFFsrJtoirLW7akQQUjeHcrHIxB2aTVEzN1+M3VAbfcxN pjA3vzKvFeOIDRmfoDZZHzqS+n8p0ZUa+kaHDwJ2JRFiB/8YME+pgJJ4A3+FoH1WQ6AGIp XK/iE9iw1h+c354ByFbwlSexDOp1b4uGxIkxzIF1kcMuw0FRs2q6SQ3fIdVfHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XggDYwgBWmc+QLObOokGuLx2xNkachrx2p0i5ltH5OM=; b=SXPa46QaGO1cHpAtb/oVDYGgWHwaSgFam4Z3zprhphGdPWZzmJaCc5hSGlZKm1ziGImybJ pXMHxySqZDdFKS0Eh+J80U8QMSK7npwgSyRVmYCh07eAESAYeQBlqbr23U1+UgV4tE/dSt 0xuEMF/NMw3owDsrffvJyzbBSVc4Yre8yoPsxu1jKAI8x9VAExFJ/Znljc8GC7hdjEbTt1 /sXNh3hXH7R2AjnrxZcUJTvI6mnoefuFx/0MdO6QfZEetzKhjdQVWXjnP5sYJ1QbhX4hhW MckOgMRI1JDtqX7sPtAEnct6OAjWR/h19/jtX/ofeisHxrL3M7u0LDWxhITddg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676923990; a=rsa-sha256; cv=none; b=kI6e+j9HVSpIHoqz+usbdC90JyEdrgGYvy3q1KyB4FnFNANWKAmMM/1zB6xOwbRSULGDQE BA09YiQpcGBhm9K+e/ay7uUi5o+TNzBGbicCjfFgHORxBPE6AtyOwZIlreKYX+xCVLWvpg X1kr5HTDH+YQtUgSLc2JENxBi7ox5630wiiTDJphQKjm0AQIRW/esFgpCGQSef+EfGYZ4p wwJApha39l5upYGLpZ7pwUhbb8XmoDtUhmMl9vDo3tbt02z7RJOgbYh5GP+7jiPWTVT1Zr td2SZsnrOVDB0Hbls3vd6e0qwnuVW1KABJWSPpsker4tR34Xrlr3J8Kagb/1Aw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLDBF6mv8ztZJ; Mon, 20 Feb 2023 20:13: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 31KKD9m1094140; Mon, 20 Feb 2023 20:13:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KKD9Si094139; Mon, 20 Feb 2023 20:13:09 GMT (envelope-from git) Date: Mon, 20 Feb 2023 20:13:09 GMT Message-Id: <202302202013.31KKD9Si094139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 16d16c4fcd72 - releng/13.2 - routing: always pass rtentry to add_route_flags(). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 16d16c4fcd72f8ce86fce64eb10a4a466c46b8e0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=16d16c4fcd72f8ce86fce64eb10a4a466c46b8e0 commit 16d16c4fcd72f8ce86fce64eb10a4a466c46b8e0 Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:20:38 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 19:48:31 +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 Approved by: re(cperciva) MFC after: 1 day (cherry picked from commit a0aa160b6d261f67b29a25c7cc5e04668fb6faf7) (cherry picked from commit 45ced2987df29a8587df2ad3c9ea0ddb1998aa16) --- 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 eaabe901b3cb..9bb02c99ddce 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -454,7 +454,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 @@ -489,6 +489,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)); @@ -765,6 +775,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 Mon Feb 20 20:13:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLDBH2CPMz3s70y; Mon, 20 Feb 2023 20:13: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 4PLDBH1XQ6z3Kqg; Mon, 20 Feb 2023 20:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+55vh4PgmjUgOw+4U6CPEupLCIhCXdmxyFdyWKSWCd0=; b=x82FEFsZ6U+rIgc9bb5aNhKGOibz3r2ahWS25TnlaxuEj5YeyOOvCXEqNKklJfSPekLQQ3 /eppmmRU9R+zcXvuMPoHWrPURxVNj7hTjA4Nq8v/SAXBokPkMiKaTA1MPqKmeuZIGrDskM HDCQsehIBpJsCdeAG1UK3sHSdnaDUPqk3UjJSBGJvd7tViOZPsLs5AFpChbAI3vVeyPr1f ghGHEhrWvdGfWjG6gfZJT3SnI5Qk+YlnfOTkOwvy2Dq3quIMdkem503iDbP8bQiBpXTcHP ZUaS9+A1eijRTxEAx4GA4NwuRA4t+ua0Idq4I4BoCq8I8EcuWmPwKcZfcSbbKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676923991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+55vh4PgmjUgOw+4U6CPEupLCIhCXdmxyFdyWKSWCd0=; b=Y3X/sAPzTRrtaSZ4XDKokIaebPl4aurwYHqhiBYG6YTRV4sJV6jqkIup0Zi59wgyaZrn8x uDgt5SmNyH923kOb/vUgYP7dRryhCnYATk7JzGLysAtkH4Zj5BAEwdf9/fzaIH3jHoPu7M G9ucJKxFRdGZKCz9f1EbYtHBLF22bi48LDoyDrqJnDDlwBc+Itgx7Q0UeGvettopqOwJUt unf+LmLBhVxXXFYoi/14PuSBv0oGewI5W5ToY92eR6nQCQfORLrGskeGB/kJ/39H/aReaP AJLYwW6Doe2sg5Lw2tNrKLsIavI2UUC5pUQ+D/3PuJQ1kUyas0Em23+C7bzq9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676923991; a=rsa-sha256; cv=none; b=Vth0KZW172R46KQODwvcQcbXnPphNtS+JPXXEofZpzYxEyk0NQPwmDGxM3cEc/8eya/8wT Jqmyppz/uaC0VkoReo47piWR9tHsXmgE+0v0qo8iWnkYuCElujDV9GPFXaNwbLY1TBLQtp uPuVVypcj9mJLdMc2VKuILXOo/futGjQmpjIBDLwQ7+ERl9wUyv/hr4eGv1OdcgY9tv78v aowcWbZUWdhoOfod6fGXc5pesr1NQPOf38641uPu0sGFv7PBFAWXTRsKSKPQi7R4GnbKWm d4iNc5zUEf8NtWezREW8sEH8GcV67bLpofqrYwoiTWL8SqqcLV8c0moFN8CGzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLDBH0ZbZztZK; Mon, 20 Feb 2023 20:13: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 31KKDAtJ094160; Mon, 20 Feb 2023 20:13:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KKDAhO094159; Mon, 20 Feb 2023 20:13:10 GMT (envelope-from git) Date: Mon, 20 Feb 2023 20:13:10 GMT Message-Id: <202302202013.31KKDAhO094159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: e28e779b1f4e - releng/13.2 - netlink: validate rtable value in RTM_ROUTE. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: e28e779b1f4ebef32070e06854336cdf15ad095d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=e28e779b1f4ebef32070e06854336cdf15ad095d commit e28e779b1f4ebef32070e06854336cdf15ad095d Author: Alexander V. Chernikov AuthorDate: 2023-02-17 17:31:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-20 19:48:35 +0000 netlink: validate rtable value in RTM_ROUTE. Reported by: Stefan Grundmann Approved by: re(cperciva) MFC after: 1 day (cherry picked from commit f2f7911c5513096e46422ad7756bc90c13c6e6d8) (cherry picked from commit e9296dc1bcd21cd9d719389cd04235ce4513e84d) --- 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 Mon Feb 20 21:12:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLFVx5xp1z3sBWf; Mon, 20 Feb 2023 21:12: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 4PLFVx5NtFz3krs; Mon, 20 Feb 2023 21:12:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676927561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FT+MZzo2P/iSxgX8dwLwqLEqMI1OE/9JFkLPTYp/Il4=; b=SdnrusThhKDfJUBdOzMuCk4V08UD0ua2ztzRNEu2n1Jd5SzpL4CdaLvJUOdRkJAZCJtI7Q Cot+ES1qtrK6LWYP3iKj7jYQ+uuTOW1BJJJJCbJoFF3m5ibWlM5Si3LxC03HeyJe8XCIPy BbYu8ymb3qn/pCInBErcL0sumkF0yScthzzvGHf5DL366sB8uawF95ISUr7DIjQzapuXti WbyNmpOBIHL97uGfz9O3fXoB36KgIlekmkSXb9VFCOlFPVFN+yXGkMgaEidCJH0OmzdvGU GPbCGiGab4PllX2VqV3ddnMNb+1MLl+RmoAE4OdbnzF1rN9MjCbNoNLu4GKLxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676927561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FT+MZzo2P/iSxgX8dwLwqLEqMI1OE/9JFkLPTYp/Il4=; b=WxocbtXwYWiZmlzxGbVoY36CMbLQthjVB4odLZXuxyrDKSp6NYSYm+zTS0njj3M706WyGC sO991GkCBS0MzU2OlIMUbK/+zbCjLN7574Yby2frPi7UnUIDqhB2/42tjSzO0Xpfh7D2nX TOQWQ/ANhQBxe1hqyxIwmVwumVEYWlh0G9McH9DCM/WD8LvTVWuHJ6NrBMcLXsjkGkSZPu OrFUdtsXnrGkmI7A1zYpb37tBybj4gBi1S5MW9dEZ7TdJ+AoyYr85rzYrQ15CGfYfNWwZ5 sCmSvkAhD0vF/bo1QcVGImJfXT0ijfMOB8Ira/Y3stCPcUXvf6Q5RDO9wENdng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676927561; a=rsa-sha256; cv=none; b=A9g1yc3QTEg8SdOipkmn9CS69MD7cmiWej5JNZpndXb09W4RBRYG6CRvCOrCmI9ULBcTR6 hiIPveVobzlhKtlNvh2AnYrOs8mFybU1kSeK7loO6ykEV4LL3KIW8bFTGMt2GMi2BRwQJS NLfpNDvxg7ceX9jwv9a3yfhmxidwcd3oFOvjePxGh+Xv2AccamQlnnbanIiucEfLW6EIQs 3yaQXJX/GDfApDGGGDcS869zyIaz3I5Ug1hPAzH5BzbjCkFsUwnAkUgAs9QPaLaDuVR4qF cpXV3MUHwx0fKGC9dNEW6pSZEM+aMm7rNviH/r3E0BG0oqePcD6L1gzrtLn/fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLFVx4SHFzwGZ; Mon, 20 Feb 2023 21:12: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 31KLCf9Q080360; Mon, 20 Feb 2023 21:12:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KLCfQB080359; Mon, 20 Feb 2023 21:12:41 GMT (envelope-from git) Date: Mon, 20 Feb 2023 21:12:41 GMT Message-Id: <202302202112.31KLCfQB080359@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: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef6fcc5e2b0714c859d2e4ba23a55b1fd12f8a4e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ef6fcc5e2b0714c859d2e4ba23a55b1fd12f8a4e commit ef6fcc5e2b0714c859d2e4ba23a55b1fd12f8a4e Author: Rick Macklem AuthorDate: 2023-02-20 21:11:22 +0000 Commit: Rick Macklem CommitDate: 2023-02-20 21:11:22 +0000 nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup Commit ed03776ca7f4 enabled the vnet front end macros. As such, for kernels built with the VIMAGE option will malloc data and initialize locks on a per-vnet basis, typically via a VNET_SYSINIT(). This patch adds VNET_SYSUNINIT() macros to do the frees of the per-vnet malloc'd data and destroys of per-vnet locks. It also removes the mtx_lock/mtx_unlock calls from nfsrvd_cleancache(), since they are not needed. Discussed with: bz, jamie MFC after: 3 months --- sys/fs/nfs/nfs_commonport.c | 28 +++++++++++++--------------- sys/fs/nfsserver/nfs_nfsdcache.c | 4 ---- sys/fs/nfsserver/nfs_nfsdport.c | 10 +++------- sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 15 ++++++++++++++- sys/rpc/rpcsec_tls.h | 3 --- sys/rpc/rpcsec_tls/rpctls_impl.c | 18 ++++++++++-------- 6 files changed, 40 insertions(+), 38 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 60131ab66184..99482069c36d 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -151,7 +151,6 @@ 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 /* @@ -871,19 +870,6 @@ nfs_pnfsio(task_fn_t *func, void *context) return (ret); } -static void -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. */ - nfsrv_cleanusergroup(); - NFSD_CURVNET_RESTORE(); -} - /* * Initialize everything that needs to be initialized for a vnet. */ @@ -902,6 +888,19 @@ nfs_vnetinit(const void *unused __unused) VNET_SYSINIT(nfs_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, nfs_vnetinit, NULL); +static void +nfs_cleanup(void *unused __unused) +{ + + mtx_destroy(&NFSD_VNET(nfsrv_nfsuserdsock).nr_mtx); + if (!IS_DEFAULT_VNET(curvnet)) + free(NFSD_VNET(nfsstatsv1_p), M_TEMP); + /* Clean out the name<-->id cache. */ + nfsrv_cleanusergroup(); +} +VNET_SYSUNINIT(nfs_cleanup, SI_SUB_VNET_DONE, SI_ORDER_ANY, + nfs_cleanup, NULL); + extern int (*nfsd_call_nfscommon)(struct thread *, struct nfssvc_args *); /* @@ -938,7 +937,6 @@ nfscommon_modevent(module_t mod, int type, void *data) } nfsd_call_nfscommon = NULL; - 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_nfsdcache.c b/sys/fs/nfsserver/nfs_nfsdcache.c index 2629c795802f..0eb623b6f5ee 100644 --- a/sys/fs/nfsserver/nfs_nfsdcache.c +++ b/sys/fs/nfsserver/nfs_nfsdcache.c @@ -824,13 +824,10 @@ nfsrvd_cleancache(void) int i; for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) { - mtx_lock(&NFSD_VNET(nfsrchash_table)[i].mtx); LIST_FOREACH_SAFE(rp, &NFSD_VNET(nfsrchash_table)[i].tbl, rc_hash, nextrp) nfsrc_freecache(rp); - mtx_unlock(&NFSD_VNET(nfsrchash_table)[i].mtx); } - mtx_lock(&nfsrc_udpmtx); for (i = 0; i < NFSRVCACHE_HASHSIZE; i++) { LIST_FOREACH_SAFE(rp, &NFSD_VNET(nfsrvudphashtbl)[i], rc_hash, nextrp) { @@ -838,7 +835,6 @@ nfsrvd_cleancache(void) } } 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 7708f0325494..cee5f96d7199 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -108,8 +108,6 @@ NFSD_VNET_DEFINE_STATIC(struct vfsoptlist, nfsv4root_newopt); NFSD_VNET_DEFINE_STATIC(bool, nfsrv_suspend_nfsd) = false; NFSD_VNET_DEFINE_STATIC(bool, nfsrv_mntinited) = false; -static void nfsrv_cleanup(struct prison *); - static int nfssvc_srvcall(struct thread *, struct nfssvc_args *, struct ucred *); static void nfsvno_updateds(struct vnode *, struct ucred *, struct thread *); @@ -7111,15 +7109,13 @@ VNET_SYSINIT(nfsrv_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, * done when the jail is destroyed or the module unloaded. */ static void -nfsrv_cleanup(struct prison *pr) +nfsrv_cleanup(const void *unused __unused) { int i; - NFSD_CURVNET_SET(pr->pr_vnet); NFSD_LOCK(); if (!NFSD_VNET(nfsrv_mntinited)) { NFSD_UNLOCK(); - NFSD_CURVNET_RESTORE(); return; } NFSD_VNET(nfsrv_mntinited) = false; @@ -7159,8 +7155,9 @@ nfsrv_cleanup(struct prison *pr) free(NFSD_VNET(nfssessionhash), M_NFSDSESSION); free(NFSD_VNET(nfsv4root_mnt), M_TEMP); NFSD_VNET(nfsv4root_mnt) = NULL; - NFSD_CURVNET_RESTORE(); } +VNET_SYSUNINIT(nfsrv_cleanup, SI_SUB_VNET_DONE, SI_ORDER_ANY, + nfsrv_cleanup, NULL); extern int (*nfsd_call_nfsd)(struct thread *, struct nfssvc_args *); @@ -7201,7 +7198,6 @@ nfsd_modevent(module_t mod, int type, void *data) vn_deleg_ops.vndeleg_disable = NULL; #endif nfsd_call_nfsd = NULL; - nfsrv_cleanup(&prison0); mtx_destroy(&nfsrc_udpmtx); mtx_destroy(&nfs_v4root_mutex); mtx_destroy(&nfsrv_dontlistlock_mtx); diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c index dc850996a592..03e185bd912b 100644 --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c @@ -204,7 +204,7 @@ 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) +svc_rpc_gss_init(void *unused __unused) { int i; @@ -222,6 +222,19 @@ svc_rpc_gss_init(void *arg) VNET_SYSINIT(svc_rpc_gss_init, SI_SUB_VNET_DONE, SI_ORDER_ANY, svc_rpc_gss_init, NULL); +static void +svc_rpc_gss_cleanup(void *unused __unused) +{ + + mem_free(KGSS_VNET(svc_rpc_gss_client_hash), + sizeof(struct svc_rpc_gss_client_list) * + svc_rpc_gss_client_hash_size); + if (IS_DEFAULT_VNET(curvnet)) + sx_destroy(&svc_rpc_gss_lock); +} +VNET_SYSUNINIT(svc_rpc_gss_cleanup, SI_SUB_VNET_DONE, SI_ORDER_ANY, + svc_rpc_gss_cleanup, NULL); + bool_t rpc_gss_set_callback(rpc_gss_callback_t *cb) { diff --git a/sys/rpc/rpcsec_tls.h b/sys/rpc/rpcsec_tls.h index ba9a754bd276..a1f77a659ee2 100644 --- a/sys/rpc/rpcsec_tls.h +++ b/sys/rpc/rpcsec_tls.h @@ -76,9 +76,6 @@ 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); diff --git a/sys/rpc/rpcsec_tls/rpctls_impl.c b/sys/rpc/rpcsec_tls/rpctls_impl.c index 92b8b9481666..4d81b8612d36 100644 --- a/sys/rpc/rpcsec_tls/rpctls_impl.c +++ b/sys/rpc/rpcsec_tls/rpctls_impl.c @@ -109,6 +109,16 @@ rpctls_vnetinit(const void *unused __unused) VNET_SYSINIT(rpctls_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, rpctls_vnetinit, NULL); +static void +rpctls_cleanup(void *unused __unused) +{ + + free(KRPC_VNET(rpctls_server_handle), M_RPC); + free(KRPC_VNET(rpctls_server_busy), M_RPC); +} +VNET_SYSUNINIT(rpctls_cleanup, SI_SUB_VNET_DONE, SI_ORDER_ANY, + rpctls_cleanup, NULL); + int rpctls_init(void) { @@ -843,11 +853,3 @@ rpctls_getinfo(u_int *maxlenp, bool rpctlscd_run, bool rpctlssd_run) return (enable); } -void -rpctls_cleanup(void) -{ - - free(KRPC_VNET(rpctls_server_handle), M_RPC); - free(KRPC_VNET(rpctls_server_busy), M_RPC); -} - From nobody Mon Feb 20 21:29:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLFtg4Szhz3sCRr; Mon, 20 Feb 2023 21:29: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 4PLFtg3qXMz3m0v; Mon, 20 Feb 2023 21:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676928587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ydC5U3nDJNllItUKNTV6rSRNaQw+tNtCfI6ylV1u1M8=; b=dQPtTQ6ZqAdw5zuubr9k+4NzofMdKsQDFoknoeiklWPNETY7ZsktMBS6kl0yU4NVkeawYe WNtSgGeX8Pm9eJHq8c5VhY7x2d+d9WypV2wCuQZcUlGrj2BG/04d1FaLuuM8xhDpMVTHNW mDW9wa4dO0FQX0gT4cN7uq+OJ08oe8VybFlstT0O42S+7fePq1lclXf7ixWvPoZcRx4bVH DwCOYB/LJkcN4FduKOYEe6Pii31oW3w3uAe7+uV3Efw7a3CGUt/VBTxMd/Vy+b8SbegVNP toLXstGwp+jzE80A4tipeQ1JQ4/nGrj5HNixKYwUbtV2hSXKZ/0WcamTqmKxQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676928587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ydC5U3nDJNllItUKNTV6rSRNaQw+tNtCfI6ylV1u1M8=; b=DWlbNJq3aWCyKDyxvlZVXRTn8dS+dhqeXTYPBR4oIENutCyEsS+Px8c8oUBJdwPx49RVF7 OF8yYd63EYnWFHynUiGB5QDACWzj44LG4DZTroCUlnXfUxrLBmYRd6IO/QZEGch023usM5 GZceT3QCB2CBIxIvM2Jj6Y9AVApGhA/xt/fHwGU5EtpGgCMT4vtyKw1F59++sexE2Xs1qG yX3mFn8V29glNsLqgtj5RViy/yAawzxwqs0QsV63V8u6+3GnHLBZ698GAz1pJf+/lyMmpO KNeS4Efr5HYnTU/DKD0TDPpJGJgeGqFB6fjXSw7iMxcWNexlgrBtoFw+IsKn1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676928587; a=rsa-sha256; cv=none; b=QRnJVTAeUmICkGTyfkxnM6YBibiDhZrZauSv1V36AQU7lk13wlxN+l/c9akZ6nPXfqJ5gG d9HoC+HI5SCSQ89lwrwYCxCwBOtH2m247ROwnsOIaGHxcTAlskB1V9YIu/K1GxfK6y10F+ llMIUsmEj++xcK8pxVKQktQYTdZe/Cqg11FL2rUdIgUlzj0XA49JNSn8skOVRyJvt2IxUb vMj1T8YPVHYLYT9aBRPtY/cNydhCVNFnwXrcA1orvNAJd9uRZVyJzeCZQQS2G51+IoWtJe WhBLR6yfD3a46bnmZUAVxLY98btz7Emp5IvgcCIvXqAnmqvUQps4z79zNS0Mbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLFtg2t5Qzwch; Mon, 20 Feb 2023 21:29: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 31KLTldA095501; Mon, 20 Feb 2023 21:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KLTlJX095500; Mon, 20 Feb 2023 21:29:47 GMT (envelope-from git) Date: Mon, 20 Feb 2023 21:29:47 GMT Message-Id: <202302202129.31KLTlJX095500@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: d481dcee72a0 - main - tarfs: Really prevent descending into a non-directory. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d481dcee72a05580c4c3af4a429b1c08fa846056 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d481dcee72a05580c4c3af4a429b1c08fa846056 commit d481dcee72a05580c4c3af4a429b1c08fa846056 Author: Dag-Erling Smørgrav AuthorDate: 2023-02-20 21:28:53 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-20 21:29:19 +0000 tarfs: Really prevent descending into a non-directory. The previous fix was incorrect: we need to verify that the current node, if it exists, is not a directory, but we were checking the parent node instead. Address this, add more tests, and fix the test cleanup routines. PR: 269519, 269561 Fixes: ae6cff89738b Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38645 --- sys/fs/tarfs/tarfs_vfsops.c | 17 ++++---- tests/sys/fs/tarfs/tarfs_test.sh | 87 ++++++++++++++++++++++++++++++++++------ 2 files changed, 85 insertions(+), 19 deletions(-) diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index b3c30e884a9d..059608ea60a5 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -304,8 +304,8 @@ tarfs_lookup_path(struct tarfs_mount *tmp, char *name, size_t namelen, if (tnp == NULL) panic("%s: root node not yet created", __func__); - TARFS_DPF(LOOKUP, "%s: Full path: %.*s\n", __func__, (int)namelen, - name); + TARFS_DPF(LOOKUP, "%s: full path: %.*s\n", __func__, + (int)namelen, name); sep = NULL; for (;;) { @@ -320,8 +320,10 @@ 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) { + /* we're not at the end, so we must be in a directory */ + if (tnp != NULL && tnp->type != VDIR) { + TARFS_DPF(LOOKUP, "%s: %.*s is not a directory\n", __func__, + (int)tnp->namelen, tnp->name); error = ENOTDIR; break; } @@ -365,8 +367,9 @@ tarfs_lookup_path(struct tarfs_mount *tmp, char *name, size_t namelen, tnp = NULL; cn.cn_nameptr = name; cn.cn_namelen = len; - TARFS_DPF(LOOKUP, "%s: Search: %.*s\n", __func__, - (int)cn.cn_namelen, cn.cn_nameptr); + TARFS_DPF(LOOKUP, "%s: looking up %.*s in %.*s/\n", __func__, + (int)cn.cn_namelen, cn.cn_nameptr, + (int)parent->namelen, parent->name); if (do_lookup) { tnp = tarfs_lookup_node(parent, NULL, &cn); if (tnp == NULL) { @@ -379,7 +382,7 @@ tarfs_lookup_path(struct tarfs_mount *tmp, char *name, size_t namelen, namelen -= cn.cn_namelen; } - TARFS_DPF(LOOKUP, "%s: Parent %p, node %p\n", __func__, parent, tnp); + TARFS_DPF(LOOKUP, "%s: parent %p node %p\n", __func__, parent, tnp); if (retparent) *retparent = parent; diff --git a/tests/sys/fs/tarfs/tarfs_test.sh b/tests/sys/fs/tarfs/tarfs_test.sh index 634b6be3dd08..15319e249034 100644 --- a/tests/sys/fs/tarfs/tarfs_test.sh +++ b/tests/sys/fs/tarfs/tarfs_test.sh @@ -27,12 +27,12 @@ # mktar="$(dirname $(realpath "$0"))"/mktar -mnt="$(realpath ${TMPDIR:-/tmp})/mnt.$$" +mnt="$(realpath ${TMPDIR:-/tmp})/mnt" # expected SHA256 checksum of file contained in test tarball sum=4da2143234486307bb44eaa610375301781a577d1172f362b88bb4b1643dee62 -atf_test_case tarfs_test +atf_test_case tarfs_basic cleanup tarfs_basic_head() { atf_set "descr" "Basic function test" atf_set "require.user" "root" @@ -50,27 +50,90 @@ tarfs_basic_cleanup() { umount "${mnt}" } -atf_test_case tarfs_notdir -tarfs_notdir_head() { - atf_set "descr" "Regression test for PR 269519" +atf_test_case tarfs_notdir_device cleanup +tarfs_notdir_device_head() { + atf_set "descr" "Regression test for PR 269519 and 269561" atf_set "require.user" "root" } -tarfs_notdir_body() { +tarfs_notdir_device_body() { + mkdir "${mnt}" + atf_check mknod d b 0xdead 0xbeef + tar cf tarfs_notdir.tar d + rm d + mkdir d + echo "boom" >d/f + tar rf tarfs_notdir.tar d/f + atf_check -s not-exit:0 -e match:"Invalid" \ + mount -rt tarfs tarfs_notdir.tar "${mnt}" +} +tarfs_notdir_device_cleanup() { + umount "${mnt}" || true +} + +atf_test_case tarfs_notdir_dot cleanup +tarfs_notdir_dot_head() { + atf_set "descr" "Regression test for PR 269519 and 269561" + atf_set "require.user" "root" +} +tarfs_notdir_dot_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 + mkdir d + echo "world" >d/f + tar rf tarfs_notdir.tar d/./f atf_check -s not-exit:0 -e match:"Invalid" \ mount -rt tarfs tarfs_notdir.tar "${mnt}" } -tarfs_notdir_cleanup() { - umount "${mnt}" +tarfs_notdir_dot_cleanup() { + umount "${mnt}" || true +} + +atf_test_case tarfs_notdir_dotdot cleanup +tarfs_notdir_dotdot_head() { + atf_set "descr" "Regression test for PR 269519 and 269561" + atf_set "require.user" "root" +} +tarfs_notdir_dotdot_body() { + mkdir "${mnt}" + echo "hello" >d + tar cf tarfs_notdir.tar d + rm d + mkdir d + echo "world" >f + tar rf tarfs_notdir.tar d/../f + atf_check -s not-exit:0 -e match:"Invalid" \ + mount -rt tarfs tarfs_notdir.tar "${mnt}" +} +tarfs_notdir_dotdot_cleanup() { + umount "${mnt}" || true +} + +atf_test_case tarfs_notdir_file cleanup +tarfs_notdir_file_head() { + atf_set "descr" "Regression test for PR 269519 and 269561" + atf_set "require.user" "root" +} +tarfs_notdir_file_body() { + mkdir "${mnt}" + echo "hello" >d + tar cf tarfs_notdir.tar d + rm d + mkdir d + echo "world" >d/f + tar rf tarfs_notdir.tar d/f + atf_check -s not-exit:0 -e match:"Invalid" \ + mount -rt tarfs tarfs_notdir.tar "${mnt}" +} +tarfs_notdir_file_cleanup() { + umount "${mnt}" || true } atf_init_test_cases() { atf_add_test_case tarfs_basic - atf_add_test_case tarfs_notdir + atf_add_test_case tarfs_notdir_device + atf_add_test_case tarfs_notdir_dot + atf_add_test_case tarfs_notdir_dotdot + atf_add_test_case tarfs_notdir_file } From nobody Mon Feb 20 21:59:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLGYC21vgz3sGBT; Mon, 20 Feb 2023 21:59:43 +0000 (UTC) (envelope-from kevans@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 4PLGYC1WHlz3pvc; Mon, 20 Feb 2023 21:59:43 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676930383; 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=AVCXJkB+rB/b6WQuOgb2r94feYJeqrg1oXOw8m7YMzM=; b=Rah/jGQC6DgDvdlutWRauDVw5Hl2ndqa4B73HH1oEEjZFFy1gqz563NehbpOZTHLoPpt7C Jg+lKBuUgsoTXsPvyaTE9o7PfsX4sl2nYorAlY6dLx2cIG11ktS5PZw2Sh6pRf7s3Oa97j Er5dMycyEMa7z0KtrPDE1iCo/wzWlHWRgYalGgLq3Lrim/yhBEUiT9QFZ37OMz20aYooJj 0HsQVyT3/+EPiYbrAE0Glr+GUk6HUjyAjQU6hIASIA0cHfqVh1XfUJpV9PkAQ3h4Ms6J3P PqTfwc3FU6vTtocbxYT3HEarxqqu5DBVG4Qzq6XacWrNdlDuhnh+eVK/qcg7gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676930383; 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=AVCXJkB+rB/b6WQuOgb2r94feYJeqrg1oXOw8m7YMzM=; b=wK79kyk+5nBlzCUfFEn8QD43O+XmpOBvzzrv4DIm47zOSnsm7BIgyshi/qPcumIirJ6znF zDGr+uKHw/HRyQqA2l/yxJJDEZ+c9ge3u7aoE0RFi3dNJ78zWOk1pQyvZ1Gi3wdflQwvWd ApRURbNvRoY7FAZVLUrWdi0IgO4ySKWzLrQU69OWk814SfLpg/ynBLp5iWS0F+hyb97sMY VetceEK/g5fW1hl+rQAYad+5vbNNmq9zKPh9Mt8sJgOa/mFJShiXKXwojazEAm3dzv/1O2 9AxsDBjecmV+H2wM1BDxLGcMrGCv4rlgUmp3IwLKRakLLaJgXYNph3otaEs8Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676930383; a=rsa-sha256; cv=none; b=LDw3GOEmJzR9nlV19MGP7ORoEUNEl0K0dgH6Cc45HL1D1JGzKvR3N71WmwQRqWzqXuxoby e2IHlk8jN6+8aF2MlzLLRWJRJroT9YlLB+eCOMyk+THUsEC+poyuAGhUy+iTS3u+qeRfJG MxDj7ZE0wnVEHkI+D9MW8UuGM11OMpvTXb2efSarC1ZlziRFiru07oUjNbJnEHlv346lqk PDIOC+sIG6OoSG7wkf/cW+7mh/6Zxowxb6KHkx57vFpKfLVfIG5MMBb/pfM600JJyqdp9m Ed2NuzASdk+DxCgjgUeRKX/svp7YWNax1RJUF2XeT/j9Vi3f/eWh0Q53hP+QWw== Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PLGYC0PnJzGbG; Mon, 20 Feb 2023 21:59:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f41.google.com with SMTP id nv15so2829823qvb.7; Mon, 20 Feb 2023 13:59:43 -0800 (PST) X-Gm-Message-State: AO0yUKWHlj4D+HItioOt7oyFShDevq+7qusOVzkYndCL0ZzO5cIA9+6n Qzc7etroMWJ7Zw0yJcGlCny4lkT166g73mY1qF4= X-Google-Smtp-Source: AK7set/kN/qsVgkD4+LwlxhepRqm+UlyaGYrbyMhCggXkz+dHZzaEz4Dxyxb2NFrY+ER9Ky+IbGycNmISCoF39/Yx7o= X-Received: by 2002:a0c:cd0c:0:b0:537:2334:7fb3 with SMTP id b12-20020a0ccd0c000000b0053723347fb3mr604480qvm.59.1676930382002; Mon, 20 Feb 2023 13:59:42 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302201855.31KItK45079891@gitrepo.freebsd.org> <870983EF-591C-4685-A133-1E0E37CF0B98@freebsd.org> In-Reply-To: <870983EF-591C-4685-A133-1E0E37CF0B98@freebsd.org> From: Kyle Evans Date: Mon, 20 Feb 2023 15:59:35 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: cd73914b01a1 - main - kern: physmem: don't truncate addresses in DEBUG output 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" X-ThisMailContainsUnwantedMimeParts: N On Mon, Feb 20, 2023 at 1:41 PM Jessica Clarke wrote: > > On 20 Feb 2023, at 18:55, Kyle Evans wrote: > > > > The branch main has been updated by kevans: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=cd73914b01a1f2300e587f802383cc563f2e7103 > > > > commit cd73914b01a1f2300e587f802383cc563f2e7103 > > Author: Kyle Evans > > AuthorDate: 2023-02-20 18:54:00 +0000 > > Commit: Kyle Evans > > CommitDate: 2023-02-20 18:55:04 +0000 > > > > kern: physmem: don't truncate addresses in DEBUG output > > > > Make it consistent with the above region printing, otherwise it appears > > to be somewhat confusing. > > --- > > sys/kern/subr_physmem.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c > > index bb6af5a580aa..d371e1e166c5 100644 > > --- a/sys/kern/subr_physmem.c > > +++ b/sys/kern/subr_physmem.c > > @@ -149,10 +149,10 @@ physmem_dump_tables(int (*prfunc)(const char *, ...)) > > #ifdef DEBUG > > prfunc("Avail lists:\n"); > > for (i = 0; phys_avail[i] != 0; ++i) { > > - prfunc(" phys_avail[%d] 0x%08x\n", i, phys_avail[i]); > > + prfunc(" phys_avail[%d] 0x%08jx\n", i, phys_avail[i]); > > You need to actually cast them though for 32-bit. > Huh, interesting; wasn't there a compiler warning for this? armv7 and riscv both seemed to have built fine (+ DEBUG), am I misremembering that and it's just a potential source of garbage at runtime? Thanks, Kyle Evans From nobody Mon Feb 20 22:00:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLGYy2ttYz3sGDg; Mon, 20 Feb 2023 22:00:22 +0000 (UTC) (envelope-from kevans@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 4PLGYy2JR9z3qNg; Mon, 20 Feb 2023 22:00:22 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676930422; 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=UQLqwpQIJUARh4XtOuQEquhFym9ZDqVszmJQUbCeDIY=; b=tY4QCx1IfPp7pSLz7IUV3kM17WWUFVJOasYFwkRTQOZEnhXmVCCxWLDUO2H1c1//Eq5zRi aNJDf6rkDPK+G+USQVGH71X+VJ56Ll1nctASVdSME5XFioo28MPcCWEdgG19THi2ng37DO ttA0M2qW4cU1F4UvgRjnMMs+hmsKJAhfc9gzA4v26/RtIx2V1hl3n8sYltV+eyKlH+sElr ibjxNqwM5SN3aHEJdLWpCEq5ORzqGcLcY96NZBVHfL/v62PMlTx5+KEGL1KHzATKQX/Z1j mbigqAhBKvXMvy56XlzBHXxJUVrpKpNLOvYj99U4AG3A1gbNoFM0Lj+Sbt6vCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676930422; 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=UQLqwpQIJUARh4XtOuQEquhFym9ZDqVszmJQUbCeDIY=; b=uDTJO81t5bINUvi7vlM/1wD7TygmGY+WFHWY3vEZiOmB0k6VOfvcK9zSn51z80fbSRKKdE oPUoLyY8ZfkrHUaq4ACZQnw/jxGjN0i1rNBmNpXzCdxisZmIg4d3oUTmxsAuFioTxZftBT Sq/hb9CEqMN5JsRd+9P7W3CPwbMeA0aAkhvyJlY3z6Q+Go3EtR2/NipjCTWjtQPTbUvLCV 5q2+cAlDv2Oaf/vyppXQUPQlWVzsCmTBjSnVVhOjFVQ15AyUtFLa1xVohddB/PFw1tEPtN UB8FUGYrA4wAM0vFXREkPC+OW9O4E2yIo1/IsrmIEW7o2Zh2dO5u6lXKyF7RIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676930422; a=rsa-sha256; cv=none; b=lyR03eU5+qSteFwBVQez4lRSVNAsYIRTscpm3PiO6k5v3sDMtlBcoo9Can0Oua/ylwKN1x KERdc/lF3xfo5L/eKSBA+6wF4DC/KDlwvvv/BrJxdV73Soc4LVyHHFElkkZib+M5d6/Y+k WWJ/KCBgw7pB9AbHnk6NWZ4iUVcBMJdaByrXZnn7P6IQyz0gAeGQRC7a9zVNZSMGhovQU2 h8lbPzaDmc6+yk/veQpSGP54N5JOH7NyjHEe5ian7TZqr27OkIiEu87CCxiOIWnBMNi/v9 mC/qmzHMuBWJXnkU5pnrpa5gm1BT95+h2AbSmmY6haCudKEnIDV9mg2MQoMcEg== Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PLGYy1Kx0zG8G; Mon, 20 Feb 2023 22:00:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f44.google.com with SMTP id nf5so2713655qvb.5; Mon, 20 Feb 2023 14:00:22 -0800 (PST) X-Gm-Message-State: AO0yUKXJIZT6je//3RgAft/Z3Pye0WqQtj1bAar0K++ceGfU91SZwGFZ ryV+XTY+qdtNgbuqiugmugBA3Aa/5rN6g955gLs= X-Google-Smtp-Source: AK7set9MREMYxwXjxfm36TQ/6mk6C4tT54v5psU8OEHWjYsPS1rPwyGuS+AF4xeWekDfl1RhCSHOWAdyBPP4EQVvNgE= X-Received: by 2002:a0c:cd0c:0:b0:537:2334:7fb3 with SMTP id b12-20020a0ccd0c000000b0053723347fb3mr604758qvm.59.1676930421600; Mon, 20 Feb 2023 14:00:21 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302201855.31KItK45079891@gitrepo.freebsd.org> <870983EF-591C-4685-A133-1E0E37CF0B98@freebsd.org> In-Reply-To: From: Kyle Evans Date: Mon, 20 Feb 2023 16:00:15 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: cd73914b01a1 - main - kern: physmem: don't truncate addresses in DEBUG output To: Kyle Evans 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" X-ThisMailContainsUnwantedMimeParts: N On Mon, Feb 20, 2023 at 3:59 PM Kyle Evans wrote: > > On Mon, Feb 20, 2023 at 1:41 PM Jessica Clarke wrote: > > > > On 20 Feb 2023, at 18:55, Kyle Evans wrote: > > > > > > The branch main has been updated by kevans: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=cd73914b01a1f2300e587f802383cc563f2e7103 > > > > > > commit cd73914b01a1f2300e587f802383cc563f2e7103 > > > Author: Kyle Evans > > > AuthorDate: 2023-02-20 18:54:00 +0000 > > > Commit: Kyle Evans > > > CommitDate: 2023-02-20 18:55:04 +0000 > > > > > > kern: physmem: don't truncate addresses in DEBUG output > > > > > > Make it consistent with the above region printing, otherwise it appears > > > to be somewhat confusing. > > > --- > > > sys/kern/subr_physmem.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c > > > index bb6af5a580aa..d371e1e166c5 100644 > > > --- a/sys/kern/subr_physmem.c > > > +++ b/sys/kern/subr_physmem.c > > > @@ -149,10 +149,10 @@ physmem_dump_tables(int (*prfunc)(const char *, ...)) > > > #ifdef DEBUG > > > prfunc("Avail lists:\n"); > > > for (i = 0; phys_avail[i] != 0; ++i) { > > > - prfunc(" phys_avail[%d] 0x%08x\n", i, phys_avail[i]); > > > + prfunc(" phys_avail[%d] 0x%08jx\n", i, phys_avail[i]); > > > > You need to actually cast them though for 32-bit. > > > > Huh, interesting; wasn't there a compiler warning for this? armv7 and > riscv both seemed to have built fine (+ DEBUG), am I misremembering > that and it's just a potential source of garbage at runtime? > Oh, well, riscv isn't 32-bit anyways. Still stands for armv7, though. From nobody Mon Feb 20 22:13:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLGs34Y1Tz3sGtt; Mon, 20 Feb 2023 22:13: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 4PLGs343dPz3rZm; Mon, 20 Feb 2023 22:13:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676931207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eiJjiuwpiDk2FwP202GV3ix7fbBoYa/zERU6IDEPc+4=; b=h+9xKYqQYrECJOweJakMdxMxgISxZ/Sw6jo2yyizHvfO5TrTTKfZLVOaLaFxprjOxN6iI6 BLCB4DkaU/6tWhJ83lHhooJvq5JZeHk5aQCez2TfVsVVY1rq3m9aHA6Nuk5hCufwwTmJXp oistFfrhXzOIG7w/6tF4zr7hD74h44O3dwr7+/Pkc0mAFmOL9c5rgbG1kMzoEecmw6Ekwr hv5jVUlFpwTRJFyO4Bu1t+ej+5gT01k1CPLFwZablytGPvsQuT8qdXMtaiFf4N9leKD++6 VvQMdmWn9ObESV6HxsMoxT0OLNDdQRI13v0vDbUaF5nTdvvMdDYTnsU8Uy+l0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676931207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eiJjiuwpiDk2FwP202GV3ix7fbBoYa/zERU6IDEPc+4=; b=StZPyMyRV1uB+L4SltKfNo0aIKdARjBJTT16esJ8sBR4BPt3LxzyQvLNDO91bj1osAX+ke jpr9IapeFPHz4j4yDWeEIMlhbg/bVhG8g11/lV2Jp4XcdUX4K5vLMsXVxn/1B+rksCDUN6 785eRh318rQhWEDKbM7TG6ryzSf21tJuJmaKe2gHxVorGl3tu9+XR7tLZ9F0T64VnAUIPL LNzB88xHwn+pf0gPDXwTKSHWFdAX7Q+rMCKHEP39jFIDtaDK9hAAlRrsRKXngnRq5tPXso UH44Pj53kOjAHto6LSv6lbsbFu7vs01mHM68OIwBJ2HG6DPLxTzzsrulNVr8/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676931207; a=rsa-sha256; cv=none; b=LE26AiynoK2yhpw96hDKuNuygpLd4AXjGUiQVAPCmTDC3lKMfPV9zTgO6WcDm56qgyzlf3 0Nr3i1kwu4t5GOF2lulLzsOyI1D7S/5n3aG+cXOzN1Q+jgqepAdFwjNCYWscJGRuABgKVL shJnp7mYInBw8X4iMFQaOJT6WzR/xQ9MK45VKKoBlsNp8Xi8qn3sKAdhIj1gRCXLQwJ2m7 /4p1nX3EIysnkKSWtMktLPcT2Z7ISJYj7MCkCx6agoQMGdGpEr8B2iZTjbksVvX2uLRr+3 jvqKG5dDSHaUIP+JdsO9SU9QzyGAEHSKmkCBCCvLnZI/6+evMEopb9FX9/uKDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLGs337hGzxrV; Mon, 20 Feb 2023 22:13: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 31KMDRXj067393; Mon, 20 Feb 2023 22:13:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KMDRP9067392; Mon, 20 Feb 2023 22:13:27 GMT (envelope-from git) Date: Mon, 20 Feb 2023 22:13:27 GMT Message-Id: <202302202213.31KMDRP9067392@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: 7b5cb32fca26 - main - kern: physmem: properly cast %jx arguments to uintmax_t List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b5cb32fca26428b8c0df98f9c58444557f808ae Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7b5cb32fca26428b8c0df98f9c58444557f808ae commit 7b5cb32fca26428b8c0df98f9c58444557f808ae Author: Kyle Evans AuthorDate: 2023-02-20 22:11:44 +0000 Commit: Kyle Evans CommitDate: 2023-02-20 22:12:55 +0000 kern: physmem: properly cast %jx arguments to uintmax_t While we're here, slap prfunc with a __printflike to get compiler checking on args to catch silly mistakes like this. Reported by: jrtc27 --- sys/kern/subr_physmem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c index d371e1e166c5..a53d2cb879eb 100644 --- a/sys/kern/subr_physmem.c +++ b/sys/kern/subr_physmem.c @@ -120,7 +120,7 @@ panic(const char *fmt, ...) * db_printf). */ static void -physmem_dump_tables(int (*prfunc)(const char *, ...)) +physmem_dump_tables(int (*prfunc)(const char *, ...) __printflike(1, 2)) { size_t i; int flags; @@ -149,10 +149,12 @@ physmem_dump_tables(int (*prfunc)(const char *, ...)) #ifdef DEBUG prfunc("Avail lists:\n"); for (i = 0; phys_avail[i] != 0; ++i) { - prfunc(" phys_avail[%d] 0x%08jx\n", i, phys_avail[i]); + prfunc(" phys_avail[%d] 0x%08jx\n", i, + (uintmax_t)phys_avail[i]); } for (i = 0; dump_avail[i] != 0; ++i) { - prfunc(" dump_avail[%d] 0x%08jx\n", i, dump_avail[i]); + prfunc(" dump_avail[%d] 0x%08jx\n", i, + (uintmax_t)dump_avail[i]); } #endif } From nobody Mon Feb 20 22:18:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLGyg32wZz3sHKH; Mon, 20 Feb 2023 22:18:19 +0000 (UTC) (envelope-from se@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 4PLGyg2STBz3rrh; Mon, 20 Feb 2023 22:18:19 +0000 (UTC) (envelope-from se@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676931499; 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=BEwJJe+7KmysjwbXkXiOgaZsw1V0S8WiOV3mbBuvNcg=; b=W62YZgyGqkEx6iMsvGUILnMcX636sbPHSJK1tnLfbH2/Tjpevw+/os/mSJ18/tScJTs5Uz DpMY++4qCcQF5EvEXWGzaQ7NeI+UlmKIV5NBtizc7HlveTEZQyPM0ZZwhvpiQxIWz/ISwP VgptKG1rEkKaYm1flKIPGcSFEIX6nb5tsyFOswPG2kLedO4Sksxa28mUfieh5lOinxXQpH MPFBwQn5JTMRhru8hJDou5j1fPa/t6eYXVJJqJrU0+Iee9veNkYf+D2RlKUWNwM4mdgK9j Ip17EVHkTkzH3/K8jAsgP5wznTrflTLAOWJkzn9TPO8NjDwOnwwK4LuwmTk6GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676931499; 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=BEwJJe+7KmysjwbXkXiOgaZsw1V0S8WiOV3mbBuvNcg=; b=LAfMjwnDIw4wkF1tRGFzh/4Tpz19NX5Uw3Wrvi6S9N1hk35a5yvyIsR99MXySo+uyogm4L nGyoBtb+qd8QxQdge9eAqjfjyzuv36+Q+skfSomU41O3Jj1ipmwyvAZ4Q/26w9bAh9zdKY HBhsONYzjnE1kjmx7LkzL6mRCjj4CawcuTg5vxPkdKwFuT55I2frRkaIZalQXnhkdf3o45 DEagQuDIzVIHCeQ4r1kUALJm6TCp7FyJPasdXrOdqp3uESbtuJSyC9h4QLfBuKkuUTxhMQ fGqi1DRxtW6b/y9xYpqbtWEHuSS1rJs5l0EGjLQmY+zNfnJ5Ivm3jbKU6BGgFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676931499; a=rsa-sha256; cv=none; b=QzgdIHdYVeTeynY88DdQexCZy4xxE48zGFR4VaRhLXvTsBJWI2tOaLTmSv86mV7ApfmQxg gGS09WdZMPKl9gkMK6cmBJRqK5kAOggrm4O2lwTFhKVIOVFzQ0yo02cm+VGQLac4Gr++gM GBSMTRFU9JCtEY4suY2hz5olJDUKyWd/2j0zzfefkUaLz5AWEARujXDV5f7roSEOhT6Hqd 2aqwcAMqWqQLuKVssA5PunWVL8vPlZoIGKaX1R0ox0wh2sMAs+9mQBGXAPGc6vd+IHS7a8 ZOeSUI5jDCy/hsvhNtD3k/UioXo6ynVby64rvDUx0s+//8EMK/x4ocJkKKwqvA== Received: from [IPV6:2003:cd:5f2a:1000:b45f:cfbc:6b74:10b6] (p200300cd5f2a1000b45fcfbc6b7410b6.dip0.t-ipconnect.de [IPv6:2003:cd:5f2a:1000:b45f:cfbc:6b74:10b6]) (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: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PLGyf3XC4zFdZ; Mon, 20 Feb 2023 22:18:18 +0000 (UTC) (envelope-from se@FreeBSD.org) Message-ID: Date: Mon, 20 Feb 2023 23:18:16 +0100 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 From: =?UTF-8?Q?Stefan_E=c3=9fer?= Subject: Re: git: c2bb66023fe3 - main - kbdcontrol: enable pre-Unicode dead key table compatibility Content-Language: de-DE, en-US To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202302141315.31EDFu9Q044384@gitrepo.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N Am 14.02.23 um 15:05 schrieb Jessica Clarke: > On 14 Feb 2023, at 13:15, Stefan Eßer wrote: >> >> 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 > > This doesn’t seem right... COMPAT_FREEBSD* is for kernel not userspace. > Normally this would be a _WANT_FOO. Yes, I know and have explained the reasoning in the commit message: There has been a request for API compatibility of the new kbdcontrol command on an old kernel, even though we do not provide that kind of compatibility in general. Defining COMPAT_FREEBSD13 has the side-effect of making definitions for the API compatibility in the kernel (typically protected with #ifdef _KERNEL) visible in the user-land. A _WANT_FOO definition would have needed to be mapped to COMPAT_FREEBSD13 (and possibly _KERNEL) anyway to have the desired effect. The way this compatibility has been implemented and made conditional on the compatibility ioctls being defined in kbio.h makes it possible to commit the kbdcontrol sources from -CURRENT to -12 and -13 (but *without* this commit to the Makefile!). This would allow to merge later commits applied to this command in -CURRENT to merged back, without causing conflicts. Since this commit (to he Makefile) is meant to be reverted as soon as possible and since it is minimal code bloat when not needed (the binary size on amd64 is unchanged when rounded to 512 byte "sectors", for example), I do not see any use in adding the complexity of a _WANT_FOO option. I plan to revert this commit as soon as I get the information that this kind of compatibility is no longer required (after EoL of 13.1 and release of 14.0, if I understand the reasons for the request for this compatibility correctly). From nobody Mon Feb 20 22:33:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLHJW38N8z3sJ5S; Mon, 20 Feb 2023 22:33: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 4PLHJW1k3Wz3tJ2; Mon, 20 Feb 2023 22:33:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676932427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zn5ok30TLfsaPPB/Oo5JHpTZGUhutBkWkzWiFXccP4k=; b=whQM+UI2ZRcdjMETZd7o1NY/OFg0LYP4H5DDpw6h48idR3K0gEXLafpiA9C0BdlZoQFaX4 OME/W+eN9I9W64OmcciPjcWCdhYt1M/NgvVBFiVybxotN3jPwvZyzNbF8R/dc75U0e704Q pcviHSZYHO6vaouq4E3Gi1kDJvDZmzXOWWmICVRJ71d9IT92M/j1KVYAdATnKa1NdwKQON T7YQB0Z2cw1GlZM3/N/S7O0cXcr28DRQXM9NmU5YAy6q9FkPNMKbwjygPUJPE0cMMbFTAG QIiELoEK7hZbP8vleN5Kq1S/zMgXmMfi8jEqbAsCGYCRiajG50ktJGqJjcCAFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676932427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zn5ok30TLfsaPPB/Oo5JHpTZGUhutBkWkzWiFXccP4k=; b=gJomJ74FJKYdOfD0QAR52RSKDqdyJgVrkp0UP1NqyH1meRKuYkWIkIX6fG8wNifCU7KFQX 6Sh5O8ABp54I9Lpg+7P0r+hGTOorxE3X+I5kkqaOzki667WH1L7K1be8D4C4VLkXWXY4A2 dKLTDGxsDXnrnl/YyWEV63OOqB52yTQfdlcObTd+evOnYv1VmrtszGtO/W240P4KtO1lan gOVV3e4o3FjBW44yhvigB3L9UGmOTtVRnypDPFsst9MyPIm8j+mI2dwyHuREWGdrE2WWJd 21l8AjDy4sBnhkSw4veYCH6ZM0BJzND0MGiHxQvTH4La/825Iexo02D3GxnM6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676932427; a=rsa-sha256; cv=none; b=HEj33gMs2zYki5lQ7BQ3+WenvkuhUeOhV502JDtEayCmTaYWDS+GfOTM/3Isk708BM5uts SzW61TG+5JqDPFmxLb/VwQjaIV1XORt5SJBgqIs+IHzpWbJZWJL5ZUz1lOgTBBThV9HMBs Z2MQryevX5wmf5k7SWuUmCpLNHnEjLtUQ8AiS8LgdC8dOUqIVHdSWRGOnV4QCJ6vo1ol2M 7Fnx/BXj+IfFQebxIjgarGGgFtTcI2PyUXxqChsXeW8hfdRqSlzlL7vA/lhwAU7MuuauyK 898Qxp1DPmlZtSTDoVl2ZdW8pa6AEtuar3iRThXG9Igc3ZdFmXs7//hISNliRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLHJW0pTGzy14; Mon, 20 Feb 2023 22:33: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 31KMXlvc096189; Mon, 20 Feb 2023 22:33:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KMXl8q096188; Mon, 20 Feb 2023 22:33:47 GMT (envelope-from git) Date: Mon, 20 Feb 2023 22:33:47 GMT Message-Id: <202302202233.31KMXl8q096188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: b16a37eda8b1 - main - bblog: sync tcp_log_events with Netflix tree List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b16a37eda8b1074767d8bc6c2508a28cf1d99270 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b16a37eda8b1074767d8bc6c2508a28cf1d99270 commit b16a37eda8b1074767d8bc6c2508a28cf1d99270 Author: Michael Tuexen AuthorDate: 2023-02-20 20:42:57 +0000 Commit: Michael Tuexen CommitDate: 2023-02-20 20:42:57 +0000 bblog: sync tcp_log_events with Netflix tree This allows the addition of entries to tcp_log_events without causing conflicts in the Netflix tree. rrs@ will upstream the related functional changes eventually. Reviewed by: guest-ccui@, rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D38646 --- sys/netinet/tcp_log_buf.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 48bc584aa0dc..3c6569cffafd 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -238,7 +238,9 @@ enum tcp_log_events { TCP_HYSTART, /* TCP Hystart logging 65 */ TCP_CHG_QUERY, /* Change query during fnc_init() 66 */ TCP_RACK_LOG_COLLAPSE, /* Window collapse by peer 67 */ - TCP_LOG_END /* End (keep at end) 68 */ + TCP_RACK_TP_TRIGGERED, /* A rack tracepoint is triggered 68 */ + TCP_HYBRID_PACING_LOG, /* Hybrid pacing log 69 */ + TCP_LOG_END /* End (keep at end) 70 */ }; enum tcp_log_states { From nobody Mon Feb 20 22:37:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLHNr29trz3sJQT; Mon, 20 Feb 2023 22:37: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 4PLHNr1hkKz3tkm; Mon, 20 Feb 2023 22:37:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676932652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0E2Kzsju8aMmcc1BfX8y046cpZmBY3Y2FuvYRcN5jyk=; b=EkVRPTgasrFg6XdUwruZyBlc22d0qt6dNwUZ60QobSvXZKOlRzbEp9jkD8PQWihYlmVJox nUsZR7uEBo0j1+olXDZfS7rnAabmYm89S5GGVeLASX6gMjJdPjqoAnbacmEQNYwI6NjEIX pi25pJbWysq9fROwgJOydXOBcHv411KIgFPzMvxT2JzmG3uKeeQvMFOEasHdAbebe1QC6L ieoldtdUgyiiraz9NTfQY+ckZg5mebtzPj/jdZMIyw53jtH60Jh+KpnqjsF65+ULQh5hH2 k6zsv4wCJyaQm452VOsiROr4UrcWJWbZeQp5fyEx9RO+FfmfAOfeGd1yWxoA5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676932652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0E2Kzsju8aMmcc1BfX8y046cpZmBY3Y2FuvYRcN5jyk=; b=B8tWKCz8+UWOiUkp7t9y8VaNxYrTOi/Y7dikp4sEoxs2R4EkB99zpDLWHRd78qygpFT1SA usI7uNDu7TF2fMoLf26q0eNogXgC9qMwN+oMDJzX3PFEoZF+NvJ7jJw7FvoHYeERPR/QSv LhqQ01THw53LCpmLmgmc4q7RFxvxe/muzQE2jJWfj2aoLgUBJJXxe0Bd8rcsj9vOUS/0be 4mL1DY49dcBzbdSEpHHTMqOclxi75dU+ZIbb4d8hsm2FIlK5dnaGm+NwPficLcVkgdRXuP iqncl0OJPWyygGbweKSWqc+xYAjc1nOGf9f19dTL4jR3j886P1phld7osDARBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676932652; a=rsa-sha256; cv=none; b=oSr0I+EOw+MOZe6mxSjqsTFEPdpRj2H4rzX28Wk2m1pSLQ9JP1XVfiZ8kj1rXo5uGAOwuu f8qbnBzTmQofPfbnPiEWPJeU4R0mYMzKcC0bZcuSUaUV2m2TXez5yG2NfWeaniPROGT/D7 LQKjoWLav/eJA+ivhTcxpMl49E2HFnRZZZGsHQNe2VG0eK3kGReTfhtJ+veGVrNeoQm/cx Zf7H7N1Sfdm2wPK/5bJf2oPmt6tSCg+h/3wQJ05+jDkFrL8FBCxhmkczLy6ZgbeeaotpfS hdUv4jY66QnkjHFpueKxIPEVzoSaTrZMmIXNvNNzNmI6H8SdJVsRyjE2iBlrVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLHNr0T0mzyHP; Mon, 20 Feb 2023 22:37: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 31KMbWWW096752; Mon, 20 Feb 2023 22:37:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31KMbViu096747; Mon, 20 Feb 2023 22:37:31 GMT (envelope-from git) Date: Mon, 20 Feb 2023 22:37:31 GMT Message-Id: <202302202237.31KMbViu096747@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: 8e022d3cdea1 - main - byacc: Update to 20230201. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e022d3cdea10ee1039a632f670c27fd93f65625 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=8e022d3cdea10ee1039a632f670c27fd93f65625 commit 8e022d3cdea10ee1039a632f670c27fd93f65625 Merge: b16a37eda8b1 cba5e8978cf6 Author: Dag-Erling Smørgrav AuthorDate: 2023-02-20 22:35:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-20 22:35:32 +0000 byacc: Update to 20230201. Note that this enables the backtracking extension, which we had previously left disabled. PR: 244149, 269425 Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38421 contrib/byacc/CHANGES | 2950 +++++++++++++++- contrib/byacc/MANIFEST | 102 +- contrib/byacc/VERSION | 2 +- contrib/byacc/aclocal.m4 | 493 ++- contrib/byacc/btyaccpar.c | 4 +- contrib/byacc/btyaccpar.skel | 4 +- contrib/byacc/closure.c | 36 +- contrib/byacc/config.guess | 1203 ++++--- contrib/byacc/config.sub | 655 ++-- contrib/byacc/config_h.in | 6 + contrib/byacc/configure | 3730 ++++++++++++-------- contrib/byacc/configure.in | 24 +- contrib/byacc/defs.h | 136 +- contrib/byacc/graph.c | 12 +- contrib/byacc/install-sh | 671 ++-- contrib/byacc/lalr.c | 41 +- contrib/byacc/lr0.c | 36 +- contrib/byacc/main.c | 153 +- contrib/byacc/makefile.in | 12 +- contrib/byacc/mkpar.c | 30 +- contrib/byacc/output.c | 101 +- contrib/byacc/package/byacc.spec | 74 +- contrib/byacc/package/debian/changelog | 103 + contrib/byacc/package/debian/compat | 1 - contrib/byacc/package/debian/control | 29 +- contrib/byacc/package/debian/copyright | 115 +- contrib/byacc/package/debian/docs | 4 - contrib/byacc/package/debian/postinst | 15 - contrib/byacc/package/debian/prerm | 12 - contrib/byacc/package/debian/rules | 148 +- contrib/byacc/package/debian/watch | 22 +- contrib/byacc/package/mingw-byacc.spec | 45 +- contrib/byacc/package/pkgsrc/Makefile | 14 +- contrib/byacc/reader.c | 211 +- contrib/byacc/test/btyacc/big_b.error | 11 + contrib/byacc/test/btyacc/big_l.error | 11 + contrib/byacc/test/btyacc/btyacc_calc1.tab.c | 36 +- contrib/byacc/test/btyacc/btyacc_calc1.tab.h | 2 +- contrib/byacc/test/btyacc/btyacc_demo.tab.c | 176 +- contrib/byacc/test/btyacc/btyacc_demo.tab.h | 2 +- contrib/byacc/test/btyacc/btyacc_destroy1.tab.c | 21 +- contrib/byacc/test/btyacc/btyacc_destroy1.tab.h | 2 +- contrib/byacc/test/btyacc/btyacc_destroy2.tab.c | 21 +- contrib/byacc/test/btyacc/btyacc_destroy2.tab.h | 2 +- contrib/byacc/test/btyacc/btyacc_destroy3.tab.c | 21 +- contrib/byacc/test/btyacc/btyacc_destroy3.tab.h | 2 +- contrib/byacc/test/btyacc/calc.tab.c | 23 +- contrib/byacc/test/btyacc/calc1.tab.c | 35 +- contrib/byacc/test/btyacc/calc1.tab.h | 2 +- contrib/byacc/test/btyacc/calc2.tab.c | 23 +- contrib/byacc/test/btyacc/calc3.tab.c | 23 +- contrib/byacc/test/btyacc/calc_code_all.tab.c | 23 +- contrib/byacc/test/btyacc/calc_code_default.tab.c | 23 +- contrib/byacc/test/btyacc/calc_code_imports.tab.c | 23 +- contrib/byacc/test/btyacc/calc_code_provides.tab.c | 23 +- contrib/byacc/test/btyacc/calc_code_requires.tab.c | 23 +- contrib/byacc/test/btyacc/calc_code_top.tab.c | 23 +- contrib/byacc/test/btyacc/code_calc.code.c | 23 +- contrib/byacc/test/btyacc/code_error.code.c | 6 +- contrib/byacc/test/btyacc/defines1.calc.c | 23 +- contrib/byacc/test/btyacc/defines2.calc.c | 23 +- contrib/byacc/test/btyacc/defines3.calc.c | 23 +- contrib/byacc/test/btyacc/empty.tab.c | 6 +- contrib/byacc/test/btyacc/err_inherit1.tab.c | 4 +- contrib/byacc/test/btyacc/err_inherit2.tab.c | 4 +- contrib/byacc/test/btyacc/err_inherit3.tab.c | 29 +- contrib/byacc/test/btyacc/err_inherit3.tab.h | 2 +- contrib/byacc/test/btyacc/err_inherit4.tab.c | 27 +- contrib/byacc/test/btyacc/err_inherit4.tab.h | 2 +- contrib/byacc/test/btyacc/err_inherit5.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax1.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax10.tab.c | 6 +- contrib/byacc/test/btyacc/err_syntax11.tab.c | 6 +- contrib/byacc/test/btyacc/err_syntax12.tab.c | 6 +- contrib/byacc/test/btyacc/err_syntax13.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax14.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax15.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax16.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax17.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax18.tab.c | 9 +- contrib/byacc/test/btyacc/err_syntax19.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax2.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax20.tab.c | 9 +- contrib/byacc/test/btyacc/err_syntax21.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax22.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax23.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax24.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax25.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax26.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax27.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax3.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax4.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax5.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax6.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax7.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax7a.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax7b.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax8.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax8a.tab.c | 4 +- contrib/byacc/test/btyacc/err_syntax9.tab.c | 4 +- contrib/byacc/test/btyacc/error.tab.c | 6 +- contrib/byacc/test/btyacc/expr.oxout.tab.c | 114 +- contrib/byacc/test/btyacc/expr.oxout.tab.h | 10 +- contrib/byacc/test/btyacc/grammar.tab.c | 90 +- contrib/byacc/test/btyacc/help.error | 11 + contrib/byacc/test/btyacc/inherit0.tab.c | 19 +- contrib/byacc/test/btyacc/inherit1.tab.c | 21 +- contrib/byacc/test/btyacc/inherit1.tab.h | 2 +- contrib/byacc/test/btyacc/inherit2.tab.c | 28 +- contrib/byacc/test/btyacc/inherit2.tab.h | 2 +- contrib/byacc/test/btyacc/no_b_opt.error | 11 + contrib/byacc/test/btyacc/no_output2.error | 11 + contrib/byacc/test/btyacc/no_p_opt.error | 11 + contrib/byacc/test/btyacc/nostdin.error | 11 + contrib/byacc/test/btyacc/ok_syntax1.tab.c | 25 +- contrib/byacc/test/btyacc/ok_syntax1.tab.h | 2 +- contrib/byacc/test/btyacc/pure_calc.tab.c | 23 +- contrib/byacc/test/btyacc/pure_error.tab.c | 6 +- contrib/byacc/test/btyacc/quote_calc-s.tab.c | 23 +- contrib/byacc/test/btyacc/quote_calc.tab.c | 23 +- contrib/byacc/test/btyacc/quote_calc2-s.tab.c | 23 +- contrib/byacc/test/btyacc/quote_calc2.tab.c | 23 +- contrib/byacc/test/btyacc/quote_calc3-s.tab.c | 23 +- contrib/byacc/test/btyacc/quote_calc3.tab.c | 23 +- contrib/byacc/test/btyacc/quote_calc4-s.tab.c | 23 +- contrib/byacc/test/btyacc/quote_calc4.tab.c | 23 +- contrib/byacc/test/btyacc/rename_debug.c | 6 +- contrib/byacc/test/btyacc/stdin1.calc.c | 23 +- contrib/byacc/test/btyacc/stdin2.calc.c | 23 +- contrib/byacc/test/btyacc/varsyntax_calc1.tab.c | 35 +- contrib/byacc/test/btyacc/varsyntax_calc1.tab.h | 2 +- contrib/byacc/test/expr.oxout.y | 18 +- contrib/byacc/test/run_lint.sh | 11 +- contrib/byacc/test/run_make.sh | 39 +- contrib/byacc/test/run_test.sh | 69 +- contrib/byacc/test/yacc/big_b.error | 11 + contrib/byacc/test/yacc/big_l.error | 11 + contrib/byacc/test/yacc/calc.tab.c | 25 +- contrib/byacc/test/yacc/calc1.tab.c | 37 +- contrib/byacc/test/yacc/calc1.tab.h | 2 +- contrib/byacc/test/yacc/calc2.tab.c | 25 +- contrib/byacc/test/yacc/calc3.tab.c | 25 +- contrib/byacc/test/yacc/calc_code_all.tab.c | 25 +- contrib/byacc/test/yacc/calc_code_default.tab.c | 25 +- contrib/byacc/test/yacc/calc_code_imports.tab.c | 25 +- contrib/byacc/test/yacc/calc_code_provides.tab.c | 25 +- contrib/byacc/test/yacc/calc_code_requires.tab.c | 25 +- contrib/byacc/test/yacc/calc_code_top.tab.c | 25 +- contrib/byacc/test/yacc/code_calc.code.c | 25 +- contrib/byacc/test/yacc/code_error.code.c | 8 +- contrib/byacc/test/yacc/defines1.calc.c | 25 +- contrib/byacc/test/yacc/defines2.calc.c | 25 +- contrib/byacc/test/yacc/defines3.calc.c | 25 +- contrib/byacc/test/yacc/empty.tab.c | 8 +- contrib/byacc/test/yacc/err_syntax1.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax10.tab.c | 8 +- contrib/byacc/test/yacc/err_syntax11.tab.c | 8 +- contrib/byacc/test/yacc/err_syntax12.tab.c | 8 +- contrib/byacc/test/yacc/err_syntax13.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax14.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax15.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax16.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax17.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax18.tab.c | 11 +- contrib/byacc/test/yacc/err_syntax19.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax2.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax20.tab.c | 11 +- contrib/byacc/test/yacc/err_syntax21.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax22.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax23.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax24.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax25.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax26.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax27.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax3.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax4.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax5.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax6.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax7.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax7a.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax7b.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax8.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax8a.tab.c | 4 +- contrib/byacc/test/yacc/err_syntax9.tab.c | 4 +- contrib/byacc/test/yacc/error.tab.c | 8 +- contrib/byacc/test/yacc/expr.oxout.tab.c | 104 +- contrib/byacc/test/yacc/expr.oxout.tab.h | 4 +- contrib/byacc/test/yacc/grammar.tab.c | 92 +- contrib/byacc/test/yacc/help.error | 11 + contrib/byacc/test/yacc/no_b_opt.error | 11 + contrib/byacc/test/yacc/no_output2.error | 11 + contrib/byacc/test/yacc/no_p_opt.error | 11 + contrib/byacc/test/yacc/nostdin.error | 11 + contrib/byacc/test/yacc/ok_syntax1.tab.c | 27 +- contrib/byacc/test/yacc/ok_syntax1.tab.h | 2 +- contrib/byacc/test/yacc/pure_calc.tab.c | 25 +- contrib/byacc/test/yacc/pure_error.tab.c | 8 +- contrib/byacc/test/yacc/quote_calc-s.tab.c | 25 +- contrib/byacc/test/yacc/quote_calc.tab.c | 25 +- contrib/byacc/test/yacc/quote_calc2-s.tab.c | 25 +- contrib/byacc/test/yacc/quote_calc2.tab.c | 25 +- contrib/byacc/test/yacc/quote_calc3-s.tab.c | 25 +- contrib/byacc/test/yacc/quote_calc3.tab.c | 25 +- contrib/byacc/test/yacc/quote_calc4-s.tab.c | 25 +- contrib/byacc/test/yacc/quote_calc4.tab.c | 25 +- contrib/byacc/test/yacc/rename_debug.c | 8 +- contrib/byacc/test/yacc/stdin1.calc.c | 25 +- contrib/byacc/test/yacc/stdin2.calc.c | 25 +- contrib/byacc/test/yacc/varsyntax_calc1.tab.c | 37 +- contrib/byacc/test/yacc/varsyntax_calc1.tab.h | 2 +- contrib/byacc/verbose.c | 64 +- contrib/byacc/warshall.c | 10 +- contrib/byacc/yacc.1 | 67 +- contrib/byacc/yaccpar.c | 6 +- contrib/byacc/yaccpar.skel | 6 +- usr.bin/yacc/config.h | 22 +- 216 files changed, 9925 insertions(+), 4290 deletions(-) diff --cc contrib/byacc/reader.c index 3bbf9a79c187,5e8ca67bc648..85d6506e0a1f --- a/contrib/byacc/reader.c +++ b/contrib/byacc/reader.c @@@ -898,9 -907,8 +907,8 @@@ copy_union(void puts_both("#ifndef YYSTYPE_IS_DECLARED\n"); puts_both("#define YYSTYPE_IS_DECLARED 1\n"); - if (!lflag) - fprintf(text_file, line_format, lineno, input_file_name); + fprintf_lineno(text_file, lineno, input_file_name); - puts_both("typedef union YYSTYPE"); + puts_both("typedef union"); depth = 0; loop: diff --cc contrib/byacc/test/btyacc/calc.tab.c index 906a4b4e04d8,000000000000..b90dc3b1c9db mode 100644,000000..100644 --- a/contrib/byacc/test/btyacc/calc.tab.c +++ b/contrib/byacc/test/btyacc/calc.tab.c @@@ -1,1474 -1,0 +1,1489 @@@ +/* original parser id follows */ +/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ +/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ + +#define YYBYACC 1 - #define YYMAJOR 1 - #define YYMINOR 9 ++#define YYMAJOR 2 ++#define YYMINOR 0 +#define YYCHECK "yyyymmdd" + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) +#define YYENOMEM (-2) +#define YYEOF 0 +#undef YYBTYACC +#define YYBTYACC 0 +#define YYDEBUGSTR YYPREFIX "debug" + +#ifndef yyparse +#define yyparse calc_parse +#endif /* yyparse */ + +#ifndef yylex +#define yylex calc_lex +#endif /* yylex */ + +#ifndef yyerror +#define yyerror calc_error +#endif /* yyerror */ + +#ifndef yychar +#define yychar calc_char +#endif /* yychar */ + +#ifndef yyval +#define yyval calc_val +#endif /* yyval */ + +#ifndef yylval +#define yylval calc_lval +#endif /* yylval */ + +#ifndef yydebug +#define yydebug calc_debug +#endif /* yydebug */ + +#ifndef yynerrs +#define yynerrs calc_nerrs +#endif /* yynerrs */ + +#ifndef yyerrflag +#define yyerrflag calc_errflag +#endif /* yyerrflag */ + +#ifndef yylhs +#define yylhs calc_lhs +#endif /* yylhs */ + +#ifndef yylen +#define yylen calc_len +#endif /* yylen */ + +#ifndef yydefred +#define yydefred calc_defred +#endif /* yydefred */ + +#ifndef yystos +#define yystos calc_stos +#endif /* yystos */ + +#ifndef yydgoto +#define yydgoto calc_dgoto +#endif /* yydgoto */ + +#ifndef yysindex +#define yysindex calc_sindex +#endif /* yysindex */ + +#ifndef yyrindex +#define yyrindex calc_rindex +#endif /* yyrindex */ + +#ifndef yygindex +#define yygindex calc_gindex +#endif /* yygindex */ + +#ifndef yytable +#define yytable calc_table +#endif /* yytable */ + +#ifndef yycheck +#define yycheck calc_check +#endif /* yycheck */ + +#ifndef yyname +#define yyname calc_name +#endif /* yyname */ + +#ifndef yyrule +#define yyrule calc_rule +#endif /* yyrule */ + +#if YYBTYACC + +#ifndef yycindex +#define yycindex calc_cindex +#endif /* yycindex */ + +#ifndef yyctable +#define yyctable calc_ctable +#endif /* yyctable */ + +#endif /* YYBTYACC */ + +#define YYPREFIX "calc_" + +#define YYPURE 0 + +#line 2 "calc.y" +# include +# include + +int regs[26]; +int base; + +extern int yylex(void); +static void yyerror(const char *s); + +#line 131 "calc.tab.c" + +#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) +/* Default: YYSTYPE is the semantic value type. */ +typedef int YYSTYPE; +# define YYSTYPE_IS_DECLARED 1 +#endif + +/* compatibility with bison */ +#ifdef YYPARSE_PARAM +/* compatibility with FreeBSD */ +# ifdef YYPARSE_PARAM_TYPE +# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) +# else +# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) +# endif +#else +# define YYPARSE_DECL() yyparse(void) +#endif + +/* Parameters sent to lex. */ +#ifdef YYLEX_PARAM +# define YYLEX_DECL() yylex(void *YYLEX_PARAM) +# define YYLEX yylex(YYLEX_PARAM) +#else +# define YYLEX_DECL() yylex(void) +# define YYLEX yylex() +#endif + +/* Parameters sent to yyerror. */ +#ifndef YYERROR_DECL +#define YYERROR_DECL() yyerror(const char *s) +#endif +#ifndef YYERROR_CALL +#define YYERROR_CALL(msg) yyerror(msg) +#endif + +extern int YYPARSE_DECL(); + +#define DIGIT 257 +#define LETTER 258 +#define UMINUS 259 +#define YYERRCODE 256 +typedef int YYINT; +static const YYINT calc_lhs[] = { -1, + 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 3, 3, +}; +static const YYINT calc_len[] = { 2, + 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 1, 1, 1, 2, +}; +static const YYINT calc_defred[] = { 1, + 0, 0, 17, 0, 0, 0, 0, 0, 0, 3, + 0, 15, 14, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, + 10, 11, +}; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) +static const YYINT calc_stos[] = { 0, + 261, 256, 257, 258, 45, 40, 262, 263, 264, 10, + 61, 258, 263, 263, 10, 124, 38, 43, 45, 42, + 47, 37, 257, 263, 41, 263, 263, 263, 263, 263, + 263, 263, +}; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ +static const YYINT calc_dgoto[] = { 1, + 7, 8, 9, +}; +static const YYINT calc_sindex[] = { 0, + -40, -7, 0, -55, -38, -38, 1, -29, -247, 0, + -38, 0, 0, 22, 0, -38, -38, -38, -38, -38, + -38, -38, 0, -29, 0, 51, 60, -20, -20, 0, + 0, 0, +}; +static const YYINT calc_rindex[] = { 0, + 0, 0, 0, 2, 0, 0, 0, 9, -9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 10, 0, -6, 14, 5, 13, 0, + 0, 0, +}; +#if YYBTYACC +static const YYINT calc_cindex[] = { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, +}; +#endif +static const YYINT calc_gindex[] = { 0, + 0, 65, 0, +}; +#define YYTABLESIZE 220 +static const YYINT calc_table[] = { 6, + 16, 6, 10, 13, 5, 11, 5, 22, 17, 23, + 15, 15, 20, 18, 7, 19, 22, 21, 4, 5, + 0, 20, 8, 12, 0, 0, 21, 16, 16, 0, + 0, 16, 16, 16, 13, 16, 0, 16, 15, 15, + 0, 0, 7, 15, 15, 7, 15, 7, 15, 7, + 8, 12, 0, 8, 12, 8, 0, 8, 22, 17, + 0, 0, 25, 20, 18, 0, 19, 0, 21, 13, + 14, 0, 0, 0, 0, 24, 0, 0, 0, 0, + 26, 27, 28, 29, 30, 31, 32, 22, 17, 0, + 0, 0, 20, 18, 16, 19, 22, 21, 0, 0, + 0, 20, 18, 0, 19, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 7, 0, + 0, 0, 0, 0, 0, 0, 8, 12, 0, 0, + 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 3, 4, 3, 12, +}; +static const YYINT calc_check[] = { 40, + 10, 40, 10, 10, 45, 61, 45, 37, 38, 257, + 10, 10, 42, 43, 10, 45, 37, 47, 10, 10, + -1, 42, 10, 10, -1, -1, 47, 37, 38, -1, + -1, 41, 42, 43, 41, 45, -1, 47, 37, 38, + -1, -1, 38, 42, 43, 41, 45, 43, 47, 45, + 38, 38, -1, 41, 41, 43, -1, 45, 37, 38, + -1, -1, 41, 42, 43, -1, 45, -1, 47, 5, + 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, + 16, 17, 18, 19, 20, 21, 22, 37, 38, -1, + -1, -1, 42, 43, 124, 45, 37, 47, -1, -1, + -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, + -1, -1, -1, -1, 124, -1, -1, 124, -1, -1, + -1, -1, -1, -1, -1, 124, -1, -1, 124, -1, + -1, -1, -1, -1, -1, -1, 124, 124, -1, -1, + -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 256, 257, 258, 257, 258, +}; +#if YYBTYACC +static const YYINT calc_ctable[] = { -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, +}; +#endif +#define YYFINAL 1 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 259 +#define YYUNDFTOKEN 265 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) +#if YYDEBUG +static const char *const calc_name[] = { + +"$end",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0, +0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,"error","DIGIT","LETTER","UMINUS","$accept","list","stat","expr","number", +"illegal-symbol", +}; +static const char *const calc_rule[] = { +"$accept : list", +"list :", +"list : list stat '\\n'", +"list : list error '\\n'", +"stat : expr", +"stat : LETTER '=' expr", +"expr : '(' expr ')'", +"expr : expr '+' expr", +"expr : expr '-' expr", +"expr : expr '*' expr", +"expr : expr '/' expr", +"expr : expr '%' expr", +"expr : expr '&' expr", +"expr : expr '|' expr", +"expr : '-' expr", +"expr : LETTER", +"expr : number", +"number : DIGIT", +"number : number DIGIT", + +}; +#endif + +#if YYDEBUG +int yydebug; +#endif + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; +int yynerrs; + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) +YYLTYPE yyloc; /* position returned by actions */ +YYLTYPE yylloc; /* position from the lexer */ +#endif + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) +#ifndef YYLLOC_DEFAULT +#define YYLLOC_DEFAULT(loc, rhs, n) \ +do \ +{ \ + if (n == 0) \ + { \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ + } \ + else \ + { \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ + } \ +} while (0) +#endif /* YYLLOC_DEFAULT */ +#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ +#if YYBTYACC + +#ifndef YYLVQUEUEGROWTH +#define YYLVQUEUEGROWTH 32 +#endif +#endif /* YYBTYACC */ + +/* define the initial stack-sizes */ +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 +#endif +#endif + +#ifndef YYINITSTACKSIZE +#define YYINITSTACKSIZE 200 +#endif + +typedef struct { + unsigned stacksize; + YYINT *s_base; + YYINT *s_mark; + YYINT *s_last; + YYSTYPE *l_base; + YYSTYPE *l_mark; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE *p_base; + YYLTYPE *p_mark; +#endif +} YYSTACKDATA; +#if YYBTYACC + +struct YYParseState_s +{ + struct YYParseState_s *save; /* Previously saved parser state */ + YYSTACKDATA yystack; /* saved parser stack */ + int state; /* saved parser state */ + int errflag; /* saved error recovery status */ + int lexeme; /* saved index of the conflict lexeme in the lexical queue */ + YYINT ctry; /* saved index in yyctable[] for this conflict */ +}; +typedef struct YYParseState_s YYParseState; +#endif /* YYBTYACC */ +/* variables for the parser stack */ +static YYSTACKDATA yystack; +#if YYBTYACC + +/* Current parser state */ +static YYParseState *yyps = 0; + +/* yypath != NULL: do the full parse, starting at *yypath parser state. */ +static YYParseState *yypath = 0; + +/* Base of the lexical value queue */ +static YYSTYPE *yylvals = 0; + +/* Current position at lexical value queue */ +static YYSTYPE *yylvp = 0; + +/* End position of lexical value queue */ +static YYSTYPE *yylve = 0; + +/* The last allocated position at the lexical value queue */ +static YYSTYPE *yylvlim = 0; + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) +/* Base of the lexical position queue */ +static YYLTYPE *yylpsns = 0; + +/* Current position at lexical position queue */ +static YYLTYPE *yylpp = 0; + +/* End position of lexical position queue */ +static YYLTYPE *yylpe = 0; + +/* The last allocated position at the lexical position queue */ +static YYLTYPE *yylplim = 0; +#endif + +/* Current position at lexical token queue */ +static YYINT *yylexp = 0; + +static YYINT *yylexemes = 0; +#endif /* YYBTYACC */ +#line 66 "calc.y" + /* start of programs */ + +int +main (void) +{ + while(!feof(stdin)) { + yyparse(); + } + return 0; +} + +static void +yyerror(const char *s) +{ + fprintf(stderr, "%s\n", s); +} + +int +yylex(void) +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + yylval = c - 'a'; + return ( LETTER ); + } + if( isdigit( c )) { + yylval = c - '0'; + return ( DIGIT ); + } + return( c ); +} +#line 511 "calc.tab.c" + +/* For use in generated program */ +#define yydepth (int)(yystack.s_mark - yystack.s_base) +#if YYBTYACC +#define yytrial (yyps->save) +#endif /* YYBTYACC */ + +#if YYDEBUG +#include /* needed for printf */ +#endif + +#include /* needed for malloc, etc */ +#include /* needed for memset */ + +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(YYSTACKDATA *data) +{ + int i; + unsigned newsize; + YYINT *newss; + YYSTYPE *newvs; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE *newps; +#endif + + if ((newsize = data->stacksize) == 0) + newsize = YYINITSTACKSIZE; + else if (newsize >= YYMAXDEPTH) + return YYENOMEM; + else if ((newsize *= 2) > YYMAXDEPTH) + newsize = YYMAXDEPTH; + + i = (int) (data->s_mark - data->s_base); + newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); + if (newss == NULL) + return YYENOMEM; + + data->s_base = newss; + data->s_mark = newss + i; + + newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); + if (newvs == NULL) + return YYENOMEM; + + data->l_base = newvs; + data->l_mark = newvs + i; + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); + if (newps == NULL) + return YYENOMEM; + + data->p_base = newps; + data->p_mark = newps + i; +#endif + + data->stacksize = newsize; + data->s_last = data->s_base + newsize - 1; + +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize); +#endif + return 0; +} + +#if YYPURE || defined(YY_NO_LEAKS) +static void yyfreestack(YYSTACKDATA *data) +{ + free(data->s_base); + free(data->l_base); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + free(data->p_base); +#endif + memset(data, 0, sizeof(*data)); +} +#else +#define yyfreestack(data) /* nothing */ +#endif /* YYPURE || defined(YY_NO_LEAKS) */ +#if YYBTYACC + +static YYParseState * +yyNewState(unsigned size) +{ + YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState)); + if (p == NULL) return NULL; + + p->yystack.stacksize = size; + if (size == 0) + { + p->yystack.s_base = NULL; + p->yystack.l_base = NULL; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + p->yystack.p_base = NULL; +#endif + return p; + } + p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT)); + if (p->yystack.s_base == NULL) return NULL; + p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE)); + if (p->yystack.l_base == NULL) return NULL; + memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE)); + if (p->yystack.p_base == NULL) return NULL; + memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE)); +#endif + + return p; +} + +static void +yyFreeState(YYParseState *p) +{ + yyfreestack(&p->yystack); + free(p); +} +#endif /* YYBTYACC */ + +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab +#if YYBTYACC +#define YYVALID do { if (yyps->save) goto yyvalid; } while(0) +#define YYVALID_NESTED do { if (yyps->save && \ + yyps->save->save == 0) goto yyvalid; } while(0) +#endif /* YYBTYACC */ + +int +YYPARSE_DECL() +{ + int yym, yyn, yystate, yyresult; +#if YYBTYACC + int yynewerrflag; + YYParseState *yyerrctx = NULL; +#endif /* YYBTYACC */ +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ +#endif +#if YYDEBUG + const char *yys; + + if ((yys = getenv("YYDEBUG")) != NULL) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } + if (yydebug) + fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); +#endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + +#if YYBTYACC + yyps = yyNewState(0); if (yyps == 0) goto yyenomem; + yyps->save = 0; +#endif /* YYBTYACC */ + yym = 0; - yyn = 0; ++ /* yyn is set below */ + yynerrs = 0; + yyerrflag = 0; + yychar = YYEMPTY; + yystate = 0; + +#if YYPURE + memset(&yystack, 0, sizeof(yystack)); +#endif + + if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystack.s_mark = yystack.s_base; + yystack.l_mark = yystack.l_base; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark = yystack.p_base; +#endif + yystate = 0; + *yystack.s_mark = 0; + +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) + { +#if YYBTYACC + do { + if (yylvp < yylve) + { + /* we're currently re-reading tokens */ + yylval = *yylvp++; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylloc = *yylpp++; +#endif + yychar = *yylexp++; + break; + } + if (yyps->save) + { + /* in trial mode; save scanner results for future parse attempts */ + if (yylvp == yylvlim) + { /* Enlarge lexical value queue */ + size_t p = (size_t) (yylvp - yylvals); + size_t s = (size_t) (yylvlim - yylvals); + + s += YYLVQUEUEGROWTH; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; +#endif + yylvp = yylve = yylvals + p; + yylvlim = yylvals + s; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpe = yylpsns + p; + yylplim = yylpsns + s; *** 87059 LINES SKIPPED *** From nobody Mon Feb 20 23:34:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLJfF57H6z3sd55; Mon, 20 Feb 2023 23:34:13 +0000 (UTC) (envelope-from kevans@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 4PLJfF4cQTz40DJ; Mon, 20 Feb 2023 23:34:13 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676936053; 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=dcTBmUDM8cFpauTNCxHMHUZMziip0Rb360r0MLzdHvE=; b=AtS5XKG37H1oe/6pcUNyZzUGuK/5OArM8xGTfMEPKkLjTxdvUwoFUHuNHqwc3fNNrs3Z6g M92JtlYCZj+Fb9cmDi4uwEe9PLSltH0db6g90wTI8pnckkwEPG7HOmLcJe/C0CN/uIWVW5 rlEhu0YgvkkrWjX41lZdRTzvCW4IM1hCAkq4bdiUIgpvgaG6jX26C+RzgYTD7+2Ts1fHQt czMsq78k7uNGL2GupeQBCKrzs+LyGbmrMWIuxn4vyDa7xN+bYks+bJe0fUcq+gs81WXw0y NCC+IkRKJmsVRu1QEwlPTNNXQkD2HE2QS9Onl+fvQh2iPSeHu3Q8UEfKojjyYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676936053; 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=dcTBmUDM8cFpauTNCxHMHUZMziip0Rb360r0MLzdHvE=; b=L05NlnCyIgsEa2FxKJt6NUQxLhOOFQ65FwQ+IdbSSopeXgJLFp3StGCx/M5Jy17w0OEVQl L/VZfC4GAu0d65UTKKypvoMsQTAXyys9rG1S1fgFAdVarDaMUx8bAVBylLREGFRjs29QRJ EgQtAb+CnXbnJv7PxNw58i8J9gAtzT4y1toPr9xT3Y7xMYNoJ4xGijWOvySVhqVK4VEDks LUMr0JrQsueWMozTPvOS9MMD2GMywwCsTOoRlLQHqqV/10rSAizqesjvhJ6SjozyLXrraX IddAhxwaeq4h0aHFoHUMc7kMV5x2FpQzXM2mU9NM4jsbgxVcpgL34DZjhx3MPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676936053; a=rsa-sha256; cv=none; b=OCNY7YItOp0svBVVymcN2TQ8NUn9EmzLVDaFq1L457OBdBx54rDYl+d+7TWksZllOzFm6e h5yhnGTiG6gkvwgYw3uWrxpriL1ZlFjo0NGasnC1Lv6ZMIVmgLr8T5Oo6atlWP6RfS9b0Y VXALC9viBV1VjxF9szFSXk5XmJj8ja8yEAvk9zxnv7pdKMjtcluzES1CZlCf990ZHCMvLw A3UUXdLbWMjQHur1eL6t8euUBzlxMLjNiOBA9yOn1rYLdOMkggAczhxK0fnxFWo6GPRdXu UPJ/liXEC81ElrLx3y00sCGkjdFW5jB1l9YL1ztKyXnODXO5EnIVlWfXFXbqmw== Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PLJfF3XkJzHnD; Mon, 20 Feb 2023 23:34:13 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f176.google.com with SMTP id w23so3157070qtn.6; Mon, 20 Feb 2023 15:34:13 -0800 (PST) X-Gm-Message-State: AO0yUKX7jRupxmhm4atmvCC6j7HrisYPypv9X9Z4TDy/S0kA0+9kUofX Z36DWcCYQeNOTxPyioYchWlP1p3PDNTejMX+SYQ= X-Google-Smtp-Source: AK7set9vnDBSWoemkVd6TdqpTGmCCqmq8Or6MbVXp7m0TTkxe0VnFhAQKM6TCOXNVv+APCCZVovOKFdStgAFjtzEr3I= X-Received: by 2002:ac8:431e:0:b0:3b7:fda5:25d0 with SMTP id z30-20020ac8431e000000b003b7fda525d0mr351398qtm.1.1676936053088; Mon, 20 Feb 2023 15:34:13 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302201855.31KItK45079891@gitrepo.freebsd.org> <870983EF-591C-4685-A133-1E0E37CF0B98@freebsd.org> In-Reply-To: From: Kyle Evans Date: Mon, 20 Feb 2023 17:34:06 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: cd73914b01a1 - main - kern: physmem: don't truncate addresses in DEBUG output 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" X-ThisMailContainsUnwantedMimeParts: N On Mon, Feb 20, 2023 at 4:00 PM Kyle Evans wrote: > > On Mon, Feb 20, 2023 at 3:59 PM Kyle Evans wrote: > > > > On Mon, Feb 20, 2023 at 1:41 PM Jessica Clarke wrote: > > > > > > On 20 Feb 2023, at 18:55, Kyle Evans wrote: > > > > > > > > The branch main has been updated by kevans: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=cd73914b01a1f2300e587f802383cc563f2e7103 > > > > > > > > commit cd73914b01a1f2300e587f802383cc563f2e7103 > > > > Author: Kyle Evans > > > > AuthorDate: 2023-02-20 18:54:00 +0000 > > > > Commit: Kyle Evans > > > > CommitDate: 2023-02-20 18:55:04 +0000 > > > > > > > > kern: physmem: don't truncate addresses in DEBUG output > > > > > > > > Make it consistent with the above region printing, otherwise it appears > > > > to be somewhat confusing. > > > > --- > > > > sys/kern/subr_physmem.c | 4 ++-- > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c > > > > index bb6af5a580aa..d371e1e166c5 100644 > > > > --- a/sys/kern/subr_physmem.c > > > > +++ b/sys/kern/subr_physmem.c > > > > @@ -149,10 +149,10 @@ physmem_dump_tables(int (*prfunc)(const char *, ...)) > > > > #ifdef DEBUG > > > > prfunc("Avail lists:\n"); > > > > for (i = 0; phys_avail[i] != 0; ++i) { > > > > - prfunc(" phys_avail[%d] 0x%08x\n", i, phys_avail[i]); > > > > + prfunc(" phys_avail[%d] 0x%08jx\n", i, phys_avail[i]); > > > > > > You need to actually cast them though for 32-bit. > > > > > > > Huh, interesting; wasn't there a compiler warning for this? armv7 and > > riscv both seemed to have built fine (+ DEBUG), am I misremembering > > that and it's just a potential source of garbage at runtime? > > > > Oh, well, riscv isn't 32-bit anyways. Still stands for armv7, though. I delayed to avoid continuing to spam the list, but this is fixed in 7b5cb32fca26 (and a __printflike added to detect it, which I had realized was the source of no-warning pretty quickly after wondering out loud). Thanks for the report! From nobody Tue Feb 21 00:42:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLL8W37dsz3sjHL; Tue, 21 Feb 2023 00:42: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 4PLL8W2byxz46yt; Tue, 21 Feb 2023 00:42:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676940123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dz+kOEnbHcMr3NwGTcEQrzON6AShjbfuq5zNlyN3Vpg=; b=gi/CzKJttKa2LvQEHGqFECS2k31j6grGfYY5ri0nnRKwb4MEy6h5d0B5o8DdqKRNOD58q9 LLtLgXLCC1q7IMTdnhdGMEvtci+6tjaj3R/KbZ5LfjpXgm5DttLEP2n7i/cJUI/1O/0Jv7 GhGJZ9HIfKL4PBAUi5f1IHBN7wVgiylwYOVJwc+BSojp/XPCzzfgQ465dcwmp2zgoa6KzN CfpToz+zPAtE7CHRx023mHlQLCIG4LbdgRD88MYSqdZiZuERGXNhXy7XqTO3kaAmnLFNbJ 5RvVg+QUsw0/e4WbCV2zkQfav/GGCq8Fnwaqeq+yvRgdlxi0+HPQgXYEyigxuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676940123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dz+kOEnbHcMr3NwGTcEQrzON6AShjbfuq5zNlyN3Vpg=; b=GS2R8zHQol+C0miPs7jucMj7ROTUhC9L5KAmwKk357si0FHI+A6sW37fMUdT4qSWz1lKpG mwxv3OzXf57gWb+M49TEHX8Zw7ksampc2BeedVUdPzutS6MNW+gC6nDwvF7Ualm5AVpPAu o2hPCRIkZt/zvx5tMP3gY5uitpHM9aUAxDn49O+FSLmClb5CNwsH6rmUk1q1LJtfEPmh1W FE1AU/rNoDa9g39ZkCB5nzYiWs6EK44/m9Pbe9v5Jok1wM7t56k++pbdkqtoxavIzvJDcY 8OOxtjSp7i6X3Zd12P4A8AWyBow2QCqFZKZI597VASfE7PJlPKTSbFgaTc4elA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676940123; a=rsa-sha256; cv=none; b=FWiD0Kfd34HatDbhhyfAYkCSsA3moemYyzrdOjO2BanJIV19zxASuEPb8gr6QVaPm7w9om jfxFfV6fcMY+Y1zyjdI2lofVaYPqIjvg4f6EtElomWXZ7usLe3wF44UpePzb3opMF3fjrG jb6BJoRBDWBJ0yPkc641wr2MLuxkCATTWeA3Zpkoo0zzi8ZiMUyoebg75Hk/B11g0sRoqT kMaQBTVMAJN2ofwZWkJGA+4yKymB434fwRoMSPZLFWjEanQp1engdA1LxVeaxRf85hBzsI zyap4V5jowiHzpCaFt0a+ZomFs7dRVKuEtkOhpr0+MPsJv4yRlN/60+PfCLxhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLL8W1h2Vz11NC; Tue, 21 Feb 2023 00:42: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 31L0g3CT080546; Tue, 21 Feb 2023 00:42:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31L0g3PW080545; Tue, 21 Feb 2023 00:42:03 GMT (envelope-from git) Date: Tue, 21 Feb 2023 00:42:03 GMT Message-Id: <202302210042.31L0g3PW080545@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: 357492c99597 - main - nfscl: Add NFSD_CURVNET macros to nfsclient syscall List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 357492c99597d13bc966441f30bb44f6ef659f08 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=357492c99597d13bc966441f30bb44f6ef659f08 commit 357492c99597d13bc966441f30bb44f6ef659f08 Author: Rick Macklem AuthorDate: 2023-02-21 00:40:07 +0000 Commit: Rick Macklem CommitDate: 2023-02-21 00:40:07 +0000 nfscl: Add NFSD_CURVNET macros to nfsclient syscall Although the nfsclient syscall is used for client side, it does set up server side krpc for callbacks. As such, it needs to have the vnet set. This patch does this. Without this patch, the system would crash when the nfscbd(8) daemon was killed. Reported by: freebsd@walstatt-de.de MFC after: 3 months --- sys/fs/nfsclient/nfs_clport.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 7f9b18e9970a..7a47da3c07bf 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -1276,10 +1276,11 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *uap) struct mount *mp; struct nfsmount *nmp; + NFSD_CURVNET_SET(NFSD_TD_TO_VNET(td)); if (uap->flag & NFSSVC_CBADDSOCK) { error = copyin(uap->argp, (caddr_t)&nfscbdarg, sizeof(nfscbdarg)); if (error) - return (error); + goto out; /* * Since we don't know what rights might be required, * pretend that we need them all. It is better to be too @@ -1288,10 +1289,11 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *uap) error = fget(td, nfscbdarg.sock, cap_rights_init_one(&rights, CAP_SOCK_CLIENT), &fp); if (error) - return (error); + goto out; if (fp->f_type != DTYPE_SOCKET) { fdrop(fp, td); - return (EPERM); + error = EPERM; + goto out; } error = nfscbd_addsock(fp); fdrop(fp, td); @@ -1300,12 +1302,14 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *uap) nfscl_enablecallb = 1; } } else if (uap->flag & NFSSVC_NFSCBD) { - if (uap->argp == NULL) - return (EINVAL); + if (uap->argp == NULL) { + error = EINVAL; + goto out; + } error = copyin(uap->argp, (caddr_t)&nfscbdarg2, sizeof(nfscbdarg2)); if (error) - return (error); + goto out; error = nfscbd_nfsd(td, &nfscbdarg2); } else if (uap->flag & NFSSVC_DUMPMNTOPTS) { error = copyin(uap->argp, &dumpmntopts, sizeof(dumpmntopts)); @@ -1391,6 +1395,8 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *uap) } else { error = EINVAL; } +out: + NFSD_CURVNET_RESTORE(); return (error); } From nobody Tue Feb 21 01:19:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLLzy5gJxz3slbG; Tue, 21 Feb 2023 01:19: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 4PLLzy58tNz4Cxv; Tue, 21 Feb 2023 01:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676942382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eCPDyLf/WfAhqN5H7BF3PUNidvBZDJ5OQfGG/vS2leE=; b=x5WaBNUpcmq5eaHOc1FhY7GoLV1ILOw6my0vkiJdvtRWCM83T3bUVNYf7KUlW7dNcMyqzJ ucKMCbSPvRNQMYkOeu682v/DSLnBmJIiQpWoMjgbnu8ClKR/uGENAUoTKxo/I0rQq3krcf CG/DcPIMP2NdExl4czIZCR4JNePtivNuGVWzX411f+jStElzdCgLJVCsbJe3takMfWdrSJ y9aRu+3DNdQIbg+7QpDUh1h16722xpUbXsD32fUggbIOq9Ju7I0ETIDeah0EGIHz0D3gj5 +lRMeLvPpW6I+x8oDV/cyOHi/fwuPzACNAMMwqVIFSbciySgMbqbIH5V8oSESg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676942382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eCPDyLf/WfAhqN5H7BF3PUNidvBZDJ5OQfGG/vS2leE=; b=CgyWSNU+2yxrEKYHwINyDnMNtMEghbGBCJBY0DY6aSr/pEfcL7PIFBz23EuItQiYA8k9Nx 5C03ZBFbUWWiSa+TvtW3EZ+3MYIFUOwaf+/Z//kYgnJ2QsitpTWZ/qybyc/DGUN1WJcKWn ROzGVCpSgMt+cEVMJSIrbrGsCIZuxT3JVqv3GqOYtWvXHbdXz+vc2Drlt8BXBoUjtrsJ2w X0DlMP/Z63GfPQgkrqS4PWJUuEAQ7E2LLNy/JCK8wXzYQx7DZq9HUgOGf/q3FzKWnbPyvW bNEMIAYysnCzck63qfazl311vdL8vkvqCig6kS1b8Npx63yNvYh3mc7FsxZtpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676942382; a=rsa-sha256; cv=none; b=B78dGcCVCkLbnUCWr8wwAktFZ+WM+iv7arlxjiQvYBao7mG07ywOQYUi9O3lWcB4xTAAox qCZ/2B6RAtY1KBYy/yQo4OPYXIzhwHNxsuwf4jspW4HTlgQV7Dob2HdjZzOdMK5H6ymAiN qMsh/TKHssnmpfMerRN4cNDooWTubsQ/gcdKCxjhsUvodpjL1hQyO+g4yxUDzcDPiVJ0D1 kC6K4YSEsAWIP4H3M/V0dehdIv9lADmxjLREpI1JeG8oFyXw7zVJPe9rY+9LvOJLW8tdaf 0DKbLhnK8Z0vBD5EZBvojj1rHaEO4omAsqE85OE7EKQK1XIgLkI7NrJJ7/ddsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLLzy449cz12c6; Tue, 21 Feb 2023 01:19: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 31L1JgFT026058; Tue, 21 Feb 2023 01:19:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31L1JgXv026057; Tue, 21 Feb 2023 01:19:42 GMT (envelope-from git) Date: Tue, 21 Feb 2023 01:19:42 GMT Message-Id: <202302210119.31L1JgXv026057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Kubaj Subject: git: 8f39cbf4f30c - stable/13 - llvm: make sure to use ELFv2 ABI on powerpc64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8f39cbf4f30c9a8cd3f593dc2b373a289785d4b6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=8f39cbf4f30c9a8cd3f593dc2b373a289785d4b6 commit 8f39cbf4f30c9a8cd3f593dc2b373a289785d4b6 Author: Piotr Kubaj AuthorDate: 2023-02-16 23:49:43 +0000 Commit: Piotr Kubaj CommitDate: 2023-02-21 01:19:33 +0000 llvm: make sure to use ELFv2 ABI on powerpc64 Currently LLVM is more or less set up to use ELFv2, but it still defaults to ELFv1 in some places. This causes lld to generate broken binaries when used with LTO. PR: 269455 Approved by: dim MFC after: 3 days (cherry picked from commit a1ffc2fe9ce54a498c410dcab86495569dbaa7cc) --- contrib/llvm-project/clang/lib/Basic/Targets/PPC.h | 3 +++ contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h index ac52eb219f54..cd9bf0d8e359 100644 --- a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h +++ b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h @@ -425,6 +425,9 @@ public: } else if ((Triple.getArch() == llvm::Triple::ppc64le)) { DataLayout = "e-m:e-i64:64-n32:64"; ABI = "elfv2"; + } else if (Triple.isOSFreeBSD() && (Triple.getOSMajorVersion() == 0 || Triple.getOSMajorVersion() >= 13)) { + DataLayout = "E-m:e-i64:64-n32:64"; + ABI = "elfv2"; } else { DataLayout = "E-m:e-i64:64-n32:64"; ABI = "elfv1"; diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index 3eff00fc3c05..9b7145aafead 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -221,8 +221,11 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT, assert(Options.MCOptions.getABIName().empty() && "Unknown target-abi option!"); - if (TT.isMacOSX()) + if (TT.isMacOSX()) { return PPCTargetMachine::PPC_ABI_UNKNOWN; + } else if (TT.isOSFreeBSD() && TT.getArch() == Triple::ppc64 && (TT.getOSMajorVersion() == 0 || TT.getOSMajorVersion() >= 13)) { + return PPCTargetMachine::PPC_ABI_ELFv2; + } switch (TT.getArch()) { case Triple::ppc64le: From nobody Tue Feb 21 03:44:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLQC24PJBz3swPC; Tue, 21 Feb 2023 03:44: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 4PLQC23v1Pz4NCL; Tue, 21 Feb 2023 03:44:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676951070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rr+M2wzCN0rLIVwD1ZSoGLrc9HVy8P7glFQIrw5htds=; b=s7ifsmDzR7F8Ge4mkZEqyw1XPC5QF9omcVzPAHd47EHaEwc0vZ2TspJp69siZ9dGxbuYmY z0lmVKNGcb4pr2ABn0Ci6PT91KrBSqRMghfKlnYL3GgEXDNeHWRncBYJC2T4mvgBm2c0+2 BDScsW2EAvJMaGf3E9kXsKV9HDbJsbqyidV3YTYMLGSqmcCHvSGA+6rQjVtjVTlPSzjL4T 2s/HV2dJmhB4lcczCtHGOmixXYiYCkwaTATVWIhVrFp4SpOHvmiAQD99bfs8WsrGTVO8vK nYEAZiKsEvJlK9RhI45AYkX+/yZumGHBZSNDLtu48lKK+rQzJ/DMzTcO7jV9Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676951070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rr+M2wzCN0rLIVwD1ZSoGLrc9HVy8P7glFQIrw5htds=; b=eCEGPHQ4lzRJquW+VpHvjRRVvgl2UxwlXIkATG5osvE8IXEQ/k2QXVATgnK3BIu0PSQBxn dwoP6K0hnmwg+YAlhQFbgYi5FVk1zhFAwkIjlks5phIJsgrzkHFngIGy+6cZ34OC7KqJqH tRLK4axo+QsNtnS4byifii3hdysZryLwFT/6i3eTytH5gdTXdjSfynIN5AcPLXe2F59cpI Q4HGQyEq/sBVrG4F4dWYNzXAUj9XpAP2gUEfxOwlxWGIbV8uUyukHMP4Bv8LfV+FfcXrIq qhSXKJBlre/PC04uq+890eAdD6y5R4nDPMuI7XQ8PJrwsLcwzZCp3EfUTDNM1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676951070; a=rsa-sha256; cv=none; b=GMQHmxP0WAuknQr7BDW3cQXSa3eYwiyliT9U80lvDAXVMWNjt1H4hw7HgoCW8tVVdYeSlC FI+RGdnf2F/kkcs6YV+JQsKRWjoQNlF1LbUl3ikNWoEvIb97wVmNzVMKVPYfeHbjnacIFS NlI3KLLNs/DxVjA8F5HdG92WzmGy6eF5eqfDvavpYmmKUlBs3LLKWqlsMyyLI37LxIwTjN kqLuxtObZdxPM1KpYiikrOuCmornoVT3zhr8WcdphWxnOiX36my31HeO+JtuAqiBd0BKNu 4zpDf4SXxakJpgooD44dAWyZLeG4ipsvP8WjbGof+KTP6P4bwlzDaacVoRXLJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLQC22xzfz16Mv; Tue, 21 Feb 2023 03:44: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 31L3iUmO039013; Tue, 21 Feb 2023 03:44:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31L3iUaC039012; Tue, 21 Feb 2023 03:44:30 GMT (envelope-from git) Date: Tue, 21 Feb 2023 03:44:30 GMT Message-Id: <202302210344.31L3iUaC039012@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: ef4e8f0cf91f - main - nfscommon: Use IS_DEFAULT_VNET() in the vnet initialization List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef4e8f0cf91f7009745d5a7a90d3bdd2d9e25780 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ef4e8f0cf91f7009745d5a7a90d3bdd2d9e25780 commit ef4e8f0cf91f7009745d5a7a90d3bdd2d9e25780 Author: Rick Macklem AuthorDate: 2023-02-21 03:43:37 +0000 Commit: Rick Macklem CommitDate: 2023-02-21 03:43:37 +0000 nfscommon: Use IS_DEFAULT_VNET() in the vnet initialization Another oopsie. The vnet initialization function in nfs_commonport.c for initializing prison0 by testing curthread->td_ucred->cr_prison == &prison0. This is bogus and always true. Replace it with IS_DEFAULT_VNET(curvnet). MFC after: 3 months --- sys/fs/nfs/nfs_commonport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 99482069c36d..212b498e6328 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -877,7 +877,7 @@ static void nfs_vnetinit(const void *unused __unused) { - if (curthread->td_ucred->cr_prison == &prison0) + if (IS_DEFAULT_VNET(curvnet)) NFSD_VNET(nfsstatsv1_p) = &nfsstatsv1; else NFSD_VNET(nfsstatsv1_p) = malloc(sizeof(struct nfsstatsv1), From nobody Tue Feb 21 05:40:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLSmf4rGhz3t49X; Tue, 21 Feb 2023 05:40: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 4PLSmf4K98z3Kjl; Tue, 21 Feb 2023 05:40:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676958018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wLhRIy2ijZ3PzdlO97vnFP5iupP6+edROTR6rxxaH/E=; b=maVQ9GpqqnllgzObhv8Znt9TBaZtX/CP9xA6RQzLesf1hvRpL/DRGYjMd8JZoXIulTRL7p sgc+SwehApM3XXNpUpuwTZOsThxF+roFKbnTsLpFlLOvWsgxgnlEQXeCi2yeJ4iY9hWfa7 A4x3kzZKpnS0FPlIC/x0EcvOmvLAJDMssGOLygethA8/g/VDuMhssvhtiE3fdR9gP0F14k Up2Pgu/EJTfe8XLsadh5cr2Vc+ocFnGxvO7T40EQFtbBbSyKQ+cK2WOdfap/yFguwtm9RM dEj4vASZxG5cRCOdwIX3bPdyp4yA9ocI0y504fyOmVf5cgMmunGfsaZrH/PmJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676958018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wLhRIy2ijZ3PzdlO97vnFP5iupP6+edROTR6rxxaH/E=; b=tRUnBMpA4jXuUQXg4uhmzjmYMucK4GdbeNkWCgFIqToLSqhGISgFubtaUNVtea1rLKAhDh j0LjsOzqUcmTFDDxsYV6guzQGKkl1h5dzHLdwwefrfkJdVJSNmeW4+RIMWox9HgpqXMJOM D+LDbxnqCPAW8LR/P1d4C+WbeicG4LKoiY0vb6MO9f/69vlU8mdrHDDVA41St/UXjNRlGP EFfc/nOvI4DQz+NTXuLcGAmZ9bGMorHrWvKhJwlIWqKxbaDFiNTcMSsxePTQF/NhKHQY+i MC58FT3m5HP/xxO4Yzy1otYFZO2ujiyqjjp0Lt1FIvvcmA6uyX6XFaauIutjCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676958018; a=rsa-sha256; cv=none; b=ff4zI8FzJKma8zv5x8XtQgDdaoiw3d87+fuLRQKy+zpO6OSfKWvbxBIo1DwwICyZTyrETu YW7Po0Z4RW0ha4rC6SW3cNP2zPs0VdGb5u6kZWj1IOR2GAm6O5RZggc/SZ9fGqSM4NoL61 1nHQ014xU+98/9BYiCYxcnRoT5PFkabYCfip2es5hS7mETRJouCrPEkEdzJ70OWdvU8KPO uzFYfA7G809S6zWqm+OXQO7csch+rZrvpmJ5idMAmsvS7A3xr6IQsQ4JBvW6OXp2/ZQ47a /eE+19k4prdP9uKhGT9laI3/GVQSdZce/uEo8Wnz0k92adptyjbP3LyGFIR2XA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLSmf37ptz18P7; Tue, 21 Feb 2023 05: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 31L5eIAj004457; Tue, 21 Feb 2023 05: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 31L5eIo2004456; Tue, 21 Feb 2023 05:40:18 GMT (envelope-from git) Date: Tue, 21 Feb 2023 05:40:18 GMT Message-Id: <202302210540.31L5eIo2004456@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: c32946d8bee0 - main - kern: physmem: fix the format string again, i is a size_t List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c32946d8bee0d82042165c5d78b4d339d1268a2a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c32946d8bee0d82042165c5d78b4d339d1268a2a commit c32946d8bee0d82042165c5d78b4d339d1268a2a Author: Kyle Evans AuthorDate: 2023-02-21 05:34:33 +0000 Commit: Kyle Evans CommitDate: 2023-02-21 05:39:38 +0000 kern: physmem: fix the format string again, i is a size_t Fixes the riscv LINT build. Fixes: 7b5cb32fca26 ("kern: physmem: properly cast %jx [...]") --- sys/kern/subr_physmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c index a53d2cb879eb..1fb617078625 100644 --- a/sys/kern/subr_physmem.c +++ b/sys/kern/subr_physmem.c @@ -149,11 +149,11 @@ physmem_dump_tables(int (*prfunc)(const char *, ...) __printflike(1, 2)) #ifdef DEBUG prfunc("Avail lists:\n"); for (i = 0; phys_avail[i] != 0; ++i) { - prfunc(" phys_avail[%d] 0x%08jx\n", i, + prfunc(" phys_avail[%zu] 0x%08jx\n", i, (uintmax_t)phys_avail[i]); } for (i = 0; dump_avail[i] != 0; ++i) { - prfunc(" dump_avail[%d] 0x%08jx\n", i, + prfunc(" dump_avail[%zu] 0x%08jx\n", i, (uintmax_t)dump_avail[i]); } #endif From nobody Tue Feb 21 06:10:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLTRG4WHtz3t635 for ; Tue, 21 Feb 2023 06:10:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLTRG42kkz3MSQ; Tue, 21 Feb 2023 06:10:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676959818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bQ11FQmBhVFZMH+ub6dxDxfGyoI9gONWSKxscIxoD+4=; b=Km4Qu7Zza/STTmS9W0I0/NzxdJwQoE817AnmAXd/N7yFGIafYJOQcENCuAYwRMVGNKcraH e5X2cA+XKVRUlGBaBxN1BA73ENmpi5wxmvcj1C2QQ+lhNiAu6I/pwHf56SzoER7VX+AyET eLV33n/vbtVR6BnqXO+kE76d4SQEWgTfkOIrbk/uhSvbgqZAPUbb82CZHhAqQnXIZ6jfIR fpFbVHckwPdI8lGKxq6VYyYEVOm35EGn4LrjrjxDLQYECNZqgTMek8a5aHucPX80dAGvwQ M8lyeP4dxoU1yEdc0VW1pEPlBzZjtGT1e9MoRsTscclJruUbG56GOoKwxqWfkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676959818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bQ11FQmBhVFZMH+ub6dxDxfGyoI9gONWSKxscIxoD+4=; b=BKc7egKVtFw3/oSmEl+76+tpgwpv6aV2S35gApLLPMlFM6baSmsQmpXnulxfC2bTwtSSoY fq4Exo380jy9URF0Uo5fiP+8O3rgIJENwFdHEfRRxThPCtCqUakZWQNV7/PxlhVPGCHWsY Ti5ysAKLCLAuHLmodWsI7jnI3hQA+Dbr+cDHJ3QKTgyQUZJm/WorSoUHa8HR75PjDVaHk1 1wTYch11ZKORAo/zuGr7fu3M9Gacykyg/yDSUnxSVFXZYKMKaR2LknPppXS8dl4ZoIZFjR WRX5mrzsCH8OPM8n3YxvMu8BwD3CoQWrH15sOLmwmlH1u/ogC0T6DSuAj/Tzaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676959818; a=rsa-sha256; cv=none; b=ysW/yp9QcaS1bMCpN2/25yvql9JOlRtrdWiMcMDW1u0MVvpiov+HzzNrar+GDB00KVaY45 Z38E59Vrre8agbmgRGeMEkCo9QjAtaMPMmF7Qje9QWvVuN9my445p/FN93A766SSHOSnPs 4gBAoHUyiSnHgn04WomjzVJgvy5hgm+KL8hq3bJbO8WSdZ/PchNOk/TdBXLg/sP2u7oUr8 sKvzvB99qE8a5OlFy9FLsPJ0Ec/9HEjTV4IyyzKFu0msL47ZoNSH4j1+Y4q9Z1XEe0JZuI XM7twnaKv8uWphZRzhW1DNk5Nftay2kZ5WoZpWiKZTABOZByat8MxwG81HMbCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLTRG2m37z19HF; Tue, 21 Feb 2023 06:10: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 31L6AIkb047616; Tue, 21 Feb 2023 06:10:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31L6AIWU047615; Tue, 21 Feb 2023 06:10:18 GMT (envelope-from git) Date: Tue, 21 Feb 2023 06:10:18 GMT Message-Id: <202302210610.31L6AIWU047615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: "Simon J. Gerraty" Subject: git: f6acb9b9f81c..d84e570b5496 - vendor/bearssl - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/vendor/bearssl X-Git-Reftype: branch X-Git-Commit: d84e570b54961e8874bbd8de25635eb96be0977e X-Git-Oldrev: f6acb9b9f81c96ae7c9592bee1bb89c4357cc3e5 X-Git-Newrev: d84e570b54961e8874bbd8de25635eb96be0977e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch vendor/bearssl has been updated by sjg: URL: https://cgit.FreeBSD.org/src/log/?id=f6acb9b9f81c..d84e570b5496 d84e570b5496 Vendor import BearSSL hash 79c060e From nobody Tue Feb 21 06:10:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLTRG4rHgz3t5hH for ; Tue, 21 Feb 2023 06:10:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLTRG4Pj7z3Md6; Tue, 21 Feb 2023 06:10:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676959818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XgdLfdLfvRK0lSPVccBB69HV34B0oJyxqP7VQIYbFYY=; b=Jk5OqriT4unlaC+cgGGBr+5E+DkVm6d26LJHAuI+mCg1UKhiwJWMiY53/kvVYujEk+bhDy NtTdkori7Dw7t0nvBlvHAoqtucIeXHM7eu6ZTFT2+5dtmizPSu8cPJJtZGsFjzSbsDcgOL 5sjCjhKjMZVM8yJX9t+G2AnaDoOpm7A63ynYv1edxQ1NMJloaFNfd21dbDXxRHeZ3HbKfk wMn6PGTsZFrZpcRqeXn02DsJkeN1wiQOVTQBnPqnFz1aO6qO36uOnjHdaapIJS15jVF/DJ QQao3ZLOUop1qmPlfEgYlAeoZt+xbkXuhWa0qSn6x4AZ6y5mrHUpJmdGozYkcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676959818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XgdLfdLfvRK0lSPVccBB69HV34B0oJyxqP7VQIYbFYY=; b=NRrZLLJ2/5gki5hZGdjUbsv7vp46gRB6HtTjdpl+o7V3F4EBijcYLMPgMnHweNKplk0YGU cvXSYnDi7yMIEL/dLxj7xaO5I4QkUZ85Y1i3VOhgZUx1fh6WPqWOhG3h8/xtyX3oesoaT0 TBvGVX4w8Im35IVXcCMsGBmucrCOMEbmgItFfg3GG9j69PcvIKPioT8/JXqqKkjaNfzvRI IpG95pDxdtP1XY85YLjNPD67DG9EbtNu70sT7FONld4JsPZ8N5bn2pj8SMZsL8BotbTyBT U4n8V+vWLaY6GJ8We9zdIZCRlVBNgl+VioE7t91u+WiXAHHLsG4Ke6uRFM0c3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676959818; a=rsa-sha256; cv=none; b=W717guTbW/B66vrhTRdUxzILEi4WqrnPntl+jS0raw307qFnehpLZtlpcjK2bH9nU2Z0bW 1gLeBuuH0mxKgjKfZq7/zuURbcmjMOufCNsb+TBWNSPJy9LbXxsLDS7/8nbDbiy2aWfLwr pPvzym/lVwryzzLY4/1CkMVPMPA9RdZo8MYn1+QkEn4DjOXDK0ouccARbCohsRd4ZVRFhX DGwhyHX50mQ/qqB01tM6LkgSW1rCcWtu7l6dD/yqz6aledmeG+fxbu8V2Ez2vDSFTfZD2x CnF3BrM/iJj5ujjZB+NLLNDG8Qa8svDNR+sWTO9Em9sGRQLdwlV+cUykt54LIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLTRG3S65z18ny; Tue, 21 Feb 2023 06:10: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 31L6AI54047637; Tue, 21 Feb 2023 06:10:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31L6AIuc047635; Tue, 21 Feb 2023 06:10:18 GMT (envelope-from git) Date: Tue, 21 Feb 2023 06:10:18 GMT Message-Id: <202302210610.31L6AIuc047635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 27932ae45d33 - Create tag vendor/bearssl/20230220 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/tags/vendor/bearssl/20230220 X-Git-Reftype: annotated tag X-Git-Commit: 27932ae45d33a9ccb7d71ab9fd2c862a98a846e7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The annotated tag vendor/bearssl/20230220 has been created by sjg: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/bearssl/20230220 tag vendor/bearssl/20230220 Tagger: Simon J. Gerraty TaggerDate: 2023-02-21 06:07:30 +0000 Import bearssl-79c060e Fixed spurious warning about old-style prototype commit d84e570b54961e8874bbd8de25635eb96be0977e Author: Simon J. Gerraty AuthorDate: 2023-02-21 06:06:34 +0000 Commit: Simon J. Gerraty CommitDate: 2023-02-21 06:06:34 +0000 Vendor import BearSSL hash 79c060e From nobody Tue Feb 21 06:16:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLTZD1wHLz3t682; Tue, 21 Feb 2023 06:16: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 4PLTZD1LPYz3NlC; Tue, 21 Feb 2023 06:16:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676960180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eYLC8/Ewl5VLC2eKWMUyalySOAr+MmbfjaMvfn5n8D8=; b=UZKzTIgqvy3IC94io2DRMoEgG7vRW6LrnEVwBEXRve8bZbp8TkOjIbaMeyLAskhaLZBhGd Tm5P2bsj4TRG/UUU2k2IJEu31EetCNcVzajVQsVlEKElDoz9uj9qjEQBQtN+bRxYPQfKsm CqxMOhwf3bhjey1k834UcfX9Xvq5IfSea/kqs8JjBXWfQJ3Pdr6XbtLRX904bVsC9ZIi1K J8d/vSuyqmDLTMKYvBiB/St7szCeycNxPJU/vtQEsAtUTZ7+PRhnnBjV6DIxL+BXV9zqvy FQ8mBpqjRq0cz6Vkv7Tj0AaQwQE/FPv7xjMkSfs75+AAaepcmNRR2t/ks8Je9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676960180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eYLC8/Ewl5VLC2eKWMUyalySOAr+MmbfjaMvfn5n8D8=; b=Ays+vfUn31mDuQfqwTQ/Ns5iuYmAQf0wJg1z2lf20OH6bQx611gxl3s9UKp9vi8u4tKkYT P/o3g/IWufWklvF6RidRGeHmZauEYGiDnqy0ynrdXSUM/YoHRtaXfDqLNadB3VbSvkCuxA RcrcUHuVzyvRK4pGZ2uRPpYb2NOytPuzyu3ZXfo9v3p0lEmhbc9y3PMJdYW74gujp9ZZXw lpM/X7iARjFXmRTC94IEUmORfnclXvgt0PetXtvJL0pJ0DiNWDU8T9z6GMVCD0V9+h6CVo wZEotBWH4XQc2k35dVvFN2/nzrDExfSmZD6qibMbXpsazCJHeli0gAX7RIuyqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676960180; a=rsa-sha256; cv=none; b=dr7HubihgR9codamU/Saikfg1FFXMtw+4DMPX+Oj654LmGtMzIt/YDYLxjKryFysgbCkDo XABXb+IR1iqHnDpMF0RTuJZZOHgE+KNsocPMYhZCG61efuM1OvkxT+ukOm8XRugG8qrTtJ rxaecYLfxRxBS36kTjDQ//mWnahGUYdlS/hHYN1kQbbb1HcC+eKNhjQYpyOGLVRQdi3YvD PmxO7W1pFnf3p0BD476gOHrNjuftt9N3wflijQgNQcHq7rYPFYvRpDxx9E2AVAbo7qa0BC +rSbQzsSXqGvJ2YEl9vtsTAu9cJAReRfSeQlnSfUF180ryBYM/3qG3OdOIJgJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLTZD0NW6z19g0; Tue, 21 Feb 2023 06:16: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 31L6GJee052840; Tue, 21 Feb 2023 06:16:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31L6GJOT052839; Tue, 21 Feb 2023 06:16:19 GMT (envelope-from git) Date: Tue, 21 Feb 2023 06:16:19 GMT Message-Id: <202302210616.31L6GJOT052839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 9c474dc51b0b - main - Merge commit 'd84e570b54961e8874bbd8de25635eb96be0977e' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c474dc51b0b09ff81339caee6772e454dd470e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=9c474dc51b0b09ff81339caee6772e454dd470e4 commit 9c474dc51b0b09ff81339caee6772e454dd470e4 Merge: c32946d8bee0 d84e570b5496 Author: Simon J. Gerraty AuthorDate: 2023-02-21 06:13:27 +0000 Commit: Simon J. Gerraty CommitDate: 2023-02-21 06:13:27 +0000 Merge commit 'd84e570b54961e8874bbd8de25635eb96be0977e' contrib/bearssl/flist | 459 ---------------------------- contrib/bearssl/inc/bearssl.h | 13 + contrib/bearssl/src/rsa/rsa_i62_keygen.c | 4 +- contrib/bearssl/src/rsa/rsa_pss_sig_unpad.c | 2 +- 4 files changed, 16 insertions(+), 462 deletions(-) From nobody Tue Feb 21 08:22:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLXML6PCZz3tDyJ; Tue, 21 Feb 2023 08: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 4PLXML5g9Bz3n4B; Tue, 21 Feb 2023 08: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=1676967726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9GfQFJ0HBUB8Th/kTbOHkxxCD8uXdGOHfjcbtYvqQTs=; b=X6lYzOFgR+98PekhUbMsLWvkt8FWUS6y0sNrXsADmMJR79YH9zFa+t7JinCrevTR65eVSA JoylNBzEp3eLT55oDxNoecUjRRHjLzv+XJ//UcySZn/FiGdcCi/G7WTi3CKAvNEmB4PyP6 q0j5iEGL7J78wzTG6v+NRpIjNACyUnP1OuvE6ZZ5ft9QJIqMujSmtc8RhFaDf4P/JQ2mhz HfpiMO4QHqE9EpvdlOaNFVQU/4qPwfzoFbK1JgLCD7DiabZIshM0xI4oMuvhi5cDzlXYSN cuCSGJGPKB3P1cQE+rwLELrvaVV6zwPtH+EbhP+hymMA4LgLIdODLrDSGpT5Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676967726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9GfQFJ0HBUB8Th/kTbOHkxxCD8uXdGOHfjcbtYvqQTs=; b=XthH58zF1p8UA8eGs82Mujk4Dja5huvjzZAkVqcfcyWDMs3UEo2xvnlXz8cwZZfUMOTz/w zL/yvGpSuwZJB1QG+49PeNNRKVbCcA0fEi1AQWhrHowdzGFvkRKh5yuyZz4O2PcaxiQBQO O7xixuvWGA2IHNj459sLooMuQL1+HtlIux7Gld+bK1Hrjr20aucWwSeSU/dvGyxaP+/deQ RtrGHUu9tBNwt+XPidgunJblq4jIoIHaek1PWQ+jAaBNNe+MqJYoNmif0hTdwUmkHG6HFA MpKqHGq8TdRn9wYCZB4zUsFVA1UiALSLq2JB9dFGyeCv2xTl6hHRQK5JI5aJjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676967726; a=rsa-sha256; cv=none; b=d8exd3kMw2VP4a83eWyhIpSBnadGyrbgM7ua2iHvNHIf7/kUM2KHZGKkVtNFJx6l73P8wL jbCIosX1pfgRZMfxEaE8Z3dimlh9/ylQP1hvYhdS8wDDM/y48JCnmXwE82N6AYW/AOo7ue o8VCiJr5ed8Ew0w132xPp+QA9KsT9rQqWPkwxEmOsrbVd0vL9DPl4V8zLU43RGAHRj2wSu 1V5gKaQam+Am95kF+kfbMF8TkxrZamogO6maBDo5yJC1+BJDV6cAlpLpwcVNHi8Ax4pxx4 1cZyF6axl+N9InbWFkX89yj0TRWsnsjel/R1H7wuwZaj/UmZ74h9w/QG/T3MCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLXML4lZKzDnc; Tue, 21 Feb 2023 08:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31L8M6gD036672; Tue, 21 Feb 2023 08:22:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31L8M6dA036671; Tue, 21 Feb 2023 08:22:06 GMT (envelope-from git) Date: Tue, 21 Feb 2023 08:22:06 GMT Message-Id: <202302210822.31L8M6dA036671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 81e5b344273c - stable/13 - linuxkpi: Add more suspend defines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 81e5b344273ca11808b4e694d684fd0c09a6a5f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=81e5b344273ca11808b4e694d684fd0c09a6a5f7 commit 81e5b344273ca11808b4e694d684fd0c09a6a5f7 Author: Emmanuel Vadot AuthorDate: 2023-02-17 13:49:52 +0000 Commit: Emmanuel Vadot CommitDate: 2023-02-21 08:21:04 +0000 linuxkpi: Add more suspend defines Needed by drm 5.15-lts Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit a0fdaf9a7b34b6f8fdab747f7a198158e66b57ab) --- 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 8458a6f6d4c5..8ceafaf35f56 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() From nobody Tue Feb 21 08:22:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLXMN0TM1z3tFNG; Tue, 21 Feb 2023 08:22:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLXMM6gjmz3nNW; Tue, 21 Feb 2023 08:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676967727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oLtlyOicGSL3Qp9+Z2ugFmZyu2D51/siQmRiW6RNoUs=; b=mRLwj9NH2/S0tOXwCA6E3xDDEeCixEtjzLCD7Zty99x9ZlY05zmED8oIeZOsGrchlc02/X GNKpTjrUfkYLbxMXQlY/Kol2KImAfkeleFkoXZ1/sPYoSzFtvxzY4EAPcXgeaCe1OsNhmD J5YyZvuYVTJ3yOI6QTaZ5BE8qzFFsrX43wzpcC0NG7I/O4WpydbnvtGvVEG1v+Wjg1RI3o mH8TYQdbE0VeKxo3oyp98eOttgqD6lxkEcXqetXI/nXZKHmjDuoRZYDD9j4mV7P4J0dUc7 3R0rIb+fmrMd4s4LI2f+xf1AUSuc/AgGuSJz3jvXaTKGiRrrH9PEcczRcq0RYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676967727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oLtlyOicGSL3Qp9+Z2ugFmZyu2D51/siQmRiW6RNoUs=; b=NmLBqJ2lDZ0K4oeg4hV7j+NzYxwaHWwwWviSzxxyu/n9zuEOqwEdrRav1i9RWZ1GzYWygc lEPEtObeCSO6+pRBR4SJDM2mC9f2kU6J7DHRu6MVheAfUMZnWgwllFYdnnBjbEsL6I83VW NhKa2zrfUShu2nCii3SBnOufifIe5HUTf80e27HwBXA/kSXTQTFe+F92dXnXrR8tRj+OYS aJXUgLnB4and4VsU9l0TyZzOtcfKSgMeL1aE1tTrIKAS5Kcemgngy+dMsYVCFcb98AtOKZ qK3xrTS8mL0CtLQGtfp01iVZWgwmkF9AtfNd130QvnTdDRDyiRlZ8jpIXccBMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676967727; a=rsa-sha256; cv=none; b=iRm7uCY67/cg6JTkMet2+Ds+7r5bBzQ4R0PiNKjFgAHU6PzHcq2gZ1irf0+x/j2rL9zAQK KyvsUR3/0BoFH4tyBvEXe13z38vfUImg23cFsIWqFUS6nKQGo8Ew2D002cUwn7J/8WX1Ij R9TY8N4CmXfZN1jFXljggz+ZxuIrvcSG7Ocvo03pjeXMCTqkK0H/XZq71Tox0EXfFwXtte OlRr0fHM1TtVCGACF9q3oCRpXFjufutTkVbmVQQH+hq1b1IecISL1o3ei9LltKuRUxEGnu f299J0E9SdsoGovM7U0fgSv6GYggvVMxWgJR6pdZLCbjzIXFfXvvgV7Z2W6Uqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLXMM5MVnzDqm; Tue, 21 Feb 2023 08:22: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 31L8M7PF036700; Tue, 21 Feb 2023 08:22:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31L8M7wK036699; Tue, 21 Feb 2023 08:22:07 GMT (envelope-from git) Date: Tue, 21 Feb 2023 08:22:07 GMT Message-Id: <202302210822.31L8M7wK036699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: aaca677fee21 - stable/13 - Bump __FreeBSD_version after linuxkpi changes. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aaca677fee21f202db4bb974fc5056f4dcbbb598 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=aaca677fee21f202db4bb974fc5056f4dcbbb598 commit aaca677fee21f202db4bb974fc5056f4dcbbb598 Author: Emmanuel Vadot AuthorDate: 2023-02-21 08:21:29 +0000 Commit: Emmanuel Vadot CommitDate: 2023-02-21 08:21:29 +0000 Bump __FreeBSD_version after linuxkpi changes. Needed to have graphics/drm-515-kmod working. 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 6c95088e783d..12a407dd0464 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1302502 /* Master, propagated to newvers */ +#define __FreeBSD_version 1302503 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Tue Feb 21 09:46:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLZDB2xzYz3s65L; Tue, 21 Feb 2023 09:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLZDB2QpWz3tDZ; Tue, 21 Feb 2023 09:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676972762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uuROCFlW+hLaSwKwFmIz/GoE94gO75mGA7C/sQJHR68=; b=RReVkEP9U40/0HY/3+1wqK82PbPAVmV4frnVJS5vuyC5NxSu0zd0B31x+ocFwt/1wo+Mml W3EOcO76EMdXQpJaCTesNUuCZ6a44lqpz+Rew92aLfTj0t3tuYeQBwdNnBvxY29I5WYGBf d2GpNpwfF7rMn7dwTsYDnNNmXAHASsUaLWl4EU4IWuX4/UDV/ltQZTqnn0tGqOA4j0QEBx 5I20K/nONZELyR+xLDpRgzsuKWPV6K3NgKYXa+I4lf6y/cwOKZFoioUpTPqDUNwU1IwfOv WcCyGOGxDf4J5SsLQQdMK7B7J+Nvu56i0GJzWpP+IYiNHfb0lMQcJgF0ygW2Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676972762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uuROCFlW+hLaSwKwFmIz/GoE94gO75mGA7C/sQJHR68=; b=FwUXHi40ht1W2sqs6NcSaFVhp1uQu4EN5JNwaj9/RnZ7o3u+wm+cgV24ci6qig40S4Zuzp 899K6DveF8vkW84yJ5Jrw3JJLkn6LKR4B3e5IWiZeTMpLrQRztRpZR3MR17A9/Qd7nfFyR rwWWONvpIBzfhbTo+LJGdw8HtEu1Yq5SdPSA8B1YKVXvD0HWt7VQt3cRZVk9d2tuA6mvts k1x8jyp0iTlNQwK1OihiBL1tqjmA0Ht1ALatqIXDyVH7otH4Zed9NkyoiWSvThCwhD+sZT 1nuJwC0Lue2IGitbUKFzzgFN1f2Y5x6ozfH6eOmOctw7RquHn2bstrlrhjr9HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676972762; a=rsa-sha256; cv=none; b=sZ27S3rf9VomO1H/3qIeYNuEhcL5Fm6Eve3iAKJKD1/9qKcM1x62OIk+fOwbSuF5eICanP NSewULjnT76l/wguYbUssANcYvgNvrgO7AanqZb5m9OwsyNFe90zrKJHh4uDC9S7AqOJ2Y XrzNIqUcO5CiJR43Xqu4ObUsuxb+VK8KBQsLhHtvSGHY0sxm/GsYL5dp4EGkfyGCXn4nTX i3rrF0hzt9D/Sx3lfKEQQJOOqtXxw9T7xtkFOsaCaM7xIo5c/RVuCqaiAUzDFjwBIG0lH2 b2YwM6iMCcf+eW4ehMZqqIGqempHCUT4tKIM0s9p2TjZS1TpRNqbA1x+NXmXFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLZDB1VXwzH0b; Tue, 21 Feb 2023 09:46: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 31L9k2Fe052051; Tue, 21 Feb 2023 09:46:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31L9k2w6052050; Tue, 21 Feb 2023 09:46:02 GMT (envelope-from git) Date: Tue, 21 Feb 2023 09:46:02 GMT Message-Id: <202302210946.31L9k2w6052050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Thomas Munro Subject: git: 58e3631bd08c - main - truss: Add preadv(2) and pwritev(2). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tmunro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58e3631bd08cf539668951c93ee2e943f963ea05 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tmunro: URL: https://cgit.FreeBSD.org/src/commit/?id=58e3631bd08cf539668951c93ee2e943f963ea05 commit 58e3631bd08cf539668951c93ee2e943f963ea05 Author: Thomas Munro AuthorDate: 2023-02-21 09:40:14 +0000 Commit: Thomas Munro CommitDate: 2023-02-21 09:40:14 +0000 truss: Add preadv(2) and pwritev(2). We already knew how to decode readv(2)/writev(2). Add the versions with an offset. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D27531 MFC after: 2 weeks --- usr.bin/truss/syscalls.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index ab68e079e6ea..2ac4b1a4b003 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -428,6 +428,9 @@ static const struct syscall_decode decoded_syscalls[] = { { .name = "pread", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 }, { QuadHex, 3 } } }, + { .name = "preadv", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { Iovec | OUT, 1 }, { Int, 2 }, + { QuadHex, 3 } } }, { .name = "procctl", .ret_type = 1, .nargs = 4, .args = { { Idtype, 0 }, { Quad, 1 }, { Procctl, 2 }, { Ptr, 3 } } }, { .name = "ptrace", .ret_type = 1, .nargs = 4, @@ -435,6 +438,9 @@ static const struct syscall_decode decoded_syscalls[] = { { .name = "pwrite", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 }, { QuadHex, 3 } } }, + { .name = "pwritev", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 }, + { QuadHex, 3 } } }, { .name = "quotactl", .ret_type = 1, .nargs = 4, .args = { { Name, 0 }, { Quotactlcmd, 1 }, { Int, 2 }, { Ptr, 3 } } }, { .name = "read", .ret_type = 1, .nargs = 3, From nobody Tue Feb 21 11:11:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLc7C6HyKz3sCks; Tue, 21 Feb 2023 11:11: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 4PLc7C5rQPz42Y6; Tue, 21 Feb 2023 11:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676977911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/MkXCJ60njhB5q7mbCf4J6eSHqhrly6Ln2PgEqPw/p8=; b=sP4ntxQ5SvaxPPeVs4IGoLUK0X5tUBLPR2iOjUFg7mQQhrSM7oqKIX80r8TH4qf9SmsEr3 GUEOt6KGdvZlzjqnIbWl9tqLCAK2IClygsmXTnyO5nLKqrOrobiYO0ApommJsdT/b+EJjH VUzeg095lpWB9PbVZ86IOLUPydEHy5mfjB4uSXs+jDK/7AdnuRsSO2y2EGYBqJ0U6SlQ7y nOiWtiENFxlAkdis4fh+tTxbpcXY6Fyu8uNpQ4jWUAb/RC3YhILbt5slA6eWunULB0e8l6 X2wY2H7eZdwDCk+1pF9uZ1WmqQ8VgwM7Fq1sH7jqTlkc1NCgeH4UmTQ3hAz//Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676977911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/MkXCJ60njhB5q7mbCf4J6eSHqhrly6Ln2PgEqPw/p8=; b=ZMQgHkEeid4OYsQCkUEWTiterY5CdzXlEH83bXwmZI8W5V6LcQ2iZJmxhogNWVMGBVVZrF aAr1onIgSJ5S+19+wKJejYp6MPuTKSaI+IOIVcBYIwxcDmrwJLQD+tkE+6xMHc9CxjoGCw Pb94rn/JK5f5Me4m++XHd2Tovp+N9K8+JH1QAeNsUnuCKczZzi+JbBa9/g8gmHObh2xuP6 /oM/DblRFnOyC3j3EEk/Je07vkDpGRJwWPXOajyPkl8vjNZvhPpgfKFY0/XptuNeJ+ma+O OGG3Lu9m4wr4A1XL26gXRmf1a0X8rOS6LYNGg3qrFw/aSH44ZDCnVPCd8HoIlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676977911; a=rsa-sha256; cv=none; b=pjNbw3Jx4EJt6EsxVwl2nNNFZDyqdVE+OZfXu0oGdHavOLC2CXyn1HwTPdPoSsbPfDqrte Z9TXeLv3r2ivTzuLov8X6Tod+x6fW72+ScfU1bg+cttDWOTczvkKLCct8do7z8nFNIyBct QamVcpVTaUl+q9z2GVd0OLLAOE7j1BHhhmAQ77jtY76xc/x4pokwPxfPRZTVYHX1OgPTym 3sdw/UnhBVtqzwkuh51KzM947/SsuxXWJ0qgiFc5uvPc3OV3ydEutd7bJidjb4HAL5CHGY uGZ7MqmUdliojXVJtox0tZhl5qJAFx2gnlh1Hw61x6mnsf5UnXr7xATMWrxjfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLc7C4vf6zJq6; Tue, 21 Feb 2023 11:11: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 31LBBpwZ078531; Tue, 21 Feb 2023 11:11:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LBBpJj078530; Tue, 21 Feb 2023 11:11:51 GMT (envelope-from git) Date: Tue, 21 Feb 2023 11:11:51 GMT Message-Id: <202302211111.31LBBpJj078530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 00812bbda25a - main - bblog: add logging of protocol user requests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00812bbda25a7a97008650dfbc20da43a9485f88 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=00812bbda25a7a97008650dfbc20da43a9485f88 commit 00812bbda25a7a97008650dfbc20da43a9485f88 Author: Michael Tuexen AuthorDate: 2023-02-21 11:07:35 +0000 Commit: Michael Tuexen CommitDate: 2023-02-21 11:07:35 +0000 bblog: add logging of protocol user requests This information was available in trpt and is useful. So provide a way to get this information via TCP BBLog. Reviewed by: rscheff@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D38701 --- sys/netinet/tcp_log_buf.h | 3 ++- sys/netinet/tcp_usrreq.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 3c6569cffafd..f82d2bf3a9b3 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -240,7 +240,8 @@ enum tcp_log_events { TCP_RACK_LOG_COLLAPSE, /* Window collapse by peer 67 */ TCP_RACK_TP_TRIGGERED, /* A rack tracepoint is triggered 68 */ TCP_HYBRID_PACING_LOG, /* Hybrid pacing log 69 */ - TCP_LOG_END /* End (keep at end) 70 */ + TCP_LOG_PRU, /* TCP protocol user request 70 */ + TCP_LOG_END /* End (keep at end) 71 */ }; enum tcp_log_states { diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 0c36e4281010..60bb59b64868 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -131,6 +131,26 @@ static void tcp_fill_info(struct tcpcb *, struct tcp_info *); static int tcp_pru_options_support(struct tcpcb *tp, int flags); +static void +tcp_bblog_pru(struct tcpcb *tp, uint32_t pru, int error) +{ + struct tcp_log_buffer *lgb; + + INP_WLOCK_ASSERT(tptoinpcb(tp)); + if (tp->t_logstate != TCP_LOG_STATE_OFF) { + lgb = tcp_log_event_(tp, NULL, NULL, NULL, TCP_LOG_PRU, error, + 0, NULL, false, NULL, NULL, 0, NULL); + } else { + lgb = NULL; + } + if (lgb != NULL) { + if (error >= 0) { + lgb->tlb_errno = (uint32_t)error; + } + lgb->tlb_flex1 = pru; + } +} + /* * TCP attaches to socket via pru_attach(), reserving space, * and an internet control block. @@ -163,6 +183,7 @@ tcp_usr_attach(struct socket *so, int proto, struct thread *td) goto out; } tp->t_state = TCPS_CLOSED; + tcp_bblog_pru(tp, PRU_ATTACH, error); INP_WUNLOCK(inp); TCPSTATES_INC(TCPS_CLOSED); out: @@ -248,6 +269,7 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) error = in_pcbbind(inp, sinp, td->td_ucred); INP_HASH_WUNLOCK(&V_tcbinfo); out: + tcp_bblog_pru(tp, PRU_BIND, error); TCP_PROBE2(debug__user, tp, PRU_BIND); INP_WUNLOCK(inp); @@ -320,6 +342,7 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) out: if (error != 0) inp->inp_vflag = vflagsav; + tcp_bblog_pru(tp, PRU_BIND, error); TCP_PROBE2(debug__user, tp, PRU_BIND); INP_WUNLOCK(inp); return (error); @@ -372,6 +395,7 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td) tp->t_tfo_pending = tcp_fastopen_alloc_counter(); out: + tcp_bblog_pru(tp, PRU_LISTEN, error); TCP_PROBE2(debug__user, tp, PRU_LISTEN); INP_WUNLOCK(inp); return (error); @@ -429,6 +453,7 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td) inp->inp_vflag = vflagsav; out: + tcp_bblog_pru(tp, PRU_LISTEN, error); TCP_PROBE2(debug__user, tp, PRU_LISTEN); INP_WUNLOCK(inp); return (error); @@ -496,6 +521,7 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) out_in_epoch: NET_EPOCH_EXIT(et); out: + tcp_bblog_pru(tp, PRU_CONNECT, error); TCP_PROBE2(debug__user, tp, PRU_CONNECT); INP_WUNLOCK(inp); return (error); @@ -620,6 +646,7 @@ out: inp->inp_inc.inc_flags = incflagsav; } + tcp_bblog_pru(tp, PRU_CONNECT, error); TCP_PROBE2(debug__user, tp, PRU_CONNECT); INP_WUNLOCK(inp); return (error); @@ -658,6 +685,7 @@ tcp_usr_disconnect(struct socket *so) goto out; tcp_disconnect(tp); out: + tcp_bblog_pru(tp, PRU_DISCONNECT, error); TCP_PROBE2(debug__user, tp, PRU_DISCONNECT); INP_WUNLOCK(inp); NET_EPOCH_EXIT(et); @@ -703,6 +731,7 @@ tcp_usr_accept(struct socket *so, struct sockaddr **nam) addr = inp->inp_faddr; out: + tcp_bblog_pru(tp, PRU_ACCEPT, error); TCP_PROBE2(debug__user, tp, PRU_ACCEPT); INP_WUNLOCK(inp); if (error == 0) @@ -756,6 +785,7 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam) } out: + tcp_bblog_pru(tp, PRU_ACCEPT, error); TCP_PROBE2(debug__user, tp, PRU_ACCEPT); INP_WUNLOCK(inp); NET_EPOCH_EXIT(et); @@ -793,6 +823,7 @@ tcp_usr_shutdown(struct socket *so) tcp_usrclosed(tp); if (!(inp->inp_flags & INP_DROPPED)) error = tcp_output_nodrop(tp); + tcp_bblog_pru(tp, PRU_SHUTDOWN, error); TCP_PROBE2(debug__user, tp, PRU_SHUTDOWN); error = tcp_unlock_or_drop(tp, error); NET_EPOCH_EXIT(et); @@ -837,6 +868,7 @@ tcp_usr_rcvd(struct socket *so, int flags) #endif outrv = tcp_output_nodrop(tp); out: + tcp_bblog_pru(tp, PRU_RCVD, error); TCP_PROBE2(debug__user, tp, PRU_RCVD); (void) tcp_unlock_or_drop(tp, outrv); NET_EPOCH_EXIT(et); @@ -1156,6 +1188,8 @@ out: inp->inp_vflag = vflagsav; inp->inp_inc.inc_flags = incflagsav; } + tcp_bblog_pru(tp, (flags & PRUS_OOB) ? PRU_SENDOOB : + ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND), error); TCP_PROBE2(debug__user, tp, (flags & PRUS_OOB) ? PRU_SENDOOB : ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND)); error = tcp_unlock_or_drop(tp, error); @@ -1220,6 +1254,7 @@ tcp_usr_abort(struct socket *so) tp = tcp_drop(tp, ECONNABORTED); if (tp == NULL) goto dropped; + tcp_bblog_pru(tp, PRU_ABORT, 0); TCP_PROBE2(debug__user, tp, PRU_ABORT); } if (!(inp->inp_flags & INP_DROPPED)) { @@ -1258,6 +1293,7 @@ tcp_usr_close(struct socket *so) if (tp->t_state != TCPS_TIME_WAIT) { tp->t_flags |= TF_CLOSED; tcp_disconnect(tp); + tcp_bblog_pru(tp, PRU_CLOSE, 0); TCP_PROBE2(debug__user, tp, PRU_CLOSE); } } @@ -1326,6 +1362,7 @@ tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int flags) tp->t_oobflags ^= (TCPOOB_HAVEDATA | TCPOOB_HADDATA); out: + tcp_bblog_pru(tp, PRU_RCVOOB, error); TCP_PROBE2(debug__user, tp, PRU_RCVOOB); INP_WUNLOCK(inp); return (error); From nobody Tue Feb 21 12:27:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLdps0j85z3sKf6; Tue, 21 Feb 2023 12:27: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 4PLdps0BPgz4Dw4; Tue, 21 Feb 2023 12:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676982469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tl9j/oaOh7csbaB5VAB1yWPvamQGaulxDe5uxi1NUtU=; b=Fdvnwf6l0nOF/AHljfZMkupU2Y4X4L0kpxiZ6QSqswvaJRimPH2DgVlFezx6oh7ebVwKOW L3UIBNYPLVHn+Dc1gRUCuqw5Kt458KPqWEWKQHUNZUk2PUfKN8xyR7emSV8QasTMqfOxLG SeH6TiQf+2WttMgmyyZv1QVvHcfztXqyNGY0SRAn3woVsvAiGz7J1TL3uZq10IRXTkLGNV moldv1BiLo9WcbZ6Ap+DRew8b5pZb+awJjdxbI4WyDP0IN6OuxbZjlVAOafiXK4dPyNRmC PPey8HeYG8h/OV8FFh+4SZeXK5jV+4fC7X2FjXvR81EcuafUK7Zw26BglX6RNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676982469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tl9j/oaOh7csbaB5VAB1yWPvamQGaulxDe5uxi1NUtU=; b=IcKky1f6SDFUzexcG2mvlFXjEweiy7UIPSDE0yQA/in4injdkWTGNjq4C/PX18HGUaj1Qs neFukjv3OVUXgLgEk/eAQq5uxTihg9xGm1A+iCL9L9kao5fK4it+n5opyxo6XAs/+h+0Ts nZH6wlhGnDsHyIfjPt8s+QpwbI9GhSQZPiB4QEhg2hAOkLA4+uQBrQJNEQuDCywJlJwMoe 10pDJwUIPNE1mjXnxhxGIOPPTMQvVUDVkcKn5rwDmjlRRwdQuktfWRehIvMm4dzxzn4S5y 0U+/1JavqRUtgcYKj+3eHnajT2XaibAl/FKuNgHglvUkwu7BNohAPntQgOtk8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676982469; a=rsa-sha256; cv=none; b=RSXJwsxihyTyH3DaqPi7V7KrqC43M17WnOtzW1VbuGrqNbRneULa1crRH7wyIk8q+SCs1T s/mShmfO6Y9jjOXCE+HnmZdHeEWmBNQ46agOne3DzyU17TMvHkrc5IvqQjSUV/mfKPVAkW iGKGC0KQs9EcE19c/scyuC+1hcH0Q/1sD4qtibpxj97rCBH0mvuhmy9LTTWrqHT2ZjViU5 gr3onIsDXimIlCovtIdKuD/CDpmiSU4BLhfEdZVwd2bFfASsdQyxRXdaFNfogMC161D1Rc R2ybVZINXrIfkZDQNK9EChqtM7/IPYFdsf06KW+UEOmYuXXuMS29pZxspayFyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLdpr6LSCzLZt; Tue, 21 Feb 2023 12:27: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 31LCRm16079804; Tue, 21 Feb 2023 12:27:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LCRmA5079803; Tue, 21 Feb 2023 12:27:48 GMT (envelope-from git) Date: Tue, 21 Feb 2023 12:27:48 GMT Message-Id: <202302211227.31LCRmA5079803@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: b9b2184322da - main - netlink: clear IPv6 embedded scope when dumping route gateways. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9b2184322da85e1f4d52e3b0a6322dd214210ec Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=b9b2184322da85e1f4d52e3b0a6322dd214210ec commit b9b2184322da85e1f4d52e3b0a6322dd214210ec Author: Alexander V. Chernikov AuthorDate: 2023-02-21 12:25:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-21 12:27:26 +0000 netlink: clear IPv6 embedded scope when dumping route gateways. Reported by: zarychtam@plan-b.pwste.edu.pl MFC after: 3 days --- sys/netlink/route/rt.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 534186447b4d..dabdaea3e03b 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -123,7 +124,9 @@ rc_get_nhop(const struct rib_cmd_info *rc) static void dump_rc_nhop_gw(struct nl_writer *nw, const struct nhop_object *nh) { +#ifdef INET6 int upper_family; +#endif switch (nhop_get_neigh_family(nh)) { case AF_LINK: @@ -132,19 +135,27 @@ dump_rc_nhop_gw(struct nl_writer *nw, const struct nhop_object *nh) case AF_INET: nlattr_add(nw, NL_RTA_GATEWAY, 4, &nh->gw4_sa.sin_addr); break; +#ifdef INET6 case AF_INET6: upper_family = nhop_get_upper_family(nh); if (upper_family == AF_INET6) { - nlattr_add(nw, NL_RTA_GATEWAY, 16, &nh->gw6_sa.sin6_addr); + struct in6_addr gw6 = nh->gw6_sa.sin6_addr; + in6_clearscope(&gw6); + + nlattr_add(nw, NL_RTA_GATEWAY, 16, &gw6); } else if (upper_family == AF_INET) { /* IPv4 over IPv6 */ + struct in6_addr gw6 = nh->gw6_sa.sin6_addr; + in6_clearscope(&gw6); + char buf[20]; struct rtvia *via = (struct rtvia *)&buf[0]; via->rtvia_family = AF_INET6; - memcpy(via->rtvia_addr, &nh->gw6_sa.sin6_addr, 16); + memcpy(via->rtvia_addr, &gw6, 16); nlattr_add(nw, NL_RTA_VIA, 17, via); } break; +#endif } } From nobody Tue Feb 21 13:31:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLgDx2W2rz3sdxc; Tue, 21 Feb 2023 13:32:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLgDv6nT4z4KXd; Tue, 21 Feb 2023 13:31:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 31LDVjD1031049 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 21 Feb 2023 15:31:49 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 31LDVjD1031049 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 31LDVjOP031048; Tue, 21 Feb 2023 15:31:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 21 Feb 2023 15:31:45 +0200 From: Konstantin Belousov To: Michael Tuexen Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 00812bbda25a - main - bblog: add logging of protocol user requests Message-ID: References: <202302211111.31LBBpJj078530@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202302211111.31LBBpJj078530@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4PLgDv6nT4z4KXd X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, Feb 21, 2023 at 11:11:51AM +0000, Michael Tuexen wrote: > The branch main has been updated by tuexen: > > URL: https://cgit.FreeBSD.org/src/commit/?id=00812bbda25a7a97008650dfbc20da43a9485f88 > > commit 00812bbda25a7a97008650dfbc20da43a9485f88 > Author: Michael Tuexen > AuthorDate: 2023-02-21 11:07:35 +0000 > Commit: Michael Tuexen > CommitDate: 2023-02-21 11:07:35 +0000 > > bblog: add logging of protocol user requests > > This information was available in trpt and is useful. So provide > a way to get this information via TCP BBLog. > > Reviewed by: rscheff@ > Sponsored by: Netflix, Inc. > Differential Revision: https://reviews.freebsd.org/D38701 > --- > sys/netinet/tcp_log_buf.h | 3 ++- > sys/netinet/tcp_usrreq.c | 37 +++++++++++++++++++++++++++++++++++++ > 2 files changed, 39 insertions(+), 1 deletion(-) > > diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h > index 3c6569cffafd..f82d2bf3a9b3 100644 > --- a/sys/netinet/tcp_log_buf.h > +++ b/sys/netinet/tcp_log_buf.h > @@ -240,7 +240,8 @@ enum tcp_log_events { > TCP_RACK_LOG_COLLAPSE, /* Window collapse by peer 67 */ > TCP_RACK_TP_TRIGGERED, /* A rack tracepoint is triggered 68 */ > TCP_HYBRID_PACING_LOG, /* Hybrid pacing log 69 */ > - TCP_LOG_END /* End (keep at end) 70 */ > + TCP_LOG_PRU, /* TCP protocol user request 70 */ > + TCP_LOG_END /* End (keep at end) 71 */ > }; > > enum tcp_log_states { > diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c > index 0c36e4281010..60bb59b64868 100644 > --- a/sys/netinet/tcp_usrreq.c > +++ b/sys/netinet/tcp_usrreq.c > @@ -131,6 +131,26 @@ static void tcp_fill_info(struct tcpcb *, struct tcp_info *); > > static int tcp_pru_options_support(struct tcpcb *tp, int flags); > > +static void > +tcp_bblog_pru(struct tcpcb *tp, uint32_t pru, int error) > +{ > + struct tcp_log_buffer *lgb; > + > + INP_WLOCK_ASSERT(tptoinpcb(tp)); > + if (tp->t_logstate != TCP_LOG_STATE_OFF) { > + lgb = tcp_log_event_(tp, NULL, NULL, NULL, TCP_LOG_PRU, error, > + 0, NULL, false, NULL, NULL, 0, NULL); > + } else { > + lgb = NULL; > + } > + if (lgb != NULL) { > + if (error >= 0) { > + lgb->tlb_errno = (uint32_t)error; > + } > + lgb->tlb_flex1 = pru; > + } > +} > + > /* > * TCP attaches to socket via pru_attach(), reserving space, > * and an internet control block. > @@ -163,6 +183,7 @@ tcp_usr_attach(struct socket *so, int proto, struct thread *td) > goto out; > } > tp->t_state = TCPS_CLOSED; > + tcp_bblog_pru(tp, PRU_ATTACH, error); > INP_WUNLOCK(inp); > TCPSTATES_INC(TCPS_CLOSED); > out: > @@ -248,6 +269,7 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) > error = in_pcbbind(inp, sinp, td->td_ucred); > INP_HASH_WUNLOCK(&V_tcbinfo); > out: > + tcp_bblog_pru(tp, PRU_BIND, error); > TCP_PROBE2(debug__user, tp, PRU_BIND); > INP_WUNLOCK(inp); > > @@ -320,6 +342,7 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) > out: > if (error != 0) > inp->inp_vflag = vflagsav; > + tcp_bblog_pru(tp, PRU_BIND, error); > TCP_PROBE2(debug__user, tp, PRU_BIND); > INP_WUNLOCK(inp); > return (error); > @@ -372,6 +395,7 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td) > tp->t_tfo_pending = tcp_fastopen_alloc_counter(); > > out: > + tcp_bblog_pru(tp, PRU_LISTEN, error); > TCP_PROBE2(debug__user, tp, PRU_LISTEN); > INP_WUNLOCK(inp); > return (error); > @@ -429,6 +453,7 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td) > inp->inp_vflag = vflagsav; > > out: > + tcp_bblog_pru(tp, PRU_LISTEN, error); > TCP_PROBE2(debug__user, tp, PRU_LISTEN); > INP_WUNLOCK(inp); > return (error); > @@ -496,6 +521,7 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) > out_in_epoch: > NET_EPOCH_EXIT(et); > out: > + tcp_bblog_pru(tp, PRU_CONNECT, error); > TCP_PROBE2(debug__user, tp, PRU_CONNECT); > INP_WUNLOCK(inp); > return (error); > @@ -620,6 +646,7 @@ out: > inp->inp_inc.inc_flags = incflagsav; > } > > + tcp_bblog_pru(tp, PRU_CONNECT, error); > TCP_PROBE2(debug__user, tp, PRU_CONNECT); > INP_WUNLOCK(inp); > return (error); > @@ -658,6 +685,7 @@ tcp_usr_disconnect(struct socket *so) > goto out; > tcp_disconnect(tp); > out: > + tcp_bblog_pru(tp, PRU_DISCONNECT, error); > TCP_PROBE2(debug__user, tp, PRU_DISCONNECT); > INP_WUNLOCK(inp); > NET_EPOCH_EXIT(et); > @@ -703,6 +731,7 @@ tcp_usr_accept(struct socket *so, struct sockaddr **nam) > addr = inp->inp_faddr; > > out: > + tcp_bblog_pru(tp, PRU_ACCEPT, error); > TCP_PROBE2(debug__user, tp, PRU_ACCEPT); > INP_WUNLOCK(inp); > if (error == 0) > @@ -756,6 +785,7 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam) > } > > out: > + tcp_bblog_pru(tp, PRU_ACCEPT, error); > TCP_PROBE2(debug__user, tp, PRU_ACCEPT); > INP_WUNLOCK(inp); > NET_EPOCH_EXIT(et); > @@ -793,6 +823,7 @@ tcp_usr_shutdown(struct socket *so) > tcp_usrclosed(tp); > if (!(inp->inp_flags & INP_DROPPED)) > error = tcp_output_nodrop(tp); > + tcp_bblog_pru(tp, PRU_SHUTDOWN, error); > TCP_PROBE2(debug__user, tp, PRU_SHUTDOWN); > error = tcp_unlock_or_drop(tp, error); > NET_EPOCH_EXIT(et); > @@ -837,6 +868,7 @@ tcp_usr_rcvd(struct socket *so, int flags) > #endif > outrv = tcp_output_nodrop(tp); > out: > + tcp_bblog_pru(tp, PRU_RCVD, error); > TCP_PROBE2(debug__user, tp, PRU_RCVD); > (void) tcp_unlock_or_drop(tp, outrv); > NET_EPOCH_EXIT(et); > @@ -1156,6 +1188,8 @@ out: > inp->inp_vflag = vflagsav; > inp->inp_inc.inc_flags = incflagsav; > } > + tcp_bblog_pru(tp, (flags & PRUS_OOB) ? PRU_SENDOOB : > + ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND), error); > TCP_PROBE2(debug__user, tp, (flags & PRUS_OOB) ? PRU_SENDOOB : > ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND)); > error = tcp_unlock_or_drop(tp, error); > @@ -1220,6 +1254,7 @@ tcp_usr_abort(struct socket *so) > tp = tcp_drop(tp, ECONNABORTED); > if (tp == NULL) > goto dropped; > + tcp_bblog_pru(tp, PRU_ABORT, 0); > TCP_PROBE2(debug__user, tp, PRU_ABORT); > } > if (!(inp->inp_flags & INP_DROPPED)) { > @@ -1258,6 +1293,7 @@ tcp_usr_close(struct socket *so) > if (tp->t_state != TCPS_TIME_WAIT) { > tp->t_flags |= TF_CLOSED; > tcp_disconnect(tp); > + tcp_bblog_pru(tp, PRU_CLOSE, 0); > TCP_PROBE2(debug__user, tp, PRU_CLOSE); > } > } > @@ -1326,6 +1362,7 @@ tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int flags) > tp->t_oobflags ^= (TCPOOB_HAVEDATA | TCPOOB_HADDATA); > > out: > + tcp_bblog_pru(tp, PRU_RCVOOB, error); > TCP_PROBE2(debug__user, tp, PRU_RCVOOB); > INP_WUNLOCK(inp); > return (error); I get ../../../netinet/tcp_usrreq.c:272:16: error: use of undeclared identifier 'tp' tcp_bblog_pru(tp, PRU_BIND, error); ^ ../../../netinet/tcp_usrreq.c:345:16: error: use of undeclared identifier 'tp' tcp_bblog_pru(tp, PRU_BIND, error); ^ ../../../netinet/tcp_usrreq.c:734:16: error: use of undeclared identifier 'tp' tcp_bblog_pru(tp, PRU_ACCEPT, error); ^ ../../../netinet/tcp_usrreq.c:788:16: error: use of undeclared identifier 'tp' tcp_bblog_pru(tp, PRU_ACCEPT, error); ^ 4 errors generated. --- tcp_usrreq.o --- *** [tcp_usrreq.o] Error code 1 Obviously, the KDTRACE_HOOKS option is not enabled in my kernel. From nobody Tue Feb 21 13:38:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLgP00SKyz3sfkk; Tue, 21 Feb 2023 13:39: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 4PLgNz6xgvz4L0d; Tue, 21 Feb 2023 13:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676986740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uy24Vh0uz882O6ttRaTz42ABAi/ycupWoKCcVfyVNiM=; b=Pgy3w4zi39k549rWK4svWIjr8xsQb2KVQsAiKwNEYLbrBdf9R6Y5JfZtET5qyHdIgNGU9w x42fYiK00Jw0QqQxjq8xvTOOtlLf27OPPDlkbLZKpNHOi0phza5D2Xf1BDAurZ6DQulCmP +CSdt4De24mWUcxh1UoI5yh1K4OWH5USGpwIykJvu/5wRYcnmR+kTQjrkLfxKV788N8YBb pNc94jk+x7S+ArkVpoAIjPPzZLWIaXpKIR9Mz/fAjaef3wTEjxw4R9SLe7mjUpY/UNucg7 mp40wiwn8g9JhpvOf2eppRMThk2jbu9nXBKEIam43u3hGsj4BNtsBhhQzGkkCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676986740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uy24Vh0uz882O6ttRaTz42ABAi/ycupWoKCcVfyVNiM=; b=WXm+Pia2B8/HuWdytwRzFWv06TWhn2lE1MRAnTC1QCB42/xxzsfYEZTBFtSY7aV0Vb+/RV 3WwhS2Qg6qHfXav1H8UJXXxuWffjFIM378pbju574AjvRR5/zQCC67VJ8cwmfJpbJmZCmg 1L74Em1XzrCdT9NaK6uGLF/aICuG9R4niF1OIy5bAyaSIuLUQhz8b0l6fchU5exJBEj6a1 Slv4k4tpiLHJOQ7Gysyn8DdieCDMtio2MxAoB7FptDFFyQ8ESu9C0U5kMm8TdZtTVDsbIT N7N4l19doosiHhfyT1ge0e2Zkq6NtYIYd8CTjXyOm6GSOYeKrMcxbyAVY9v7OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676986740; a=rsa-sha256; cv=none; b=OAn/kVGMsKbEwAH15mgRySCoCnMG6fmYcdyCh4X1QndIk+cAq9Hg4j7XmiOudzBvAjf6C9 VBz/MLwcXC7ul9jGocubPipjWd25ffbOGHi/DAfiVxZ7y1/2KrSDGwrKUUwliK/6VlVBac HvSZ8h0RQYsvJK2GalAEOp5n4BKiM59sLBy+7cUZBr/AAbHU8uEeAA1VpiHpo/DAXL/1wc iIt6QleN/fs1PP7bsL4VGjAR6Kxpajq6NFsuWubzar/V0Zqz6W77wOKJKuvOqo/i0+9zDv 40YmIZ8qc1Cm3kEMQlQXH8cy7LPN7BSl8SGmS7jrt8wuBSy83/4N+8TTXXsPug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLgNz5mpvzNGF; Tue, 21 Feb 2023 13:38: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 31LDcxYU079499; Tue, 21 Feb 2023 13:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LDcxPF079498; Tue, 21 Feb 2023 13:38:59 GMT (envelope-from git) Date: Tue, 21 Feb 2023 13:38:59 GMT Message-Id: <202302211338.31LDcxPF079498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Kubaj Subject: git: 50796dea719a - releng/13.2 - llvm: make sure to use ELFv2 ABI on powerpc64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 50796dea719a4ca2e26376eaab67eafd94532fee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=50796dea719a4ca2e26376eaab67eafd94532fee commit 50796dea719a4ca2e26376eaab67eafd94532fee Author: Piotr Kubaj AuthorDate: 2023-02-16 23:49:43 +0000 Commit: Piotr Kubaj CommitDate: 2023-02-21 13:38:43 +0000 llvm: make sure to use ELFv2 ABI on powerpc64 Currently LLVM is more or less set up to use ELFv2, but it still defaults to ELFv1 in some places. This causes lld to generate broken binaries when used with LTO. PR: 269455 Approved by: dim, re (cpercival) MFC after: 3 days (cherry picked from commit a1ffc2fe9ce54a498c410dcab86495569dbaa7cc) (cherry picked from commit 8f39cbf4f30c9a8cd3f593dc2b373a289785d4b6) --- contrib/llvm-project/clang/lib/Basic/Targets/PPC.h | 3 +++ contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h index ac52eb219f54..cd9bf0d8e359 100644 --- a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h +++ b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h @@ -425,6 +425,9 @@ public: } else if ((Triple.getArch() == llvm::Triple::ppc64le)) { DataLayout = "e-m:e-i64:64-n32:64"; ABI = "elfv2"; + } else if (Triple.isOSFreeBSD() && (Triple.getOSMajorVersion() == 0 || Triple.getOSMajorVersion() >= 13)) { + DataLayout = "E-m:e-i64:64-n32:64"; + ABI = "elfv2"; } else { DataLayout = "E-m:e-i64:64-n32:64"; ABI = "elfv1"; diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index 3eff00fc3c05..9b7145aafead 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -221,8 +221,11 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT, assert(Options.MCOptions.getABIName().empty() && "Unknown target-abi option!"); - if (TT.isMacOSX()) + if (TT.isMacOSX()) { return PPCTargetMachine::PPC_ABI_UNKNOWN; + } else if (TT.isOSFreeBSD() && TT.getArch() == Triple::ppc64 && (TT.getOSMajorVersion() == 0 || TT.getOSMajorVersion() >= 13)) { + return PPCTargetMachine::PPC_ABI_ELFv2; + } switch (TT.getArch()) { case Triple::ppc64le: From nobody Tue Feb 21 13:50:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLgfL60MXz3sgGv; Tue, 21 Feb 2023 13:50: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 4PLgfL5N4tz4LKG; Tue, 21 Feb 2023 13:50:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676987434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MJTUPZ9hGOZGqLUCfhc83OERtjMeL+Hsq4N7jhu+S9Q=; b=ibpwIUoryhfkwG56FuMkS5+5/lvoyp+P++vRbXsBVYbkv4N0rEyS2LpGu/E8YykS133dq5 qA6X8ZOxP6vTQaCkSlvuHf4v8yoluWTrC9Z8t+jl/DPPeAtIwesV/nILuPDmi5gMvZq6rZ R+PnYHW0sTFjPpgP2zS2dCacv/ze7i7iXNILrIa3uCzA3sD9xvD/m5Ad6dZMoP/Z13IrJC e6qDvQn/TV5+/4KRqSMJIFWg2XWh9itq9+QttMW7/jvV1EQio7dUE94krFiko4sx8Qtv9s W3nRiM2ClPEXBTMYtEt3SBqQQ193wbZPb7PkXfmVD9gdw/03XsXowgs0xJhG0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676987434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MJTUPZ9hGOZGqLUCfhc83OERtjMeL+Hsq4N7jhu+S9Q=; b=pqeGQOPFMSsY63Uu1QcNOW+/wLkGDvT/Q6xTqpw0/K7cPV9xx+5Tj3EYyOZYQwod5w3AWA zGAN+1nn8f2injO/8WCGmsoEvzbEQgxhcgia2HnDFekWIJqwfusGQFYXgNLIA7YuwYUG9y g5kMeWjCTJrnHZbkwoiiVdV0D6ML1Ug3TvRhG8yYZuaG6680ao0AykPcKrX0+dbsqjU5Lp SnSa3LjlcPw25GzMeEi27uj3ULgU2lhkGEdtVXoCINj6PHanv+4c0/vck3OImHkUxtPrhs 2bMwn5MKRGmURKInzYLF8k8eqTpWd3VyJerZ3PHmys0u+rv0xKl7O+caekVxCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676987434; a=rsa-sha256; cv=none; b=kl/Lt0vG9VgEDT9B/TkADH9pSObLA/PG3qNQ4W6XGO/GJWE7ShX688ffKdfvf2Seb2i2Ab bHjPsXQcMMdnRJg4TJPggRCuM0NbifMaIkPAMGfJ7CIPaJRUxs/trlk23YAu4CWo8EaQ6C iwY8O1hVNvDGtSR7XUeysHycqZ/fiL8zFf7uMRTgkIiwIb78bmYsa5vrE1xQHrrmaaBj87 H1vgZhrTw5MqpnIi1FB/UHIVczK6C5rV+zGCv8Qvf5NBMnwpv5lg1uLDsGtIOcjr7rLyO3 Oeeo0a6jI8oCj4qGRtbtjRxBS6X+/QEOcZLvhe8fSv7ytX6dZ3+R169FOTI9pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLgfL4QmFzNHG; Tue, 21 Feb 2023 13:50: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 31LDoYbK001989; Tue, 21 Feb 2023 13:50:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LDoYFo001988; Tue, 21 Feb 2023 13:50:34 GMT (envelope-from git) Date: Tue, 21 Feb 2023 13:50:34 GMT Message-Id: <202302211350.31LDoYFo001988@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: 7f337c94b5dd - main - sdt: add __sdt_used List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f337c94b5dd4b2848e5d5e32c2fc99b9d5ca515 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7f337c94b5dd4b2848e5d5e32c2fc99b9d5ca515 commit 7f337c94b5dd4b2848e5d5e32c2fc99b9d5ca515 Author: Mateusz Guzik AuthorDate: 2023-02-21 13:43:00 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-21 13:43:00 +0000 sdt: add __sdt_used To pacify set-but-not-used warns when compiling without sdt probes. Reviewed by: Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: --- sys/sys/sdt.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h index fb5c3d671604..2407ef88ab56 100644 --- a/sys/sys/sdt.h +++ b/sys/sys/sdt.h @@ -86,6 +86,8 @@ extern volatile bool sdt_probes_enabled; #ifndef KDTRACE_HOOKS +#define __sdt_used __unused + #define SDT_PROVIDER_DEFINE(prov) #define SDT_PROVIDER_DECLARE(prov) #define SDT_PROBE_DEFINE(prov, mod, func, name) @@ -141,6 +143,8 @@ extern volatile bool sdt_probes_enabled; #else +#define __sdt_used + SET_DECLARE(sdt_providers_set, struct sdt_provider); SET_DECLARE(sdt_probes_set, struct sdt_probe); SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); From nobody Tue Feb 21 13:50:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLgfM6jJSz3sgJl; Tue, 21 Feb 2023 13:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLgfM68Lkz4Lmq; Tue, 21 Feb 2023 13:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676987435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OPsDvzICkceGYs+k9gXFutQwlofl6PSJAtoBvL+neJ8=; b=F4ayd6VEe913k92bYLFIQ4TjJeKZxxm96a9zcC+I+xGh/g/OizwKaJEk7029xg0AfpAveu XGaVXZPGwoL4pjBIPhTiCv4BLOi2lz008QjuyRQ2c0JHl0Nry4XoRU2DehcM/Pu+lmXHht 6XcP9QCypVU0qbcIsTpgtZ9ePum7X89qCommAaTbLaQu1BkMR41fVBHdQiGDqsbkGkFtJS EWm04pmZrXE3wuRIxDmE/h1Qd+d/8mam/OsZGak3zcRuGJFv4O+YpbcpGOa4FBrDpPJgbn 6m3xq0gOGO04gcIRC6mmZCCdms4yI24S6q9dJlXHpuU7aTfplCrHpXtUtw1BxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676987435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OPsDvzICkceGYs+k9gXFutQwlofl6PSJAtoBvL+neJ8=; b=U2Quh45YjmyTNzrOib7HQA0JO8qQlC97Zb1M9KQwbE6D9Mh1bdkE2uvcHwgdMYCReUkIdd Webp++D3DvediWgrO0Y/JXv2Cp/UJusDPc2cIAYGOwCm1jnD0s3n6HI6iTYbAjc0zAR4NY Y+5pCAVz127K/fResSLc8NeA/8ywH2kYWIc4TixQW4rSSwSxnznN+yYMcicwFTU5mNIpKb zKpAG8F5/t1b9IqWnfFP+s3k2eLCQSibZSF0Swu1Z8gym13Z2n9R8KJ08aV+ToUgK4EWcD WDZENw0u1JEF3IxqpX/rcROqfKm0JvjstP5TUg4GWHnpsHEEmt2iAongdmfNTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676987435; a=rsa-sha256; cv=none; b=VFISNbbvYUGFEfPpgCDBZTyPPtalXf8snRft/mCS89/kY0wMcQ95VMqi/CjWr+++WIkI5O TYxI8hkfln2Azdbp5PzVCLXiFtF7mWMJv1LT4uC4pu7tF1axrNJtYx1mCLz4Av6FvZYzco efN4dxXT1f5R82PynoxZw1+AKO5e33OCFCfiTM0dtWjgT+/47CdfsbwjtaZ5Vhtq2i3OoC HiH96lnxzMiKJXH8ycERgZ6HKdfNdvptBZfXhIrbWGhqq/JrqCBaYuuGzCgpXWxA2rVlJ5 UMZtdqVrUm3kpBPrEjElkMcCxIsR3u0+dHdnuf24wAJW+DhJTSLIMEm0gm1rcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLgfM5GBfzNHH; Tue, 21 Feb 2023 13:50: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 31LDoZSK002018; Tue, 21 Feb 2023 13:50:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LDoZuJ002017; Tue, 21 Feb 2023 13:50:35 GMT (envelope-from git) Date: Tue, 21 Feb 2023 13:50:35 GMT Message-Id: <202302211350.31LDoZuJ002017@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: dbcd7e7e329c - main - vfs cache: whack set-but-not-used warn in cache_purgevfs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbcd7e7e329cd555e12434b2fa9e48f3dfeadf05 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=dbcd7e7e329cd555e12434b2fa9e48f3dfeadf05 commit dbcd7e7e329cd555e12434b2fa9e48f3dfeadf05 Author: Mateusz Guzik AuthorDate: 2023-02-21 13:48:35 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-21 13:48:35 +0000 vfs cache: whack set-but-not-used warn in cache_purgevfs Reported by: kib Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/kern/vfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 47065cf85bb5..3ae2b663fffb 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3016,7 +3016,7 @@ void cache_purgevfs(struct mount *mp) { struct vnode *vp, *mvp; - size_t visited, purged; + size_t visited __sdt_used, purged __sdt_used; visited = purged = 0; /* From nobody Tue Feb 21 13:50:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLgfP07ZTz3sgM6; Tue, 21 Feb 2023 13:50: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 4PLgfN6qRgz4Lyl; Tue, 21 Feb 2023 13:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676987437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sa0Qi3TvgRZUo/vdijBbclgYCMQUD6SYUg1SXKhVnsU=; b=O5/yg+06BplAn+5uwXNFaxwBJXFS9229rInx3l+HwcYc20jHMCZQ3smIOYWNihMTJ7LSKP VK/aXptARa2EVqixJcZyEv1ZaWe803CBvaD5zUZ30oJDng9I5dMlENsIPCQIU/l6g/DNMe 7WZzllSlGqnj1lML01bBlcQMpwowCyR/g6LiMql1ti66bXQkiT9TFQ+CJBZ/LJT8gtS7ld GAV/zPFx8KHNNNCWvbYHcWWojEtxxE+z3JiJCxkxxVZCptEqAwgkMpLho/vlB+CLgjdDRK R9tZjo9CY44fenpV11DjTwrK/tGoM1R7hXcgKLx2SBc/XRy0Q0z2qcO9f2TtRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676987437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sa0Qi3TvgRZUo/vdijBbclgYCMQUD6SYUg1SXKhVnsU=; b=VwH//xhcZhpiSebbuQN4agyJDSpPEQNvNzX8LNQIqHSg8hXj7AJ8E3rxZDHZsmNiyaf44q EjeKcFs5WIYy7qWwhOfHZn+PNeWIiRljJTyAcS3M1G2onQPhDN8kB11LcrZyHIXZzEQxBw wVnr+a7eVd91PzC0RqRBGlRqOdFLj1XpSGqXxt8tiTzVvnBuqO8vdmB3qXigjxJnnQWJPK WHGePWHGIPony6m6wEZ5HjhDOElZIAV0zEPDd/ZifC5oMShuG53buVPxQsrUp2MKRKR2Nz awxYGMNbi8qzyQysZR9P+DCtLhIvu6yaDfAaD6zdJBa6eTnlykArNPH3Ac2PDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676987437; a=rsa-sha256; cv=none; b=tRgcGHVQAC16G/N6/dQFCvpQwPLFt8KW4c8lpvK9+uQ1Vu/c4x864THQhxNNLneRmSNHem zGlqd7wtnew9+79Kb5Hr4QuR911OtK7N3kbwWQM6Gblg+nUEwI8k0bkxyLZIYG/T5sXNTo ATyPdiMrwtmwGQFM0LXKNyhowzTS3O+XDNszshiKNOy4InKgCIZA4xRChSNPMTNeqxqXrF 3nFHeGfW5FhXqJTtEP/vc3m+k5xpqus90JzSd0C3JuNMnbj70FLRqrkB2b5Xmgwd8KZ9xv /aUryWT6QKHcL/GgH/N7HIpDhUpjNZ87/UPhVnRSYHq1PThwS8pS/PwfjRGM3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLgfN5xM0zN7r; Tue, 21 Feb 2023 13:50: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 31LDoakN002039; Tue, 21 Feb 2023 13:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LDoaQ7002038; Tue, 21 Feb 2023 13:50:36 GMT (envelope-from git) Date: Tue, 21 Feb 2023 13:50:36 GMT Message-Id: <202302211350.31LDoaQ7002038@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: de709b1455fb - main - sx: whack set-but-not-used warn in _sx_slock_hard List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de709b1455fb464bdfab735c81a1f69bd1b9df91 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=de709b1455fb464bdfab735c81a1f69bd1b9df91 commit de709b1455fb464bdfab735c81a1f69bd1b9df91 Author: Mateusz Guzik AuthorDate: 2023-02-21 13:49:14 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-21 13:49:14 +0000 sx: whack set-but-not-used warn in _sx_slock_hard Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/kern/kern_sx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index ad1c1a0e8813..2b826fa91a26 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -1039,7 +1039,7 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LOCK_FILE_LINE_ARG_DEF) #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) uintptr_t state = 0; #endif - int extra_work = 0; + int extra_work __sdt_used = 0; td = curthread; From nobody Tue Feb 21 14:03:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLgww4Mv6z3shF2; Tue, 21 Feb 2023 14:03: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 4PLgww3tXwz4Nmm; Tue, 21 Feb 2023 14:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676988192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zEQvV6Dg3qM5NqIjgJzyHj1lxziDSUaM+OBOwMKo+f0=; b=bxhBcW8Az4zVie8xq0u7m43R/lDSXqbmWoSIlEvOX2OHwQXsd+1UGwhh3XnDgN8j3JhNFb l8yDaOb74g1q1wQ/MV1McWwihX1yXofPHKBHoOvGGTT4NoxL5Qvwl250tRsmJ40GjEoIA8 OL864LXYo7v4VbkslXYmjBOAYZkBpJ5l0RLqWMmPgfLeZzL4zAuFzJzFv3vlMvtfKguduk H9omOwDyTS4ez5VsS63iU8dKFTftQCnpugDCM8Kic+uQjQ/iz9Lh/W5A0nojLkEORH5xwd mnEmFORuO0ACIh2GmdPwfu/tTEoDg8E571ru7osDA3UZBmHKZ9dyb6rvAnYjwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676988192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zEQvV6Dg3qM5NqIjgJzyHj1lxziDSUaM+OBOwMKo+f0=; b=iv0na7z4ZWJqqsHwMQ5QzPCExJ9E5MOpwt0Duw+Y8F5jvmW5sBo8UPVMyBHFoSB1rEeiDD dJYD8jxAh/e4HFxCYQGZXmTPO1nHs/n4SR24kI+I5Z9ss9LtGixcIm7d/yZ4oMA6Z4mdRW al87fCzW62rrRmTU2IAVE0o42gv5wFC8DgE3/khkOqgRzQILJLdiGEH+yXa41CDu9a1/hl Xrg2dq061TGbImInBdgYagIGCut0o5AvxAjN5PuJitx3+W0Da3AgVbpDMZOE704aIHHAbF +nP6fusyKuCVjzslvdgBc++uN9BQ8hSd/OXdYuzPWITB/vc2CA0o0mRRl12Nug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676988192; a=rsa-sha256; cv=none; b=NEUbevXFmS6e8PEBZhmBcNx66yAxEKJNbAc5pqkpZZj1Xarqw0S6xmeYNCRfMs8MDFGiLt B7Whwep4oVQQhSv9Sjj9ViOMDHbkyi0IYzPgGX+I0y+NO1vGTkJ8EBI0q2cT9RI/MxB1NJ ctPqkqCXJqIyLqXDNXAmkxqT99Y5IakmD0Su74eqUqjLa4coX3C6kMPZVtoZMPnXp+KxLk 3SuB00ajvP7x75WZCKp9lMk2OsNhZhET7HZO/2WIqgPSMMOhHs9rtq35DlkJOB8gfI6sZo 9Mq80Nd7pwb2CtfP38+tJxwRKSQaR3YnRZvbmaTTP/5O9U5dZyEJu3FUWeuhMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLgww2w6pzNj3; Tue, 21 Feb 2023 14:03: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 31LE3Cdq022264; Tue, 21 Feb 2023 14:03:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LE3CIa022263; Tue, 21 Feb 2023 14:03:12 GMT (envelope-from git) Date: Tue, 21 Feb 2023 14:03:12 GMT Message-Id: <202302211403.31LE3CIa022263@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: 836e4b371b6e - main - kern/sysv_ipc.c: use ANSI C function definition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 836e4b371b6eacc8a7e14cdf30fbced59c343455 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=836e4b371b6eacc8a7e14cdf30fbced59c343455 commit 836e4b371b6eacc8a7e14cdf30fbced59c343455 Author: Konstantin Belousov AuthorDate: 2023-02-21 14:00:22 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-21 14:02:46 +0000 kern/sysv_ipc.c: use ANSI C function definition Also remove pointless return's. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/kern/sysv_ipc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c index 4a7d79ad23b3..071253a9f59d 100644 --- a/sys/kern/sysv_ipc.c +++ b/sys/kern/sysv_ipc.c @@ -56,23 +56,18 @@ void (*shmexit_hook)(struct vmspace *) = NULL; /* called from kern_fork.c */ void -shmfork(p1, p2) - struct proc *p1, *p2; +shmfork(struct proc *p1, struct proc *p2) { - if (shmfork_hook != NULL) shmfork_hook(p1, p2); - return; } /* called from kern_exit.c */ void shmexit(struct vmspace *vm) { - if (shmexit_hook != NULL) shmexit_hook(vm); - return; } #endif From nobody Tue Feb 21 15:37:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLk1Q0tqNz3snN5; Tue, 21 Feb 2023 15:37: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 4PLk1Q0PCtz3G7t; Tue, 21 Feb 2023 15:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676993834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+yvsiglxpRgOEJ0JXR3PA9HwyxJXgd863RC8kW481mE=; b=MRRBJQLj9gk/VH7usKo4LuPpfohsxkTNGDT/0RQBPFDOVySYkxrtBJ01aZIwbvPNLKM3Kd 1hkcaA7wsrGOfaIps5qMt0Jo0vpJZXaFCOXRkdi7mNjyHLNDHJ5CuL8cc0P3v3mbOBYKYM 6FU+93zJErb/ceJFJJyZIy+jLCYQ4AYv7pwIkPn1EqcCmyzIlqertkiyzBz/OgvxYFRFFL /oJppsm5EvTB7xQJmcNfsnxOG7jwI1pmjA1wtrHmSe1elivOAaR9YRYGGWNiugPcjtYb/4 zdnLxyxhp1qhl9Wbs3G7wjku8OM03wwTXImk7lz3Qp5YB6ih0VTB+lXK3oXW6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676993834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+yvsiglxpRgOEJ0JXR3PA9HwyxJXgd863RC8kW481mE=; b=BVQCJRwviKHtHyGlGzwvLVB5lcRlQKqn1WJ+MwvVWjDKAe3BrAj5IszItY69LGS1eIAnHj 1y+tL6C/ZwDGOZvqmT9W5p3BKIlMqEp3zS3cVW6DKTGU3kHYsfR9Suer4ik46J4u5c8gZJ dD2w3/szHd8D5ccaOxsjmIaK2/HGXRbDhPZFRic55pBoWBVQif1hhRNfUR1ZO0DazzyYUv 7iNZNPrndeSVTKVuP6rTlc/BOmzXQD/6jrmV3EDx82Em1HbsdbsfTFEfJTf2yU144zaowx ziXJTVYfuicQ7kabfYu61YVAofPTVtvxT3DkxiMFkoqn7NQRLhI+O5TDBj4gTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676993834; a=rsa-sha256; cv=none; b=WHEp1y0Ye5TuUwqTewQMC/KRUD+CE/wFl0Di/tALv+bNFPWWMACVhJzry0Kr7XXSAY0n2q vekAIrekprJTcMj/qYIM2wr+pueb7QHoDBNsOYwrNZwBuc9VTaAJDdE7vRKVvszwS+aSzo UzTLTdLDDbxObC182a1DGFfNlbOH3UFNHzM3amTqqwfMiKYPw81mVnxBPCqGRZR/RJ3VQB cV/6mS6HaTc5RpD3U5AaAZngg87QMaa/4nTd0nD2DcHtlXmcsdfqdSr6HRMnfJp94L4J2b CMoi2vyISxNCPtM7tEEu06izpFeW62aTtXr80BG/JDSQRWEIeiDCVzBxUiMAYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLk1P6NNgzQxD; Tue, 21 Feb 2023 15:37: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 31LFbDPd050656; Tue, 21 Feb 2023 15:37:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LFbDI7050655; Tue, 21 Feb 2023 15:37:13 GMT (envelope-from git) Date: Tue, 21 Feb 2023 15:37:13 GMT Message-Id: <202302211537.31LFbDI7050655@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: 192a00198400 - main - i386: whack LINT-NO* kernels List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 192a001984009ad99e61203db0ea97bd1fc2dc73 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=192a001984009ad99e61203db0ea97bd1fc2dc73 commit 192a001984009ad99e61203db0ea97bd1fc2dc73 Author: Mateusz Guzik AuthorDate: 2023-02-21 08:35:19 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-21 15:36:48 +0000 i386: whack LINT-NO* kernels there is nothing i386-specific about them and equivalent configs already build for amd64. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D38700 --- sys/i386/conf/LINT-NOINET | 8 -------- sys/i386/conf/LINT-NOINET6 | 6 ------ sys/i386/conf/LINT-NOIP | 22 ---------------------- 3 files changed, 36 deletions(-) diff --git a/sys/i386/conf/LINT-NOINET b/sys/i386/conf/LINT-NOINET deleted file mode 100644 index 2e4366ef8996..000000000000 --- a/sys/i386/conf/LINT-NOINET +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -include LINT -ident LINT-NOINET -makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT=" -nooptions INET -nodevice gre -nodevice netmap diff --git a/sys/i386/conf/LINT-NOINET6 b/sys/i386/conf/LINT-NOINET6 deleted file mode 100644 index ffb275fd68d9..000000000000 --- a/sys/i386/conf/LINT-NOINET6 +++ /dev/null @@ -1,6 +0,0 @@ -# $FreeBSD$ - -include LINT -ident LINT-NOINET6 -makeoptions MKMODULESENV+="WITHOUT_INET6_SUPPORT=" -nooptions INET6 diff --git a/sys/i386/conf/LINT-NOIP b/sys/i386/conf/LINT-NOIP deleted file mode 100644 index 1c91dae98baa..000000000000 --- a/sys/i386/conf/LINT-NOIP +++ /dev/null @@ -1,22 +0,0 @@ -# $FreeBSD$ -include LINT -ident LINT-NOIP -makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT=" -makeoptions MKMODULESENV+="WITHOUT_INET6_SUPPORT=" -nooptions INET -nooptions INET6 -nooptions KERN_TLS -nodevice age -nodevice alc -nodevice ale -nodevice bxe -nodevice em -nodevice fxp -nodevice jme -nodevice lio -nodevice msk -nodevice mxge -nodevice sge -nodevice sk -nodevice txp -nodevice netmap From nobody Tue Feb 21 15:38:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLk2T2D1Lz3snh4; Tue, 21 Feb 2023 15:38: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 4PLk2T1VPMz3Gft; Tue, 21 Feb 2023 15:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676993889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gYCoq9dk7tuLVOBVFqHuuxDpIVa43XIEeZGeAWLZoKM=; b=pFzdJwR1UrFQutS9fUhnwmkvkjOMdCc+JNpJ4nMKpZ/LpLoJ1dQ+VvRu0IH1fJThAl8k8v bOVPhFcgc4uPbEAVzbVRgYRB9sl19EiNfVGrgqqs7XQrc6wNdngDLKFwp2yffLr57z8/Ea jtk3Dy5g94xNf7wIowNch6DVXNnSrLWr5CjFpLR9HdEs5X3DLsEjZ7ImtZAg4gszl0wXRr no3bAGq/ZVLBvNLpHdJNCno9C8g8TMq0tllK18MdomjhoNQyB0IFQhtg+/6OTdDcKsBfIR wwdSYdjAFsT4GRzclQlWrHtpVqJa2kXrJTn/9ydfJOp0qGG2CSuwTTp2x79sNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676993889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gYCoq9dk7tuLVOBVFqHuuxDpIVa43XIEeZGeAWLZoKM=; b=DtQPSXviGfcz5m3RbzrO1phVxbqXY2PU8BsRtnsNrZlVYubJG6B1JGqQP73Edl6xsE3qsQ M7lIqOoIoSmixxedZRiMZu8S3yMLs1fAHpa5hAATJkxDg0NlTLPzpBKxbGhRIsgVyp5bS4 hIwGlj1OR2meX42LotinBARBnALI147wvDgJPwrGm9yxVsjz5bPrQvKxGHyyAUsBxbTVlI ZsV3qaAF07JrPalz/Q0GtUDS+ho6Q5hwgu+d8Ks8B1KHEK6A76n3zvA1sZh4eW+0QfuXYn 8Fwbxec6+gLVgAycxlvtOTpasKs1KgiKFz5HYiIs9BcDXeS5qkpNWw6iTWAUrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676993889; a=rsa-sha256; cv=none; b=T/htfU2DWAkf0gs8IHHLkc9nzYhrJRD+62/i8On04K/tABT+z5PjG59T1uFAQD6iGdoLt3 nyEc1IhtvZbSS4rsazDDmJR/bnNm3TUnWgm9WuG5piIeiid1dU67ZG7WXFn6IB9tneKgau U0tYSsQ0mPwI4aJNfOlt03+q+Kb4zvG/O4oll0YetKGl81PaGykD2rv1XoDfEZEu0gSYSu hOo3JAfgdHClftGELZEHzseP/6rKZAOFmrhehTnoyJGWRV8C1AX9W2btAy+Uxu5088SL7o MAzdg8nSLAZwYZr7BwGgQltmQUpl3MtAPQO9jmBvYIO5QfquIVfJvSl3rHrVUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLk2T0ZLpzQc0; Tue, 21 Feb 2023 15:38: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 31LFc8RO050867; Tue, 21 Feb 2023 15:38:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LFc8oE050866; Tue, 21 Feb 2023 15:38:08 GMT (envelope-from git) Date: Tue, 21 Feb 2023 15:38:08 GMT Message-Id: <202302211538.31LFc8oE050866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 57c37babde36 - releng/13.2 - cleanvar: Be more careful when cleaning up /var. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 57c37babde3664c81bc30ec5086092ae950aab49 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=57c37babde3664c81bc30ec5086092ae950aab49 commit 57c37babde3664c81bc30ec5086092ae950aab49 Author: Xin LI AuthorDate: 2023-02-13 04:56:17 +0000 Commit: Xin LI CommitDate: 2023-02-21 15:37:30 +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 Approved by: re (cperciva) (cherry picked from commit 39e8c2a29a860bdb69ffcfbc06de4d4ad103b458) (cherry picked from commit 0699f0d43416776d87d20d7953b7d686f1e2e572) --- 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 Tue Feb 21 15:51:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLkL037zwz3spFH; Tue, 21 Feb 2023 15:51: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 4PLkL02fRnz3H23; Tue, 21 Feb 2023 15:51:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676994696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HW33LUVpEz1j5Nz2M24Tmi8tjGIt/eazdf5n5LxDlqU=; b=wxaAfXMDNEbmNN4OyGdhV2VZlmMr+yX4EItOjB4Fd8qNEC7/GL119pdPuutiCNj5mfar3G AzVxQeKAlEMDrQjw6KMr7AaceVMsmlrHm6/HE54LG+64/+l+L0eGlu+07ywwZL0Xyj6RDz WVmYQH/sINFCyBZECPfHo11BHcB/A9cfZ701DeDjdmEcMpCWghK6eRLFeRiqHtN+4mDDfz q14h7L3c10dn93pslAMxK8o70MiJqhAr0is3Paj29VcsEEG+s2mR1OS+3KTDe0nQjLaZ3h 0RA2/+b6OgWwzEP0eTUOZagPulsmbWaimveXSAMQfjEnCqftRGcIS8Y6JQbK6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676994696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HW33LUVpEz1j5Nz2M24Tmi8tjGIt/eazdf5n5LxDlqU=; b=enVHok2ZzISg+8zXr9VfRyoWyNW2fc038CVsiffAmCQ6HSkrjWnWzn8Jws6J2vrRw6R0Rb vSq5NxFn0NCY4WY6vMeSPzYDQcnjRHbFwPLqvpNpzNN4Wf9+UqOHg+WiBwPyrMDObN2eeW aG0DkEEJbEQv9C+5u/5RGtq6vUoubR/wBZLatY+BRVuBDgzrMmqBhI+qkw/OR2JWVtCCvp sohi9pagBEd43SupcfwK+SF6i/tYjKXg9tw6DcGrIJArqyMpRV6931xHcZ4Pb9YfkorvpZ oYAOTk4zH/UcXdgJmh+3z+l7Wze9ex/7MbzitZ3nZGSEFIUgH2ESVBiluPck6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676994696; a=rsa-sha256; cv=none; b=eCI4KR/mZzaqROq6XVwVk1Wv0DVrmkNMy3NddK6wklSRWH1LOfwvoQVubL6DVeDnYbwj1k rh4B0CZRqBA4e4D89xeFcZUHQeK0aRMl9Rd4xCF1v1OAiF3STStaMH3a/60pX1opjupCC0 2xybXzdjSu5zZ3wi3RJHh6Mqh7Bpw4HMk405P/M3Cl0ujyRS1TPFkq3ZebAqAE45uFUoIV sCEbJbFvOXjXxzZyFaZ6AyFPYZ6EjN0dUrQDKWZZcMAM7ZhZgmc3G++zmtroDpR+Qjgg18 2C9bPbYmG31Ik7tCLym+6hDksx1oil7Eo2vlVTz5Yg/uVJvEM3YB9M3FWgmaLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLkL01lHWzRGH; Tue, 21 Feb 2023 15:51: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 31LFpaRk073691; Tue, 21 Feb 2023 15:51:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LFpa3c073690; Tue, 21 Feb 2023 15:51:36 GMT (envelope-from git) Date: Tue, 21 Feb 2023 15:51:36 GMT Message-Id: <202302211551.31LFpa3c073690@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: b2d76b52fd48 - main - jail: Fix redoing ip restricting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2d76b52fd48306486deff193d49b728afbb04a3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b2d76b52fd48306486deff193d49b728afbb04a3 commit b2d76b52fd48306486deff193d49b728afbb04a3 Author: Zhenlei Huang AuthorDate: 2023-02-21 15:43:25 +0000 Commit: Zhenlei Huang CommitDate: 2023-02-21 15:43:25 +0000 jail: Fix redoing ip restricting `prison_ip_restrict()` is called in loop FOREACH_PRISON_DESCENDANT_LOCKED. While under low memory, it is still possible that in subsequent rounds `prison_ip_restrict()` succeed and `redo_ip[46]` flip over from true to false, thus leave some prisons's IPv[46] addresses unrestricted. Reviewed by: jamie Fixes: 8bce8d28abe6 jail: Avoid multipurpose return value of function prison_ip_restrict() Differential Revision: https://reviews.freebsd.org/D38697 --- sys/kern/kern_jail.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 75be0df85448..92e8e4f34b42 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2047,7 +2047,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) continue; } #endif - redo_ip4 = !prison_ip_restrict(tpr, PR_INET, &ip4); + if (!prison_ip_restrict(tpr, PR_INET, &ip4)) + redo_ip4 = true; } mtx_unlock(&pr->pr_mtx); } @@ -2066,7 +2067,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) continue; } #endif - redo_ip6 = !prison_ip_restrict(tpr, PR_INET6, &ip6); + if (!prison_ip_restrict(tpr, PR_INET6, &ip6)) + redo_ip6 = true; } mtx_unlock(&pr->pr_mtx); } From nobody Tue Feb 21 16:42:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLlSW565kz3ss4t; Tue, 21 Feb 2023 16:42: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 4PLlSW4SC1z3Nlm; Tue, 21 Feb 2023 16:42:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676997739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N2EEJrKedUcP+V8R3ol5hbNo1i9cfyfIjGK6Iur6b2o=; b=Uiog+67UAqzozgqvEesXiDjZ+RxOie85OMD3qEWAZ6M7oFZfX/X82V7ojeNt/lO8IN2GfZ lCTCg8i98Vw8YNUz+e2HzdPgswB9uf6b7tYOhNFv2Mrepr8mTQCnehX7k5Sxjdp/eP31uE Sw+CEgzMIPw7/ooPjxjTWRBS+Vytvhfg/G6v6rKgrkfkbK3kXHx5I3mRMkDDazkTXZMDuY WBLaktnClJ+Cgy5U9Rc9GLqm9BbGhfz+RAJPonJEQmjnheoIZPiqlmLESbOgIKltdt22r3 sAHA+WwjH9VvDW3Ko7mFAMbgk0CDoxVXULkZT0YskhtbMDCto6hMi0tLTXspyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676997739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N2EEJrKedUcP+V8R3ol5hbNo1i9cfyfIjGK6Iur6b2o=; b=QaT8tYeOufPs4vpvEwYzFNTZJfS9hHPjsFw7xxrXZtsgcKMGlzVW0YH5g+UE8BZTvlwSMw g/lEvRT04sNYq0DBu37uP+Hwz74b4JySmHoSaGugJ+dKDn2ko+E8Bvc8Dc4E5JAyhlK9gy Z0E4aUqCCE8pduSi1cJNQ+8YlcaqypFl/88j26I1SsNN361Lwz8q1yUtZBwKwOD/2Lflcd coeNGGtt/8ECMHT2v0LmP2UZID66DFqUXTSRK3THH8p4I/cUIt/+QMkx1spIi+S578kVfH wGJGOHyzhkDDDwoLQJiKQNKMpFL5kAcNVOyU70sZS8VQhpg1lBjMrsQLZ1sYrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676997739; a=rsa-sha256; cv=none; b=wxy1VJigQqJR95OXu5doZs/ap7SV5FnAKALY1fvmqJJuP6YRx52Kdw6ScRzP9+rPCGZGuK 6jseClBS1keg3hzMPVDeOftVH/p3Kmt7EXfngJV2WBRLtH9mQHbJfU/ccOc+O4gaMzoCdL 8kLN7Tf2A8rrEyIo+omjvEMmljhhpAnLrgHwUemezU7CA0KZ6Zy0CDGF+g25sTc+enO08/ yrXko2HdQ32oZ/hpmI6uXDiWTnYT/9r8ydzZvpRu+/ZhIPrDKaNRlyiAAYjU2Y4EH40rlY LikPAm8BOmgqfVZmeUifMLZN44yBsucFb1HPzwuj1nPI0EIAKYPsOFD1bw+YAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLlSW3X73zSGN; Tue, 21 Feb 2023 16:42: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 31LGgJP3050646; Tue, 21 Feb 2023 16:42:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LGgJXJ050645; Tue, 21 Feb 2023 16:42:19 GMT (envelope-from git) Date: Tue, 21 Feb 2023 16:42:19 GMT Message-Id: <202302211642.31LGgJXJ050645@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: fb9b76e05247 - main - vnet: Make vnet_sys[un]init() static List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb9b76e05247e014f5faa554161028f6aa409bfd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=fb9b76e05247e014f5faa554161028f6aa409bfd commit fb9b76e05247e014f5faa554161028f6aa409bfd Author: Zhenlei Huang AuthorDate: 2023-02-21 16:22:23 +0000 Commit: Zhenlei Huang CommitDate: 2023-02-21 16:22:23 +0000 vnet: Make vnet_sys[un]init() static These two functions are intended to be used only when allocating or destroying vnet instances. No functional change intended. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37955 --- sys/net/vnet.c | 10 ++++++++-- sys/net/vnet.h | 6 ------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/net/vnet.c b/sys/net/vnet.c index 4f242b07f169..b064e8e864ff 100644 --- a/sys/net/vnet.c +++ b/sys/net/vnet.c @@ -220,6 +220,12 @@ SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, "int"); +/* + * Run per-vnet sysinits or sysuninits during vnet creation/destruction. + */ +static void vnet_sysinit(void); +static void vnet_sysuninit(void); + #ifdef DDB static void db_show_vnet_print_vs(struct vnet_sysinit *, int); #endif @@ -571,7 +577,7 @@ vnet_deregister_sysuninit(void *arg) * vnet construction. The caller is responsible for ensuring the new vnet is * the current vnet and that the vnet_sysinit_sxlock lock is locked. */ -void +static void vnet_sysinit(void) { struct vnet_sysinit *vs; @@ -589,7 +595,7 @@ vnet_sysinit(void) * vnet destruction. The caller is responsible for ensuring the dying vnet * the current vnet and that the vnet_sysinit_sxlock lock is locked. */ -void +static void vnet_sysuninit(void) { struct vnet_sysinit *vs; diff --git a/sys/net/vnet.h b/sys/net/vnet.h index d0ede39c0cb1..a02b86077043 100644 --- a/sys/net/vnet.h +++ b/sys/net/vnet.h @@ -360,12 +360,6 @@ struct vnet_sysinit { SYSUNINIT(vnet_uninit_ ## ident, subsystem, order, \ vnet_deregister_sysuninit, &ident ## _vnet_uninit) -/* - * Run per-vnet sysinits or sysuninits during vnet creation/destruction. - */ -void vnet_sysinit(void); -void vnet_sysuninit(void); - /* * Interfaces for managing per-vnet constructors and destructors. */ From nobody Tue Feb 21 17:03:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLlwc4spJz3stKR; Tue, 21 Feb 2023 17:03: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 4PLlwc2fXrz3Pv8; Tue, 21 Feb 2023 17:03:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676998992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qW3a3hZsk63AFz9VfU6/Kx+s1SWHCbGbShKpVbqyDo=; b=jZcNKsxUOEuYzLTrGxaJAO73KORHI0yhelmUGh2cP/A8AYvOv2uaw6lZUuQpPskeTgha5W bnG6NTpl68qZGfMDjqraGgAdT6gtOjZBchEEhX0AxYvM9VM7xnuynBkFxfvMulyEOkyfOs PriMD5/cvZVcL5Bnl475wfizr4+yM3xMIPNQVUcZcqhoGEynpNy1BNXr9HjlyGdMXSMs3o G7uaESOTQejGmuK5+ElVEYF8MZxgJmzGVrgJ7nkBE8+fX8IkUlTT/pBG9ER0uwvIKhffe7 f58qJf3z+GGpXe6DSHgr4nEscNGUvAkA/I2pu+BkZ6ZVpyWqhfUBPUQ/JraAdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676998992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qW3a3hZsk63AFz9VfU6/Kx+s1SWHCbGbShKpVbqyDo=; b=PpDQ8TTPPq4iiPXmwOQoE6M2/wPFbBBYW4O2jcMFn/15+mqQYeDNEqvD2YCPsoa/zGLAOi FlQk4SK5mgEwDZfuJJnIlyu6R/4nWnavqJIzI27Il7EMamtpu+vE5va76NO/PFF4+DWWbH O/R4Rk/3a4jwv6VOBIa/GzqQbIZhwW0tnCEVRcLzRbcTFU6dqQb/1ImyMECGN2VO4OMZpw s3tcJ97Ti5RBBgElrqUdyYMLq7XJSZ+0IOYUhjtv+KYHk3LDK8mSQP/4tRe0ELOlxrMxPW wECI84MX/FGUGMRxuoOtsqcPv3t7qNMREmsbEl5b/DgyqCqwyjDxAsJR1G5RFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676998992; a=rsa-sha256; cv=none; b=wyK/h76/+4yRPyvWEwdSMQlYvLMGG0mjePYVMZ+5JynLAVegBElptppr8cF0OPQ9z7Tj3J RoFiZJZXsOnXq3j5Z2t23H+UbXVMsGCcO0nOKigQOXYyqRYvgrTtzj5RJW0tyDt5gx+sFb EOFC9HpGzgcdl3PHhYxT8vBXCHW6mmjDzuHj+hGMTGgRv3C+REwM+TmOFPd3Ak2y6SB2zD awub+02ymZ92Ym0NRF5QvLYHZyVnrcyFhtiZrdbQl1WMGjUF+AFG+ANodB6gZyf0QpLL59 UD3EDNR+YSR1cTfhZw7RkgaO5OtP1h3VYrvQ5JJWBaGqLWA728cmPWhOZcW7bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLlwc1kZ8zSdL; Tue, 21 Feb 2023 17:03: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 31LH3C7B079728; Tue, 21 Feb 2023 17:03:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LH3CnE079727; Tue, 21 Feb 2023 17:03:12 GMT (envelope-from git) Date: Tue, 21 Feb 2023 17:03:12 GMT Message-Id: <202302211703.31LH3CnE079727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 42657d65d8aa - releng/13.2 - kern: physmem: improve region coalescing logic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 42657d65d8aabf201209b8472ef664c6dba5b6ca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=42657d65d8aabf201209b8472ef664c6dba5b6ca commit 42657d65d8aabf201209b8472ef664c6dba5b6ca Author: Kyle Evans AuthorDate: 2021-10-28 04:40:08 +0000 Commit: Kyle Evans CommitDate: 2023-02-21 17:02:49 +0000 kern: physmem: improve region coalescing logic The existing logic didn't take into account newly inserted mappings wholly contained by an existing region (or vice versa), nor did it account for weird overlap scenarios. The latter is probably unlikely to happen, but the former may happen in UEFI: BootServicesData allocated within a large chunk of ConventionalMemory. This situation blows up vm initialization. While we're here, remove the "exact match" logic as it's likely wrong; if an exact match exists with conflicting flags, for instance, then we should probably be doing something else. The new logic takes into account exact matches as part of the overlapping efforts. Reviewed by: kib, mhorne (both earlier version) Approved by: re (cperciva) (cherry picked from commit 7771f2a0c94fc2f7b9ce1565a49e52dba1e7381d) (cherry picked from commit 13f1d1bd86476393b8a2ec2c79cb0b1637fcdec6) --- sys/kern/subr_physmem.c | 92 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_physmem.c b/sys/kern/subr_physmem.c index 99b4c2141612..2c7837019ea2 100644 --- a/sys/kern/subr_physmem.c +++ b/sys/kern/subr_physmem.c @@ -295,6 +295,67 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, size_t maxavail, return (acnt); } +/* + * Check if the region at idx can be merged with the region above it. + */ +static size_t +merge_upper_regions(struct region *regions, size_t rcnt, size_t idx) +{ + struct region *lower, *upper; + vm_paddr_t lend, uend; + size_t i, mergecnt, movecnt; + + lower = ®ions[idx]; + lend = lower->addr + lower->size; + + /* + * Continue merging in upper entries as long as we have entries to + * merge; the new block could have spanned more than one, although one + * is likely the common case. + */ + for (i = idx + 1; i < rcnt; i++) { + upper = ®ions[i]; + if (lend < upper->addr || lower->flags != upper->flags) + break; + + uend = upper->addr + upper->size; + if (uend > lend) { + lower->size += uend - lend; + lend = lower->addr + lower->size; + } + + if (uend >= lend) { + /* + * If we didn't move past the end of the upper region, + * then we don't need to bother checking for another + * merge because it would have been done already. Just + * increment i once more to maintain the invariant that + * i is one past the last entry merged. + */ + i++; + break; + } + } + + /* + * We merged in the entries from [idx + 1, i); physically move the tail + * end at [i, rcnt) if we need to. + */ + mergecnt = i - (idx + 1); + if (mergecnt > 0) { + movecnt = rcnt - i; + if (movecnt == 0) { + /* Merged all the way to the end, just decrease rcnt. */ + rcnt = idx + 1; + } else { + memmove(®ions[idx + 1], ®ions[idx + mergecnt + 1], + movecnt * sizeof(*regions)); + rcnt -= mergecnt; + } + } + return (rcnt); +} + /* * Insertion-sort a new entry into a regions list; sorted by start address. */ @@ -303,19 +364,38 @@ insert_region(struct region *regions, size_t rcnt, vm_paddr_t addr, vm_size_t size, uint32_t flags) { size_t i; + vm_paddr_t nend, rend; struct region *ep, *rp; + nend = addr + size; ep = regions + rcnt; for (i = 0, rp = regions; i < rcnt; ++i, ++rp) { - if (rp->addr == addr && rp->size == size) /* Pure dup. */ - return (rcnt); if (flags == rp->flags) { - if (addr + size == rp->addr) { + rend = rp->addr + rp->size; + if (addr <= rp->addr && nend >= rp->addr) { + /* + * New mapping overlaps at the beginning, shift + * for any difference in the beginning then + * shift if the new mapping extends past. + */ + rp->size += rp->addr - addr; rp->addr = addr; - rp->size += size; + if (nend > rend) { + rp->size += nend - rend; + rcnt = merge_upper_regions(regions, + rcnt, i); + } return (rcnt); - } else if (rp->addr + rp->size == addr) { - rp->size += size; + } else if (addr <= rend && nend > rp->addr) { + /* + * New mapping is either entirely contained + * within or it's overlapping at the end. + */ + if (nend > rend) { + rp->size += nend - rend; + rcnt = merge_upper_regions(regions, + rcnt, i); + } return (rcnt); } } From nobody Tue Feb 21 17:05:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLlzk0b72z3sttT; Tue, 21 Feb 2023 17:05: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 4PLlzk026lz3QVp; Tue, 21 Feb 2023 17:05:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676999154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xLmRanEkYy9lvZMkzlYvK1+SXJp57c4oG5BFApQqdlw=; b=M7srNvEv8EC7JHORGj7yqKRMHuxdtfV/J9Y8P9grLKYW4wp9AQJrqRQSyHyYuUrO/dFep0 qwgm+jYceTg+R9v5hHWQS2Berl6OJNe8Q3sk6HZjkIOfZG4zleQd7vYo4xXmkpUIJD1AqZ 067h/HEeuuF64i/lfNJjxEmRq7YeFlsUNf1MVzgVDErkJfrbrDhfN9jYoGqiud1T9ge6JY Vy0NHIP6CRTofM3IIo0j+rP9oMehyKt9wlvR5TrDNGsB+v/p7z68PBXkHmdSdiVxsr41N/ amr7rRsh9B8I8ujhZ3QlTY21dezMlQSQHK3gRshfTQOjPEa8gC/dWpuvHjTHhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676999154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xLmRanEkYy9lvZMkzlYvK1+SXJp57c4oG5BFApQqdlw=; b=HocmPRprZuVqCrnrCDjj59iKAqqNN0pr4chpYmjO1AyNQSw/ivc5+e0Gkn71732pIObDA4 uLpWBp8qNiREVtHR1F35vKCI3OjPD2BK/VARfI3Nmd0ekFwGfJwO6uWnUxYaKqBdHdjb4c 0QC1Cx31Rf+XEiK5qjJd80A0aQwPdFjdy9L0MXMF5w/nJQ9Qc2BSbYAddcHlgojS3hjqRp HRB25wYE4wX4NLkoOVueo6wI0ybLZydNtebqpkot4UYfto2JlrmSu2Km9fNLM9FwJCj1Ic 9PM8hg9qZemzPlTy9QMRD/TzHgsCHV1JF+tiqvEuy4BGRltkTdCxeoZuUK6hhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676999154; a=rsa-sha256; cv=none; b=uSDlWeeM8jwp0yMLQVhFeF+VRERzmEQWY+Sab5QsvBggdUKYA/zvyOI+RQzo3T0Dx81scl 72McE8JZliv6dERbqeEW42msBXWngBZy/ZaudDeDhGxjsvK2WjFkwsoRdR34tmmWn1t3pm ZTavZi3cdcGytuBK2cUKH2uWmZ9zutL2McVk7uINMtzKy65Wm7WN3+g8NLIa+Y95vznl9B XdvAAEAPmgiue6Or+hnLHZW3mZ7ivzJOQ0apicJBJdP/sWDfwF5SL33M+ejVD59huSsUiR upVil107tMRaAGdCZFlKx0cNNz6vaBu5uETedGclDMPjdEK4m+gO1gAuBvS8oQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLlzj6ClqzT0F; Tue, 21 Feb 2023 17:05: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 31LH5r8n080165; Tue, 21 Feb 2023 17:05:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LH5r2X080164; Tue, 21 Feb 2023 17:05:53 GMT (envelope-from git) Date: Tue, 21 Feb 2023 17:05:53 GMT Message-Id: <202302211705.31LH5r2X080164@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: 71e70c25c008 - main - Revert "unix/dgram: return EAGAIN instead of ENOBUFS when O_NONBLOCK set" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71e70c25c0085a4e6e5eef834ca8a29b65435d62 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=71e70c25c0085a4e6e5eef834ca8a29b65435d62 commit 71e70c25c0085a4e6e5eef834ca8a29b65435d62 Author: Gleb Smirnoff AuthorDate: 2023-02-21 16:50:07 +0000 Commit: Gleb Smirnoff CommitDate: 2023-02-21 16:50:07 +0000 Revert "unix/dgram: return EAGAIN instead of ENOBUFS when O_NONBLOCK set" This API change led to unexpected consequences with Go runtime. The Go runtime emulates blocking sockets over non-blocking sockets and for that uses available event dispatcher on the target OS, which is kevent(2) if availabe, with OS independent layer on top. It expects that if whatever O_NONBLOCK socket returned ever EAGAIN, then it is supposed to be reported as writable by the event dispatcher. kevent(2) would never report a unix/dgram socket, since they never change their state, they always are writeable. The expectations of Go are not literally specified by SUS, however they are in its spirit. The SUS specifies EAGAIN for send(2) as "The socket's file descriptor is marked O_NONBLOCK and the requested operation would block" [1]. This doesn't apply to FreeBSD unix/dgram socket, it never blocks on send(2). Thus, changing API trying to mimic Linux was a mistake. But what about the problem we tried to fix? Discussed that with Max Dounin of nginx, and we agreed that the log bomb described shall be fixed on nginx side, and it actually isn't specific to FreeBSD, may happen with nginx on any non-Linux system with a certain configuration. [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html This reverts commit 65572cade35a93add2168a7a012f808ac499218b. --- sys/kern/uipc_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 8f86bdb48c69..294ef807416c 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1338,7 +1338,7 @@ uipc_sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio, f = NULL; } else { soroverflow_locked(so2); - error = (so->so_state & SS_NBIO) ? EAGAIN : ENOBUFS; + error = ENOBUFS; if (f->m_next->m_type == MT_CONTROL) unp_scan(f->m_next, unp_freerights); } From nobody Tue Feb 21 17:18:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLmGN0GQgz3svrp; Tue, 21 Feb 2023 17:18: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 4PLmGM6x6yz3hJk; Tue, 21 Feb 2023 17:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676999916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nQ6/JhGi7kgXRJYSDtf7rD24+x1HjaVdenDi2fTiois=; b=s+zk33LdyqXQSJwjJu0ITxyPIYHZ7oXvvKIp2yt1L0gsQTvCQu7GNSDlasL0LDUmR6GSKM bsFPoF7PS9DglWHuSZJKvW7VOOkUvuW6T7P1sBatNYTXrvhlc9EKzbhHkmnS2hb59dLocn x+VnTIS7pQhtIQRuMqIXeAluOTbeUFL92ShsLWw6osLZDOLC+nFtb7gybsNuiL+5qz2qbj 4uxeyl8nDOqqlZlALeKGcIkwEGDzRel2gyDl71LinRxI7tJOwr+PlHGAh4w6fwgzi6Vj7L MiLe/AimT+ivBflFLkR18l6Gv2RVKBtlw5U+GfN5Za7lxZJ6KYPzrlV1qOO+nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676999916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nQ6/JhGi7kgXRJYSDtf7rD24+x1HjaVdenDi2fTiois=; b=Dsql9JJyvPc4MCDtWZg/qK6LBl+GIokg+wXWXA2Nrnunk33C1riPesVT4DMh/IhgyVWtyv m1im+L67XEyAsAMQYiRTkk3egMM7F6jxqitko21BXqtjisdQiOFtc/BiDxEisZemQiDZiM skBWDg4wqmTnrNkLZva6xm+U98R2Z7zNX/GD2AmC/NvxE+fnS0jwyG190xbOmC5I38mw5v q6kcRxJXINeRmcz5D31YztTvjR5W5HnfnHunQ7Oj6M/7k56RBVz6LdbLOTWcYcZ/4BeOEM ft4gUBj1qpvJ61qMTOU7G5h+HazaGoJ9MMixCWVdeMpOILknyaKuiUno06Izhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676999916; a=rsa-sha256; cv=none; b=HGr+lb0ZfOB/niW9FFCnfsCO7HPxR4IPuOwXsnhnyjv6lAYB0skgSoB8kFWjRdpP4u0GZp KBRagHbZ2psID/rn5RiBB6NY9zYDXd12azvK2ivI/quuzy2Yw1i9M63edn3qo7K49bVGME 3vDr0Yz3AE5EnrqNGjStUtGOw1RwjhIdIdqkDm+F8yUctWi81jhBFrT4PEyIt2XQ1fOiQs BZUJiZXdHIrLUgCes4tAEfVIO28hZQjixt9ceeCc+SfFSxVo8bl3tUDjruGX61/gvVGAWG smTtEIKzJ9i1pOYlkXKc3UAKJO9WHjmY23kFE8qvTyNJNqJJnc9QRDff+i3RHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLmGM60DZzT1Q; Tue, 21 Feb 2023 17:18: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 31LHIZYv094326; Tue, 21 Feb 2023 17:18:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LHIZZK094325; Tue, 21 Feb 2023 17:18:35 GMT (envelope-from git) Date: Tue, 21 Feb 2023 17:18:35 GMT Message-Id: <202302211718.31LHIZZK094325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 4065becf3f3d - main - bblog: unbreak build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4065becf3f3d4a742a500e18206eae9dfdb7da11 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4065becf3f3d4a742a500e18206eae9dfdb7da11 commit 4065becf3f3d4a742a500e18206eae9dfdb7da11 Author: Michael Tuexen AuthorDate: 2023-02-21 17:13:23 +0000 Commit: Michael Tuexen CommitDate: 2023-02-21 17:16:59 +0000 bblog: unbreak build Ensure that tp is always declared and set. Reported by: Michael Butler Sponsored by: Netflix, Inc. --- sys/netinet/tcp_usrreq.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 60bb59b64868..878e5095eef2 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -229,9 +229,7 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { int error = 0; struct inpcb *inp; -#ifdef KDTRACE_HOOKS struct tcpcb *tp = NULL; -#endif struct sockaddr_in *sinp; sinp = (struct sockaddr_in *)nam; @@ -262,9 +260,7 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) error = EINVAL; goto out; } -#ifdef KDTRACE_HOOKS tp = intotcpcb(inp); -#endif INP_HASH_WLOCK(&V_tcbinfo); error = in_pcbbind(inp, sinp, td->td_ucred); INP_HASH_WUNLOCK(&V_tcbinfo); @@ -283,9 +279,7 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { int error = 0; struct inpcb *inp; -#ifdef KDTRACE_HOOKS struct tcpcb *tp = NULL; -#endif struct sockaddr_in6 *sin6; u_char vflagsav; @@ -310,9 +304,7 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) error = EINVAL; goto out; } -#ifdef KDTRACE_HOOKS tp = intotcpcb(inp); -#endif INP_HASH_WLOCK(&V_tcbinfo); inp->inp_vflag &= ~INP_IPV4; inp->inp_vflag |= INP_IPV6; @@ -702,9 +694,7 @@ tcp_usr_accept(struct socket *so, struct sockaddr **nam) { int error = 0; struct inpcb *inp = NULL; -#ifdef KDTRACE_HOOKS struct tcpcb *tp = NULL; -#endif struct in_addr addr; in_port_t port = 0; @@ -718,9 +708,7 @@ tcp_usr_accept(struct socket *so, struct sockaddr **nam) error = ECONNABORTED; goto out; } -#ifdef KDTRACE_HOOKS tp = intotcpcb(inp); -#endif /* * We inline in_getpeeraddr and COMMON_END here, so that we can @@ -746,9 +734,7 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam) { struct inpcb *inp = NULL; int error = 0; -#ifdef KDTRACE_HOOKS struct tcpcb *tp = NULL; -#endif struct in_addr addr; struct in6_addr addr6; struct epoch_tracker et; @@ -766,9 +752,7 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam) error = ECONNABORTED; goto out; } -#ifdef KDTRACE_HOOKS tp = intotcpcb(inp); -#endif /* * We inline in6_mapped_peeraddr and COMMON_END here, so that we can From nobody Tue Feb 21 17:20:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLmJb1L6zz3svgS; Tue, 21 Feb 2023 17:20: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 4PLmJb0rHnz3hhc; Tue, 21 Feb 2023 17:20:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677000031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2vtpnLNtJLwHGY+2V/AdYkmOYKLOZXKOOtUU+oZuKSI=; b=L91YsLeJRvTTaxtBEi2BX57NmTrHd2Mwl9GfSHuyjzZbsGrhLS4FT2BUUJ6itGXZNka4kC qUgGFrSmyuk+IUgtQn2G+XX5SWxSSbrupE1yvE4zherch4Agv20fJk+P7Y/FZLXVqmAmQ5 qNOwyqBbgo8EZvo6cQO60XEF5fM4uBM0q1ONw6E27rUToqwssiDHf2mawHIQbp9pLqGpBw Vr0Gs81AMvtJjq7PLOf5IYmQ7Ki5EMJUuvx/NlOEoJK309+UsT1QXNfj8tp7H9eOahPId9 2Fdnvl3GdjVwSAqKTJp78oOSee29msSMjiJzHFV+fJf7k42k1oklZj29znRtJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677000031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2vtpnLNtJLwHGY+2V/AdYkmOYKLOZXKOOtUU+oZuKSI=; b=kS1dCotYntMaWeIZ/xsNcEk31sEH1sWkg9MrKvqesEJC9xhp5babk7NRY6dujfHdnclLkQ U0s/RyfbOZQTc+0SJ+982S3YAivvi1BtMOhhItNe/4/d1ar6jtKzknDXkQUYCA4YU/EJjy bXC42hVWxIZcdOKY2soP/0bcPKdKzhGYKL0lM0ovmAl2w9ffYJ4Cy9bMtzl3r/y+cREsKq wyn9bqGesTLo/hPDYoIqKZNkcCp1B7Z+zg4Yu4waXE0vZo08aHqcm8oHOxHy0C6PsUrBc6 tCCKbt+YkxpR8FMCKOfdEdAKdAfJjvZVqD3B1ow58sPc3JiDjkl/TrxNQ2aRNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677000031; a=rsa-sha256; cv=none; b=ZKSvRSPpNvZAgZVgTt/zUUswhbKoF4dTHdE5yGRaxsuuQWYvyBmlEkMmTnUzs5H+ExcnKb 2VJKjkoFs9SVOQpFl75vwuFqf5xTLP64gjv66BgVF5su0GWmux4xKIM4rYjTriMLs8fC/y NcIsCE6Scp3GXMod20nCffwB4JyyOExC/vTMQsFIEKkPTmqgd9/cO59no3wDI2nksNv7gJ VyM9NA9cweZ+iFAbmCsLeeCVBrleKgL8npIir7fpkIaouCEt8NF7gUEmyVUvw00WZqgfeA SVpJTtjKgKD1pglT67Mud/1lR84S9HvUnU1QzhZlG5e8J5iD/4dE6nToivkHQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLmJZ6vS0zT1R; Tue, 21 Feb 2023 17:20: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 31LHKUKh003105; Tue, 21 Feb 2023 17:20:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LHKU9U003104; Tue, 21 Feb 2023 17:20:30 GMT (envelope-from git) Date: Tue, 21 Feb 2023 17:20:30 GMT Message-Id: <202302211720.31LHKU9U003104@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: e9e637bf243c - main - Revert "Port Linuxulator to IfAPI" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9e637bf243c35180936574e761b2fa164a97144 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=e9e637bf243c35180936574e761b2fa164a97144 commit e9e637bf243c35180936574e761b2fa164a97144 Author: Justin Hibbits AuthorDate: 2023-02-21 17:18:36 +0000 Commit: Justin Hibbits CommitDate: 2023-02-21 17:20:24 +0000 Revert "Port Linuxulator to IfAPI" Revert pending netlink fixes, and further fixes to this. This reverts commit 52d984831d82d97dc132d0d57fca6ee89572799b. Requested by: dchagin --- sys/compat/linux/linux.c | 104 ++++++++------------- sys/compat/linux/linux.h | 4 +- sys/compat/linux/linux_ioctl.c | 205 ++++++++++++++++------------------------- 3 files changed, 118 insertions(+), 195 deletions(-) diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index 16aa731b20ff..4e435081b3b6 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -241,36 +241,6 @@ 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 @@ -280,33 +250,46 @@ ifname_linux_to_bsd_cb(if_t ifp, void *arg) struct ifnet * ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) { - struct ifname_linux_to_bsd_cb_s cbs = {}; - int len; + struct ifnet *ifp; + int len, unit; 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) */ - cbs.is_lo = (len == 2 && strncmp(lxname, "lo", len) == 0); - cbs.unit = (int)strtoul(lxname + len, &ep, 10); + is_lo = (len == 2 && strncmp(lxname, "lo", len) == 0); + unit = (int)strtoul(lxname + len, &ep, 10); if ((ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) && - cbs.is_lo == 0) + is_lo == 0) return (NULL); - cbs.index = 0; - cbs.is_eth = (len == 3 && strncmp(lxname, "eth", len) == 0); + index = 0; + is_eth = (len == 3 && strncmp(lxname, "eth", len) == 0); CURVNET_SET(TD_TO_VNET(td)); IFNET_RLOCK(); - if_foreach(ifname_linux_to_bsd_cb, &cbs); + 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; + } IFNET_RUNLOCK(); CURVNET_RESTORE(); - if (cbs.ifp != NULL && bsdname != NULL) - strlcpy(bsdname, if_name(cbs.ifp), IFNAMSIZ); - return (cbs.ifp); + if (ifp != NULL && bsdname != NULL) + strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); + return (ifp); } void @@ -314,7 +297,7 @@ linux_ifflags(struct ifnet *ifp, short *flags) { unsigned short fl; - fl = (if_getflags(ifp) | if_getdrvflags(ifp)) & 0xffff; + fl = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; *flags = 0; if (fl & IFF_UP) *flags |= LINUX_IFF_UP; @@ -338,28 +321,11 @@ 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)); @@ -370,8 +336,16 @@ linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa) if (!IFP_IS_ETH(ifp)) return (ENOENT); - if (if_foreach_addr_type(ifp, AF_LINK, linux_ifhwaddr_cb, lsa) > 0) - return (0); + 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); + } + } return (ENOENT); } @@ -758,5 +732,5 @@ bool linux_use_real_ifname(const struct ifnet *ifp) { - return (use_real_ifnames || !IFP_IS_ETH(__DECONST(if_t, ifp))); + return (use_real_ifnames || !IFP_IS_ETH(ifp)); } diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index e133c35010cf..055d8e3b9cf6 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) (if_gettype(ifp) == IFT_ETHER) -#define IFP_IS_LOOP(ifp) (if_gettype(ifp) == IFT_LOOP) +#define IFP_IS_ETH(ifp) ((ifp)->if_type == IFT_ETHER) +#define IFP_IS_LOOP(ifp) ((ifp)->if_type == IFT_LOOP) struct ifnet; diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index c70060b8bf5d..2cb0e9ead23f 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -2087,138 +2087,46 @@ 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; - int error; + struct ifnet *ifp; + int error, ethno, index; - error = copyin(uifr, &cbs.ifr, sizeof(cbs.ifr)); + error = copyin(uifr, &ifr, sizeof(ifr)); if (error != 0) return (error); CURVNET_SET(TD_TO_VNET(curthread)); IFNET_RLOCK(); - 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; + 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(); - if (error == -1) + if (error == 0) 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 */ @@ -2231,22 +2139,30 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) #else struct ifconf ifc; #endif - struct linux_ifconfig_ifaddr_cb2_s cbs; + struct l_ifreq ifr; + struct ifnet *ifp; + struct ifaddr *ifa; struct sbuf *sb; - int error, full = 0; + int error, ethno, full = 0, valid_len, max_len; error = copyin(uifc, &ifc, sizeof(ifc)); if (error != 0) return (error); - cbs.max_len = maxphys - 1; + 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(); - if_foreach(linux_ifconf_ifnet_cb, &ifc); + 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); + } + } IFNET_RUNLOCK(); error = copyout(&ifc, uifc, sizeof(ifc)); CURVNET_RESTORE(); @@ -2259,28 +2175,61 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) } again: - cbs.ethno = 0; /* Keep track of eth interfaces */ - if (ifc.ifc_len <= cbs.max_len) { - cbs.max_len = ifc.ifc_len; + ethno = 0; + if (ifc.ifc_len <= max_len) { + max_len = ifc.ifc_len; full = 1; } - sb = sbuf_new(NULL, NULL, cbs.max_len + 1, SBUF_FIXEDLEN); - cbs.max_len = 0; - cbs.valid_len = 0; - cbs.sb = sb; + sb = sbuf_new(NULL, NULL, max_len + 1, SBUF_FIXEDLEN); + max_len = 0; + valid_len = 0; /* Return all AF_INET addresses of all interfaces */ IFNET_RLOCK(); - if_foreach(linux_ifconf_ifnet_cb2, &cbs); + 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); + } + } IFNET_RUNLOCK(); - if (cbs.valid_len != cbs.max_len && !full) { + if (valid_len != max_len && !full) { sbuf_delete(sb); goto again; } - ifc.ifc_len = cbs.valid_len; + ifc.ifc_len = valid_len; sbuf_finish(sb); error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); if (error == 0) From nobody Tue Feb 21 17:33:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLmbW5wGrz3swq0; Tue, 21 Feb 2023 17:33: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 4PLmbW0H5Wz3kR4; Tue, 21 Feb 2023 17:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677000807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CNxvErzCHS4vhTsf992qP8aapgBpsB6tOHD5f2vUHcg=; b=Dq+PZd8vpJVAaxATKyth/37Osi7/pUTa23l042J3g5FRi8SXBkmUP8OIF6fmZCl2YjoEH4 4GsjkLTna0/cetL5narsl9TDgQKlogNiP42ANUL4GwZxlCMy9XjVLZKqcDGQ3zP46Mg9bV ty4hEg/UO91IiydzXwQ1HzoyJKgYtZrvXAoQSHxfMCCx3XnSYeoSSS0malM/W7cbzCADNB /l2HgXoteQJGnZlCSXZ1tFFTWXyHKHF3Nai+Rs7OvOyOUojBYIsmXZZHv0XnXbWdFR7fBA iUA6vB/prrSOka8F91QT3b0ci8XzMaLUULTjrIeaoThxuhgBI6q2Wvg1cCAjyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677000807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CNxvErzCHS4vhTsf992qP8aapgBpsB6tOHD5f2vUHcg=; b=d94KfTg4OoGk03iVJWeoUPDxsrOpTkX6R/kWwUt9lPehpt+k33Oa2QGJ94PMM1SW/ERQK5 qcpQJb9IXL5tnbggL6T/ocJtKZx7NxSskhwrfRdHXtn0NuUmndcPqAx0R0nDu3M73RsYLd Y2JAEEdWs3lcx3BWx/nBI7nyVEX9/Vu+WggqkNPZyIiUKit/+GasstjkuV0lsvC+MP9srC 5+u3SsFJ45qQrvu68cJzXwrrRQEYm/237x4XriMT5gCqYN1lr2pDOwnaEvs+vsof9Ovu+w GA7o+5FSc4OhOYNiBY295Dpt9PUiqgCiqGsMTQ51U+0vRq8chwRqAgmoeSa2Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677000807; a=rsa-sha256; cv=none; b=qp7REvIFnQfyNUL9i+l5vAUDPYHVCIPe7vqxMgkwD2BsZOatGQ+FvHUCaK3hSOg6FQcgkn oW5YhABGQUJ0/H1Pmwm6cwsf9ryGEPrdn27jwaQVErEgFYyaSuRNqDfER+iX41JEdBcAmE /6Z5wW2WOfNghye8ubbZvySw8ETPfXFzGc+fLk5A+G1MZTV3rHfLu+s/v0GvOeGmyB7DPz 7Fmc4zx+pDaaM7QxZQhkTbbG7tYLcStrbL5+Bhe9biyoXanWqwmcyFHJMjx5VQrA9O/r7c FuVt+5ei3wORA4AW9SHBOOnPZrqfeAGs7r7ub92Do2APSdsrh/f6FNxAQlz/sA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLmbV6TMNzTPw; Tue, 21 Feb 2023 17:33: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 31LHXQa8022762; Tue, 21 Feb 2023 17:33:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LHXQCi022761; Tue, 21 Feb 2023 17:33:26 GMT (envelope-from git) Date: Tue, 21 Feb 2023 17:33:26 GMT Message-Id: <202302211733.31LHXQCi022761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 6b802933f16f - main - tcp: rearrange enum and remove unused variable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b802933f16f7dba62800ef29912f378e048f2ce Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6b802933f16f7dba62800ef29912f378e048f2ce commit 6b802933f16f7dba62800ef29912f378e048f2ce Author: Michael Tuexen AuthorDate: 2023-02-21 17:26:49 +0000 Commit: Michael Tuexen CommitDate: 2023-02-21 17:26:49 +0000 tcp: rearrange enum and remove unused variable Rearrange the enum tt_which such that TT_REXMIT is 0. This allows an extension of the BBLog event RTO in a backwards compatible way. Remove tcptimers, which was only used in trpt, a utility removed from the source tree recently. Reviewed by: glebius@, guest-ccui@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D38547 --- sys/netinet/tcp_timer.h | 5 ----- sys/netinet/tcp_var.h | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h index 9d27c9e3780e..9ee1d5fcdc91 100644 --- a/sys/netinet/tcp_timer.h +++ b/sys/netinet/tcp_timer.h @@ -127,11 +127,6 @@ */ #define TCP_RTT_INVALIDATE (TCP_MAXRXTSHIFT / 4) -#ifdef TCPTIMERS -static const char *tcptimers[] = - { "REXMT", "PERSIST", "KEEP", "2MSL", "DELACK" }; -#endif - /* * Force a time value to be in a certain range. */ diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index c2d5c2c99587..cd457893e36f 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -127,11 +127,11 @@ struct sackhint { STAILQ_HEAD(tcp_log_stailq, tcp_log_mem); typedef enum { - TT_DELACK = 0, - TT_REXMT, + TT_REXMT = 0, TT_PERSIST, TT_KEEP, TT_2MSL, + TT_DELACK, TT_N, } tt_which; From nobody Tue Feb 21 21:03:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLsFd2VmZz3tDGq; Tue, 21 Feb 2023 21:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLsFd2F74z4Cjq; Tue, 21 Feb 2023 21:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677013397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2YkEpQkryhbpmNTptwi42PT0X/pNawD6BIHX9ubEtDY=; b=TCvyO73VeFuV9PBGSb7AS1M0kKNdSG5EVC2CrVfgGljDLknTx7Ej9ANIRSKR+kIk54ddSM InuF+vyhNKgnGj9wSgXKuwzQSBUwMiXf2Lmn5aRQuZUvJk17FdOVa9qcLaaF6MSeTv0uW2 zC0zlQ5HbnP3Ie7Yx6hKMEBINIM/drWSxmPwLZ1NOgwWY4kPlFPefr51kg2VaVAulvwAR3 qA7Mnl9roszH7xG3Ob10QRWIfiAY1OnEOV+yQdaulAkO4lHLiLWIpUZTWAA5WmDanfSV0u 1dbWENiGiV/GfQPYbLf9tPJMnNbLAAy3MCo0PtW9j5QoFqJRz/rNAABJCxsylg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677013397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2YkEpQkryhbpmNTptwi42PT0X/pNawD6BIHX9ubEtDY=; b=msskdtpZZJmJa1EGEUv7rpemFAKGsfnHfhd3aGMqv5svBCUxdaswvEbaRbmjTqza6+CilV UbS8olBSv4/qOhsv6qDzlBqgef0C1+yHJoGCZZ3fjL9zKyTr46wjEIbGYCJG1PrxUFZIdv y6n85DB6MgtHvLj/uYv9NexBZwOtU3TPyVxePoF8Flb3ZZA29+U2pxyLSELPWr2xUAZYKH SfLUQoF5l/oOpN4aurfn8hMG6MD/dZ/2TGXLLe0krX5xtTbMzd+X2MVZGTqDtnk8yDdjdX DC6T1NT3oGVe86GY7ZilWx5fqD0cDU+zPa9r1h3qpsOBgkNXDC0v0lr2sVE9bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677013397; a=rsa-sha256; cv=none; b=tezJKchK31+/ga2bStpdwIYFgMef6kS9BwsBSL1X3K9L7EMxdqdcj1JAu0YKEtYd1UqnZu myhxEqgvhRg1wxcF6WkKxPbbtK6oUPX1mWXnhePcpZP8h+KgtWZXrjQ5OPOJ6aW9ANh4pQ jZFrWKOxzVcnoy/gh5TPEU2LATK4VK0fXRvherrOxLKI3SJYZbyzqcoIaIak2lb/QrOd9G OqIiBCQf5jsSfSQ7vjFUPxMqQbULTxH0XryOp4t5HKdkqsBbW7Q+yrqkHfC3LOQ9Lf6/dg QJDR6tb57kHlwrPv7W70wDyh8laCKbTAtDu9TKTaJFfpCpGi2QJ9riDUqaCXNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLsFd1J6YzbJ2; Tue, 21 Feb 2023 21:03: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 31LL3HSi024965; Tue, 21 Feb 2023 21:03:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LL3HUG024964; Tue, 21 Feb 2023 21:03:17 GMT (envelope-from git) Date: Tue, 21 Feb 2023 21:03:17 GMT Message-Id: <202302212103.31LL3HUG024964@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: 88175af8b75e - main - vfs_export: Add mnt_exjail to control exports done in prisons List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88175af8b75ea8850757cc9dca68b6d336b82675 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=88175af8b75ea8850757cc9dca68b6d336b82675 commit 88175af8b75ea8850757cc9dca68b6d336b82675 Author: Rick Macklem AuthorDate: 2023-02-21 21:00:42 +0000 Commit: Rick Macklem CommitDate: 2023-02-21 21:00:42 +0000 vfs_export: Add mnt_exjail to control exports done in prisons If there are multiple instances of mountd(8) (in different prisons), there will be confusion if they manipulate the exports of the same file system. This patch adds mnt_exjail to "struct mount" so that the credentials (and, therefore, the prison) that did the exports for that file system can be recorded. If another prison has already exported the file system, vfs_export() will fail with an error. If mnt_exjail == NULL, the file system has not been exported. mnt_exjail is checked by the NFS server, so that exports done from within a different prison will not be used. The patch also implements vfs_exjail_destroy(), which is called from prison_cleanup() to release all the mnt_exjail credential references, so that the prison can be removed. Mainly to avoid doing a scan of the mountlist for the case where there were no exports done from within the prison, a count of how many file systems have been exported from within the prison is kept in pr_exportcnt. Reviewed by: markj Discussed with: jamie Differential Revision: https://reviews.freebsd.org/D38371 MFC after: 3 months --- sys/fs/nfsserver/nfs_nfsdport.c | 24 ++++-- sys/kern/kern_jail.c | 1 + sys/kern/vfs_export.c | 164 +++++++++++++++++++++++++++++++++++++++- sys/kern/vfs_mount.c | 9 ++- sys/sys/jail.h | 3 +- sys/sys/mount.h | 7 +- 6 files changed, 194 insertions(+), 14 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index cee5f96d7199..34b2f114bd7a 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3259,8 +3259,16 @@ nfsvno_checkexp(struct mount *mp, struct sockaddr *nam, struct nfsexstuff *exp, { int error; - error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp, - &exp->nes_numsecflavor, exp->nes_secflavors); + error = 0; + *credp = NULL; + MNT_ILOCK(mp); + if (mp->mnt_exjail == NULL || + mp->mnt_exjail->cr_prison != curthread->td_ucred->cr_prison) + error = EACCES; + MNT_IUNLOCK(mp); + if (error == 0) + error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp, + &exp->nes_numsecflavor, exp->nes_secflavors); if (error) { if (NFSD_VNET(nfs_rootfhset)) { exp->nes_exflag = 0; @@ -3294,8 +3302,14 @@ nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct sockaddr *nam, /* Make sure the server replies ESTALE to the client. */ error = ESTALE; if (nam && !error) { - error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp, - &exp->nes_numsecflavor, exp->nes_secflavors); + MNT_ILOCK(mp); + if (mp->mnt_exjail == NULL || + mp->mnt_exjail->cr_prison != curthread->td_ucred->cr_prison) + error = EACCES; + MNT_IUNLOCK(mp); + if (error == 0) + error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp, + &exp->nes_numsecflavor, exp->nes_secflavors); if (error) { if (NFSD_VNET(nfs_rootfhset)) { exp->nes_exflag = 0; @@ -3465,7 +3479,7 @@ nfsrv_v4rootexport(void *argp, struct ucred *cred, struct thread *p) struct nameidata nd; fhandle_t fh; - error = vfs_export(NFSD_VNET(nfsv4root_mnt), &nfsexargp->export); + error = vfs_export(NFSD_VNET(nfsv4root_mnt), &nfsexargp->export, false); if ((nfsexargp->export.ex_flags & MNT_DELEXPORT) != 0) NFSD_VNET(nfs_rootfhset) = 0; else if (error == 0) { diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 92e8e4f34b42..b89c576b76ca 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -3332,6 +3332,7 @@ prison_cleanup(struct prison *pr) { sx_assert(&allprison_lock, SA_XLOCKED); mtx_assert(&pr->pr_mtx, MA_NOTOWNED); + vfs_exjail_delete(pr); shm_remove_prison(pr); (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); } diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index cab37ce205ad..16d2e88bdc41 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -296,12 +297,18 @@ vfs_free_addrlist(struct netexport *nep) * and the passed in netexport. * Struct export_args *argp is the variable used to twiddle options, * the structure is described in sys/mount.h + * The do_exjail argument should be true if *mp is in the mountlist + * and false if not. It is not in the mountlist for the NFSv4 rootfs + * fake mount point just used for exports. */ int -vfs_export(struct mount *mp, struct export_args *argp) +vfs_export(struct mount *mp, struct export_args *argp, bool do_exjail) { struct netexport *nep; + struct ucred *cr; + struct prison *pr; int error; + bool new_nep; if ((argp->ex_flags & (MNT_DELEXPORT | MNT_EXPORTED)) == 0) return (EINVAL); @@ -312,6 +319,7 @@ vfs_export(struct mount *mp, struct export_args *argp) return (EINVAL); error = 0; + pr = curthread->td_ucred->cr_prison; lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); nep = mp->mnt_export; if (argp->ex_flags & MNT_DELEXPORT) { @@ -319,6 +327,21 @@ vfs_export(struct mount *mp, struct export_args *argp) error = ENOENT; goto out; } + MNT_ILOCK(mp); + if (mp->mnt_exjail != NULL && mp->mnt_exjail->cr_prison != pr && + pr == &prison0) { + MNT_IUNLOCK(mp); + /* EXDEV will not get logged by mountd(8). */ + error = EXDEV; + goto out; + } else if (mp->mnt_exjail != NULL && + mp->mnt_exjail->cr_prison != pr) { + MNT_IUNLOCK(mp); + /* EPERM will get logged by mountd(8). */ + error = EPERM; + goto out; + } + MNT_IUNLOCK(mp); if (mp->mnt_flag & MNT_EXPUBLIC) { vfs_setpublicfs(NULL, NULL, NULL); MNT_ILOCK(mp); @@ -330,18 +353,51 @@ vfs_export(struct mount *mp, struct export_args *argp) free(nep, M_MOUNT); nep = NULL; MNT_ILOCK(mp); + cr = mp->mnt_exjail; + mp->mnt_exjail = NULL; mp->mnt_flag &= ~(MNT_EXPORTED | MNT_DEFEXPORTED); MNT_IUNLOCK(mp); + if (cr != NULL) { + atomic_subtract_int(&pr->pr_exportcnt, 1); + crfree(cr); + } } if (argp->ex_flags & MNT_EXPORTED) { + new_nep = false; + MNT_ILOCK(mp); + if (mp->mnt_exjail == NULL) { + MNT_IUNLOCK(mp); + if (do_exjail && nep != NULL) { + vfs_free_addrlist(nep); + memset(nep, 0, sizeof(*nep)); + new_nep = true; + } + } else if (mp->mnt_exjail->cr_prison != pr) { + MNT_IUNLOCK(mp); + error = EPERM; + goto out; + } else + MNT_IUNLOCK(mp); if (nep == NULL) { - nep = malloc(sizeof(struct netexport), M_MOUNT, M_WAITOK | M_ZERO); + nep = malloc(sizeof(struct netexport), M_MOUNT, + M_WAITOK | M_ZERO); mp->mnt_export = nep; + new_nep = true; } if (argp->ex_flags & MNT_EXPUBLIC) { - if ((error = vfs_setpublicfs(mp, nep, argp)) != 0) + if ((error = vfs_setpublicfs(mp, nep, argp)) != 0) { + if (new_nep) { + mp->mnt_export = NULL; + free(nep, M_MOUNT); + } goto out; + } + new_nep = false; MNT_ILOCK(mp); + if (do_exjail && mp->mnt_exjail == NULL) { + mp->mnt_exjail = crhold(curthread->td_ucred); + atomic_add_int(&pr->pr_exportcnt, 1); + } mp->mnt_flag |= MNT_EXPUBLIC; MNT_IUNLOCK(mp); } @@ -349,9 +405,18 @@ vfs_export(struct mount *mp, struct export_args *argp) argp->ex_numsecflavors = 1; argp->ex_secflavors[0] = AUTH_SYS; } - if ((error = vfs_hang_addrlist(mp, nep, argp))) + if ((error = vfs_hang_addrlist(mp, nep, argp))) { + if (new_nep) { + mp->mnt_export = NULL; + free(nep, M_MOUNT); + } goto out; + } MNT_ILOCK(mp); + if (do_exjail && mp->mnt_exjail == NULL) { + mp->mnt_exjail = crhold(curthread->td_ucred); + atomic_add_int(&pr->pr_exportcnt, 1); + } mp->mnt_flag |= MNT_EXPORTED; MNT_IUNLOCK(mp); } @@ -371,6 +436,97 @@ out: return (error); } +/* + * Get rid of credential references for this prison. + */ +void +vfs_exjail_delete(struct prison *pr) +{ + struct mount *mp; + struct ucred *cr; + int error, i; + + /* + * Since this function is called from prison_cleanup() after + * all processes in the prison have exited, the value of + * pr_exportcnt can no longer increase. It is possible for + * a dismount of a file system exported within this prison + * to be in progress. In this case, the file system is no + * longer in the mountlist and the mnt_exjail will be free'd + * by vfs_mount_destroy() at some time. As such, pr_exportcnt + * and, therefore "i", is the upper bound on the number of + * mnt_exjail entries to be found by this function. + */ + i = atomic_load_int(&pr->pr_exportcnt); + KASSERT(i >= 0, ("vfs_exjail_delete: pr_exportcnt negative")); + if (i == 0) + return; + mtx_lock(&mountlist_mtx); +tryagain: + TAILQ_FOREACH(mp, &mountlist, mnt_list) { + MNT_ILOCK(mp); + if (mp->mnt_exjail != NULL && + mp->mnt_exjail->cr_prison == pr) { + MNT_IUNLOCK(mp); + error = vfs_busy(mp, MBF_MNTLSTLOCK | MBF_NOWAIT); + if (error != 0) { + /* + * If the vfs_busy() fails, we still want to + * get rid of mnt_exjail for two reasons: + * - a credential reference will result in + * a prison not being removed + * - setting mnt_exjail NULL indicates that + * the exports are no longer valid + * The now invalid exports will be deleted + * when the file system is dismounted or + * the file system is re-exported by mountd. + */ + cr = NULL; + MNT_ILOCK(mp); + if (mp->mnt_exjail != NULL && + mp->mnt_exjail->cr_prison == pr) { + cr = mp->mnt_exjail; + mp->mnt_exjail = NULL; + } + MNT_IUNLOCK(mp); + if (cr != NULL) { + crfree(cr); + i--; + } + if (i == 0) + break; + continue; + } + cr = NULL; + lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); + MNT_ILOCK(mp); + if (mp->mnt_exjail != NULL && + mp->mnt_exjail->cr_prison == pr) { + cr = mp->mnt_exjail; + mp->mnt_exjail = NULL; + mp->mnt_flag &= ~(MNT_EXPORTED | MNT_DEFEXPORTED); + MNT_IUNLOCK(mp); + vfs_free_addrlist(mp->mnt_export); + free(mp->mnt_export, M_MOUNT); + mp->mnt_export = NULL; + } else + MNT_IUNLOCK(mp); + lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); + if (cr != NULL) { + crfree(cr); + i--; + } + mtx_lock(&mountlist_mtx); + vfs_unbusy(mp); + if (i == 0) + break; + goto tryagain; + } + MNT_IUNLOCK(mp); + } + mtx_unlock(&mountlist_mtx); +} + /* * Set the publicly exported filesystem (WebNFS). Currently, only * one public filesystem is possible in the spec (RFC 2054 and 2055) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 430bafc8502f..a3990b9203dd 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -761,6 +761,11 @@ vfs_mount_destroy(struct mount *mp) #endif if (mp->mnt_opt != NULL) vfs_freeopts(mp->mnt_opt); + if (mp->mnt_exjail != NULL) { + atomic_subtract_int(&mp->mnt_exjail->cr_prison->pr_exportcnt, + 1); + crfree(mp->mnt_exjail); + } if (mp->mnt_export != NULL) { vfs_free_addrlist(mp->mnt_export); free(mp->mnt_export, M_MOUNT); @@ -1395,7 +1400,7 @@ vfs_domount_update( } else export_error = EINVAL; if (export_error == 0) - export_error = vfs_export(mp, &export); + export_error = vfs_export(mp, &export, true); free(export.ex_groups, M_TEMP); break; case (sizeof(export)): @@ -1417,7 +1422,7 @@ vfs_domount_update( else export_error = EINVAL; if (export_error == 0) - export_error = vfs_export(mp, &export); + export_error = vfs_export(mp, &export, true); free(grps, M_TEMP); break; default: diff --git a/sys/sys/jail.h b/sys/sys/jail.h index c50c8607aa0a..0a5a7c3288d7 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -196,7 +196,8 @@ struct prison { int pr_enforce_statfs; /* (p) statfs permission */ int pr_devfs_rsnum; /* (p) devfs ruleset */ enum prison_state pr_state; /* (q) state in life cycle */ - int pr_spare[2]; + volatile int pr_exportcnt; /* (r) count of mount exports */ + int pr_spare; int pr_osreldate; /* (c) kern.osreldate value */ unsigned long pr_hostid; /* (p) jail hostid */ char pr_name[MAXHOSTNAMELEN]; /* (p) admin jail name */ diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 5f02f261b8f4..8dc28a9e0ed9 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -216,6 +216,7 @@ struct mount_upper_node { * i - interlock * v - vnode freelist mutex * d - deferred unmount list mutex + * e - mnt_explock * * Unmarked fields are considered stable as long as a ref is held. * @@ -245,13 +246,14 @@ struct mount { void * mnt_data; /* private data */ time_t mnt_time; /* last time written*/ int mnt_iosize_max; /* max size for clusters, etc */ - struct netexport *mnt_export; /* export list */ + struct netexport *mnt_export; /* (e) export list */ struct label *mnt_label; /* MAC label for the fs */ u_int mnt_hashseed; /* Random seed for vfs_hash */ int mnt_lockref; /* (i) Lock reference count */ int mnt_secondary_writes; /* (i) # of secondary writes */ int mnt_secondary_accwrites;/* (i) secondary wr. starts */ struct thread *mnt_susp_owner; /* (i) thread owning suspension */ + struct ucred *mnt_exjail; /* (i) jail which did exports */ #define mnt_endzero mnt_gjprovider char *mnt_gjprovider; /* gjournal provider name */ struct mtx mnt_listmtx; @@ -1015,8 +1017,9 @@ int vfs_setpublicfs /* set publicly exported fs */ (struct mount *, struct netexport *, struct export_args *); void vfs_periodic(struct mount *, int); int vfs_busy(struct mount *, int); +void vfs_exjail_delete(struct prison *); int vfs_export /* process mount export info */ - (struct mount *, struct export_args *); + (struct mount *, struct export_args *, bool); void vfs_free_addrlist(struct netexport *); void vfs_allocate_syncvnode(struct mount *); void vfs_deallocate_syncvnode(struct mount *); From nobody Tue Feb 21 21:13:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLsT32vSpz3tF0c; Tue, 21 Feb 2023 21:13:11 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4PLsT237Sjz4DVh; Tue, 21 Feb 2023 21:13:10 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 162.251.186.162 is neither permitted nor denied by domain of glebius@freebsd.org) smtp.mailfrom=glebius@freebsd.org; dmarc=none Received: by glebi.us (Postfix, from userid 1000) id E59DF637B0; Tue, 21 Feb 2023 13:13:08 -0800 (PST) Date: Tue, 21 Feb 2023 13:13:08 -0800 From: Gleb Smirnoff To: Rick Macklem Cc: bz@freebsd.org, jamie@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup Message-ID: References: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> X-Spamd-Result: default: False [0.67 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.83)[-0.827]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; R_SPF_SOFTFAIL(0.00)[~all:c]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[glebius]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4PLsT237Sjz4DVh X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N On Mon, Feb 20, 2023 at 09:12:41PM +0000, Rick Macklem wrote: R> nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup R> R> Commit ed03776ca7f4 enabled the vnet front end macros. R> As such, for kernels built with the VIMAGE option will malloc R> data and initialize locks on a per-vnet basis, typically R> via a VNET_SYSINIT(). R> R> This patch adds VNET_SYSUNINIT() macros to do the frees R> of the per-vnet malloc'd data and destroys of per-vnet R> locks. It also removes the mtx_lock/mtx_unlock calls R> from nfsrvd_cleancache(), since they are not needed. In the netinet/netinet6/TCP/UDP we came to a style where we avoid using IS_DEFAULT_VNET(). Instead doing global and per-vnet init in the same function: static globalfoo; VNET_DEFINE_STATIC(foobar); static void foo_vnet_init() { initialize(V_foobar); if (IS_DEFAULT_VNET(curvnet)) initialize(globalfoo); } VNET_SYSINIT(foo_vnet_init, ....) We can do a separate init of global state and separate of per-VNET: static globalfoo; static void foo_init() { initialize(globalfoo); } SYSINIT(foo_init, ....) VNET_DEFINE_STATIC(foobar); static void foo_vnet_init() { initialize(V_foobar); } This allows to: * guarantee that global state is initialized earlier than per-vnet * separate all global vars from all vnet vars, and keep them together, easier to maintain * makes it easier to write VNET_SYSUNINIT() that is complement to VNET_SYSINIT() * makes it easier to write SYSUNINIT(), if module is unloadable * sometimes global SYSINIT cab be avoided, if a static initializer is enough What do you guys think? -- Gleb Smirnoff From nobody Tue Feb 21 21:16:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLsY35jNWz3tFJL for ; Tue, 21 Feb 2023 21:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLsY35FQwz4F5x; Tue, 21 Feb 2023 21:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677014199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TOuDwAGf9zpg8dSuO+kiA9HWtPbP+J4vYCEnbQyPG24=; b=LmCQA4dWfl3OpZBt7Cdi0GfAmeJyO2fyhOOmkopdRKEvmxa1j0m+t/DwlIYklf2TpEGiBc yr4V9gJHEd9KyXetYJArKYJ5AbtK48vvE/lt/H4hYdvA9+L6oYqOvO63w0kQ9NBuOirOxg k6yI+RsSvN+M9kGCbmH3pY4xH/5eLkiyo3F1pcb8ZZNpvTugljzRmj/De6Vy+HSnryjJqa wJd4NE9YlCg66KbLhGtQhkGELQs38JPtW3f6VyRJXi8Xigw72yYyLhgfH6VlWKg2t+xeHT cetpklYIAqLD7qkjUfB110Zs45R6p/uM8z/OsxJZ9v4JFRS0Q/+MH8/tGvS8Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677014199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TOuDwAGf9zpg8dSuO+kiA9HWtPbP+J4vYCEnbQyPG24=; b=Vdsb4WHcfMpudPSIKIMbTU/11Q3htduSgzR+SGxej44trDY6LkqqEE5fraNSUWencs/izI 6My25dw1eiv0O7aHtxYz6Z78LB2UqXIjD7iSGKzCXXx4uTvuv0ht2Iclk8sh7vpkoHQqRO mM/aSgR9zpBL1vCLq91cg+jVvMIrSawa8OYOcHuMSY6Ob49hZ8gTOq5Tmlz5+g7SVOGFg3 a9jCHmKJjkk0pi1zjMrUAty3kTimoKLZrGbRk91qOLOVlKgXDFmm2/RlOwSGWcz3JFRhUG 52cgE6UKCwPgzNnqSp3BdN/SmA+5KAS+wUHR5CdRm8B6uokK5P2kKY3l0bNlew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677014199; a=rsa-sha256; cv=none; b=SySmJZk2G84hhP8hOoyNDvUUFIpbWCXpRv28zDvJVghW/+InKapjJ6DbrSsa5k/ztoXMJM Ho66t6fvvoSy1g5aIB4flJeDbtD0JlMf4M7qRNuc5NUu7wq0PpLjy8HdmP1wxcqKpkZaX7 f1wBAG8wfvips2rS5OdIYlm85MAKoqo/cCBjOQKpwn8AKZto0GFr7UEfioWKPYER7ldNMh UyD8CHpih/Qpd+Qx5d90INeHC/vEbnXhkcCDIMxxG4f+qxso+ItvfyXZXkJMbUSPLnZPVO zffbRPa4bRJtaZTSeu6YX5HtRb7yrFwno0t0JMzcwHKRqzkaWbXg63XE/wHt6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLsY34CRrzbRm; Tue, 21 Feb 2023 21:16: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 31LLGd2p039256; Tue, 21 Feb 2023 21:16:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LLGd8I039255; Tue, 21 Feb 2023 21:16:39 GMT (envelope-from git) Date: Tue, 21 Feb 2023 21:16:39 GMT Message-Id: <202302212116.31LLGd8I039255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Warner Losh Subject: git: 482b475bf561 - internal/admin - Add Sumit Saxena List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/internal/admin X-Git-Reftype: branch X-Git-Commit: 482b475bf5619a697cc93eee8ba5dbd79079c6b7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch internal/admin has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=482b475bf5619a697cc93eee8ba5dbd79079c6b7 commit 482b475bf5619a697cc93eee8ba5dbd79079c6b7 Author: Warner Losh AuthorDate: 2023-02-21 21:13:49 +0000 Commit: Warner Losh CommitDate: 2023-02-21 21:13:49 +0000 Add Sumit Saxena Sumit will be acting as vendor liason for Broadcom. I'll be mentoring him through this process. Approved by: core@ --- access | 1 + mentors | 1 + 2 files changed, 2 insertions(+) diff --git a/access b/access index 1efa6c66bf90..bf7c931c312b 100644 --- a/access +++ b/access @@ -164,6 +164,7 @@ se sef sjg sobomax +ssaxena stevek syrinx takawata diff --git a/mentors b/mentors index 6d5e9754f2c3..784c3297b841 100644 --- a/mentors +++ b/mentors @@ -28,5 +28,6 @@ pjd allanjude Co-mentor: oshogbo rajeshasp gallatin Co-mentor: vmaffione ram ken Co-mentor: mav sam emaste +ssaxena imp theraven markj wosch cem From nobody Tue Feb 21 21:47:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLtDp40c1z3tGwl; Tue, 21 Feb 2023 21:47: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 4PLtDp3J9Cz4JJG; Tue, 21 Feb 2023 21:47:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677016058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LeQtD6vCx7yDpl4mrfv5FuPMkV8/vcm/B4zcEEluKrU=; b=dL5eZmI45SJ+uVIjQZeDjl5HLv7cV4vD2Uo6jOVUjflkn/JK+OBzf5OGTKvwOhclE2oPSk AgOSgOvGNs7oqu0aOLqHj3MG8PhyvsnpSp2QK9sAnzU3dVy8ARJDcrBG5BWtMaqXbOp8W8 8W/t4CYJ8qGFatYPo/BdC61GnONYLIEjDCcAQYv1AIcUoEyuqaKCWB+dxRjZF99Bbgtykq G+M+NUILngtJoFicBuu9JXL8cHG06aE8/5FwuoaLS+hCpN0Ku1KCi0FNY9FCfUeylqnvMf kp6FX5Yr682oyYO72uSfBUlGJsn+1mZcYgvNJJtOGjAcGQziFNLvLLNSd19LEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677016058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LeQtD6vCx7yDpl4mrfv5FuPMkV8/vcm/B4zcEEluKrU=; b=mXfLboJKMHBIWwhdyNcv/nfenYZoIVKiQU4AHa3Jy2CHCcXzFtYaljKrbIhekRo7IMw3qi Xpg9i8Jcq+kLQTECq+ROVL4/S0JLhgIE3LqoqnMGnsYJyEbmgGRPRwV7D9la+Md4FTEFM0 tU92eBzLyC/V7OE6UmLuBa7lq2nf0sgADiwHpb6Ak/glWZ608w1C6eV1GrkAOXsU1jqLuE yh57PXwmJlLIqoYwdEfisQiO8rfTZynBDwXKPLgOdOwy6T9OuA4oJL60hOo/EQQaAtT6Ue ajBqAGX/sfPDQBqpTK+j+O/Z3PtG6VMxJYznzYj3fTxYkmYRL6aikVHmtsjm6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677016058; a=rsa-sha256; cv=none; b=U2SE2J49vim9xVzR7lmM9NTuqq+rwQ8V5toS69VQwVUO02VRrlmUa5DiwbqIvJYnXREGFi 4oEkO3PSzJTLiqF7yNDToy1q9NAUfAIY5Q3doH+4fivOjI6uWIU1SqyhE076TISXGPwN2l eQp1xDSYrfyVWew3//NE4UtO7HhyvwkhAPPvE4KQ/ImVrxR4EZdKv+CuIRSirYz0ICbcEg 0ZqJchyaUFQMaA6SjBU7R4Kazpm36jgxZ+dpMNxG0P9LZksSYdq/LYR5aKwPj77uRS429F A6Sts/tajDnveTrhSe0T7UOTXGraxgXk8AB6gis0w62znAsCccrHKy+v9lT55w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLtDp1Nz4zbqL; Tue, 21 Feb 2023 21:47: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 31LLlcNf081810; Tue, 21 Feb 2023 21:47:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LLlcwZ081809; Tue, 21 Feb 2023 21:47:38 GMT (envelope-from git) Date: Tue, 21 Feb 2023 21:47:38 GMT Message-Id: <202302212147.31LLlcwZ081809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 76578d601e7f - main - bblog: improve timeout event handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76578d601e7fae45edd397b9863b77c3029483ab Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=76578d601e7fae45edd397b9863b77c3029483ab commit 76578d601e7fae45edd397b9863b77c3029483ab Author: Michael Tuexen AuthorDate: 2023-02-21 21:38:18 +0000 Commit: Michael Tuexen CommitDate: 2023-02-21 21:46:15 +0000 bblog: improve timeout event handling Extend the BBLog RTO event to deal with all timers of the base stack. Also provide information about starting, stopping, and running off. The expiration of the retransmission timer is reported as it was done before. Reviewed by: rscheff@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D38710 --- sys/netinet/tcp_timer.c | 45 +++++++++++++++++++++++++++++++++++++++++---- sys/netinet/tcp_var.h | 7 +++++++ 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 0186d6a9827a..019f01391f22 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -542,7 +542,6 @@ tcp_timer_rexmt(struct tcpcb *tp) TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); CURVNET_SET(inp->inp_vnet); tcp_free_sackholes(tp); - TCP_LOG_EVENT(tp, NULL, NULL, NULL, TCP_LOG_RTO, 0, 0, NULL, false); if (tp->t_fb->tfb_tcp_rexmit_tmr) { /* The stack has a timer action too. */ (*tp->t_fb->tfb_tcp_rexmit_tmr)(tp); @@ -790,6 +789,35 @@ tcp_timer_rexmt(struct tcpcb *tp) return (rv); } +static void +tcp_bblog_timer(struct tcpcb *tp, tt_which which, tt_what what, uint32_t ticks) +{ + struct tcp_log_buffer *lgb; + uint64_t ms; + + INP_WLOCK_ASSERT(tptoinpcb(tp)); + if (tp->t_logstate != TCP_LOG_STATE_OFF) + lgb = tcp_log_event_(tp, NULL, NULL, NULL, TCP_LOG_RTO, 0, 0, + NULL, false, NULL, NULL, 0, NULL); + else + lgb = NULL; + if (lgb != NULL) { + lgb->tlb_flex1 = (what << 8) | which; + if (what == TT_STARTING) { + /* Convert ticks to ms and store it in tlb_flex2. */ + if (hz == 1000) + lgb->tlb_flex2 = ticks; + else { + ms = (((uint64_t)ticks * 1000) + (hz - 1)) / hz; + if (ms > UINT32_MAX) + lgb->tlb_flex2 = UINT32_MAX; + else + lgb->tlb_flex2 = (uint32_t)ms; + } + } + } +} + static inline tt_which tcp_timer_next(struct tcpcb *tp, sbintime_t *precision) { @@ -816,6 +844,7 @@ tcp_timer_enter(void *xtp) struct inpcb *inp = tptoinpcb(tp); sbintime_t precision; tt_which which; + bool tp_valid; INP_WLOCK_ASSERT(inp); MPASS((curthread->td_pflags & TDP_INTCPCALLOUT) == 0); @@ -827,7 +856,10 @@ tcp_timer_enter(void *xtp) tp->t_timers[which] = SBT_MAX; tp->t_precisions[which] = 0; - if (tcp_timersw[which](tp)) { + tcp_bblog_timer(tp, which, TT_PROCESSING, 0); + tp_valid = tcp_timersw[which](tp); + if (tp_valid) { + tcp_bblog_timer(tp, which, TT_PROCESSED, 0); if ((which = tcp_timer_next(tp, &precision)) != TT_N) { callout_reset_sbt_on(&tp->t_callout, tp->t_timers[which], precision, tcp_timer_enter, @@ -847,6 +879,7 @@ tcp_timer_activate(struct tcpcb *tp, tt_which which, u_int delta) { struct inpcb *inp = tptoinpcb(tp); sbintime_t precision; + tt_what what; #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) @@ -855,11 +888,15 @@ tcp_timer_activate(struct tcpcb *tp, tt_which which, u_int delta) INP_WLOCK_ASSERT(inp); - if (delta > 0) + if (delta > 0) { + what = TT_STARTING; callout_when(tick_sbt * delta, 0, C_HARDCLOCK, &tp->t_timers[which], &tp->t_precisions[which]); - else + } else { + what = TT_STOPPING; tp->t_timers[which] = SBT_MAX; + } + tcp_bblog_timer(tp, which, what, delta); if ((which = tcp_timer_next(tp, &precision)) != TT_N) callout_reset_sbt_on(&tp->t_callout, tp->t_timers[which], diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index cd457893e36f..1be3244e15c5 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -135,6 +135,13 @@ typedef enum { TT_N, } tt_which; +typedef enum { + TT_PROCESSING = 0, + TT_PROCESSED, + TT_STARTING, + TT_STOPPING, +} tt_what; + /* * Tcp control block, one per tcp connection. */ From nobody Tue Feb 21 22:41:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLvR93St8z3tZkJ; Tue, 21 Feb 2023 22:41: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 4PLvR92yGgz4N0K; Tue, 21 Feb 2023 22:41:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kfkCpDLtbSCZBR1l5+3FjLIcWK/hsBMpih0fo94CqvE=; b=VvwJdsS8+ArRE8O7NI95IYKRhUxKNVhDBkNDEkZxfltbjjTHloSv3xbkDWvuPtSNsX1SZi ko/EdTi3UH4sLfhOqXBIscHvlZG8sO7xJrO6Su52JVnHlnN7ekzrTqH8QRAEnqAk6IphNv CdAqPiNwlZg1kR0XzGCh+h+e5Fqj7u1hJqsORNcIzB7QoUkeIGHLLI4e0yS4IFehY0+dKD hutejLhSCw4y8m+ItqfnlKzbVqy4tHOl8NW+40UhkRTM/LcQLJDudfF7LsWLuO3DYNlitx XsYUeDc6Mg7JIf9XGIbsnLZA0Q3FfKdTAopAmcTItUSfNDadcY7L0FS1TrlfFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kfkCpDLtbSCZBR1l5+3FjLIcWK/hsBMpih0fo94CqvE=; b=WmN8MCNxW25MmPpfsScH1JOVQraT3szzJ/Y6Jl3Y4ekxxU9304pkA+jeO3qKsYfZhZy7Bw SZrYMttRqruLIech9NcPcc/QjlR1B/foALgxa+n79bSae0bH9Ya18Oh0Ym/18tMPbpPTFS j9qqT6PA5A4FVgSvuObTyIxFjb2PP2vFwjxdZhDhUy3dCr2KnpMVzLr+8pQtjzlPKZveOA UWB4UhOshDIM5vBCDYM1q3rrUyrdZ1pRDGFChi/dT/dtPuzG8E5wT1zNdCPY2UheSy/M0j 1hbTeAoNhOOtIWxfzuiWFCrmus0slqlOsiud5l8bT5r+wRGWGlRCNRlQwQRS7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677019301; a=rsa-sha256; cv=none; b=uLV8MPdZlNlQgOrAbGJSCaCvBFs/3cHTsUlVWQE/sXWb2sfYv8OOou81lIzoAxL0O2Moo8 Xlr6z8zSZ6HTRQ6AUSjdG7VNxn60lt6UUAr6gmgM+MyayvFMcy5dLd9hZ8dAdgznBKVOEs JPrLZ2//jvwarB0aSnKKYXrwv27nQ0gEmGmV8B9TV+SLD7uh9axDI2VEeo7wNNcfpdJ7IP 5pWqFsuIas3wjClXErvh67jcMZbXKr9SjeBUJV3dudMg63ogmyk4m5CyL5tMFYBIHRMkz4 Dibcu/xNjwvOp4I93gJLhguoN9zgKPmQApt+Nc5QTG/hLBySiBc7XcaBmVJhOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLvR91jkrzcwQ; Tue, 21 Feb 2023 22:41: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 31LMffeC066868; Tue, 21 Feb 2023 22:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LMff7n066867; Tue, 21 Feb 2023 22:41:41 GMT (envelope-from git) Date: Tue, 21 Feb 2023 22:41:41 GMT Message-Id: <202302212241.31LMff7n066867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: a8c86b2e05ca - releng/13.2 - irdma: fix LINT-NOIP/NOINET/NOINET6 builds List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: a8c86b2e05ca703b3975134bf74f852a1a7aaf21 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=a8c86b2e05ca703b3975134bf74f852a1a7aaf21 commit a8c86b2e05ca703b3975134bf74f852a1a7aaf21 Author: Mitchell Horne AuthorDate: 2022-05-30 20:47:32 +0000 Commit: Eric Joyner CommitDate: 2023-02-21 22:40:49 +0000 irdma: fix LINT-NOIP/NOINET/NOINET6 builds This module depends on the presence of both INET and INET6 options in order to compile. Reviewed by: erj Fixes: cdcd52d41e24 ("irdma: Add RDMA driver for Intel(R) Ethernet...") Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D35343 (cherry picked from commit acdfbc6cbe0a8a976d446216be84994c8ee8d5c1) (cherry picked from commit 7333d34e5ec96db747648ab7b245d814d3140738) --- sys/conf/files | 30 +++++++++++++++--------------- sys/modules/Makefile | 2 ++ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index c15f87d9f830..0c3a553c3dad 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4764,35 +4764,35 @@ ofed/drivers/infiniband/ulp/sdp/sdp_cma.c optional sdp inet \ ofed/drivers/infiniband/ulp/sdp/sdp_tx.c optional sdp inet \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -dev/irdma/icrdma.c optional irdma ice pci ofed \ +dev/irdma/icrdma.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_cm.c optional irdma ice pci ofed \ +dev/irdma/irdma_cm.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_ctrl.c optional irdma ice pci ofed \ +dev/irdma/irdma_ctrl.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_hmc.c optional irdma ice pci ofed \ +dev/irdma/irdma_hmc.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_hw.c optional irdma ice pci ofed \ +dev/irdma/irdma_hw.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/icrdma_hw.c optional irdma ice pci ofed \ +dev/irdma/icrdma_hw.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/fbsd_kcompat.c optional irdma ice pci ofed \ +dev/irdma/fbsd_kcompat.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_kcompat.c optional irdma ice pci ofed \ +dev/irdma/irdma_kcompat.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_pble.c optional irdma ice pci ofed \ +dev/irdma/irdma_pble.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_puda.c optional irdma ice pci ofed \ +dev/irdma/irdma_puda.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_uda.c optional irdma ice pci ofed \ +dev/irdma/irdma_uda.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_uk.c optional irdma ice pci ofed \ +dev/irdma/irdma_uk.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_utils.c optional irdma ice pci ofed \ +dev/irdma/irdma_utils.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_verbs.c optional irdma ice pci ofed \ +dev/irdma/irdma_verbs.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" -dev/irdma/irdma_ws.c optional irdma ice pci ofed \ +dev/irdma/irdma_ws.c optional irdma ice inet inet6 pci ofed \ compile-with "${OFED_C} -I$S/dev/ice/" dev/mthca/mthca_allocator.c optional mthca pci ofed \ diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 975ca2d84e57..3e2cc835dc99 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -621,9 +621,11 @@ _ice= ice _ice_ddp= ice_ddp .endif .if ${MK_OFED} != "no" || defined(ALL_MODULES) +.if ${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no" _irdma= irdma .endif .endif +.endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ ${MACHINE_CPUARCH} == "riscv" From nobody Tue Feb 21 22:43:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLvTN4PJvz3tZWD; Tue, 21 Feb 2023 22:43: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 4PLvTN3vswz4NSW; Tue, 21 Feb 2023 22:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I5AqokptW+J+p3oyD0VgjyCHbmkUzU+DFOXGYOm7eC4=; b=adV9UTitfvJfZBZaT+sk2aw6khckr11Leg9mA4eVHn/EuEfZGwfzWVtCYQTz2mh0czaWVU waZcb73IN/TR5Kwd9kKbyyv7ljUHsRvshLpfnqTZRQSzUUKgxuSsYUeQTlRkRySuoVNgoW fJg2/vJKKqqo6I1mwhzuzap8C4iC1nbkNWdhxfyaafEdu+TnyyNbDotMLoi52vsJNvA8yw jgCrwaRPDJNUTbT5lfABN7VGRh/0P3WQhXHIFY/dXk89dPrhgZFCPZMrlAZOV/HfMcDFAB b9myLC5LVFKBCq1oR9z6ah/WUuH9BO/+M5k7saRvWDbRizBiVXu/aKGy8jgNXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I5AqokptW+J+p3oyD0VgjyCHbmkUzU+DFOXGYOm7eC4=; b=SiggXEcMYqlEr6am/kx3L4CnoesQwVumhWxR8kRU5ekrYu3iFNrgWeJHKlrc+L/tT6TmYz eBGyCSgDogFYBvRKcIPkto1Hr79M/deTiw8CovVC97zXADlJnjbeNxEjrcfZdcUxUbumyZ HptNhxtnBKzbWuxLByiJH3YL0rt6j4YEECYUagH0dqixb/lUqouMm5TkD9LMBq4PBtW/n9 pucjF1xjDZq6eeVFH8iYHgXIboJA2iSZ5G5/M2LzwS3r5KV4PqN3IDe1Ep+BvhqPXp3T/M rFgxWPo43vn/ImWS+1c4zDiJ5tkXE4ISYLcN+KM7cIxqR//V745c7l8fZXKo9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677019416; a=rsa-sha256; cv=none; b=VFGSTj1UbiIF6vLXMGlxRMMx+5OZ9mwgtI2cSgi1LepVe7o/aTckJk8EGBh6IVt14zfLha Rup1DMnflyfWanXqL5YfQvSr6r1/JlspVzsv/WnCvpsmkkukblTYi8EQ+IgG1r1caynzvV qAI5N7LnUlBsXSjMRk7DmMpZ29+Ef/ZL5qesbcdbHSkK4OiXOimsRc4hMk2nzNX7R4FfO4 vbjahYxZpO0XEJHmOC3dfoztAd4/XqN46Z1mxBnr6lMYz9kObg3P/Un1O2i9XQ5EA8HyYt hXF9NpVUkelWolmzB3xzxc4H7Bg3PSE8DQ3iMW1luDcNHjTz3kP7ajQx/NdLpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLvTN2zT0zdTq; Tue, 21 Feb 2023 22:43: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 31LMha2l067215; Tue, 21 Feb 2023 22:43:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LMhavc067214; Tue, 21 Feb 2023 22:43:36 GMT (envelope-from git) Date: Tue, 21 Feb 2023 22:43:36 GMT Message-Id: <202302212243.31LMhavc067214@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: 8b04c1cbfc1c - main - Fix per-jail zfs.mount_snapshot setting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b04c1cbfc1cb71a1ce53b3a7855f1d45866fcfb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=8b04c1cbfc1cb71a1ce53b3a7855f1d45866fcfb commit 8b04c1cbfc1cb71a1ce53b3a7855f1d45866fcfb Author: Allan Jude AuthorDate: 2023-02-18 01:44:34 +0000 Commit: Allan Jude CommitDate: 2023-02-21 22:42:28 +0000 Fix per-jail zfs.mount_snapshot setting When jail.conf set the nopersist flag during startup, it was incorrectly destroying the per-jail ZFS settings. PR: 260160 Reported by: imp (previous version), mm (upstream), freqlabs (upstream) MFC after: immediately Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38662 --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index a1e0595bda34..9fb2873132bf 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -2495,7 +2495,9 @@ zfs_jailparam_set(void *obj, void *data) mount_snapshot = -1; else jsys = JAIL_SYS_NEW; - if (jsys == JAIL_SYS_NEW) { + switch (jsys) { + case JAIL_SYS_NEW: + { /* "zfs=new" or "zfs.*": the prison gets its own ZFS info. */ struct zfs_jailparam *zjp; @@ -2513,12 +2515,22 @@ zfs_jailparam_set(void *obj, void *data) if (mount_snapshot != -1) zjp->mount_snapshot = mount_snapshot; mtx_unlock(&pr->pr_mtx); - } else { + break; + } + case JAIL_SYS_INHERIT: /* "zfs=inherit": inherit the parent's ZFS info. */ mtx_lock(&pr->pr_mtx); osd_jail_del(pr, zfs_jailparam_slot); mtx_unlock(&pr->pr_mtx); + break; + case -1: + /* + * If the setting being changed is not ZFS related + * then do nothing. + */ + break; } + return (0); } From nobody Tue Feb 21 22:45:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLvW83Rkhz3tZTv; Tue, 21 Feb 2023 22:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLvW82xPlz4PC2; Tue, 21 Feb 2023 22:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WF1ImqSSCC9Pg2uhph6PEULkHyvwn8vm6z8Hhzj6Lw0=; b=W/hSUURA3Qe2bGnnxJsmPJz9vqivQ72EY/eN8d9urUz8v6R1EWUfuip0jYDiSYklrYTZoA I9MKgKWK2Mq+qIAy20TeXcKu7ZBdg0YnynLXNq+gjSeg2ixL2wOt6CAi5Drc0+9ToOE/U5 SddvAVt47l075a8FTf+2nUawU3mzQ7Lp72lBT9fVs5VkJGUISwkVjAO2ulJPEVl6zGZvFI JuRjd/8x3NubMaxXs93mCi5t8BUTDHZDJzCOr7ATOchsLeQgQG42PvuYD0zge5CzsAKKnt wUIG8TBB3JAlVMGS5eqxIO5Tp9Od248hvgZdblK1cXlHuhPuRd/78wl2x3//cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WF1ImqSSCC9Pg2uhph6PEULkHyvwn8vm6z8Hhzj6Lw0=; b=DGmHpR1KJXg83wcA8tMnpvVftSkgXv1OYmrPlovwrXyo3gWuZRIuawvZq1HfNm8E3oQjz7 iL51BOSC39gv7SRBX5GF2uyVSB3L56qgWX42M57kTkYYBjbe+VppxrGxdIxcNRTsH/cxB+ G610Rgc0bu7WOqV+75bfkmk0DTZhOHO7Cg3fP/9BtqL2Zk8MsOz4Qa6u+bipTTfexrvycH qc3l4p6Gc7RoS6xYzfQ6/gzUMVE5dbRlICg8olXSNjnZUtsy0JMV2Y8V3y/5OPCozQHLG2 zP0EXbhNxTBpFDR3/q0C8XzcxL+a9pSUsJNJvtHfgxe5l9zrB87ld77CxZ7JLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677019508; a=rsa-sha256; cv=none; b=r6lVFfpTBO5xqDI817L6Yn/UnIvyiOaM2X+1+nsuMcufnwPgB5SRVRDXAbi4wZewRBvaKB jfXw3u/OzDY9tbBytw2g8rflAq9GGdjj1KK34+0avF9wHetpNfI6jAa66ppM/s2VXFtzxx QsjFIeEWZHUACqhbplVMse8SegR1Qv45+GeuN6t5Hk4Ef4xhjjdpT6jMKSyHgeE3Z41j+k +Si2agEtfPs3sQM7BukbIvEKJzlVKxhM1+nJXbqwPHMVOJeZsGiATp2q91hdsx5jHUq8IM lzt8+eTC+498OmofvteJWpsfDnoduZDiVrJYmWLYl0Szz88kTr7SXHmgArv+pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLvW81zykzd2x; Tue, 21 Feb 2023 22:45: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 31LMj8KT067567; Tue, 21 Feb 2023 22:45:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LMj8tJ067566; Tue, 21 Feb 2023 22:45:08 GMT (envelope-from git) Date: Tue, 21 Feb 2023 22:45:08 GMT Message-Id: <202302212245.31LMj8tJ067566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 25d43e3c6b36 - stable/13 - ixgbe(4): Filter out spurious link up indication List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00 commit 25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00 Author: Krzysztof Galazka AuthorDate: 2023-02-15 22:35:40 +0000 Commit: Eric Joyner CommitDate: 2023-02-21 22:42:25 +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 Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38395 (cherry picked from commit 04a5e6d7cadd06b10169c3c3a560649e7dc7444c) --- 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 Tue Feb 21 22:45:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLvW94V6Hz3tZWW; Tue, 21 Feb 2023 22:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLvW93fsWz4P4T; Tue, 21 Feb 2023 22:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dJ13rMONWc0U3wuZkQrZWOljDDBxCP9UHqeXnUIUzlI=; b=oP8VkGsJYhPeVDdGi2xMszd/CE4NlzGarqvQpBLOc8Nb3KdAMghhKTB+0iB8dqcqgNuF8g rUPBrIYT0fseAg/HdV8GKQfcmVSMcr7wHy5Wr95H5j9MwyJnQKkIPIg85FUscIfUIoillF pGQPCXHU059CWX3n4uDkKoEVM4CZADfFDa25vQLxGMpuDtnIrjgQjIWZGEMogHvACL56o7 FGddGiWOnktPStm+0EK2dAQ4Alw4cT5bYvS1UJHUiRC97MqP21HzHpsTLKM3fb18G4u0Be uw8Qw/iQ2/ECeiTx7354rRf2ckzhclqiZSxEWVdzsieh6Ed0TJ3jOGJfVKJiQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dJ13rMONWc0U3wuZkQrZWOljDDBxCP9UHqeXnUIUzlI=; b=RZYKqE4GxRHm0xbbRmZoqmnRxmlMTRV3Zl5pBETEal7iX06g3WglyKQyYpXo1nJTDEcO6g FiVysBrcfmIjV/fF+U/KT64z71SJ2Oj1Vsh8Jh119LwaKh+7g8jHBD1ml9TjgrZyAyfZiY +369Oi913GEOcuR9p0nOFCHX4Wp0ZkqCESCpnvqXQWKSkCPvfpwt47QbM79cJ+Xk+GlB+f bkRKop2iutfxhvaO6HIHzbm2xFOXOPmGz7prEA6SpTHuRAiBgO1SfOe/JFO9Bxv/7Fr6gV kddwShG6tkXs25XOsMnibWw66AHM2D0rpCw/MhQ7gKR6kKLMBp+9L+I+fTZCVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677019509; a=rsa-sha256; cv=none; b=PSA9LPAMX5HQ8QZklr+h7Q3OB9Amq4AUs65YeacvbvVIu2qSg+1jhcsSvgy3JjjPZt4dmE E/kQ5lbUf5mVAJhAquH4ZF5Wjlg4kmJVJQO0Pf8SmB3fLkFzGQoJNQ6mVlhlEKM3EE6uBT wOKA1yQY7nFh88C/iD7PBWgNzx/tXxgiOtdF/NgwLYkQb3yilQOZlioydYkB8Hfw1d+amX 5j9zC4fRL546k3+9yx+qKTW6LfOc9095mojsbC+jArOeSusj+4wVDgfLY0m9gscOe5C1Br AV5/qdrAX2UZHPWDCsjSyHlBF12GnEUknbTiIO9/okBjm3506VBDn6qcCLFWNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLvW92kfPzcYR; Tue, 21 Feb 2023 22:45: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 31LMj9x0067592; Tue, 21 Feb 2023 22:45:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LMj9nA067591; Tue, 21 Feb 2023 22:45:09 GMT (envelope-from git) Date: Tue, 21 Feb 2023 22:45:09 GMT Message-Id: <202302212245.31LMj9nA067591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: a6fa27eb5267 - stable/13 - ixl(4): Fix MAC/VLAN filters accounting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a6fa27eb5267bfaceb626d90ead84b4d9a4f5655 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=a6fa27eb5267bfaceb626d90ead84b4d9a4f5655 commit a6fa27eb5267bfaceb626d90ead84b4d9a4f5655 Author: Krzysztof Galazka AuthorDate: 2023-02-15 22:28:01 +0000 Commit: Eric Joyner CommitDate: 2023-02-21 22:42:51 +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 Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D37457 (cherry picked from commit 1d02c6b1b859e9f611bc8fe27ca3d2c16ec128c1) --- 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 cbf6f9444c18..985843d546fa 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) "." \ @@ -1722,9 +1722,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 9828760e4ea6..9b49520a8851 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 f783ae5ed31a..0b4e69a5ce37 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 Tue Feb 21 22:47:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLvYv19Mpz3tZpX; Tue, 21 Feb 2023 22:47: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 4PLvYv0d29z4Psr; Tue, 21 Feb 2023 22:47:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LdGrZcuPgvLOwY+jgfwdsPIybvu8ciCIgAAUd0ICg6s=; b=vnMGtoaBWqYSJxOJlMSw5aLs+vyY7tunn6iusWAPcJLnmexP757lJvxvmAY5QPkfuXUEgp BZOcxC2/Lh8NiOuCCRP0/8UfYa1iRSeNS6/g530361rHIGNWMU7PqoWPH6D7PKn0b/h5z9 tsUGbFs6UzmQScQInJNeqg8CYkPnXHdxQGqNmAy1n+QKV9lFLErCAiuuzI7Q7A9bvUoo4L /8OKIdVnyYJIj7onuYcEiFKX1eGh669wS5wJnX8og2Dc8LE1XlwGWsdK3THRZf5+FsQMFE J3YgP+lpotIhA6muOE3vxJ5UC/zH8Y728wG2oJWTpOFJyPPJmYSchj71UOkuhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677019651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LdGrZcuPgvLOwY+jgfwdsPIybvu8ciCIgAAUd0ICg6s=; b=OGRWF/twbmaB16SLLCZL7pVWN9CzzKZnw11dR8ERMxujlm+6TGzpqqSMfYxrom5pMAUyoK wsAiYOQsQaoxp5qm48p6pq+t3GMvb6fMBuB06L2A1t9wxFwUrNaNsZR4P86DlPDjReiE9d lWwDtUsbquqi7n77rpk8MYMI5JSxAsGZfdrp7MoXAzEzw2dtJgvfBeYIEXR3og4O0Xzp2z AJQPOOHwtDw1xqfkGii/6JfemuuLbZE8ZBN0tvIjTMC2uajDCydH2+5FHcg4+ckTPz466o es3PfRgEJBaoAvSxRXtBpjY6eW9HAiZL25G01vU6NoXZpjXZ3KVgC5RdDfFZdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677019651; a=rsa-sha256; cv=none; b=igfg6/H4wk+chI9z3/a/baF86U7N4RgwDmhwQPqIqLN58nlARrpvSnH42NBpK2CBhf86u7 OvszB3yGHB15uelqa1vI+ZSTCUtZKDXeh9/RvGMP0/3s2ZNl139bE+SvaG5nB4AG6GgT1o sde13XNrc3Vk8IpsUk60mOso3h4REwnNTIKF41pQ8C8pDAqyWFjdLKoyD6wMyeRF2tsHyE pCIFGlSOVCAg6vdnd49Saih1aCezVnwWGhBqydaUCtX9bwtZLLYx+8VVe/Q1nN1r4C28DF GP/Emc7Hv7pPHshII657/5GiL4SzBLlrecEH+prIXw/qGqXHLZibr3zYxa77yg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLvYt6p8gzcwh; Tue, 21 Feb 2023 22:47: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 31LMlUqA068018; Tue, 21 Feb 2023 22:47:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LMlUPJ068017; Tue, 21 Feb 2023 22:47:30 GMT (envelope-from git) Date: Tue, 21 Feb 2023 22:47:30 GMT Message-Id: <202302212247.31LMlUPJ068017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: 426ed0052540 - stable/13 - Fix per-jail zfs.mount_snapshot setting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 426ed00525409d084e97dc44397722aff2cc0bb3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=426ed00525409d084e97dc44397722aff2cc0bb3 commit 426ed00525409d084e97dc44397722aff2cc0bb3 Author: Allan Jude AuthorDate: 2023-02-18 01:44:34 +0000 Commit: Allan Jude CommitDate: 2023-02-21 22:47:21 +0000 Fix per-jail zfs.mount_snapshot setting When jail.conf set the nopersist flag during startup, it was incorrectly destroying the per-jail ZFS settings. PR: 260160 Reported by: imp (previous version), mm (upstream), freqlabs (upstream) MFC after: immediately Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38662 (cherry picked from commit 8b04c1cbfc1cb71a1ce53b3a7855f1d45866fcfb) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index 85449ebb9d97..6ffd36885655 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -2525,7 +2525,9 @@ zfs_jailparam_set(void *obj, void *data) mount_snapshot = -1; else jsys = JAIL_SYS_NEW; - if (jsys == JAIL_SYS_NEW) { + switch (jsys) { + case JAIL_SYS_NEW: + { /* "zfs=new" or "zfs.*": the prison gets its own ZFS info. */ struct zfs_jailparam *zjp; @@ -2543,12 +2545,22 @@ zfs_jailparam_set(void *obj, void *data) if (mount_snapshot != -1) zjp->mount_snapshot = mount_snapshot; mtx_unlock(&pr->pr_mtx); - } else { + break; + } + case JAIL_SYS_INHERIT: /* "zfs=inherit": inherit the parent's ZFS info. */ mtx_lock(&pr->pr_mtx); osd_jail_del(pr, zfs_jailparam_slot); mtx_unlock(&pr->pr_mtx); + break; + case -1: + /* + * If the setting being changed is not ZFS related + * then do nothing. + */ + break; } + return (0); } From nobody Tue Feb 21 23:16:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLwCm1PqTz3tcsh; Tue, 21 Feb 2023 23:16: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 4PLwCm0wBrz4Sf3; Tue, 21 Feb 2023 23:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677021412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BUGQABh+FXF/ROWiFMtfjZPaqG/xfpTHuUSUF8g6DQw=; b=NxHkO5/qhsoV7+o0YstPlNY8ZFyFBqQHVCrsCwYWJ+G3zmYFRwGAXvYc7FY4x0WSP4nkj1 jQyROgXHcqRB80uFAJ9LsfChWSetzmYpEjpWxYSPVWUNNWsKTcfxkGOA+YQ/+V3AFjjDE0 X+l/PNXQv2KEAYk5XrA/iIjh9BW36allko/++/ExNk5C1AhSYMszLyw4l+CcRebFpVAXKe unCQw8Ltp0bw542+QROpdSdLjXGjJOxixYdutOLgbyZft7XIjPTGop3jr7so/fJTQHm0Y2 c2qTaCSKBwVWlbKaJN3n/DLqMdpYYkEj9dqEwAeEyG36WChZ0T6l3YSjduFMpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677021412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BUGQABh+FXF/ROWiFMtfjZPaqG/xfpTHuUSUF8g6DQw=; b=GoD30Q61YhgkEKBARLxP6s04CAQrclj4vA5AjkhPPaoFM+wY6Hb31lL4Zm8muJLdILoTtE TBwYOr4/M2b5xcmCC3BR7up+WYdInRLy0IABi0MqJRcNqK6nUbh7xGmbYDSpiNYASh6XU8 NFUb+B0i/fATn5yAD7jza8keCR+S08AGDZ7LCV13t4oqcBbzFAT18f5EBZvOuRauiF9FHZ 7eYsi0IkUmkhwDKUY+u/VWwOyr2FSmZOfYMWwsW1zijlF0F0CRIGkfYE5fqfqVEifXvB9I 7Jdzc2pb7uQ4Z2MSk7su+UwuRyk4ostPff88w6m5hSARoCZvCjSZ1JiOiV7Lcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677021412; a=rsa-sha256; cv=none; b=ru2MaQ7EldafJaPZotzc0fQLCIM2De95ZfSViQtCPlJoZrHERj2E+dDm8a8Or4wgoItvOi q1BrErLRKM/m1l9fyoKYTMXg1QHojq1SxL3Rbh5rrQU9NNGg2/jQNLVNJm8dZkPwBeg0V0 HHOQDRxqYB9HNyLwjY2joli+/E9rbOzFrxBIv/1MWkmp0gVPh9z8qJqgKs8GV8dhKJJ17A VxnKG0BiQwUTT6nwCDxPFwIDg9Q4ChQjkXbcBFhSSPyPCexkGcZOwjeo0sUgyumVOsHULT EHGVCLX9eUf6uqbr5p9P6/UKxu9pVVEerKCrxmwWLINU7JL9ISmO34ktpa8DRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLwCl74PRzfDY; Tue, 21 Feb 2023 23:16: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 31LNGp9k011788; Tue, 21 Feb 2023 23:16:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LNGpsp011787; Tue, 21 Feb 2023 23:16:51 GMT (envelope-from git) Date: Tue, 21 Feb 2023 23:16:51 GMT Message-Id: <202302212316.31LNGpsp011787@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: 19850ee07363 - main - Revert "linprocfs: Migrate to IfAPI" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19850ee07363ffd97b4ba3c06361392ce9834440 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=19850ee07363ffd97b4ba3c06361392ce9834440 commit 19850ee07363ffd97b4ba3c06361392ce9834440 Author: Justin Hibbits AuthorDate: 2023-02-21 23:13:00 +0000 Commit: Justin Hibbits CommitDate: 2023-02-21 23:17:26 +0000 Revert "linprocfs: Migrate to IfAPI" This reverts commit 5243598927a95e77b3bb9804b049539b87353a5b. Requested by: dchagin --- sys/compat/linprocfs/linprocfs.c | 107 ++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 64 deletions(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index f2a8c5833c82..15c4d3c41749 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1474,79 +1474,26 @@ linprocfs_doprocmem(PFS_FILL_ARGS) return (error); } -struct linux_ifname_cb_s { - struct ifnet *ifp; - int ethno; - char *buffer; - size_t buflen; -}; - -static int -linux_ifname_cb(if_t ifp, void *arg) -{ - struct linux_ifname_cb_s *cbs = arg; - - if (ifp == cbs->ifp) - return (snprintf(cbs->buffer, cbs->buflen, "eth%d", cbs->ethno)); - if (!linux_use_real_ifname(ifp)) - cbs->ethno++; - return (0); -} - static int linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) { - struct linux_ifname_cb_s arg; + struct ifnet *ifscan; + int ethno; IFNET_RLOCK_ASSERT(); - arg.ifp = ifp; - arg.buffer = buffer; - arg.buflen = buflen; - arg.ethno = 0; - /* Short-circuit non ethernet interfaces */ if (linux_use_real_ifname(ifp)) - return (strlcpy(buffer, if_name(ifp), buflen)); + return (strlcpy(buffer, ifp->if_xname, buflen)); /* Determine the (relative) unit number for ethernet interfaces */ - return (if_foreach(linux_ifname_cb, &arg)); -} - -static int -linprocfs_donetdev_cb(if_t ifp, void *arg) -{ - char ifname[16]; /* XXX LINUX_IFNAMSIZ */ - struct sbuf *sb = arg; - - linux_ifname(ifp, ifname, sizeof ifname); - sbuf_printf(sb, "%6.6s: ", ifname); - sbuf_printf(sb, "%7ju %7ju %4ju %4ju %4lu %5lu %10lu %9ju ", - (uintmax_t )if_getcounter(ifp, IFCOUNTER_IBYTES), - (uintmax_t )if_getcounter(ifp, IFCOUNTER_IPACKETS), - (uintmax_t )if_getcounter(ifp, IFCOUNTER_IERRORS), - (uintmax_t )if_getcounter(ifp, IFCOUNTER_IQDROPS), - /* rx_missed_errors */ - 0UL, /* rx_fifo_errors */ - 0UL, /* rx_length_errors + - * rx_over_errors + - * rx_crc_errors + - * rx_frame_errors */ - 0UL, /* rx_compressed */ - (uintmax_t )if_getcounter(ifp, IFCOUNTER_IMCASTS)); - /* XXX-BZ rx only? */ - sbuf_printf(sb, "%8ju %7ju %4ju %4ju %4lu %5ju %7lu %10lu\n", - (uintmax_t )if_getcounter(ifp, IFCOUNTER_OBYTES), - (uintmax_t )if_getcounter(ifp, IFCOUNTER_OPACKETS), - (uintmax_t )if_getcounter(ifp, IFCOUNTER_OERRORS), - (uintmax_t )if_getcounter(ifp, IFCOUNTER_OQDROPS), - 0UL, /* tx_fifo_errors */ - (uintmax_t )if_getcounter(ifp, IFCOUNTER_COLLISIONS), - 0UL, /* tx_carrier_errors + - * tx_aborted_errors + - * tx_window_errors + - * tx_heartbeat_errors*/ - 0UL); /* tx_compressed */ + ethno = 0; + CK_STAILQ_FOREACH(ifscan, &V_ifnet, if_link) { + if (ifscan == ifp) + return (snprintf(buffer, buflen, "eth%d", ethno)); + if (!linux_use_real_ifname(ifscan)) + ethno++; + } return (0); } @@ -1557,6 +1504,9 @@ linprocfs_donetdev_cb(if_t ifp, void *arg) static int linprocfs_donetdev(PFS_FILL_ARGS) { + char ifname[16]; /* XXX LINUX_IFNAMSIZ */ + struct ifnet *ifp; + sbuf_printf(sb, "%6s|%58s|%s\n" "%6s|%58s|%58s\n", "Inter-", " Receive", " Transmit", @@ -1566,7 +1516,36 @@ linprocfs_donetdev(PFS_FILL_ARGS) CURVNET_SET(TD_TO_VNET(curthread)); IFNET_RLOCK(); - if_foreach(linprocfs_donetdev_cb, sb); + CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { + linux_ifname(ifp, ifname, sizeof ifname); + sbuf_printf(sb, "%6.6s: ", ifname); + sbuf_printf(sb, "%7ju %7ju %4ju %4ju %4lu %5lu %10lu %9ju ", + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IBYTES), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IPACKETS), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IERRORS), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IQDROPS), + /* rx_missed_errors */ + 0UL, /* rx_fifo_errors */ + 0UL, /* rx_length_errors + + * rx_over_errors + + * rx_crc_errors + + * rx_frame_errors */ + 0UL, /* rx_compressed */ + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IMCASTS)); + /* XXX-BZ rx only? */ + sbuf_printf(sb, "%8ju %7ju %4ju %4ju %4lu %5ju %7lu %10lu\n", + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OBYTES), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OERRORS), + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_OQDROPS), + 0UL, /* tx_fifo_errors */ + (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_COLLISIONS), + 0UL, /* tx_carrier_errors + + * tx_aborted_errors + + * tx_window_errors + + * tx_heartbeat_errors*/ + 0UL); /* tx_compressed */ + } IFNET_RUNLOCK(); CURVNET_RESTORE(); From nobody Tue Feb 21 23:33:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLwbW2Vp2z3tdQy; Tue, 21 Feb 2023 23:33: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 4PLwbW1yThz4Tkk; Tue, 21 Feb 2023 23:33:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677022439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79ImOHXuY+sRVsJWH73KN2Og5MYtSg6OkhmJ+i51o2I=; b=xowDgm2nHi/yU7qkJE5v32IM2kEgw+NSJX1UBJaANvciry+zZ8awYnLvEyCYtcaOEtwOBV jF4EtI3GugKT29uApwtph2mBqUEsUpFNwgVHqp+UCEbjnbLxv7u9zvUe1IuIfg0BdBYeeB fsS2tt3zegh5jsJLY+kOWlC3I0rmiQacpATjPoyOjMMDJlvy5uWx9WXywt9LU6tBdHccBT 69BlV18vsU+ji2cNX52DxPQ8WHKR1XERqszQTFzNjnPqqJ3WB2e2uyllyI9oWDXYJ3VJxO C80mgP5KKVY1I3yZOtSAvqr0OTHQY0SJ/+xX8brlt7hTmiIEL6cALQwiv0hV1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677022439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79ImOHXuY+sRVsJWH73KN2Og5MYtSg6OkhmJ+i51o2I=; b=BlByCUhAaPt6/Hlvphmqk9Rye8P8Dbq2C1/LmL29DAi/wd/KtXQubFVClwYaEuRA3b7fcV zwP8dcWjG35S5p2MTY+bng+ggi1xwYFEK56HF+GM2FvCSBZIgqX9E8VWcx72yIO6KhVjPw cMWIAliDiMx9ycItODTOA0rcCQnrPReNd3Cq1iebls7BCPtPgsbxehxSND2pSoq8xPd3Tq dci0vawWeF0Jr02YAdRb/6eV+pF+0Dox01DO68ucXSu3MQZ6vNKh0MVvrPpHtT+y2TAe2h KXGV7RktAJzMR7eZf4RxGek4YzBntCAoLsjb+FV4VfKYnm4lDg5ItDyaVkJtsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677022439; a=rsa-sha256; cv=none; b=rKvGQlYMwScqwfTt1AgceX0OHhBE95JSM4ASeuysnwClj7mPzN/BgP2KlIPbZSjtvrJ6r3 dN+fM0Vvlftdo0wFLzmDqp7RdBAoHBO9CQlYXRSbKAexPa4RIeSCPt7NFNbCdy+tzJa6LR Jb9qSC9/wNoC6xRr1ntbx2pq7yklTqxoGL79Vff2wLM+F+TRGPU3yZBIQckGr1VXRc6sPN NQLf1tW+BM8fbqNYjz5qddQ5axWZ28q9KxmScIflzFq9qbwdGoBXT7yG5utYgjnuy/jeYE hn3LxmYGN0c4StDZ6lKfrMMfnuW7SBZOG/n5UZVQXvn8lTgDrltAiBVk4TVnZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLwbW10rjzf4W; Tue, 21 Feb 2023 23:33: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 31LNXxMa039420; Tue, 21 Feb 2023 23:33:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LNXxGE039419; Tue, 21 Feb 2023 23:33:59 GMT (envelope-from git) Date: Tue, 21 Feb 2023 23:33:59 GMT Message-Id: <202302212333.31LNXxGE039419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 335517b9b02b - stable/13 - nfscl: Fix interaction between mmap'd and VOP_WRITE file updates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 335517b9b02bc37f4d532998dc8e3ce5757cdef6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=335517b9b02bc37f4d532998dc8e3ce5757cdef6 commit 335517b9b02bc37f4d532998dc8e3ce5757cdef6 Author: Rick Macklem AuthorDate: 2023-02-08 22:25:01 +0000 Commit: Rick Macklem CommitDate: 2023-02-21 23:32:40 +0000 nfscl: Fix interaction between mmap'd and VOP_WRITE file updates asomers@ found a problem with the NFS client, where a write to an NFS mounted file done via mmap(2) was lost when fspacectl(2) was done before it. This turned out to be caused by clearing the dirty bit on pages when the client was doing commit RPCs, due to the second argument to vfs_busy_pages() being set to 1. Commit RPCs tell the server to commit previously written data to stable storage. However, Commit RPCs do not write data from the client to the server. As such, if the dirty bit on the page has been set by a mmap'd write to an address in the page, it should not be cleared. Clearing it causes the mmap'd write to by lost. This patch fixes the problem by changing the 2nd argument to vfs_busy_pages() to 0 for this case. I doubt this bug has affected many, since it was inherited from the old NFS client and was in 4.3 FreeBSD twenty years ago. Although fspacectl(2) is FreeBSD 14 specific, a write(2) would cause the same failure. PR: 269328 (cherry picked from commit 847967bc4e198a258b030a5864e64e029e7452e5) --- sys/fs/nfsclient/nfs_clvnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 02e5e3540d72..d1d84b05bbd7 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3023,7 +3023,7 @@ again: wcred = bp->b_wcred; else if (wcred != bp->b_wcred) wcred = NOCRED; - vfs_busy_pages(bp, 1); + vfs_busy_pages(bp, 0); BO_LOCK(bo); /* From nobody Tue Feb 21 23:57:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLx6L5hdGz3tfnn; Tue, 21 Feb 2023 23:57: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 4PLx6L4d2Mz4Z9M; Tue, 21 Feb 2023 23:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDmCdv3/4llf+dr3fUkK/llIRwnnpZCCtkcoFLit64U=; b=v5NT3PlnmwHajw4HvIDSUzIS3YwMP1Q0UhVKNcGMT/6I6MAvhwQgUCDx+W0unEMSBWsZmw YvZcnjqeCwrggVrxh9zfQ6e30OvplA1zdsn7OtT+wIDt8oB5cYIEytckzm9hMh2zgrTSxS i5XyK7Uqd9pMd9K5IfoItxmacMtlrKUzWo+Ega4eReqQ0CLeQdF6vg7pPVUvJtD9MCqg7/ mL2Gg66cMj7YLDeZObyNnCg7tyTFuXQBYRalC5iRokdh9gMdaakJLeQ7QgqzPYjwj3y/He nIiuJdg8GHQSgIXqfcGwun8XQBJLYfFXJrh6fKPz6WASuUUnj/yUde60jxw6qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDmCdv3/4llf+dr3fUkK/llIRwnnpZCCtkcoFLit64U=; b=W3eQqeFLTskA2qOzwwbrFZd1IRSuMsUYOS0OryUmRrpep176oj/cxHQirgq/3BF/HL0F8z R3gqTglHbBC+GwzQ9+DgS157hoXjtNbbxROXXcAvYmstpMtS7BXB1MmgCdnUOV8zPUycpg x8OfRjGKMs5/npfN+qzvZPWsPzKoaIX8ipPHQgATE/WUTwXzmvMqfTjCTJEtK/RnJPIC1D AKV1AJQwqR6kbhWK4TBVhnzx/c0puftzWY/lXBkQ6ixrzoDgO8Fm5C9llUNsTHu94sW3SQ joTWziACerpfxU7B7y3cAkUorVt1169ifD65cb6VDrIUpXXvvGmWZ8D0O4Y9iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677023834; a=rsa-sha256; cv=none; b=qKMMbfA/lGKjs5r1TnW/Mw4y5nn3wWS+LD+9oxBvMjgMYNBs/nHMn9gCn+IxhzJlQJ9Q21 yFf5+N9CPL9RjAcCb8iyjJumNtQm/FJkPXOG80KWGvY9/l/DboDDjCHsvGGczEC22Gvi8S O0wXqjFSEycchOKq4V09Jnu8xsoDTJWQZr37QNlUQd5RdfOdgwcJJDtvSNUAKnrvf9Tazx ub2VPZVtTi3A67bDCBoZeWfwCwfV2HpX5mv4U7dM5abA0mqX45SeAtoTjeKQD6hVqQa/3v jpqUfokHXyAqzApcsVaayLRNwYuSQ9SBLPoH2ThZx6sER8Hc1aqNgcxej5INkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLx6L3gj1zftp; Tue, 21 Feb 2023 23:57: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 31LNvEa1068431; Tue, 21 Feb 2023 23:57:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LNvEB1068430; Tue, 21 Feb 2023 23:57:14 GMT (envelope-from git) Date: Tue, 21 Feb 2023 23:57:14 GMT Message-Id: <202302212357.31LNvEB1068430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: e8046d1cc4b9 - releng/13.2 - ice_ddp: Update package to 1.3.30.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: e8046d1cc4b93ed844b75524f80f94bcd88f2c14 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=e8046d1cc4b93ed844b75524f80f94bcd88f2c14 commit e8046d1cc4b93ed844b75524f80f94bcd88f2c14 Author: Eric Joyner AuthorDate: 2023-01-24 22:01:57 +0000 Commit: Eric Joyner CommitDate: 2023-02-21 23:55:14 +0000 ice_ddp: Update package to 1.3.30.0 This updated DDP is intended to be used with the forthcoming ice(4) driver update to 1.37.7-k. (But it will still work with the current version.) Co-authored-by: Piotr Kubaj Signed-off-by: Eric Joyner Approved by: re (cperciva) Sponsored by: Intel Corporation (cherry picked from commit 2508da22cd6f0904fe55d2d5f6cab7c6011f918c) (cherry picked from commit cd280c60a5b85875b8aeff8d522793914e60d19d) --- sys/conf/files.amd64 | 6 +- sys/conf/files.arm64 | 6 +- sys/conf/files.powerpc | 12 +- sys/contrib/dev/ice/README | 168 ++++++++++++++++----- .../dev/ice/{ice-1.3.27.0.pkg => ice-1.3.30.0.pkg} | Bin 676216 -> 692660 bytes sys/modules/ice_ddp/Makefile | 2 +- 6 files changed, 142 insertions(+), 52 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index d8f7a1837f6a..464c7af84bfa 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -206,7 +206,7 @@ dev/ice/irdma_if.m optional ice pci \ dev/ice/irdma_di_if.m optional ice pci \ compile-with "${NORMAL_M} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031b00 -mice_ddp -c${.TARGET}" \ + 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 \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -215,8 +215,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.27.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.27.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.30.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.30.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 563d62859258..88cb483f178f 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -236,7 +236,7 @@ dev/ice/irdma_if.m optional ice pci \ dev/ice/irdma_di_if.m optional ice pci \ compile-with "${NORMAL_M} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031b00 -mice_ddp -c${.TARGET}" \ + 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 \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -245,8 +245,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.27.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.27.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.30.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.30.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 889310c0afaa..c01e0e81ab1a 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -80,18 +80,18 @@ dev/ice/irdma_if.m optional ice pci powerpc64 \ compile-with "${NORMAL_M} -I$S/dev/ice" dev/ice/irdma_di_if.m optional ice pci powerpc64 \ compile-with "${NORMAL_M} -I$S/dev/ice" -ice_ddp.c optional ice_ddp powerpc64 \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031b00 -mice_ddp -c${.TARGET}" \ +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 \ clean "ice_ddp.c" -ice_ddp.fwo optional ice_ddp powerpc64 \ +ice_ddp.fwo optional ice_ddp powerpc64 | ice pci powerpc64le \ dependency "ice_ddp.fw" \ compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ice_ddp.fwo" -ice_ddp.fw optional ice_ddp powerpc64 \ - dependency "$S/contrib/dev/ice/ice-1.3.27.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.27.0.pkg ice_ddp.fw" \ +ice_ddp.fw optional ice_ddp powerpc64 | ice pci powerpc64le \ + dependency "$S/contrib/dev/ice/ice-1.3.30.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.30.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ixl/if_ixl.c optional ixl pci powerpc64 \ diff --git a/sys/contrib/dev/ice/README b/sys/contrib/dev/ice/README index e6d126d62877..e2ce84d72e71 100644 --- a/sys/contrib/dev/ice/README +++ b/sys/contrib/dev/ice/README @@ -1,14 +1,16 @@ -OS Default Dynamic Device Personalization (DDP) Package +OS Default Dynamic Device Personalization (DDP) Package ====================================================================== -July 7, 2020 +May 12, 2022 Contents ======== - Overview +- Supported Operating Systems - Safe Mode - Notes -- Installation & Troubleshooting +- Installation +- Troubleshooting - Legal @@ -16,7 +18,7 @@ Overview ======== Devices based on the Intel(R) Ethernet 800 Series require a Dynamic Device Personalization (DDP) package file to enable advanced features (such as dynamic -tunneling, Intel(R) Ethernet Flow Director, RSS, and ADQ). +tunneling, Intel(R) Ethernet Flow Director, RSS, and ADQ). DDP allows you to change the packet processing pipeline of a device by applying a profile package to the device at runtime. Profiles can be used to, for @@ -24,12 +26,13 @@ example, add support for new protocols, change existing protocols, or change default settings. DDP profiles can also be rolled back without rebooting the system. -The DDP package loads during device initialization. The driver checks to see if -the DDP package is present and compatible. If this file exists, the driver will -load it into the device. If the DDP package file is missing or incompatible -with the driver, the driver will go into Safe Mode where it will use the -configuration contained in the device's NVM. Refer to the Intel(R) Ethernet -Adapters and Devices User Guide for more information on Safe Mode. +The DDP package loads during device initialization or driver runtime, depending +on the operating system. The driver checks to see if the DDP package is present +and compatible. If this file exists, the driver will load it into the device. +If the DDP package file is missing or incompatible with the driver, the driver +will go into Safe Mode where it will use the configuration contained in the +device's NVM. Refer to the Intel(R) Ethernet Adapters and Devices User Guide +for more information on Safe Mode. A general-purpose, default DDP package is automatically installed with all supported Intel Ethernet 800 Series drivers on supported operating systems. @@ -59,6 +62,18 @@ The default DDP package supports the following: - MPLS (up to 5 consecutive MPLS labels in the outermost Layer 2 header group) +Supported Operating Systems +=========================== +This DDP package is supported on the following operating systems: +- Microsoft* Windows Server* +- Linux* +- FreeBSD* +- VMware* ESXi* + +Refer to the Intel(R) Ethernet Adapters and Devices User Guide for currently +supported versions of these operating systems. + + Safe Mode ========= Safe Mode disables advanced and performance features, and supports only basic @@ -66,45 +81,44 @@ traffic and minimal functionality, such as updating the NVM or downloading a new driver or DDP package. Refer to the Intel(R) Ethernet Adapters and Devices User Guide for more details -on DDP and Safe Mode. +on DDP and Safe Mode. Notes ===== -- You cannot update the DDP package if any PF drivers are already loaded. To -overwrite a package, unload all PFs and then reload the driver with the new -package. +- In Linux, FreeBSD, and Windows, you cannot update the DDP package if any PF +drivers are already loaded. To overwrite a package, unload all PFs and then +reload the driver with the new package. -- Except for Linux, you can only use one DDP package per driver, even if you -have more than one device installed that uses the driver. +- In ESXi, use esxcli to load and unload DDP packages for specific market +segments during driver runtime. + +- In FreeBSD and Windows, you can only use one DDP package per driver, even if +you have more than one device installed that uses the driver. -- Only the first loaded PF per device can download a package for that device. +- In Linux, FreeBSD, and Windows, only the first loaded PF per device can +download a package for that device. In ESXi, you can load different DDP +packages for different PFs associated with a device. - If you are using DPDK, see the DPDK documentation at https://www.dpdk.org/ for installation instructions and more information. -Installation and Troubleshooting -================================ - -Microsoft* Windows* -------------------- -The DDP package is installed as part of the driver binary. You don't need to -take additional steps to install the DDP package file. +Installation +============ -If you encounter issues with the DDP package file, download the latest driver. - - -ESX ---- -The DDP package is installed as part of the driver binary. You don't need to -take additional steps to install the DDP package file. +Microsoft Windows +----------------- +TO INSTALL THE OS DEFAULT DDP PACKAGE: -If you encounter issues with the DDP package file, download the latest driver. +The default DDP package is installed as part of the driver binary. You don't +need to take additional steps to install the DDP package file. FreeBSD ------- +TO INSTALL THE OS DEFAULT DDP PACKAGE: + The FreeBSD driver automatically installs the default DDP package file during driver installation. See the base driver README for general installation and building instructions. @@ -112,15 +126,14 @@ building instructions. The DDP package loads during device initialization. The driver looks for the ice_ddp module and checks that it contains a valid DDP package file. -If you encounter issues with the DDP package file, you may need to download an -updated driver or ice_ddp module. See the log messages for more information. - NOTE: It's important to do 'make install' during initial ice driver installation so that the driver loads the DDP package automatically. Linux ----- +TO INSTALL THE OS DEFAULT DDP PACKAGE: + The Linux driver automatically installs the default DDP package file during driver installation. Read the base driver README for general installation and building instructions. @@ -131,9 +144,8 @@ intel/ice/ddp/ice.pkg in your firmware root (typically /lib/firmware/ or The ice.pkg file is a symbolic link to the default DDP package file installed by the linux-firmware software package or the out-of-tree driver installation. -If you encounter issues with the DDP package file, you may need to download an -updated driver or DDP package file. Refer to the log messages for more -information. + +TO INSTALL A DDP PACKAGE FOR SPECIFIC MARKET SEGMENTS: You can install specific DDP package files for different physical devices in the same system. To install a specific DDP package: @@ -177,9 +189,87 @@ NOTE: The presence of a device-specific DDP package file overrides the loading of the default DDP package file. +ESX +--- +TO INSTALL THE OS DEFAULT DDP PACKAGE: + +The default DDP package is installed as part of the driver binary. You don't +need to take additional steps to install the DDP package file. + +TO INSTALL A DDP PACKAGE FOR SPECIFIC MARKET SEGMENTS: + +You must first install the Intel(R) ESXCLI Plug-In for Managing Intel(R) +Ethernet Network Adapters to be able to install and load market-specific DDP +packages. Download it from: +https://www.intel.com/content/www/us/en/download/19380/intel-esxcli-plug-in-for- +managing-intel-ethernet-network-adapters.html + +NOTE: ESXi support for DDP packages for specific market segments requires the +following: +- OS: ESXi 6.7 or higher +- Driver: icen 1.9.1.x or higher +- Tool: intnet 1.8.3.x or higher + +To install and load this DDP package: + +1. Download and install the esxcli plug-in from the URL above. + +2. Download the DDP package. + +3. Copy the DDP package file to the following location: /store/intel/icen/ddp/. + If the directory does not yet exist, create it before copying the file. + +4. From the command prompt, run the following command to load the DDP package: + + # esxcli intnet ddp load -n -p -f + + Where: + = the name of the NIC + = the name of the DDP package to load + -f = forces the package to load + + NOTE: This operation will cause the driver to reset. + +5. Wait for the load result status. + + +To list all active DDP packages for all virtual NICs, run the following: + +# esxcli intnet ddp list + +To unload (roll back) a DDP package, run the following: + +# esxcli intnet ddp rollback -n -f + +NOTE: This operation will cause the driver to reset. + + +Troubleshooting +=============== + +Microsoft Windows +----------------- +If you encounter issues with the DDP package file, download the latest driver. + +FreeBSD +------- +If you encounter issues with the DDP package file, you may need to download an +updated driver or ice_ddp module. See the log messages for more information. + +Linux +----- +If you encounter issues with the DDP package file, you may need to download an +updated driver or DDP package file. Refer to the log messages for more +information. + +ESX +--- +If you encounter issues with the DDP package file, download the latest driver. + + Legal / Disclaimers =================== -Copyright (c) 2019 - 2020, Intel Corporation. +Copyright (c) 2019 - 2022, Intel Corporation. Intel and the Intel logo are trademarks of Intel Corporation or its subsidiaries in the U.S. and/or other countries. diff --git a/sys/contrib/dev/ice/ice-1.3.27.0.pkg b/sys/contrib/dev/ice/ice-1.3.30.0.pkg similarity index 79% rename from sys/contrib/dev/ice/ice-1.3.27.0.pkg rename to sys/contrib/dev/ice/ice-1.3.30.0.pkg index 2fcc57d47d5f..454a2a6ea193 100644 Binary files a/sys/contrib/dev/ice/ice-1.3.27.0.pkg and b/sys/contrib/dev/ice/ice-1.3.30.0.pkg differ diff --git a/sys/modules/ice_ddp/Makefile b/sys/modules/ice_ddp/Makefile index ef0b064503bb..2735a2ba4da2 100644 --- a/sys/modules/ice_ddp/Makefile +++ b/sys/modules/ice_ddp/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ KMOD= ice_ddp -FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.27.0.pkg:ice_ddp:0x01031b00 +FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.30.0.pkg:ice_ddp:0x01031e00 .include From nobody Tue Feb 21 23:57:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLx6N0Z3lz3tfr3; Tue, 21 Feb 2023 23:57: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 4PLx6M6ms6z4ZNr; Tue, 21 Feb 2023 23:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cUmlHFbwcBftUQ8GtF5V7FWiCkt/qIafRmKxnS6BHMQ=; b=O3wXyltd4PHyRv1mPyvRAdPYwYIe/P+5hHUq6WuIUdZyMB7MxOIegBODcXxYMlR/lBGzJK pcTnIBw6xquzqSD/PrSqoPW+r0g1EshCs5MnF4TANMlKE7Kbftz7IAqFoFEC93oy0m2qbT kQvZ0Ao6K/BFsor8PcG+EThTEIEwFNfTNWae5i4KyZWKCpHvlRFvSEs+bcQBnE03Dty6vs cE4Q4tBpI3AyaBPCFTHcQJHK3JGanHDlxfJwJvKvAb9h/fHwlOpCRqaacI9NsKMXguq88H /ZpAUcrZnFupcTuF5j7SOuJB2LZrxTzy1DaRh9aZkjHHKhCWusIGbRLa2pXvuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cUmlHFbwcBftUQ8GtF5V7FWiCkt/qIafRmKxnS6BHMQ=; b=LYkO222X96KhvU5UZCLAq/OWXpc+7kzzhWEv1kTA4BltDdJrZoMburz6oZV+iSGzK8kqY2 ssIEmrzstbletTFO510EehPzg5m8e9vLPF1rtLI4B1y3LmlxNjg4DfIo90WGF8gRQvb5J9 d/oQ1QsCAmHpCWIPgFBSEZmHcNYHJcl1OSXoi8dpQwJcuLLjbMVffonMiCkKHW9ZEEcy4B 78+nQ2dRf4EuvLAgomgFqHVJFgelgM3PVg6n79MGS4x7S+SzR8YO+nPJKMC8yBwnbjrZOg lZX53Ux6glkbN2ZoKfKJc13CcJvpCsUz4UGo3+FpRVr0FViuHKxLDs8Jki5alg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677023835; a=rsa-sha256; cv=none; b=b/vkFalyrJR6r/duaZGFdt8XwIeJGRvEG9ES+b+wETWpj8etw0ULQFfPcxa9H+efBCJHjQ dIzSU8l3I51piL9ZrHKOosMbH6zrE2T0E0RLo15pqCvbYzJYRLGbA754rXGzMxC6DgC44F bBk6widGlU0kP6/EZlLj2PY5XOjhrMsEQZP3HX76BU93L2FkmQu7wi4W7nfz5AUAosvM92 UfEx1E4AZN9qILgcJEbDFf65VgOKhR58Lorr9P8Ox1XC/K2o1WtJaDh8QzM1QN6hAUNvab vg+nyqPGKJ4mMHLqCqbQ+gcDDEBQoqTsZOLMlpfs0HodojW0eVS4kBWNKVhHMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLx6M5N47zftq; Tue, 21 Feb 2023 23:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31LNvFoE068450; Tue, 21 Feb 2023 23:57:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LNvF7D068449; Tue, 21 Feb 2023 23:57:15 GMT (envelope-from git) Date: Tue, 21 Feb 2023 23:57:15 GMT Message-Id: <202302212357.31LNvF7D068449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 576955dd669e - releng/13.2 - ice(4): Update to 1.37.7-k List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 576955dd669e381c59c06168fda6b73f930b191f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=576955dd669e381c59c06168fda6b73f930b191f commit 576955dd669e381c59c06168fda6b73f930b191f Author: Piotr Kubaj AuthorDate: 2023-02-14 01:29:44 +0000 Commit: Eric Joyner CommitDate: 2023-02-21 23:55:41 +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 Approved by: re (cperciva) Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38109 (cherry picked from commit 8923de59054358980102ea5acda6c6dd58273957) (cherry picked from commit ebc914f942f6655ff4c27f8717630f81c74624cb) --- 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 464c7af84bfa..b973827d6632 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -205,6 +205,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 88cb483f178f..6b96de28128d 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -235,6 +235,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 c01e0e81ab1a..05f331e2c3e0 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -38,48 +38,50 @@ dev/iicbus/max6690.c optional max6690 powermac dev/iicbus/ofw_iicbus.c 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); *** 12050 LINES SKIPPED *** From nobody Tue Feb 21 23:57:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLx6P2G3dz3tfcM; Tue, 21 Feb 2023 23:57: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 4PLx6P0vYsz4ZXD; Tue, 21 Feb 2023 23:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/0jj8H58mS7E+7Ampam2f2a1FZm08e5f2nvcMPANcc8=; b=J451Co6mKFFLxCuwEH1XB97eZj54P/K8MibG92hao+t4rSsixPLOzyfAOUDFp9Z/MvsuJX 9neiniVx0UGpMiKe+nPSSJIufouWFAYQtPox5rDUQ3NWtMAObkiklv4ceBvjbin+936znC QCqI1dUNErPTEgBAeAT1pD2RWT0kNBqs1wnf95ibRj4+4KZoLzBacUQ2m954HIvFd7L3Ei 8Q77e98HbLPpCJ8OEI+sad46+3596aR7v9JYeAomBnAtwaxDlo9tqVmwDFuku5SbmdFpFU ZsKo0EL9GWc1fSidmYJvAeVJXQSt8LrTX+3ezOZbKNZUp54ux91Mli0DtG/heQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/0jj8H58mS7E+7Ampam2f2a1FZm08e5f2nvcMPANcc8=; b=USyQSe6DMvyBRXX6owHsCrc432YSzPjjg1L3mtfFIvYUmjT+swDY0Ssri3o4JAW6I39B2p YtNHmwC+SAzWozCr+mVD7ukmw1++v6yuDlbXORFKiytHOrY4tQ143WTMg4w2vUEpbzFNow 3rk15z8D7XUCpewyBhrQS+fx9E2rFsl6BlMy+aHZA3KO84iSTyuuRaEPiyMxJsfoNLs5JP oClL+ZHNbPQskmHsIhFVOci0aeW22YpS7+FdsIRTbqJhs4zXlTz4VPmYSZ2/KdArlUAJoc S+eUxbW45rKWr5/H9T21/tYWEusbRX8tcuB6H6/cKMFO6rzNT0BPACbAjWWsRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677023837; a=rsa-sha256; cv=none; b=FHsuTcB4IXh5iLCgsI9wDHWjpyas96Mf2pRR86xL+92rJUqxoHek0bVuE6/1pl+awfxdhV +cCp1alHP2cMBZHQ+2TYnDizTqh8oc42qfdXXHMf5YoVSL95afinnyerTvmiuFXC90IVl0 CR2hvLUb27yEYaqqVg1cRFyVbdQNbkzyE6t0F56T+desI36yjj/M4Gp7t4Zj1TURcZTot0 Qu6Ia6bja6JwgclvugjRiWLd1e/44N2AUmo/ddVq9UW5NYGfdTDX40l5utF0BQLVnnK+Ly KKzyHIvR+pP3IYvJn02ouopSb341cL1Ms3cvzH7CACkj/UvWi8JIK+fBJX/OtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLx6N6TXQzftr; Tue, 21 Feb 2023 23:57: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 31LNvGM3068469; Tue, 21 Feb 2023 23:57:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LNvGQm068468; Tue, 21 Feb 2023 23:57:16 GMT (envelope-from git) Date: Tue, 21 Feb 2023 23:57:16 GMT Message-Id: <202302212357.31LNvGQm068468@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 7006923991c6 - releng/13.2 - ixgbe(4): Filter out spurious link up indication List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 7006923991c6e56399b07dd839378c81844df8ef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=7006923991c6e56399b07dd839378c81844df8ef commit 7006923991c6e56399b07dd839378c81844df8ef Author: Krzysztof Galazka AuthorDate: 2023-02-15 22:35:40 +0000 Commit: Eric Joyner CommitDate: 2023-02-21 23:56:00 +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 Approved by: re (cperciva) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38395 (cherry picked from commit 04a5e6d7cadd06b10169c3c3a560649e7dc7444c) (cherry picked from commit 25d43e3c6b365c3fb68c594fe1b9a40b98bf4f00) --- 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 Tue Feb 21 23:57:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLx6Q2Z5Wz3tfww; Tue, 21 Feb 2023 23:57: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 4PLx6Q1V0yz4ZdD; Tue, 21 Feb 2023 23:57:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZjZ80HO4702kP0wFjDeQlnpErEHcudfvquItUDqspA=; b=Ki/7pwzt0Yz6/wtDwggyeDjfGAoTTgzwsLupMkqpqJYFkIn5+UUbRN5HC4+CSVhoXjFrpB YoidB5YG4iUWXQiGph8mdP/+jIa5BglwboLFanwI0De39OSJnLAFkv5dbvD6M/dRD/F2UP SvLLzHc59XgKKL8aGrVZJJRKP+wYiDCbIMATa1G6KxuSxHrh9j8+ehcVeK/Sr7jbZOGbjR PB0r7p9uo1ohSJfGcNi8H3FOd62srf5jPI7onaSVo/CUi67P63vDOkSXuggWzBcDyEZIDU QhpTTq8uC5AW7KZ+5mXXWd+BftbFVcBCsm/06t902CrRPyE3wzJafwlRohaBxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZjZ80HO4702kP0wFjDeQlnpErEHcudfvquItUDqspA=; b=U2HBA2KS8hfWhWsd0HlFydKmNAEU4M0qEjweg2unZbGaULijk4LOk1poJ1HBybir52XSJJ gPgV94PrzZzUWBRlw0yi0Qh9RqsSRPsE89ilAz6sRa2WmIVBgALls4vTMGSO4iATJhyYRC p6UAch1acjC3+jHQclzknWtJMaBvgRLKaSO6slXuK0jDZHJo6F9CkuyktXkYQrrxH/Y4/e QYT2+uzGpN06Xm2cAXIBYbLaBUYRIhakh8JQEvmxmHgwPYxQ92FctQ4xSUc8v7aLX/xKn3 JKsVHQ0S0mfAZMRAxSQyCTMhwlU30Cydf1HbW06+id2Lsz5a4U/eVLmbpLnN5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677023838; a=rsa-sha256; cv=none; b=eJWnQQpMEJ6ZGszXHQMUp8Rq9kUh8gFAmvRcLjp1P5Dk1VPWbiHL3vn/SArg7Bf+PR9to/ C7399O5HuBqRFm3BUDs+sQDgCvtMf/fxKn4RwOyVjnI2StVHsTJItaGKkfeq4owJy6VwMj OzzYltlQGkSmuqbKyFNvfljy+UtiZdNVNDmGUpBFi9NMhMsYdrPTjXAUK0XYK1J7XGTR0P B9mSsuFrdD6TrD91t6GvI4W3JrJzQkNOcDP2T5gPWtSDapdwY2gBFEqYwK9CEXIrK4ctlU jbZ/92eX+skuT9/oHt54o+MrSfNLa/PtVh2P6fgO1dHscdUNaJgiOGWmuAzBQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLx6Q0HsCzfwS; Tue, 21 Feb 2023 23:57: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 31LNvHpu068494; Tue, 21 Feb 2023 23:57:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LNvHbH068493; Tue, 21 Feb 2023 23:57:17 GMT (envelope-from git) Date: Tue, 21 Feb 2023 23:57:17 GMT Message-Id: <202302212357.31LNvHbH068493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 0f59de6879b8 - releng/13.2 - ixl(4): Fix MAC/VLAN filters accounting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0f59de6879b8590177c050a1dd02a5383271f33b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=0f59de6879b8590177c050a1dd02a5383271f33b commit 0f59de6879b8590177c050a1dd02a5383271f33b Author: Krzysztof Galazka AuthorDate: 2023-02-15 22:28:01 +0000 Commit: Eric Joyner CommitDate: 2023-02-21 23:56:18 +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 Approved by: re (cperciva) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D37457 (cherry picked from commit 1d02c6b1b859e9f611bc8fe27ca3d2c16ec128c1) (cherry picked from commit a6fa27eb5267bfaceb626d90ead84b4d9a4f5655) --- 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 cbf6f9444c18..985843d546fa 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) "." \ @@ -1722,9 +1722,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 9828760e4ea6..9b49520a8851 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 f783ae5ed31a..0b4e69a5ce37 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 22 00:48:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLyFh6vkBz3tjqP; Wed, 22 Feb 2023 00:48: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 4PLyFh5tV3z3F42; Wed, 22 Feb 2023 00:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677026920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j/973yX4zx8s/qCLRs3g0dgug/+UoNt0gLhsYqDZrnM=; b=l8S6GN/V3C7iYWD9pnMk4K6ag/uG3mThV6ALBJLCEEVGkEhaDNb5ImDNORzyclZEdDv6Rv PwQ6DjZ9znuXVY9AmLZOit7rjrWopMueNCyS6YgFmh8CC53/bdtVFa2xiY5QVe4ZNxdsTh 18s0kG9ssiPoE4H4meDhBDNIxpSXD0S0Hfs93UYegoH9WUjeC+3HEKVp/0VYT/Yw4+pq19 BSxAEeUmOyLH+bYU9wRJnB86mKx98FJ/9vmzezLBEjggYAOFbiJN+1Ms3KhaCe3uXNDG+P G45mD26qvU7eJiEhqro90LmCN+Iha0VApqTeOnI20DUM83dy6jrdIIj4a4T94A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677026920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j/973yX4zx8s/qCLRs3g0dgug/+UoNt0gLhsYqDZrnM=; b=m0N3WkjEdSxSjbP9hWUO/yt7yvPMWXHPswI6Oi18PlQsfJvPRX8MCDrWwfTKupLEhIDx/O vfsaDVlcLhBxyA88gCt9JDXkomzaWlSjCuYTvLyRZqO7Ku/mcW5W+6pdyz/sUAvoDnF0oS 988fTgAFgjcQcsTiZr9T6CkHuE1JJqh9ptknGlnQf+Bim1t3S8B8KLiykhVAJbpq5LTmyF hb/ZqsfMD7R5uGmPitA8KBuXS3tTrbd0N9PWGPC3ZimgBBtZVVTap5DJjyVTMfTSRq3TFa PfU//LJGJM4ltRRsfCwTCpqk+Jofponio4lzM+3xeCTK9ETsbgT+oR1XGo5+Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677026920; a=rsa-sha256; cv=none; b=SzuZMF95zjQRE1N+kDoa2n+sWBY7MGIsnbcot9xU0k5ZO71xG6t3Uyy2QMWMcJQsTkjQt4 Xl4t7ymwT33NzIyQqERS7FXosT+HNWCvkQyonbICqw6ZDqvTgbD62JB3HFjypjxAcDdZMr N5Kr2LyImtFpXtuDF4zaUuU6ZZVGW0lyRRswSeHQdvdmd0He2UcZN0YdxqrYkih+etwhnr aNnB5asmb9lskR/hXHkxSGg96QAHqjJuvqkCmOZWup4koOYXB0DLzEdIPzU/I7w0iTUcUY sS12q34dio324VkTlHaPZkCQGQKjiBXRrTmOkutX/eDoRG6B3xqs472X1ohHdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLyFh4x3jzh55; Wed, 22 Feb 2023 00:48: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 31M0meJh040984; Wed, 22 Feb 2023 00:48:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31M0meXw040983; Wed, 22 Feb 2023 00:48:40 GMT (envelope-from git) Date: Wed, 22 Feb 2023 00:48:40 GMT Message-Id: <202302220048.31M0meXw040983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 17d1b8eef7d1 - stable/13 - e1000: fix I219 hang on reset List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17d1b8eef7d18ad6093c5024bd25a9bca7c3febe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=17d1b8eef7d18ad6093c5024bd25a9bca7c3febe commit 17d1b8eef7d18ad6093c5024bd25a9bca7c3febe Author: Kevin Bowling AuthorDate: 2023-02-08 19:21:45 +0000 Commit: Kevin Bowling CommitDate: 2023-02-22 00:48:25 +0000 e1000: fix I219 hang on reset Clear the rings before reset to avoid a HW hang. Inspired by em-7.7.8 and DPDK (1fc9701238edcf0541289b9ae15565b6d9d7ab30) Reviewed by: erj Sponsored by: BBOX.io Pull Request: https://github.com/freebsd/freebsd-src/pull/540 (cherry picked from commit ae1dca798e0f826de46f4ec11914ba4c91928d7a) --- sys/dev/e1000/if_em.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 117 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index c17714dbd566..80a3bbee7814 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -343,6 +343,7 @@ static int em_get_regs(SYSCTL_HANDLER_ARGS); static void lem_smartspeed(struct e1000_softc *); static void igb_configure_queues(struct e1000_softc *); +static void em_flush_desc_rings(struct e1000_softc *); /********************************************************************* @@ -1907,6 +1908,10 @@ em_if_stop(if_ctx_t ctx) INIT_DEBUGOUT("em_if_stop: begin"); + /* I219 needs special flushing to avoid hangs */ + if (sc->hw.mac.type >= e1000_pch_spt && sc->hw.mac.type < igb_mac_min) + em_flush_desc_rings(sc); + e1000_reset_hw(&sc->hw); if (sc->hw.mac.type >= e1000_82544) E1000_WRITE_REG(&sc->hw, E1000_WUFC, 0); @@ -1972,8 +1977,7 @@ em_allocate_pci_resources(if_ctx_t ctx) sc->hw.hw_addr = (u8 *)&sc->osdep.mem_bus_space_handle; /* Only older adapters use IO mapping */ - if (sc->hw.mac.type < em_mac_min && - sc->hw.mac.type > e1000_82543) { + if (sc->hw.mac.type < em_mac_min && sc->hw.mac.type > e1000_82543) { /* Figure our where our IO BAR is ? */ for (rid = PCIR_BAR(0); rid < PCIR_CIS;) { val = pci_read_config(dev, rid, 4); @@ -2461,6 +2465,113 @@ igb_init_dmac(struct e1000_softc *sc, u32 pba) E1000_WRITE_REG(hw, E1000_DMACR, 0); } } +/********************************************************************* + * The 3 following flush routines are used as a workaround in the + * I219 client parts and only for them. + * + * em_flush_tx_ring - remove all descriptors from the tx_ring + * + * We want to clear all pending descriptors from the TX ring. + * zeroing happens when the HW reads the regs. We assign the ring itself as + * the data of the next descriptor. We don't care about the data we are about + * to reset the HW. + **********************************************************************/ +static void +em_flush_tx_ring(struct e1000_softc *sc) +{ + struct e1000_hw *hw = &sc->hw; + struct tx_ring *txr = &sc->tx_queues->txr; + struct e1000_tx_desc *txd; + u32 tctl, txd_lower = E1000_TXD_CMD_IFCS; + u16 size = 512; + + tctl = E1000_READ_REG(hw, E1000_TCTL); + E1000_WRITE_REG(hw, E1000_TCTL, tctl | E1000_TCTL_EN); + + txd = &txr->tx_base[txr->tx_cidx_processed]; + + /* Just use the ring as a dummy buffer addr */ + txd->buffer_addr = txr->tx_paddr; + txd->lower.data = htole32(txd_lower | size); + txd->upper.data = 0; + + /* flush descriptors to memory before notifying the HW */ + wmb(); + + E1000_WRITE_REG(hw, E1000_TDT(0), txr->tx_cidx_processed); + mb(); + usec_delay(250); +} + +/********************************************************************* + * em_flush_rx_ring - remove all descriptors from the rx_ring + * + * Mark all descriptors in the RX ring as consumed and disable the rx ring + **********************************************************************/ +static void +em_flush_rx_ring(struct e1000_softc *sc) +{ + struct e1000_hw *hw = &sc->hw; + u32 rctl, rxdctl; + + rctl = E1000_READ_REG(hw, E1000_RCTL); + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); + E1000_WRITE_FLUSH(hw); + usec_delay(150); + + rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); + /* zero the lower 14 bits (prefetch and host thresholds) */ + rxdctl &= 0xffffc000; + /* + * update thresholds: prefetch threshold to 31, host threshold to 1 + * and make sure the granularity is "descriptors" and not "cache lines" + */ + rxdctl |= (0x1F | (1 << 8) | E1000_RXDCTL_THRESH_UNIT_DESC); + E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl); + + /* momentarily enable the RX ring for the changes to take effect */ + E1000_WRITE_REG(hw, E1000_RCTL, rctl | E1000_RCTL_EN); + E1000_WRITE_FLUSH(hw); + usec_delay(150); + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); +} + +/********************************************************************* + * em_flush_desc_rings - remove all descriptors from the descriptor rings + * + * In I219, the descriptor rings must be emptied before resetting the HW + * or before changing the device state to D3 during runtime (runtime PM). + * + * Failure to do this will cause the HW to enter a unit hang state which can + * only be released by PCI reset on the device + * + **********************************************************************/ +static void +em_flush_desc_rings(struct e1000_softc *sc) +{ + struct e1000_hw *hw = &sc->hw; + device_t dev = sc->dev; + u16 hang_state; + u32 fext_nvm11, tdlen; + + /* First, disable MULR fix in FEXTNVM11 */ + fext_nvm11 = E1000_READ_REG(hw, E1000_FEXTNVM11); + fext_nvm11 |= E1000_FEXTNVM11_DISABLE_MULR_FIX; + E1000_WRITE_REG(hw, E1000_FEXTNVM11, fext_nvm11); + + /* do nothing if we're not in faulty state, or if the queue is empty */ + tdlen = E1000_READ_REG(hw, E1000_TDLEN(0)); + hang_state = pci_read_config(dev, PCICFG_DESC_RING_STATUS, 2); + if (!(hang_state & FLUSH_DESC_REQUIRED) || !tdlen) + return; + em_flush_tx_ring(sc); + + /* recheck, maybe the fault is caused by the rx ring */ + hang_state = pci_read_config(dev, PCICFG_DESC_RING_STATUS, 2); + if (hang_state & FLUSH_DESC_REQUIRED) + em_flush_rx_ring(sc); +} + /********************************************************************* * @@ -2692,6 +2803,10 @@ em_reset(if_ctx_t ctx) break; } + /* I219 needs some special flushing to avoid hangs */ + if (sc->hw.mac.type >= e1000_pch_spt && sc->hw.mac.type < igb_mac_min) + em_flush_desc_rings(sc); + /* Issue a global reset */ e1000_reset_hw(hw); if (hw->mac.type >= igb_mac_min) { From nobody Wed Feb 22 00:49:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLyGv61jWz3tjqb; Wed, 22 Feb 2023 00:49: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 4PLyGv5Wfdz3FLd; Wed, 22 Feb 2023 00:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677026983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bEQLuDaKY6KNRAZb7ALNkSD+n3vLGVVxERKBI8BoEBM=; b=axIirnf6Fo9GDHLuRzP3WV6qAFEpS/QBTeUQMCQfJOdIctnLClmI8xmhViK/MitYUSBL/1 F3R4rFpQaaZpe4eQRZZChlA4LslBGI7+Eps2mfG9bO12VICd87l4bHM07mXxg0hLf3yu9f XptsFJg6z4QyjgiiYneQ8v/ybSDzDZGLaOkQFXcViV0kxDtsdpPCBop+2vcXVfDYwkZqww wUlxKjsErTFSoStEckoYBDVn3/ho3oBlPR4xjSQ9tXVEQT7aSCQtL9YOVeXmXIvMi1Z7sm UBARuoMOcs85UN/Wf9ecSeYiAJbz94TzdMTX8W9f/B+ZX1kUivPsJZr4XDrtYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677026983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bEQLuDaKY6KNRAZb7ALNkSD+n3vLGVVxERKBI8BoEBM=; b=AnVgKyBT8wq6x/3BYTh3D+9ibJBkpxTF3vN/W/xLAuUbYasFixMjT+Xhoy/u/QV/gORavV vfo1Is7y1lXqj+5bRuJR9AAs1cWRdJ2FA5jpWehLBzpySoofTW4DX4edJ+kf4+Khawq/Ze OW2VIawrAo8jEZHAUbYfDh6gfSM6QevS4ReiP1QQksXPckaGfjGmw6VDzoM6eEtJXpS/pq YzQc5UpMcts0TNn1KG/vSX/rXN19F05ZwuEGi0QYjsaCwHxyoWqPgY38WnUBq7HihPYrPo iR8gIWF3s08iBP9pQRXt1fbwPC3x9wA8KfMop5rivOLd9nnnXAqf0RmXWhYI7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677026983; a=rsa-sha256; cv=none; b=ZdbfDubKr/DPDuWUSZqXJcvnDUz3fNUymD/18n3exLTz/yw8MpUxI78LnXDWJDFfMqUw05 AhT/+5l25NtDM4b54F/sffppLJ8dEHjK1h/rlrnF9DFEHH/qrgmuHnHsiMZJ0TC6nu0MQy Y9S14GRRcL/ORiXnHKTWmiv8G2I9Jmvcp2R5zpLnra6izbaMfvf0MJWS2/hweiYbfXCQw8 5oraf+UnBUb/aRjmPNu/eCxwmhMHhvrMOTX7t6aUzgiPxgVbHHzXUhjpXB9t8vLcWjYenJ 3jY0K3dM+o1T81mZHA0xrmSMe2DAFx9VKn0CXn/PSTRdqsi9cAIZM3O6UjYiSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLyGv4bnjzh7M; Wed, 22 Feb 2023 00:49: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 31M0nhZd041208; Wed, 22 Feb 2023 00:49:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31M0nhMg041207; Wed, 22 Feb 2023 00:49:43 GMT (envelope-from git) Date: Wed, 22 Feb 2023 00:49:43 GMT Message-Id: <202302220049.31M0nhMg041207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e646dced5931 - stable/12 - e1000: fix I219 hang on reset List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e646dced5931a1e51177688d0bd8f1ace90711e5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e646dced5931a1e51177688d0bd8f1ace90711e5 commit e646dced5931a1e51177688d0bd8f1ace90711e5 Author: Kevin Bowling AuthorDate: 2023-02-08 19:21:45 +0000 Commit: Kevin Bowling CommitDate: 2023-02-22 00:49:29 +0000 e1000: fix I219 hang on reset Clear the rings before reset to avoid a HW hang. Inspired by em-7.7.8 and DPDK (1fc9701238edcf0541289b9ae15565b6d9d7ab30) Reviewed by: erj Sponsored by: BBOX.io Pull Request: https://github.com/freebsd/freebsd-src/pull/540 (cherry picked from commit ae1dca798e0f826de46f4ec11914ba4c91928d7a) --- sys/dev/e1000/if_em.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 117 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index a9ab2fb21535..3f6087404f36 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -343,6 +343,7 @@ static int em_get_regs(SYSCTL_HANDLER_ARGS); static void lem_smartspeed(struct e1000_softc *); static void igb_configure_queues(struct e1000_softc *); +static void em_flush_desc_rings(struct e1000_softc *); /********************************************************************* @@ -1895,6 +1896,10 @@ em_if_stop(if_ctx_t ctx) INIT_DEBUGOUT("em_if_stop: begin"); + /* I219 needs special flushing to avoid hangs */ + if (sc->hw.mac.type >= e1000_pch_spt && sc->hw.mac.type < igb_mac_min) + em_flush_desc_rings(sc); + e1000_reset_hw(&sc->hw); if (sc->hw.mac.type >= e1000_82544) E1000_WRITE_REG(&sc->hw, E1000_WUFC, 0); @@ -1960,8 +1965,7 @@ em_allocate_pci_resources(if_ctx_t ctx) sc->hw.hw_addr = (u8 *)&sc->osdep.mem_bus_space_handle; /* Only older adapters use IO mapping */ - if (sc->hw.mac.type < em_mac_min && - sc->hw.mac.type > e1000_82543) { + if (sc->hw.mac.type < em_mac_min && sc->hw.mac.type > e1000_82543) { /* Figure our where our IO BAR is ? */ for (rid = PCIR_BAR(0); rid < PCIR_CIS;) { val = pci_read_config(dev, rid, 4); @@ -2449,6 +2453,113 @@ igb_init_dmac(struct e1000_softc *sc, u32 pba) E1000_WRITE_REG(hw, E1000_DMACR, 0); } } +/********************************************************************* + * The 3 following flush routines are used as a workaround in the + * I219 client parts and only for them. + * + * em_flush_tx_ring - remove all descriptors from the tx_ring + * + * We want to clear all pending descriptors from the TX ring. + * zeroing happens when the HW reads the regs. We assign the ring itself as + * the data of the next descriptor. We don't care about the data we are about + * to reset the HW. + **********************************************************************/ +static void +em_flush_tx_ring(struct e1000_softc *sc) +{ + struct e1000_hw *hw = &sc->hw; + struct tx_ring *txr = &sc->tx_queues->txr; + struct e1000_tx_desc *txd; + u32 tctl, txd_lower = E1000_TXD_CMD_IFCS; + u16 size = 512; + + tctl = E1000_READ_REG(hw, E1000_TCTL); + E1000_WRITE_REG(hw, E1000_TCTL, tctl | E1000_TCTL_EN); + + txd = &txr->tx_base[txr->tx_cidx_processed]; + + /* Just use the ring as a dummy buffer addr */ + txd->buffer_addr = txr->tx_paddr; + txd->lower.data = htole32(txd_lower | size); + txd->upper.data = 0; + + /* flush descriptors to memory before notifying the HW */ + wmb(); + + E1000_WRITE_REG(hw, E1000_TDT(0), txr->tx_cidx_processed); + mb(); + usec_delay(250); +} + +/********************************************************************* + * em_flush_rx_ring - remove all descriptors from the rx_ring + * + * Mark all descriptors in the RX ring as consumed and disable the rx ring + **********************************************************************/ +static void +em_flush_rx_ring(struct e1000_softc *sc) +{ + struct e1000_hw *hw = &sc->hw; + u32 rctl, rxdctl; + + rctl = E1000_READ_REG(hw, E1000_RCTL); + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); + E1000_WRITE_FLUSH(hw); + usec_delay(150); + + rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0)); + /* zero the lower 14 bits (prefetch and host thresholds) */ + rxdctl &= 0xffffc000; + /* + * update thresholds: prefetch threshold to 31, host threshold to 1 + * and make sure the granularity is "descriptors" and not "cache lines" + */ + rxdctl |= (0x1F | (1 << 8) | E1000_RXDCTL_THRESH_UNIT_DESC); + E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl); + + /* momentarily enable the RX ring for the changes to take effect */ + E1000_WRITE_REG(hw, E1000_RCTL, rctl | E1000_RCTL_EN); + E1000_WRITE_FLUSH(hw); + usec_delay(150); + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); +} + +/********************************************************************* + * em_flush_desc_rings - remove all descriptors from the descriptor rings + * + * In I219, the descriptor rings must be emptied before resetting the HW + * or before changing the device state to D3 during runtime (runtime PM). + * + * Failure to do this will cause the HW to enter a unit hang state which can + * only be released by PCI reset on the device + * + **********************************************************************/ +static void +em_flush_desc_rings(struct e1000_softc *sc) +{ + struct e1000_hw *hw = &sc->hw; + device_t dev = sc->dev; + u16 hang_state; + u32 fext_nvm11, tdlen; + + /* First, disable MULR fix in FEXTNVM11 */ + fext_nvm11 = E1000_READ_REG(hw, E1000_FEXTNVM11); + fext_nvm11 |= E1000_FEXTNVM11_DISABLE_MULR_FIX; + E1000_WRITE_REG(hw, E1000_FEXTNVM11, fext_nvm11); + + /* do nothing if we're not in faulty state, or if the queue is empty */ + tdlen = E1000_READ_REG(hw, E1000_TDLEN(0)); + hang_state = pci_read_config(dev, PCICFG_DESC_RING_STATUS, 2); + if (!(hang_state & FLUSH_DESC_REQUIRED) || !tdlen) + return; + em_flush_tx_ring(sc); + + /* recheck, maybe the fault is caused by the rx ring */ + hang_state = pci_read_config(dev, PCICFG_DESC_RING_STATUS, 2); + if (hang_state & FLUSH_DESC_REQUIRED) + em_flush_rx_ring(sc); +} + /********************************************************************* * @@ -2680,6 +2791,10 @@ em_reset(if_ctx_t ctx) break; } + /* I219 needs some special flushing to avoid hangs */ + if (sc->hw.mac.type >= e1000_pch_spt && sc->hw.mac.type < igb_mac_min) + em_flush_desc_rings(sc); + /* Issue a global reset */ e1000_reset_hw(hw); if (hw->mac.type >= igb_mac_min) { From nobody Wed Feb 22 00:50:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLyJJ6mJLz3tjtk; Wed, 22 Feb 2023 00:50: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 4PLyJJ6LTxz3FW2; Wed, 22 Feb 2023 00:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677027056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IBPXJwsIpSukOMI3qFMDXstUof8sIm5Xfq/WJGP48s=; b=ft6TZG1LnsB1FgDroMytmP9ph/u9FFzwuELB+IjH5fNywwsic3OysF9vrdiojRNtsadTv8 HS9hg47RXNfQwNMCum7OlCXOzOJLUZxO91CDDRbenvLoKxp7Y9Fuc+34qCdqv2mcE7sDPu 8K4el8YKkdvD7TDkTy9HtZq72waG13I1W4MZ1Ji7BFUig8EwOLi+mMWAbExwy2UlIkA5HV BNyUFmkNTOGG3fYRzId8TxsEvUpKrJjKwysh8TPE6dc7ambTKK/huv8P46LZnOSXt50kMx OnaLn8H3Bvmk653Cu00zqfnpqqOUNMk//kWgpemizCfIBd/EKJPIl0K6Z9VsxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677027056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IBPXJwsIpSukOMI3qFMDXstUof8sIm5Xfq/WJGP48s=; b=B20tpiWHNgwOVtRdr2A1XiBU3H5ZrfSdWJFlM20Z+mwojxfm0B7wCa9RNnGbIhJSaqV3k7 W9/9QMuh3QBmeujPaD04aWGPtwH00FG/Pi9jUJRu7PMo/l0Wd2CZWjLeezO36sqjfhsZcK dOeSefrEes0gKz4cjNmGjxaParYdfJKF/LGK9TH7nVuYYdCNhpuyIu7Kun+Zt+0fWbcsOQ tMInGj/MhijjymjdhYyZtFshJPOSN0KtNSZlhhMYb/FP+J4miW7eXxQuBE9ynINX2UwfZJ 5zOjQZAhamh6WHCGhwbBiGOotp9vtBxKUX+F954B8U4BSz1nb4bWthJ2M51Rpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677027056; a=rsa-sha256; cv=none; b=oXhz4w6c0MMbdm0/cwYQ/ud7Dpz7wISksGvZjkNVSjzhRec+i1lvQDZVypS8LqKplVanKz iWB6UR23q8zs9CYgtrrT4+Y8dlQiFYjYzZzKCD/x+X/Ez1DW8HyuvEIak431IJSVAdlkfN H05+GAhm2HgQ9A7IvynXI38ZJLNOFzDF1eUOsogK6uQNN6OlrqAaZvloNzwQkPN5al8oMb 5rqi5QQ2CxpCzg+tdxIeHhOo7N6K5Z33V1EvHpTPNaVqUjgchJ7DZEkQI7v8N4iGn8rnuN 8Y7npoUi19Xi6J/Xalpma8jm6RVnKl4nzCYkUUujTZu934BP8rbHeYlHIJ4Q2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLyJJ5QSmzghL; Wed, 22 Feb 2023 00:50: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 31M0ou7D050644; Wed, 22 Feb 2023 00:50:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31M0oull050643; Wed, 22 Feb 2023 00:50:56 GMT (envelope-from git) Date: Wed, 22 Feb 2023 00:50:56 GMT Message-Id: <202302220050.31M0oull050643@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 8c2eeb1c1cd6 - stable/13 - e1000: bump driver version List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8c2eeb1c1cd67accad434303bc9f2cd6ec401733 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=8c2eeb1c1cd67accad434303bc9f2cd6ec401733 commit 8c2eeb1c1cd67accad434303bc9f2cd6ec401733 Author: Kevin Bowling AuthorDate: 2023-02-08 19:25:58 +0000 Commit: Kevin Bowling CommitDate: 2023-02-22 00:50:23 +0000 e1000: bump driver version Incrementing these to avoid confusion in users; we are on par with these out of tree versions. Reviewed by: erj Sponsored by: BBOX.io Pull Request: https://github.com/freebsd/freebsd-src/pull/540 (cherry picked from commit 647f2d2bc0cb9357ac083bf2aae4b669167dd66b) --- sys/dev/e1000/if_em.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 80a3bbee7814..408b76c6876f 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -37,7 +37,8 @@ /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.6.1-k"; +char em_driver_version[] = "7.7.8-fbsd"; +char igb_driver_version[] = "2.5.19-fbsd"; /********************************************************************* * PCI Device ID Table @@ -593,7 +594,7 @@ static struct if_shared_ctx igb_sctx_init = { .isc_ntxqs = 1, .isc_admin_intrcnt = 1, .isc_vendor_info = igb_vendor_info_array, - .isc_driver_version = em_driver_version, + .isc_driver_version = igb_driver_version, .isc_driver = &igb_if_driver, .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP | IFLIB_NEED_ZERO_CSUM, From nobody Wed Feb 22 00:51:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLyKL5D2Sz3tjpK; Wed, 22 Feb 2023 00:51: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 4PLyKL4k9Hz3GM8; Wed, 22 Feb 2023 00:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677027110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=osp7qLIet9DL6cOA8xWx2YLA81k68dDE4ZYkx9Zxzvg=; b=kzagqxQrJRo9i7ga78gypU9Mfk4WlZolFIGGCYJvvqoJRuGsUnEJwwv/kmvmtgTH2pN8BT obgi8DZ7NTnbxrCAiQyAmlQLhVcavvH8A0QE7vdrK09wtS0jBeSANMaHECajg9A/D5bVLI lCoVrnkM7hLdzFr7WXwxO2LbcvurFL0khp1L2y8W9b3wXs5gDcaHF7ZpxnJN1rp/TZWZaD wDjnIs33JT40YTGAYIfj8C9Hg4/h1DfuR67gzQH4+OWYWybAxGaJkOmiVYxu0CNjxoN2S5 EvQ527vghPp152Flamy2f367wBWSYU7krNEDzTHFt50sbamWK5LsS1F9cEAD2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677027110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=osp7qLIet9DL6cOA8xWx2YLA81k68dDE4ZYkx9Zxzvg=; b=tqB0X1PcatuRXE4D9G6E2SsdfkkQ1KYhGjOl6WxuuBlG6daPcg097a/QRPl58AedcSkMT2 eWJA/LNDKpwLYKOpbtd+SmqiHajXi4nB2QgHusJNkeMIHNrvsnMG354BhZmkNPP2GmOm0n LMZFBiI5lZ3js9fRUkPbd+AZqBZkf60HLe0CJHzo92laLMjq3abgsST2i6e2O2yzIUqOSq 4pZT1m9Ul7gF8446+UMgJVZpJGka0IxtyneFnniWsWnw9K5tGCdx43H3B6BhMgGKrg/LdM IEvQsCBB7XnKS2okNGt9S6w/vyLWQJnho6LbGnJHAvzfZ7H5hhPste+HrP4HOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677027110; a=rsa-sha256; cv=none; b=xj4CmC/WgwF1N5qJX92O8juXYkz2ws7RZEmaA9zEfW8I+qSI5RVSVEhjQ4c3I6L/guBT42 rgeEar3l44cJ6/SIhbbCUzhTp5Ce47zmw7i7uxR1y0bUcf22Oh4DYNAtTTfqPzskO6O6qD 6r1nn6SiSTPO01I6fWRHlMCMJONIIn4XNVZ1gXjk6owJNGYKwjcnExUdNVxY+umSiluSbz 8sI2IZBZsJg8HjjnC6NQWO66ZoHRDmv/WEMR1D+jwVujxmmPJGxgmBrrf8UANakACeRcgE bJQSyKtXFZCDpV5xCwfBLcZWENCxuB6dzipVPgbFykykz49JJ46ymM8vayeS/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 4PLyKL3pFpzh9f; Wed, 22 Feb 2023 00:51: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 31M0po9u050845; Wed, 22 Feb 2023 00:51:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31M0po32050844; Wed, 22 Feb 2023 00:51:50 GMT (envelope-from git) Date: Wed, 22 Feb 2023 00:51:50 GMT Message-Id: <202302220051.31M0po32050844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 1fb11c84caa8 - stable/12 - e1000: bump driver version List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1fb11c84caa89453d6a1b15c38252ac464980193 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=1fb11c84caa89453d6a1b15c38252ac464980193 commit 1fb11c84caa89453d6a1b15c38252ac464980193 Author: Kevin Bowling AuthorDate: 2023-02-08 19:25:58 +0000 Commit: Kevin Bowling CommitDate: 2023-02-22 00:51:20 +0000 e1000: bump driver version Incrementing these to avoid confusion in users; we are on par with these out of tree versions. Reviewed by: erj Sponsored by: BBOX.io Pull Request: https://github.com/freebsd/freebsd-src/pull/540 (cherry picked from commit 647f2d2bc0cb9357ac083bf2aae4b669167dd66b) --- sys/dev/e1000/if_em.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 3f6087404f36..869ce4fb4cf4 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -37,7 +37,8 @@ /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.6.1-k"; +char em_driver_version[] = "7.7.8-fbsd"; +char igb_driver_version[] = "2.5.19-fbsd"; /********************************************************************* * PCI Device ID Table @@ -592,7 +593,7 @@ static struct if_shared_ctx igb_sctx_init = { .isc_ntxqs = 1, .isc_admin_intrcnt = 1, .isc_vendor_info = igb_vendor_info_array, - .isc_driver_version = em_driver_version, + .isc_driver_version = igb_driver_version, .isc_driver = &igb_if_driver, .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP | IFLIB_NEED_ZERO_CSUM, From nobody Wed Feb 22 01:43:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLzSf5WwBz3tmqn; Wed, 22 Feb 2023 01:43:14 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [162.220.209.3]) (using TLSv1.3 with cipher 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 "gritton.org", Issuer "gritton.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLzSf36Qsz3MjW; Wed, 22 Feb 2023 01:43:14 +0000 (UTC) (envelope-from jamie@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from gritton.org ([127.0.0.3]) (authenticated bits=0) by gritton.org (8.16.1/8.16.1) with ESMTPA id 31M1h7CQ019415; Tue, 21 Feb 2023 17:43:07 -0800 (PST) (envelope-from jamie@freebsd.org) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Date: Tue, 21 Feb 2023 17:43:07 -0800 From: James Gritton To: Gleb Smirnoff Cc: Rick Macklem , bz@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup In-Reply-To: References: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: jamie@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4PLzSf36Qsz3MjW X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:30247, ipnet:162.220.208.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 2023-02-21 13:13, Gleb Smirnoff wrote: > On Mon, Feb 20, 2023 at 09:12:41PM +0000, Rick Macklem wrote: > R> nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup > R> > R> Commit ed03776ca7f4 enabled the vnet front end macros. > R> As such, for kernels built with the VIMAGE option will malloc > R> data and initialize locks on a per-vnet basis, typically > R> via a VNET_SYSINIT(). > R> > R> This patch adds VNET_SYSUNINIT() macros to do the frees > R> of the per-vnet malloc'd data and destroys of per-vnet > R> locks. It also removes the mtx_lock/mtx_unlock calls > R> from nfsrvd_cleancache(), since they are not needed. > > In the netinet/netinet6/TCP/UDP we came to a style where we avoid > using IS_DEFAULT_VNET(). Instead doing global and per-vnet init > in the same function: > > static globalfoo; > VNET_DEFINE_STATIC(foobar); > > static void > foo_vnet_init() > { > initialize(V_foobar); > if (IS_DEFAULT_VNET(curvnet)) > initialize(globalfoo); > > } > VNET_SYSINIT(foo_vnet_init, ....) > > We can do a separate init of global state and separate of per-VNET: > > static globalfoo; > static void > foo_init() > { > initialize(globalfoo); > } > SYSINIT(foo_init, ....) > > VNET_DEFINE_STATIC(foobar); > static void > foo_vnet_init() > { > initialize(V_foobar); > } > > This allows to: > > * guarantee that global state is initialized earlier than per-vnet > * separate all global vars from all vnet vars, and keep them together, > easier to maintain > * makes it easier to write VNET_SYSUNINIT() that is complement to > VNET_SYSINIT() > * makes it easier to write SYSUNINIT(), if module is unloadable > * sometimes global SYSINIT cab be avoided, if a static initializer is > enough > > What do you guys think? I'm all for that, just on the first point alone. - Jamie From nobody Wed Feb 22 01:52:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLzg10Gg0z3tn3Q; Wed, 22 Feb 2023 01:52:13 +0000 (UTC) (envelope-from zlei@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 4PLzg06smhz3N7N; Wed, 22 Feb 2023 01:52:12 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677030733; 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=oC/VADfMSoI124Ub1CXWatWYSzTwE58Fbse8lL9GGR4=; b=ES5nWWFEfwgVqZ+2KBejIUmCMT1K62z8MeEovphLBA2elHmShLfzOHed0gzFh0hIK/Mrdz L6KLqr+93YqsUNCEJ4xJQEs22aPcwUdcal5lAMSUDza+XSaCCB7KQL6g8wqcf9pbQR9ybc bSo187klJFI4mTqHlyk4OkM1HUKuVRGCxT/llfNPYiWxmsSA+wccUWNyExam81flIhktA9 xOffvEui6d4k8WIdforUkCIi0eb6HhWVOpXQSFgcwZf36br4xT6rdSqHAvTBgetyJGVToN 4NRoFvzMEZcdx2q7DgsHUhRnUjAOygU/PTpOL8ofb0If1ucwupGYgGFpaYg9Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677030733; 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=oC/VADfMSoI124Ub1CXWatWYSzTwE58Fbse8lL9GGR4=; b=TpFiw+uc5Namt+PMtJSxnOz2yaVoRiT7rhRtkSGvbKeDbqLg2hBGIc3dfcUe9zG6KKsnht YmztgcXODlZaKc4IrcRHPZIEX+569e6kT+s1yqNEauJ02kV+23Tii7s6Cik+UJu0uQoAB0 KCFyqniUV25bHounltFfO5VDEArcTSgPy7sq30/+sbSMIPOGcblMn5031/fj2ICJxwsxXu j30JaPo4qN2s8F0CBa7hm0fwnttku8BF7QKNZmWQwZDmzQLWZkJ+S8i0uDJB23Xh647nNQ QcluC1stgmpbZEwv9Gdq8KS1UQ+JO9UcRp1U6IYcI554IuKrgq19BK0hOs3l/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677030733; a=rsa-sha256; cv=none; b=vGNa53u1DGENWOU/F8SGmB4lvjmqYCtrqoUgYdTDm/jcYxKvLLhDaJzC1FL5UOkMRo8vSh q+XNZNCRM5ubuPd9yfRoosJj8ouq1EfTWD1QeAiHsyfHCD6a8tjaOKm/OEKp9v0hkMzgVt fNqQFyueS6orzyCP6sQF6l8Bccua0QWbDjkWk8W77+GQix6YrwFwUmytalFwlc+7aBv65Q ye0bm/L9+RwEKxNHA2+Ax3Vd1Q33Ovmp+bPDq90QUtWUgw+y/q60aGqDyVMr4cbTlgWB6Q w3j1UgYcBeb/9ond+W52tcrGhglStQgsodXygY8HLDd1FS5cNRVQEgWoZS40Wg== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PLzfy5wQ2zly1; Wed, 22 Feb 2023 01:52:10 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.2\)) Subject: Re: git: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup From: Zhenlei Huang In-Reply-To: Date: Wed, 22 Feb 2023 09:52:05 +0800 Cc: Rick Macklem , bz@freebsd.org, jamie@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6AE3CB33-555F-444B-8263-70FDCA550798@FreeBSD.org> References: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3696.120.41.1.2) X-ThisMailContainsUnwantedMimeParts: N > On Feb 22, 2023, at 5:13 AM, Gleb Smirnoff = wrote: >=20 > On Mon, Feb 20, 2023 at 09:12:41PM +0000, Rick Macklem wrote: > R> nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup > R> =20 > R> Commit ed03776ca7f4 enabled the vnet front end macros. > R> As such, for kernels built with the VIMAGE option will malloc > R> data and initialize locks on a per-vnet basis, typically > R> via a VNET_SYSINIT(). > R> =20 > R> This patch adds VNET_SYSUNINIT() macros to do the frees > R> of the per-vnet malloc'd data and destroys of per-vnet > R> locks. It also removes the mtx_lock/mtx_unlock calls > R> from nfsrvd_cleancache(), since they are not needed. >=20 > In the netinet/netinet6/TCP/UDP we came to a style where we avoid > using IS_DEFAULT_VNET(). Instead doing global and per-vnet init > in the same function: >=20 > static globalfoo; > VNET_DEFINE_STATIC(foobar); >=20 > static void > foo_vnet_init() > { > initialize(V_foobar); > if (IS_DEFAULT_VNET(curvnet)) > initialize(globalfoo); > =09 > } > VNET_SYSINIT(foo_vnet_init, ....) >=20 > We can do a separate init of global state and separate of per-VNET: >=20 > static globalfoo; > static void > foo_init() > { > initialize(globalfoo); > } > SYSINIT(foo_init, ....) >=20 > VNET_DEFINE_STATIC(foobar); > static void > foo_vnet_init() > { > initialize(V_foobar); > } >=20 > This allows to: >=20 > * guarantee that global state is initialized earlier than per-vnet > * separate all global vars from all vnet vars, and keep them together, = easier to maintain > * makes it easier to write VNET_SYSUNINIT() that is complement to = VNET_SYSINIT() > * makes it easier to write SYSUNINIT(), if module is unloadable > * sometimes global SYSINIT cab be avoided, if a static initializer is = enough >=20 > What do you guys think? >=20 > --=20 > Gleb Smirnoff +1 for that. Also be aware the init order of VNET_SYSINIT, when VIMAGE is not = enabled. Best regards, Zhenlei From nobody Wed Feb 22 03:29:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PM1qb2Vhdz3s9X2; Wed, 22 Feb 2023 03:29:47 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (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 4PM1qb0bvLz3pPW; Wed, 22 Feb 2023 03:29:47 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x430.google.com with SMTP id f11so3774177pfe.2; Tue, 21 Feb 2023 19:29:47 -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:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YUiQnElUjMCfByvJYfxA4ggNozAPJEKSFoqrdVcOWQ0=; b=Lv9gbtmYquHGwY7IfwwMb2vP4t/GdjPDKVt+C6jn+BcMb4AIprtxtV3esZDOzUheeg F248v2nEPXq0GpPD7V5dA0+o2UgEeU3OjKmpsXRHmny+hjPUgbAVlE5CdQ5hEEtxMrzk TTm4NBwBTMzsvzTcTIfqV8v/HezLI0EO3EfIYRn7woMBJEQhvLskbcanz7sM3LEQj6Jg 7jQ2t4pk+CnCRkPtxVQ9vT5iYAMVnm4VVjeKVrxJdQMF19aOqn77k9LCUWWWpCed72a7 zcPij/Qn7O70U3ETNThPEOEYHhEcM4ZaxT6RLAjeCf1r3xAU+ljm9+88BsOqFIzgvOOi erBA== 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=YUiQnElUjMCfByvJYfxA4ggNozAPJEKSFoqrdVcOWQ0=; b=QCAOcllDBptiuwpk5BSsNKT9raE6PB/eEAMmbxJU0gRkz2XC/4j6hZ2TWtfkeN58C6 gDDCJGpN5L4l3KTnJJO9pja4bAU/iDgpB53BK7rXoGoBesTwjmwUMTVc31/bX7ZO7jSk G6F1oJFrx9PWZ0JUl7MzeB/uqph0aBJLxx0im3AWPjJ10L8qqTLqYFX1/s/8Mbbw5Hzw KhXOXgwx7wuuqbkZ+7fALCIeLEfyX1L0fmj7otpiEjawALy7/dp76T+cbrPFoBb7NimE 7QQGUkIWqAAQNBrVu5AOdx/Pe7pQhCdfoK6CliffG8fZTXkGgtKXOgUbw/fd0Bod5rJX FFjQ== X-Gm-Message-State: AO0yUKXQushTNAJL90tNKPTxyTDt3gh/7jr/4K25atIPyUmCD8Pcjx8S O9WpD5rcySm3xq/R5gK6oTpXicHmKrEILS2Vykh85bQXNA== X-Google-Smtp-Source: AK7set+XJutR1z3+6Gfle6wXt37FPARN24M22n6y480JUOFd+w17x+4L1NZ+158d2hFCGzISpom9Eyu+JY+qp8RHh0w= X-Received: by 2002:a05:6a00:2251:b0:5a8:4955:6d8a with SMTP id i17-20020a056a00225100b005a849556d8amr1045241pfu.9.1677036585328; Tue, 21 Feb 2023 19:29:45 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> In-Reply-To: From: Rick Macklem Date: Tue, 21 Feb 2023 19:29:30 -0800 Message-ID: Subject: Re: git: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup To: Gleb Smirnoff Cc: Rick Macklem , bz@freebsd.org, jamie@freebsd.org, 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: 4PM1qb0bvLz3pPW 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]; TAGGED_FROM(0.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, Feb 21, 2023 at 1:13 PM Gleb Smirnoff wrote: > > CAUTION: This email originated from outside of the University of Guelph. Do not click links or open attachments unless you recognize the sender and know the content is safe. If in doubt, forward suspicious emails to IThelp@uoguelph.ca > > > On Mon, Feb 20, 2023 at 09:12:41PM +0000, Rick Macklem wrote: > R> nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup > R> > R> Commit ed03776ca7f4 enabled the vnet front end macros. > R> As such, for kernels built with the VIMAGE option will malloc > R> data and initialize locks on a per-vnet basis, typically > R> via a VNET_SYSINIT(). > R> > R> This patch adds VNET_SYSUNINIT() macros to do the frees > R> of the per-vnet malloc'd data and destroys of per-vnet > R> locks. It also removes the mtx_lock/mtx_unlock calls > R> from nfsrvd_cleancache(), since they are not needed. > > In the netinet/netinet6/TCP/UDP we came to a style where we avoid > using IS_DEFAULT_VNET(). Instead doing global and per-vnet init > in the same function: > > static globalfoo; > VNET_DEFINE_STATIC(foobar); > > static void > foo_vnet_init() > { > initialize(V_foobar); > if (IS_DEFAULT_VNET(curvnet)) > initialize(globalfoo); > > } > VNET_SYSINIT(foo_vnet_init, ....) > > We can do a separate init of global state and separate of per-VNET: > > static globalfoo; > static void > foo_init() > { > initialize(globalfoo); > } > SYSINIT(foo_init, ....) > > VNET_DEFINE_STATIC(foobar); > static void > foo_vnet_init() > { > initialize(V_foobar); > } > > This allows to: > > * guarantee that global state is initialized earlier than per-vnet > * separate all global vars from all vnet vars, and keep them together, easier to maintain > * makes it easier to write VNET_SYSUNINIT() that is complement to VNET_SYSINIT() > * makes it easier to write SYSUNINIT(), if module is unloadable > * sometimes global SYSINIT cab be avoided, if a static initializer is enough > > What do you guys think? > I did that for one of the ones related to nfsd (sys/fs/nfsserver/nfs_fha_new.c). It so happens it doesn't work for this case. If you look at the patch, you'll see that the variable is vnet'd. It happens that it is only malloc'd for prisons other than prison0. (For prison0, it points to a global structure that is not malloc'd and is shared with the NFS client, which is not vnet'd. rick > -- > Gleb Smirnoff > From nobody Wed Feb 22 04:31:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PM3C30YF7z3sFRd; Wed, 22 Feb 2023 04: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 4PM3C304M5z3v26; Wed, 22 Feb 2023 04: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=1677040303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3oGShW9ALVvbv/T/gKkF1+Z3sWYZWSq3VvIwikxjJ/g=; b=ShOmVHBlysppYh+DyTeAP4mLs/rpwZ+jfgcZLz7IJL3Xn7/Nvhv0LD/glXIMMi0T2L0r/l 8sealTeYJMSzCM+JKqwgPHZrCDmdVPVa2z3kEz+J3vMocQcOJIi4cVWELiT4n0fQ+WZjWz ceO9QOdLGzk2hnrNaM15iKAOlZudwXhGKV6x9T4ME/QM9odhc18OrghrA/SXABtuPNq7PY 9E7HvicgEtwW/Gzja7B/08pPRBTTnvAkmdbHVUsUQRjgSEBxN53cHeUNhPnXTOipYG1kSv 6NWWNKw67wF+nTtNbqH2mcJ5bhFoNIhEOeFEbYrEH5cNV87VyitFcB8482mz7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677040303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3oGShW9ALVvbv/T/gKkF1+Z3sWYZWSq3VvIwikxjJ/g=; b=jtLLj40hC6HjqAuBeG4XGWdH8MHXChlL/vWhwf404Fn9NSk4Xeo2sVZCiaQYU0e1MbZjEr 8xqpreUHSOA8h+Zc9QHi+Yc7ZSrYcsgNGdY813aXE2dydW35itCbgwwzNlA15YgX5WN71j yTuXmNZUKw6xI7/oGwPypt9VKP0lT90Z1JwesvQMgS67HPo5lcycsob3F65lvbF/DtxoK9 fU8YPJ7jY8XSuUIgBJfiY//xp8DeRzOJKg7vhgzLgkX/KKSubN6TY5j+x603qz8+qBHKG3 0dn0cyR6Z3pAY8h2rTFoN2WF/9OQIIP5NSjWmgYImcYI79cIHEzo+hMCAKHHKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677040303; a=rsa-sha256; cv=none; b=p41F4TeMyF2WNsCmzsHLGM6mhvOZKpGHMor7APYV5oqtPgllJ0tGSxBLNw2Rasp1Ob6q72 bUrm3YJyi+3i66wJ1URGl9t7AqlUrf+qDmTrywT0lBUvUBJzz3D2McCY7fQoO7RhQj4W+3 LvhtSbBZWhZGsR3uh5jpUyqhyofUBR+gLUdJ0O4lFnMQ8efD9yQx7w9+gCY5OIvS23Ljut ztiImDNK/Bdie6L6mbJjjCYaBFkeJf5eNhsereyi5fQRfuxih4StbCwS6iOTPyjNq+FAlX BpikhiUQBUtTnS+VhVcEnk5xTg5dHmBi5XZ5BIAAbTOJiFh8AIDr+PnLEbzCBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PM3C264fGzmw7; Wed, 22 Feb 2023 04: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 31M4Vgps065943; Wed, 22 Feb 2023 04:31:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31M4VgwO065942; Wed, 22 Feb 2023 04:31:42 GMT (envelope-from git) Date: Wed, 22 Feb 2023 04:31:42 GMT Message-Id: <202302220431.31M4VgwO065942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John-Mark Gurney Subject: git: ee97f198b42d - main - Support SMBIOS v3 for 64-bit entry systems List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jmg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee97f198b42d50437f87aa4111d478eca2a5be16 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jmg: URL: https://cgit.FreeBSD.org/src/commit/?id=ee97f198b42d50437f87aa4111d478eca2a5be16 commit ee97f198b42d50437f87aa4111d478eca2a5be16 Author: John-Mark Gurney AuthorDate: 2023-02-22 02:27:37 +0000 Commit: John-Mark Gurney CommitDate: 2023-02-22 04:10:12 +0000 Support SMBIOS v3 for 64-bit entry systems Summary: Under QEMU on arm64 systems, the smbios table is above 4GB requiring a 64-bit address to access. Reviewers: manu Subscribers: imp, bcran, dab Differential Revision: https://reviews.freebsd.org/D38721 --- stand/efi/loader/main.c | 3 ++- stand/libsa/smbios.c | 54 +++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 446c267a517a..9ff5f1dd7674 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -1187,7 +1187,8 @@ main(int argc, CHAR16 *argv[]) #if !defined(__arm__) for (k = 0; k < ST->NumberOfTableEntries; k++) { guid = &ST->ConfigurationTable[k].VendorGuid; - if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { + if (!memcmp(guid, &smbios, sizeof(EFI_GUID)) || + !memcmp(guid, &smbios3, sizeof(EFI_GUID))) { char buf[40]; snprintf(buf, sizeof(buf), "%p", diff --git a/stand/libsa/smbios.c b/stand/libsa/smbios.c index 61bd82f9d6f0..15c5c7e50565 100644 --- a/stand/libsa/smbios.c +++ b/stand/libsa/smbios.c @@ -32,6 +32,11 @@ __FBSDID("$FreeBSD$"); #define PTOV(x) ptov(x) +/* Only enable 64-bit entry point if it makes sense */ +#if __SIZEOF_POINTER__ > 4 +#define HAS_SMBV3 1 +#endif + /* * Detect SMBIOS and export information about the SMBIOS into the * environment. @@ -53,11 +58,13 @@ __FBSDID("$FreeBSD$"); #define SMBIOS_LENGTH 0x10000 #define SMBIOS_STEP 0x10 #define SMBIOS_SIG "_SM_" +#define SMBIOS3_SIG "_SM3_" #define SMBIOS_DMI_SIG "_DMI_" #define SMBIOS_GET8(base, off) (*(uint8_t *)((base) + (off))) #define SMBIOS_GET16(base, off) (*(uint16_t *)((base) + (off))) #define SMBIOS_GET32(base, off) (*(uint32_t *)((base) + (off))) +#define SMBIOS_GET64(base, off) (*(uint64_t *)((base) + (off))) #define SMBIOS_GETLEN(base) SMBIOS_GET8(base, 0x01) #define SMBIOS_GETSTR(base) ((base) + SMBIOS_GETLEN(base)) @@ -80,6 +87,9 @@ struct smbios_attr { }; static struct smbios_attr smbios; +#ifdef HAS_SMBV3 +static int isv3; +#endif static uint8_t smbios_checksum(const caddr_t addr, const uint8_t len) @@ -98,12 +108,23 @@ smbios_sigsearch(const caddr_t addr, const uint32_t len) caddr_t cp; /* Search on 16-byte boundaries. */ - for (cp = addr; cp < addr + len; cp += SMBIOS_STEP) - if (strncmp(cp, SMBIOS_SIG, 4) == 0 && + for (cp = addr; cp < addr + len; cp += SMBIOS_STEP) { + /* v2.1, 32-bit Entry point */ + if (strncmp(cp, SMBIOS_SIG, sizeof(SMBIOS_SIG) - 1) == 0 && smbios_checksum(cp, SMBIOS_GET8(cp, 0x05)) == 0 && strncmp(cp + 0x10, SMBIOS_DMI_SIG, 5) == 0 && smbios_checksum(cp + 0x10, 0x0f) == 0) return (cp); + +#ifdef HAS_SMBV3 + /* v3.0, 64-bit Entry point */ + if (strncmp(cp, SMBIOS3_SIG, sizeof(SMBIOS3_SIG) - 1) == 0 && + smbios_checksum(cp, SMBIOS_GET8(cp, 0x06)) == 0) { + isv3 = 1; + return (cp); + } +#endif + } return (NULL); } @@ -450,6 +471,8 @@ smbios_probe(const caddr_t addr) { caddr_t saddr, info; uintptr_t paddr; + int maj_off; + int min_off; if (smbios.probed) return; @@ -461,10 +484,25 @@ smbios_probe(const caddr_t addr) if (saddr == NULL) return; - smbios.length = SMBIOS_GET16(saddr, 0x16); /* Structure Table Length */ - paddr = SMBIOS_GET32(saddr, 0x18); /* Structure Table Address */ - smbios.count = SMBIOS_GET16(saddr, 0x1c); /* No of SMBIOS Structures */ - smbios.ver = SMBIOS_GET8(saddr, 0x1e); /* SMBIOS BCD Revision */ +#ifdef HAS_SMBV3 + if (isv3) { + smbios.length = SMBIOS_GET16(saddr, 0x0c); /* Structure Table Length */ + paddr = SMBIOS_GET64(saddr, 0x10); /* Structure Table Address */ + smbios.count = -1; /* not present in V3 */ + smbios.ver = 0; /* not present in V3 */ + maj_off = 0x07; + min_off = 0x08; + } else +#endif + { + smbios.length = SMBIOS_GET16(saddr, 0x16); /* Structure Table Length */ + paddr = SMBIOS_GET32(saddr, 0x18); /* Structure Table Address */ + smbios.count = SMBIOS_GET16(saddr, 0x1c); /* No of SMBIOS Structures */ + smbios.ver = SMBIOS_GET8(saddr, 0x1e); /* SMBIOS BCD Revision */ + maj_off = 0x06; + min_off = 0x07; + } + if (smbios.ver != 0) { smbios.major = smbios.ver >> 4; @@ -473,8 +511,8 @@ smbios_probe(const caddr_t addr) smbios.ver = 0; } if (smbios.ver == 0) { - smbios.major = SMBIOS_GET8(saddr, 0x06);/* SMBIOS Major Version */ - smbios.minor = SMBIOS_GET8(saddr, 0x07);/* SMBIOS Minor Version */ + smbios.major = SMBIOS_GET8(saddr, maj_off);/* SMBIOS Major Version */ + smbios.minor = SMBIOS_GET8(saddr, min_off);/* SMBIOS Minor Version */ } smbios.ver = (smbios.major << 8) | smbios.minor; smbios.addr = PTOV(paddr); From nobody Wed Feb 22 04:37:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PM3KL37CVz3sFhP; Wed, 22 Feb 2023 04:37:10 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gold.funkthat.com [IPv6:2001:470:800b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PM3KK4qQvz3w29; Wed, 22 Feb 2023 04:37:09 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 2001:470:800b::2) smtp.mailfrom=jmg@gold.funkthat.com; dmarc=none Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 31M4b8n3081570 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Feb 2023 20:37:08 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 31M4b8P2081569; Tue, 21 Feb 2023 20:37:08 -0800 (PST) (envelope-from jmg) Date: Tue, 21 Feb 2023 20:37:08 -0800 From: John-Mark Gurney To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: imp@FreeBSD.org Subject: Re: git: ee97f198b42d - main - Support SMBIOS v3 for 64-bit entry systems Message-ID: <20230222043708.GQ95670@funkthat.com> Mail-Followup-To: John-Mark Gurney , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, imp@FreeBSD.org References: <202302220431.31M4VgwO065942@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202302220431.31M4VgwO065942@gitrepo.freebsd.org> X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Tue, 21 Feb 2023 20:37:08 -0800 (PST) X-Spamd-Result: default: False [-1.80 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; R_SPF_NA(0.00)[no SPF record]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[funkthat.com]; FREEFALL_USER(0.00)[jmg]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_NONE(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4PM3KK4qQvz3w29 X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N John-Mark Gurney wrote this message on Wed, Feb 22, 2023 at 04:31 +0000: > The branch main has been updated by jmg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ee97f198b42d50437f87aa4111d478eca2a5be16 > > commit ee97f198b42d50437f87aa4111d478eca2a5be16 > Author: John-Mark Gurney > AuthorDate: 2023-02-22 02:27:37 +0000 > Commit: John-Mark Gurney > CommitDate: 2023-02-22 04:10:12 +0000 > > Support SMBIOS v3 for 64-bit entry systems > > Summary: > Under QEMU on arm64 systems, the smbios table is above 4GB > requiring a 64-bit address to access. > > Reviewers: manu > > Subscribers: imp, bcran, dab > > Differential Revision: https://reviews.freebsd.org/D38721 Sorry, but this commit message is incorrect, it should be Reviewed by: imp and the Reviewers and subscriber lines dropped. I had editted the file, but due to wonkyness w/ git, that amended commit got lost and the original one was submitted instead. Not sure if there is a way to fix it though. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From nobody Wed Feb 22 05:04:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PM3xd0Xn0z3sHLF for ; Wed, 22 Feb 2023 05:05:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (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 4PM3xc5bNyz40HJ for ; Wed, 22 Feb 2023 05:05:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id o12so26102656edb.9 for ; Tue, 21 Feb 2023 21:05:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=Jv6c2Qc3M77gj+VgIHGONlmrsMM8sDG5YwK1XY2G1O8=; b=Jweye7ye3d/5FAeTN6bnxyPIdaMFEgeWExQc45+/KsWie9aIFgrnxPOYkAttEoQVJ+ E8DYVN8fyM3sCy4TQ6OD5p4YSBy9XFMNIhGmeLFDgP+PQhOi+C4gBL31yWasNw2Kze28 U8b9/kOUEUYz02Eo731dM9senlBRm5oYgSxkW6IjSCp1koUN9RyzaRQG3TiFb/lyw+QY jHIUH3bOVbTTEFhc8R4YMGqQopy3DGHv15Qj0g6GmztAtUOkwMRL+to2ZDkqyn60T9jw 0EQU05XuextWD0k2DIbR8Job+Ke6/Vq/y0L7Cg9nb7naTYxvuiSabXXv3fwG+I5yTv5p V98A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=Jv6c2Qc3M77gj+VgIHGONlmrsMM8sDG5YwK1XY2G1O8=; b=xEeUGg0It86nFXMjnuKG0kXdT7fF+eZA5uCpWMLep07g530cKzdyo+dhDzdXtQf0bJ wwtnQA3T74v1d0zJMbMdrN7oD22FnTXRoCPjNV/YxKcyk/Xz7P4btL8Ssbj/t4fB1At4 IOzHTuN5BSfz3ZBOMLRbmEloB3VW9AuecIIKu99UTYw1FN4rcSxSJniWLmZr4Yx/Sbkc HJFSfNRjBwrFkzxsxMgUkrl9bbho89NmoPbFZv5A8jUpQ9QNdDx/q8T+jhQnJpb5UuLj yBhfp5kIKTmNWK7q6z+kwz0lPCHgxGrIBPFn/D8+ytXMmL2TxVKuhzgb3yeGGaiCOvX0 Ed6w== X-Gm-Message-State: AO0yUKXm+mgdqn6WLzxJHaY49I6IaVf9neSaPl9gX+OTcaN/BoKbRkBL DR95s5ACZ/9PhxseXgUV92ectSvxttstVDoEC5NJoIa/1QGafQ== X-Google-Smtp-Source: AK7set9TVS9yMJCIMeKR5xlRAOoh0uFitKNRI9Ujmd7kgZ0o/ZcvvbhlseUXuwrgx8+DPltzOkB9cFfLpdvjE2EQZ/g= X-Received: by 2002:a17:906:4885:b0:8b2:23fb:dfd1 with SMTP id v5-20020a170906488500b008b223fbdfd1mr7734832ejq.2.1677042307351; Tue, 21 Feb 2023 21:05:07 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302220431.31M4VgwO065942@gitrepo.freebsd.org> <20230222043708.GQ95670@funkthat.com> In-Reply-To: <20230222043708.GQ95670@funkthat.com> From: Warner Losh Date: Tue, 21 Feb 2023 22:04:56 -0700 Message-ID: Subject: Re: git: ee97f198b42d - main - Support SMBIOS v3 for 64-bit entry systems To: John-Mark Gurney , src-committers , "" , dev-commits-src-main@freebsd.org, Warner Losh Content-Type: multipart/alternative; boundary="00000000000000dae205f542d766" X-Rspamd-Queue-Id: 4PM3xc5bNyz40HJ 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 --00000000000000dae205f542d766 Content-Type: text/plain; charset="UTF-8" On Tue, Feb 21, 2023, 9:37 PM John-Mark Gurney wrote: > John-Mark Gurney wrote this message on Wed, Feb 22, 2023 at 04:31 +0000: > > The branch main has been updated by jmg: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=ee97f198b42d50437f87aa4111d478eca2a5be16 > > > > commit ee97f198b42d50437f87aa4111d478eca2a5be16 > > Author: John-Mark Gurney > > AuthorDate: 2023-02-22 02:27:37 +0000 > > Commit: John-Mark Gurney > > CommitDate: 2023-02-22 04:10:12 +0000 > > > > Support SMBIOS v3 for 64-bit entry systems > > > > Summary: > > Under QEMU on arm64 systems, the smbios table is above 4GB > > requiring a 64-bit address to access. > > > > Reviewers: manu > > > > Subscribers: imp, bcran, dab > > > > Differential Revision: https://reviews.freebsd.org/D38721 > > Sorry, but this commit message is incorrect, it should be > Reviewed by: imp > > and the Reviewers and subscriber lines dropped. > > I had editted the file, but due to wonkyness w/ git, that amended > commit got lost and the original one was submitted instead. > > Not sure if there is a way to fix it though. > You can't fix it. But it's not a huge deal... How'd you land this? with 'arc' or 'git arc' Since I've started using the latter, I've not had issues... Raw 'arc' seems to have an extra layer of wonkiness... Warner -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." > --00000000000000dae205f542d766 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Feb 21, 2023, 9:37 PM John-Mark Gurney <jmg@funkthat.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">John-Mark Gurney wrote this message on Wed, F= eb 22, 2023 at 04:31 +0000:
> The branch main has been updated by jmg:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dee97f198b42d50437f87aa4111d478= eca2a5be16
>
> commit ee97f198b42d50437f87aa4111d478eca2a5be16
> Author:=C2=A0 =C2=A0 =C2=A0John-Mark Gurney <jmg@FreeBSD.org> > AuthorDate: 2023-02-22 02:27:37 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0John-Mark Gurney <jmg@FreeBSD.org> > CommitDate: 2023-02-22 04:10:12 +0000
>
>=C2=A0 =C2=A0 =C2=A0Support SMBIOS v3 for 64-bit entry systems
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Summary:
>=C2=A0 =C2=A0 =C2=A0Under QEMU on arm64 systems, the smbios table is ab= ove 4GB
>=C2=A0 =C2=A0 =C2=A0requiring a 64-bit address to access.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Reviewers: manu
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Subscribers: imp, bcran, dab
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Differential Revision: https://= reviews.freebsd.org/D38721

Sorry, but this commit message is incorrect, it should be
Reviewed by: imp

and the Reviewers and subscriber lines dropped.

I had editted the file, but due to wonkyness w/ git, that amended
commit got lost and the original one was submitted instead.

Not sure if there is a way to fix it though.

You can't fix it. But it= 9;s not a huge deal...

H= ow'd you land this? with 'arc' or 'git arc' Since I'= ;ve started using the latter, I've not had issues... Raw 'arc' = seems to have an extra layer of wonkiness...

Warner

--
=C2=A0 John-Mark Gurney=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Voice: +1 415 225 5579=

=C2=A0 =C2=A0 =C2=A0"All that I will do, has been done, All that I hav= e, has not."
--00000000000000dae205f542d766-- From nobody Wed Feb 22 07:09:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PM6hd2Tffz3sfjy; Wed, 22 Feb 2023 07:09:05 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gold.funkthat.com [IPv6:2001:470:800b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PM6hc52JNz49c3; Wed, 22 Feb 2023 07:09:04 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Authentication-Results: mx1.freebsd.org; none Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 31M790gb092654 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Feb 2023 23:09:00 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 31M790Hn092653; Tue, 21 Feb 2023 23:09:00 -0800 (PST) (envelope-from jmg) Date: Tue, 21 Feb 2023 23:09:00 -0800 From: John-Mark Gurney To: Warner Losh Cc: src-committers , "" , dev-commits-src-main@freebsd.org, Warner Losh Subject: Re: git: ee97f198b42d - main - Support SMBIOS v3 for 64-bit entry systems Message-ID: <20230222070900.GR95670@funkthat.com> Mail-Followup-To: John-Mark Gurney , Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org, Warner Losh References: <202302220431.31M4VgwO065942@gitrepo.freebsd.org> <20230222043708.GQ95670@funkthat.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Tue, 21 Feb 2023 23:09:00 -0800 (PST) X-Rspamd-Queue-Id: 4PM6hc52JNz49c3 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Warner Losh wrote this message on Tue, Feb 21, 2023 at 22:04 -0700: > On Tue, Feb 21, 2023, 9:37 PM John-Mark Gurney wrote: > > > John-Mark Gurney wrote this message on Wed, Feb 22, 2023 at 04:31 +0000: > > > The branch main has been updated by jmg: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=ee97f198b42d50437f87aa4111d478eca2a5be16 > > > > > > commit ee97f198b42d50437f87aa4111d478eca2a5be16 > > > Author: John-Mark Gurney > > > AuthorDate: 2023-02-22 02:27:37 +0000 > > > Commit: John-Mark Gurney > > > CommitDate: 2023-02-22 04:10:12 +0000 > > > > > > Support SMBIOS v3 for 64-bit entry systems > > > > > > Summary: > > > Under QEMU on arm64 systems, the smbios table is above 4GB > > > requiring a 64-bit address to access. > > > > > > Reviewers: manu > > > > > > Subscribers: imp, bcran, dab > > > > > > Differential Revision: https://reviews.freebsd.org/D38721 > > > > Sorry, but this commit message is incorrect, it should be > > Reviewed by: imp > > > > and the Reviewers and subscriber lines dropped. > > > > I had editted the file, but due to wonkyness w/ git, that amended > > commit got lost and the original one was submitted instead. > > > > Not sure if there is a way to fix it though. > > > > You can't fix it. But it's not a huge deal... Yeah, I figured, and the info is there in the review... > How'd you land this? with 'arc' or 'git arc' Since I've started using the > latter, I've not had issues... Raw 'arc' seems to have an extra layer of > wonkiness... I did the dev on another box than the one that I can commit from.. So it took some git push/fetch to get it onto the correct box... I had amended the commit, but then I got a bit confused about how to push from the branch to main, and so I checked out the branch again that didn't the amended commit and then pushed it: git push origin HEAD:main It just teaches me to make sure I amend the commits sooner rather than later.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From nobody Wed Feb 22 08:44:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PM8pB0k0Gz3skmn; Wed, 22 Feb 2023 08:44: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 4PM8pB0C84z4Jdc; Wed, 22 Feb 2023 08:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677055442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EtnveQF/9s934MiaTMklxiMPS6StjPZnIQaVIFoeuf0=; b=b160U3o4VcKI/wB/TC9i+K0AYu+OJIR5V7P7rUv2zhY6s26p8l8rVxZAtaMkrFy1M/gOPI GjzjkfWZDJpee62YIlstLEjwJMBMN2GaNRiGaRu4YjHtz5vGd/gXAO1XvmPCVhBHYeXl0U ECUsPL1sWUGw53Qm1cBT5rKOJch5uc9nVYkwNzARC/jdM1PDxxW9Ni4Lpm2M99yjbWou2a Dr8s9QKUi+Vc+8VIKMAeWmxrhZwPUeg87V6WzlCjv/uAwnFSeTaNH2vGRbytRuAQWd6Jau UQZLXVhGtQDK8/2tJ3zX3Koq4xasaY7y1c5DVCcwYfkeGvr+tEi8Sh8IsrHkZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677055442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EtnveQF/9s934MiaTMklxiMPS6StjPZnIQaVIFoeuf0=; b=Q8f3IEGyjHWAJku0CCYalcpskovPK3a1PzPXDlNog2qTuDgbsRc6B427Bc3h/9nD6EXuba fQ7NwXDdUXSh+83CZli3CmGmNoE8J++1brFKPmhm2wV/TRR4EflenSfZgXfGUIedrpKYAE VbT8l2awiLcvQ2bwtua9+iEaw8B3wA7b1QtaShvEPSVDpGaO0o9d6suuu7jYAMeaGtd9Qn eIvDmHuealuFcdeCRm9eJ50BMaaFtUdHRLXk1m+QVi2QHS2ez+W8qUrCKmOtA3IYKyQ26I NiQxrok9RMU8fAylQtBM0uy9jsNtmyVOGAptE31olwYIwtF4AmIQCzwlg334PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677055442; a=rsa-sha256; cv=none; b=Qg/mXZTc1gGsVieVbbNB1MhV6IhQbBvRQMvatnbcPjeqFuk/8LQFlYi4yMGcy8nyugSYW9 +CGQbhN8pytPToogRS6/RnIErOhy6YlOuvVW6dnec/CxATYJ8FuDnuGy79nfE/h5Yq4cGe 3hEI9hPXzK/3aRtsfl0IM+awqMG29Yx+ERupKifzfSzKgnFxamyMk9fNML/Tdt1usGQV9q nYx7Kdy2uLERC7IJ3ik/9RZbngQGEqRGnf98oS9iUMu+4wJ3Np3q4PE1ZY0MbindfnVpgx aAVjj2pEEVXPPSg+Uq85K+4JFP8ahBPbNtuGKI/6Mh7QI4t1CiypudWD7kKgfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PM8p96MctzvTT; Wed, 22 Feb 2023 08:44: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 31M8i1KY027264; Wed, 22 Feb 2023 08:44:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31M8i1lM027263; Wed, 22 Feb 2023 08:44:01 GMT (envelope-from git) Date: Wed, 22 Feb 2023 08:44:01 GMT Message-Id: <202302220844.31M8i1lM027263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 49bf65be44ad - main - arm ti: Fix a typo in a kernel message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49bf65be44adc3fbcc64a672530e52afb5cf5555 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=49bf65be44adc3fbcc64a672530e52afb5cf5555 commit 49bf65be44adc3fbcc64a672530e52afb5cf5555 Author: Gordon Bergling AuthorDate: 2023-02-22 08:43:49 +0000 Commit: Gordon Bergling CommitDate: 2023-02-22 08:43:49 +0000 arm ti: Fix a typo in a kernel message - s/adress/address/ MFC after: 5 days --- sys/arm/ti/ti_sysc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/ti/ti_sysc.c b/sys/arm/ti/ti_sysc.c index d6e23234b39c..2f6011e3049d 100644 --- a/sys/arm/ti/ti_sysc.c +++ b/sys/arm/ti/ti_sysc.c @@ -340,7 +340,7 @@ parse_regfields(struct ti_sysc_softc *sc) { sc->offset_reg[prop_idx] = sc->reg[prop_idx].address - sc->sc.ranges[REG_REV].host; - DPRINTF(sc->dev, "reg[%s] adress %#jx size %#jx\n", + DPRINTF(sc->dev, "reg[%s] address %#jx size %#jx\n", reg_names[idx], sc->reg[prop_idx].address, sc->reg[prop_idx].size); From nobody Wed Feb 22 12:29:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMFp53PKkz3sxC1; Wed, 22 Feb 2023 12:29: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 4PMFp5100pz3KK0; Wed, 22 Feb 2023 12:29:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677068957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBDzAdBH4/m22ztjLDSxhPqGi66nUchQQfiHY8zEbYE=; b=bqtiE6A2/T+U7l49j8bZYiBjEuaD2l/mcBXergtVljc/OMwmO5Tzg4l2S8VjFjJ0JqgVp/ wVlT22Uj6EwSlLuye3m2z2KBr8fNbRPtN+4li7Xcgcxz34PWCN9YZSefYNEUyWAQRX4HLA N5k6pn+cc+nZI6Lx7YNgjFNZzbuvWlIXzXC+1c0pIO1cLd1D0bVuplYuqb0wmG/6HUVPAD db5t22k2G/w1X4Gb1sJOwEwL0tvkZ/7+sCHTUDFLbdAfHZfG6I5BuWgb/3X3WT54x8omUN C2RtqHEXjQiObqak+eElHI1mvUSCSqwguw2nwebqqoEH58b9YrfISgQIg8+Dcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677068957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBDzAdBH4/m22ztjLDSxhPqGi66nUchQQfiHY8zEbYE=; b=RjZ/mpjoIaHvpx8WqGvJiZfIkGld4V9h9ilQf0OpBsUoAa/5dC0R8X2Gh/cpJS2olFEYvy 0Ve6Qf0+bst6In2ET0XBS4F/P4mwtchZmUQWnU9nKlfQb7Gx4SDqm6rnB0dk/ZWQa2mn8d Myo6Qye+I+hQMxcYyTOdiQFWzyXdWi5BQcLMjVhMpkpnNEJkCLeT4A1lMCJj6dTwPaVlm3 FItdwFi7TauMAsUx+VCTYuniuxCWBESGWCAXbxNeGig4GG3qOGjfGLH57XYmaodw6I0TC9 2i59jQlNaFZyh6oCIi1AIz1U8XzTb26wUKw/weypid7XeqMlcVzpU6ku1FtcIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677068957; a=rsa-sha256; cv=none; b=IrEjRHHE6JpYrCYk8fGUbJaxpGMPFYc++UJDX+VC2sI7csfiyC1lquxxvtxUrSyLdeWa0A n5ub3Rh2H5SiLaY4s7+FAKPvbKpVMxjrRnNlrwb1ys4PW8mg3kOIrR+Am5lhuohVEw5kIL kMXrRkRILGRpkyVQYE4w0G51Omiq2xBh7n1Tl627ONuGTId8bcbChui6iY0sWgly+Iwq/c b9opXAD+S3TfXQYSTD3bcnkSGcPzhGNHrNdH1g6+uU+n5SOqXUGVvSbYDweGA3VxaXqQzV MeqrZ4Uy9Fg92sqL30BgnNtV9fD8xQ6p5rEV7xxPDq/GhS/7aaEkYCu2Kxd3Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMFp504Ngz115F; Wed, 22 Feb 2023 12:29: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 31MCTGN9042523; Wed, 22 Feb 2023 12:29:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MCTGtj042522; Wed, 22 Feb 2023 12:29:16 GMT (envelope-from git) Date: Wed, 22 Feb 2023 12:29:16 GMT Message-Id: <202302221229.31MCTGtj042522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 8f2bb173bfc6 - stable/13 - Introduce startmsg and use it in rc scripts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8f2bb173bfc6e1a03a56b5098f8d2af740ce743f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=8f2bb173bfc6e1a03a56b5098f8d2af740ce743f commit 8f2bb173bfc6e1a03a56b5098f8d2af740ce743f Author: Jose Luis Duran AuthorDate: 2022-03-13 17:48:06 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-02-22 12:27:16 +0000 Introduce startmsg and use it in rc scripts startmsg is a new rc.subr(8) function function to be used instead of echo(1) when for boot messages. It replaces the often forgotten check_startmsgs && echo ... with startmsg ... No functional change intended. I adjusted the commit message and did some final clean-ups of the patch before committing. PR: 255207 Reported by: Jose Luis Duran Reviewed by: imp, 0mp Approved by: imp (src) Differential Revision: https://reviews.freebsd.org/D34514 (cherry picked from commit 325ebf37d8efc6488754051fcc2b1aaa40cefd8b) --- libexec/rc/rc.d/bgfsck | 2 +- libexec/rc/rc.d/cleartmp | 4 ++-- libexec/rc/rc.d/fsck | 4 ++-- libexec/rc/rc.d/hostid | 4 ++-- libexec/rc/rc.d/hostname | 4 ++-- libexec/rc/rc.d/ldconfig | 5 ++--- libexec/rc/rc.d/motd | 4 ++-- libexec/rc/rc.d/mountcritlocal | 4 ++-- libexec/rc/rc.d/moused | 4 ++-- libexec/rc/rc.d/newsyslog | 4 ++-- libexec/rc/rc.d/nfsclient | 3 +-- libexec/rc/rc.d/os-release | 4 ++-- libexec/rc/rc.d/pf | 4 ++-- libexec/rc/rc.d/savecore | 2 +- libexec/rc/rc.subr | 11 ++++++++++- share/man/man8/rc.subr.8 | 13 +++++++++++++ 16 files changed, 48 insertions(+), 28 deletions(-) diff --git a/libexec/rc/rc.d/bgfsck b/libexec/rc/rc.d/bgfsck index e83f6fb3634f..aae8ba086f4d 100755 --- a/libexec/rc/rc.d/bgfsck +++ b/libexec/rc/rc.d/bgfsck @@ -39,7 +39,7 @@ bgfsck_start() bgfsck_msg="${bgfsck_msg} in ${background_fsck_delay} seconds" fi if [ -z "${rc_force}" ]; then - check_startmsgs && echo "${bgfsck_msg}." + startmsg "${bgfsck_msg}." fi (sleep ${background_fsck_delay}; nice -4 fsck -B -p) 2>&1 | \ diff --git a/libexec/rc/rc.d/cleartmp b/libexec/rc/rc.d/cleartmp index 72e6c3ee881a..cc5777484305 100755 --- a/libexec/rc/rc.d/cleartmp +++ b/libexec/rc/rc.d/cleartmp @@ -26,7 +26,7 @@ cleartmp_start() ${tmp}/.ICE-unix ${tmp}/.font-unix" if checkyesno ${rcvar1}; then - check_startmsgs && echo "Clearing ${tmp}." + startmsg "Clearing ${tmp}." # This is not needed for mfs, but doesn't hurt anything. # Things to note: @@ -48,7 +48,7 @@ cleartmp_start() elif checkyesno clear_tmp_X; then # Remove X lock files, since they will prevent you from # restarting X. Remove other X related directories. - check_startmsgs && echo "Clearing ${tmp} (X related)." + startmsg "Clearing ${tmp} (X related)." rm -rf ${tmp}/.X[0-9]-lock ${x11_socket_dirs} fi if checkyesno clear_tmp_X; then diff --git a/libexec/rc/rc.d/fsck b/libexec/rc/rc.d/fsck index a7fe9a15d5c3..c46c11af240e 100755 --- a/libexec/rc/rc.d/fsck +++ b/libexec/rc/rc.d/fsck @@ -24,7 +24,7 @@ fsck_start() # During fsck ignore SIGQUIT trap : 3 - check_startmsgs && echo "Starting file system checks:" + startmsg "Starting file system checks:" # Background fsck can only be run with -p if checkyesno background_fsck; then fsck -F -p @@ -37,7 +37,7 @@ fsck_start() echo "Warning! Some of the devices might not be" \ "available; retrying" root_hold_wait - check_startmsgs && echo "Restarting file system checks:" + startmsg "Restarting file system checks:" # Background fsck can only be run with -p if checkyesno background_fsck; then fsck -F -p diff --git a/libexec/rc/rc.d/hostid b/libexec/rc/rc.d/hostid index 3cf7dd42eb6c..01697a1d1e11 100755 --- a/libexec/rc/rc.d/hostid +++ b/libexec/rc/rc.d/hostid @@ -50,9 +50,9 @@ hostid_set() # Set both kern.hostuuid and kern.hostid. # - check_startmsgs && echo "Setting hostuuid: ${uuid}." + startmsg "Setting hostuuid: ${uuid}." ${SYSCTL} kern.hostuuid="${uuid}" >/dev/null - check_startmsgs && echo "Setting hostid: ${id}." + startmsg "Setting hostid: ${id}." ${SYSCTL} kern.hostid=${id} >/dev/null } diff --git a/libexec/rc/rc.d/hostname b/libexec/rc/rc.d/hostname index 148b61fd68f2..9d4c0221ccf6 100755 --- a/libexec/rc/rc.d/hostname +++ b/libexec/rc/rc.d/hostname @@ -72,9 +72,9 @@ hostname_start() # All right, it is safe to invoke hostname(1) now. # - check_startmsgs && echo -n "Setting hostname: ${hostname}" + startmsg -n "Setting hostname: ${hostname}" /bin/hostname "${hostname}" - check_startmsgs && echo '.' + startmsg '.' } load_rc_config $name diff --git a/libexec/rc/rc.d/ldconfig b/libexec/rc/rc.d/ldconfig index 03627df6da06..6e59bc641a0a 100755 --- a/libexec/rc/rc.d/ldconfig +++ b/libexec/rc/rc.d/ldconfig @@ -37,7 +37,7 @@ ldconfig_start() _LDC="${_LDC} ${i}" fi done - check_startmsgs && echo 'ELF ldconfig path:' ${_LDC} + startmsg 'ELF ldconfig path:' ${_LDC} ${ldconfig} -elf ${_ins} ${_LDC} machine_arch=$(sysctl -n hw.machine_arch) @@ -58,8 +58,7 @@ ldconfig_start() _LDC="${_LDC} ${i}" fi done - check_startmsgs && - echo '32-bit compatibility ldconfig path:' ${_LDC} + startmsg '32-bit compatibility ldconfig path:' ${_LDC} ${ldconfig} -32 ${_ins} ${_LDC} ;; esac diff --git a/libexec/rc/rc.d/motd b/libexec/rc/rc.d/motd index e63973945f9d..d9dd60a0f59a 100755 --- a/libexec/rc/rc.d/motd +++ b/libexec/rc/rc.d/motd @@ -26,7 +26,7 @@ motd_start() # Must be done *before* interactive logins are possible # to prevent possible race conditions. # - check_startmsgs && echo -n 'Updating motd:' + startmsg -n 'Updating motd:' if [ ! -f "${TEMPLATE}" ]; then # Create missing template from existing regular motd file, if # one exists. @@ -51,7 +51,7 @@ motd_start() install -C -o root -g wheel -m "${PERMS}" "$T" "${TARGET}" rm -f "$T" - check_startmsgs && echo '.' + startmsg '.' } load_rc_config $name diff --git a/libexec/rc/rc.d/mountcritlocal b/libexec/rc/rc.d/mountcritlocal index f52c565d65c6..c3df4cdbea69 100755 --- a/libexec/rc/rc.d/mountcritlocal +++ b/libexec/rc/rc.d/mountcritlocal @@ -29,7 +29,7 @@ mountcritlocal_start() esac # Mount everything except nfs filesystems. - check_startmsgs && echo -n 'Mounting local filesystems:' + startmsg -n 'Mounting local filesystems:' mount_excludes='no' for i in ${netfs_types}; do fstype=${i%:*} @@ -47,7 +47,7 @@ mountcritlocal_start() err=$? fi - check_startmsgs && echo '.' + startmsg '.' case ${err} in 0) diff --git a/libexec/rc/rc.d/moused b/libexec/rc/rc.d/moused index 84f886c0d9c3..b9ac9e0bd3aa 100755 --- a/libexec/rc/rc.d/moused +++ b/libexec/rc/rc.d/moused @@ -52,9 +52,9 @@ moused_start() mytype="$moused_type" fi - check_startmsgs && echo -n "Starting ${ms} moused" + startmsg -n "Starting ${ms} moused" /usr/sbin/moused ${myflags} -p ${myport} -t ${mytype} ${pidarg} - check_startmsgs && echo '.' + startmsg '.' mousechar_arg= case ${mousechar_start} in diff --git a/libexec/rc/rc.d/newsyslog b/libexec/rc/rc.d/newsyslog index 740fcfeefaf4..38ad64b3d4a0 100755 --- a/libexec/rc/rc.d/newsyslog +++ b/libexec/rc/rc.d/newsyslog @@ -18,9 +18,9 @@ stop_cmd=":" newsyslog_start() { - check_startmsgs && echo -n 'Creating and/or trimming log files' + startmsg -n 'Creating and/or trimming log files' ${command} ${rc_flags} - check_startmsgs && echo '.' + startmsg '.' } load_rc_config $name diff --git a/libexec/rc/rc.d/nfsclient b/libexec/rc/rc.d/nfsclient index 2acfb84d8b09..7516ab6703f4 100755 --- a/libexec/rc/rc.d/nfsclient +++ b/libexec/rc/rc.d/nfsclient @@ -23,8 +23,7 @@ nfsclient_start() # if [ -n "${nfs_access_cache}" ]; then - check_startmsgs && - echo "NFS access cache time=${nfs_access_cache}" + startmsg "NFS access cache time=${nfs_access_cache}" if ! sysctl vfs.nfs.access_cache_timeout=${nfs_access_cache} >/dev/null; then warn "failed to set access cache timeout" fi diff --git a/libexec/rc/rc.d/os-release b/libexec/rc/rc.d/os-release index 16f8cb178db8..4614fb8cc18b 100755 --- a/libexec/rc/rc.d/os-release +++ b/libexec/rc/rc.d/os-release @@ -21,7 +21,7 @@ osrelease_start() { local _version _version_id - check_startmsgs && echo -n "Updating ${osrelease_file} " + startmsg -n "Updating ${osrelease_file} " _version=$(freebsd-version -u) _version_id=${_version%%[^0-9.]*} t=$(mktemp -t os-release) @@ -38,7 +38,7 @@ osrelease_start() __EOF__ install -C -o root -g wheel -m ${osrelease_perms} "$t" "${osrelease_file}" rm -f "$t" - check_startmsgs && echo 'done.' + startmsg 'done.' } load_rc_config $name diff --git a/libexec/rc/rc.d/pf b/libexec/rc/rc.d/pf index fa1b49643cc5..eb9cea6c271e 100755 --- a/libexec/rc/rc.d/pf +++ b/libexec/rc/rc.d/pf @@ -42,13 +42,13 @@ pf_fallback() pf_start() { - check_startmsgs && echo -n 'Enabling pf' + startmsg -n 'Enabling pf' $pf_program -F all > /dev/null 2>&1 $pf_program -f "$pf_rules" $pf_flags || pf_fallback if ! $pf_program -s info | grep -q "Enabled" ; then $pf_program -eq fi - check_startmsgs && echo '.' + startmsg '.' } pf_stop() diff --git a/libexec/rc/rc.d/savecore b/libexec/rc/rc.d/savecore index c39872cf1729..5d8204a1e805 100755 --- a/libexec/rc/rc.d/savecore +++ b/libexec/rc/rc.d/savecore @@ -74,7 +74,7 @@ savecore_start() fi sync else - check_startmsgs && echo 'No core dumps found.' + startmsg 'No core dumps found.' fi } diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index df91737566d5..db49e79ccaf8 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -715,6 +715,15 @@ check_startmsgs() fi } +# +# startmsg +# Preferred method to use when displaying start messages in lieu of echo. +# +startmsg() +{ + check_startmsgs && echo "$@" +} + # # run_rc_command argument # Search for argument in the list of supported commands, which is: @@ -1106,7 +1115,7 @@ run_rc_command() # setup the full command to run # - check_startmsgs && echo "Starting ${name}." + startmsg "Starting ${name}." if [ -n "$_chroot" ]; then _cd= _doit="\ diff --git a/share/man/man8/rc.subr.8 b/share/man/man8/rc.subr.8 index b4de4ea060ad..130962ecdcdf 100644 --- a/share/man/man8/rc.subr.8 +++ b/share/man/man8/rc.subr.8 @@ -73,6 +73,8 @@ .It .Ic run_rc_script Ar file Ar argument .It +.Ic startmsg Oo Fl n Oc Ar message +.It .Ic wait_for_pids Op Ar pid ... .It .Ic warn Ar message @@ -882,6 +884,17 @@ otherwise source .Ar file into the current shell. .El +.It Ic startmsg Oo Fl n Oc Ar message +Display a start message to +.Va stdout . +It should be used instead of +.Xr echo 1 . +The display of this output can be turned off if the +.Xr rc.conf 5 +variable +.Va rc_startmsgs +is set to +.Dq Li NO . .It Ic stop_boot Op Ar always Prevent booting to multiuser mode. If the From nobody Wed Feb 22 12:29:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMFp63GZRz3sxFL; Wed, 22 Feb 2023 12:29: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 4PMFp61sF9z3K5b; Wed, 22 Feb 2023 12:29:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677068958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l08Lzzsg7eFrzN0CNqBZNzpLMs3FuMY0wvM3l+2KnGQ=; b=qFYvXBMeyqIr1HVjU4tz6TcePJbisTEPs4CEs3B0XJF0dteCQBlRaW/rGNpU4tOMEpeGrb a+C5UxIWVDcpJsn4zuU8PiL3S7ZOSJeDTUAaHA9fmyI04srBm2tFT2tgxwi7nguPsnxjEc q50acGKMI6trczHWE2R1+kYZ0XaYBWVk9lILGxzwuuJt0MFseBVYZ3ShhZ3I4dCNVPtsEa Dc4nTnhUtAmG+LwTuBLX+8oft6tkWxxlXn0/Ol0qzd1R28YJWkK9DUBbuyJQ9dSGLybotf EOMBdmK3mN2YTMg3UEKa1NwyLIpOtaJZ3SuzwDbevGyhqnvH/l0tlJJ+UU913Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677068958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l08Lzzsg7eFrzN0CNqBZNzpLMs3FuMY0wvM3l+2KnGQ=; b=NTZ2DEoF/UWP1qMvoCltGRliXeiNr1Cke+3YMWz+eGKg+kQJtl6O5h4bTvlmJ5MzOuYxkJ 1cIUQY0F3gCXNODJLJGV4xFyF+bP1cNdbgIMlom4VNOZAlTU+Cs28nNfP+XO3idwgOt7ZI BiLw6+1kMHvj1VoG+KvXr+BLGmONqM3c0LmU61MboEvH5PZnAvierN+f2RgeH4p2y5ZNla Az7D7ldSqazumI/6s9ZRetDz2hVWoLw6iJp5W+dpyto8GQVJPyJ6JKd4oBXLSp9A/49zv8 iYNLrhfK5uuJOCbzeNxf7/JUUimsDWD/fT3GsblQOpvX45F9BIcV9bcCndbHbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677068958; a=rsa-sha256; cv=none; b=B188qHbm014frCAbo5COchXFmh7tv7s/DWzr9cEkloKIi0KOcWik0hEPoCEEF13xkfElB5 eg1mxcNJLI2dB5m44Wz9IRL8lziOkc3240QEcnyiU4sivekXBS4rj5VbzqHavgORWlfGIz AqEDvD4T00IM05aC9z+n5qQRjwGHjJWNe143CdeGxf9KhTdQGZYxFqyrRxs4rEC8iOdZ92 WjYJZAhc+VnoLpxqMPEtcxkFeU3WnsaNNnbwXPW8wp705Q9syT7ln0sjWeTfg10e0hHsrX i7rZQqXDbd7imFa+mNj6jZekRQcvvEUnE+Dmhuigd66czeGiSJc1DvvqM+23Nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMFp60y4yz11bk; Wed, 22 Feb 2023 12:29: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 31MCTITR042551; Wed, 22 Feb 2023 12:29:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MCTIfY042550; Wed, 22 Feb 2023 12:29:18 GMT (envelope-from git) Date: Wed, 22 Feb 2023 12:29:18 GMT Message-Id: <202302221229.31MCTIfY042550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: e8396a9592ab - stable/13 - rc.d/*: Use startmsg instead of echo on start messages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e8396a9592abb08069009e48b84ead2636681b16 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=e8396a9592abb08069009e48b84ead2636681b16 commit e8396a9592abb08069009e48b84ead2636681b16 Author: Jose Luis Duran AuthorDate: 2022-03-13 17:54:39 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-02-22 12:27:50 +0000 rc.d/*: Use startmsg instead of echo on start messages By rc.conf(5), setting rc_startmsgs="NO" should silence start messages. Fix a few rc scripts by using startmsg. PR: 255207 Reported by: Jose Luis Duran Reviewed by: imp, 0mp Approved by: imp (src) Differential Revision: https://reviews.freebsd.org/D34514 (cherry picked from commit 19a6267d61a0c3bd6cd56f19ca3f8a67a54f675c) --- libexec/rc/rc.d/jail | 16 ++++++++-------- libexec/rc/rc.d/local | 4 ++-- libexec/rc/rc.d/netif | 2 +- libexec/rc/rc.d/ppp | 6 +++--- libexec/rc/rc.d/pppoed | 2 +- libexec/rc/rc.d/rfcomm_pppd_server | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libexec/rc/rc.d/jail b/libexec/rc/rc.d/jail index 1d544501e32b..d95af40f459e 100755 --- a/libexec/rc/rc.d/jail +++ b/libexec/rc/rc.d/jail @@ -450,7 +450,7 @@ jail_start() if [ $# = 0 ]; then return fi - echo -n 'Starting jails:' + startmsg -n 'Starting jails:' case $1 in _ALL) command=$jail_program @@ -462,14 +462,14 @@ jail_start() _tmp=`mktemp -t jail` || exit 3 if $command $rc_flags $command_args >> $_tmp 2>&1; then $jail_jls jid name | while read _id _name; do - echo -n " $_name" + startmsg -n " $_name" echo $_id > /var/run/jail_${_name}.id done else cat $_tmp fi rm -f $_tmp - echo '.' + startmsg '.' return ;; esac @@ -490,11 +490,11 @@ jail_start() _tmp=`mktemp -t jail_${_j}` || exit 3 if $command $rc_flags $command_args \ >> $_tmp 2>&1 /var/run/jail_${_j}.id else - echo " cannot start jail " \ + startmsg " cannot start jail " \ "\"${_hostname:-${_j}}\": " cat $_tmp fi @@ -517,18 +517,18 @@ jail_start() _tmp=`mktemp -t jail` || exit 3 if $command $rc_flags $command_args \ >> $_tmp 2>&1 /var/run/jail_${_j}.id else - echo " cannot start jail " \ + startmsg " cannot start jail " \ "\"${_hostname:-${_j}}\": " cat $_tmp fi rm -f $_tmp done fi - echo '.' + startmsg '.' } jail_stop() diff --git a/libexec/rc/rc.d/local b/libexec/rc/rc.d/local index ba17a674ae9d..53907ad27011 100755 --- a/libexec/rc/rc.d/local +++ b/libexec/rc/rc.d/local @@ -18,9 +18,9 @@ stop_cmd="local_stop" local_start() { if [ -f /etc/rc.local ]; then - echo -n 'Starting local daemons:' + startmsg -n 'Starting local daemons:' . /etc/rc.local - echo '.' + startmsg '.' fi } diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif index 3dbb3e1a9588..bb401a6d5ce4 100755 --- a/libexec/rc/rc.d/netif +++ b/libexec/rc/rc.d/netif @@ -247,7 +247,7 @@ netif_common() _str='Reclaiming' ;; esac - echo "${_str} Network:${_ok}." + startmsg "${_str} Network:${_ok}." case ${_func} in ifn_vnetup) # Clear _ok not to do "ifconfig $ifn" diff --git a/libexec/rc/rc.d/ppp b/libexec/rc/rc.d/ppp index 93d0655b296f..8dbff30a7e32 100755 --- a/libexec/rc/rc.d/ppp +++ b/libexec/rc/rc.d/ppp @@ -82,14 +82,14 @@ ppp_start() _ppp_profile=$ppp_profile fi - echo -n "Starting PPP profile:" + startmsg -n "Starting PPP profile:" for _p in $_ppp_profile; do - echo -n " $_p" + startmsg -n " $_p" ppp_start_profile $_p done - echo "." + startmsg "." } ppp_poststart() diff --git a/libexec/rc/rc.d/pppoed b/libexec/rc/rc.d/pppoed index 7e848595e833..c368b32008a1 100755 --- a/libexec/rc/rc.d/pppoed +++ b/libexec/rc/rc.d/pppoed @@ -24,7 +24,7 @@ pppoed_start() if [ -n "${pppoed_provider}" ]; then pppoed_flags="${pppoed_flags} -p ${pppoed_provider}" fi - echo 'Starting pppoed' + startmsg 'Starting pppoed' _opts=$-; set -f /usr/libexec/pppoed ${pppoed_flags} ${pppoed_interface} set +f; set -${_opts} diff --git a/libexec/rc/rc.d/rfcomm_pppd_server b/libexec/rc/rc.d/rfcomm_pppd_server index 990a22475b0e..a7035f6e4ea7 100755 --- a/libexec/rc/rc.d/rfcomm_pppd_server +++ b/libexec/rc/rc.d/rfcomm_pppd_server @@ -90,14 +90,14 @@ rfcomm_pppd_server_start() _profile=${rfcomm_pppd_server_profile} fi - echo -n "Starting RFCOMM PPP profile:" + startmsg -n "Starting RFCOMM PPP profile:" for _p in ${_profile} ; do - echo -n " ${_p}" + startmsg -n " ${_p}" rfcomm_pppd_server_start_profile ${_p} done - echo "." + startmsg "." } rfcomm_pppd_server_stop() From nobody Wed Feb 22 12:31:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMFrv4fQFz3sxLC; Wed, 22 Feb 2023 12: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 4PMFrv2TMdz3MHB; Wed, 22 Feb 2023 12: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=1677069103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nGTIJrMIHs+jfujTDaYi+rMBaWwcJL/NjeZMweJ64CI=; b=RWmAqjx8jN0WGgpk2IHj7+QoEjhkAwq84WALoqiGgB1a05QXzZOOK7QpGLVf5OyX/s3zZN Du94g7I+M73OoQRfBIWNcZEOEFehA1NruRJ68hU9IOOa4t8unP8YTVcQO69nI7qzZQI6VZ Xj2Ho7LbSOXmU+9V4dwKMWXA+M+vVy2Gb+Qs/BxxzdgU0lzN/kbBFcmAlFUVjGkamrXYYo 1tVujCdFKGWxWPizWIZZ7mvMOA/HLJHSIqIdkeCxNsK332bIixFnMjw82roEcf2+ueBdyu IbXiUv22pGxXyIJtH3GnXeFMEezyEmp5RJFgm6SZdTYJEcJnYU0itc2McEp/zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677069103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nGTIJrMIHs+jfujTDaYi+rMBaWwcJL/NjeZMweJ64CI=; b=VZDIwisUADwQHXQOVxOtUzeNcigvDblDQaHpd5TR5x1BgSmkEFVSqXH2YT5bKluX5/1AiT tQjNqf6Xp0FGYeOVQtKRLRRrLAXqhOLBJTKvplFMZzIp4rdsqM9obfUZ9yVQpQ35wp8vrn kSy510xuqjtVVtCnpf9E/4/X2pIW+vawdi9LTLfCOtzi/mCa9UhVFO/xwNHNLPiVLvCvQ8 vgMgAj3dmQBkSR3QSFVjn85oK0vuVLmJAQpwX+afx1M+c69p3TNJ1TF7IlHtFee/9DXzj3 BptltvNQoAx4ETIsDM2jFNC7W4wU7HyFNY96jWQGbTUxC/IhgJKE/kBOB2Aiug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677069103; a=rsa-sha256; cv=none; b=tkxn/YIOHEAA3rz5l4nGshjYcZZoORkE5jst5NLAOTSbMEgvLBamDQy3Cs1vZ0k1T5FTKV jmLrcdDxIjyAZB4cH/d0dFfNXI/h5Jpouqvg+Qse3dZ0vPM4rS3YVSombpTOd7279jxQMc G949BvOlqgQWc57ZC9gW9+LzMgpqCrCd3CzIbMPChs569H7H2ga+qx3Pw8bplMjUNEsutA wBetMOBtvqrNKPu2XHr+4iJyhoywvjSyyoJlzysG10ysSbcnMuLtoI+areVXw0ApwcwzkY tXPDm6YZadjeXN/YXYY4IaL4rPTnmWScdvETMdgta0H0+uovSv/GZssKQQCRgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMFrv1Qb1z11mq; Wed, 22 Feb 2023 12: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 31MCVhhb055650; Wed, 22 Feb 2023 12: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 31MCVh2X055649; Wed, 22 Feb 2023 12:31:43 GMT (envelope-from git) Date: Wed, 22 Feb 2023 12:31:43 GMT Message-Id: <202302221231.31MCVh2X055649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 624de4eca545 - main - tcp: remove unused function prototype List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 624de4eca5458655cb78a0397c17306880a99f7a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=624de4eca5458655cb78a0397c17306880a99f7a commit 624de4eca5458655cb78a0397c17306880a99f7a Author: Michael Tuexen AuthorDate: 2023-02-22 12:28:17 +0000 Commit: Michael Tuexen CommitDate: 2023-02-22 12:28:17 +0000 tcp: remove unused function prototype tcp_trace was implemented in tcp_debug.c, which was removed recently. Reviewed by: rscheff@, zlei@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D38712 --- sys/netinet/tcp_var.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 1be3244e15c5..f0469e09fe6d 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1199,7 +1199,6 @@ void tcpip_fillheaders(struct inpcb *, uint16_t, void *, void *); void tcp_timer_activate(struct tcpcb *, tt_which, u_int); bool tcp_timer_active(struct tcpcb *, tt_which); void tcp_timer_stop(struct tcpcb *); -void tcp_trace(short, short, struct tcpcb *, void *, struct tcphdr *, int); int inp_to_cpuid(struct inpcb *inp); /* * All tcp_hc_* functions are IPv4 and IPv6 (via in_conninfo) From nobody Wed Feb 22 13:48:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMHYs3ThPz3t281; Wed, 22 Feb 2023 13:48:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMHYs2v6Yz3kjx; Wed, 22 Feb 2023 13:48:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677073729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vd6bq8xf2FJMjH7D+DnrIbeNq6XSPRUKmysMpQW9HG4=; b=gsprw5qWDPkI60dJBX9ewdKexlxr+0sNerXXjap061sWH1P5y7bdoEQLHrimTN+w/7Fcog hvtwYq4cYQE5tpJv0oOa0kTtslGqUTB6oNPJYWej2/Sfnaqv6ZhWLQf3ueQHqSr4tK96SG izsmrAfOw/WufBCiImCrJ2O37SQ0xLXF45xREuYTyoJeE8PCG27LMKiBw3HLD625/UH3mp jso51i3TiKOsu4fGA512EwN6wBAzwvgOGD+cXNeb+2Na3U3kvMrnREO/kKMydhi2lMIkRO 7IH/OqTbpn7Spzza3Mo8+/1076+WHGacabj0P31808r3DJfY7XF4GxzLgZ2H0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677073729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vd6bq8xf2FJMjH7D+DnrIbeNq6XSPRUKmysMpQW9HG4=; b=xQc82g3D0At2fIfyT2q37LW34f8dpSl28195l92JmZwX6atYIOaZUfbR7yyJ9/cUmpubKn UxsRJToDylwZKmt52D1aKr8asbyJcdxJ8MOqn8Jwjxr9UHLxIrq4c5Sg/wtXaxf4woA8E3 0lm2Of7Kc1I1duvZiU62D7OFYLk7mfNlX6I+LlGxxeY7PkVL26nEObu+VF5ONQMp2HewVY pLMepJUiTfahXMRMPcLgnbVrb4wfs5l/jSDdvo4GnF8ViKXuXZt+gy/baw8SNAReEE8XFB Qa720aUb/11ZGsYu+fN3GjIZLtHHVB9T8nfSL72eTqw3aWh7EHJZt0AVAJa8VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677073729; a=rsa-sha256; cv=none; b=JfWHasyUEYTjlpIExr4oz/WrpMXwkjcHH+I+E3POM8DJ2QZKwHTUn0Cka2LSw7t+p2avQF +Wobbm9x8lK5Uii08+VqPvRIDGF1uLjhCV63UdqNOyppJlAGDRt6zWOgShvpcEeqvtH/K/ H5L4MCIRUK22lFpZCI4Uw+CCxvUfECF4teWmYqH2RxSOjYKuSJTNhKcN0pKbe9fPkV8Iji 0yBWZsBTigGeJOuIuXQJZkVej99ZJY+2+fxL9bymp99DQrnhB2INexfSTNoyTx8Pjr42cS U1dGN+2cl1JbN3zQKu/1hcJ5z9NZus/tp2OeaSxWefdxN9FnmLPfpd1N1o300g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMHYs1p4hz13FW; Wed, 22 Feb 2023 13:48: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 31MDmn8e056741; Wed, 22 Feb 2023 13:48:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MDmnvG056740; Wed, 22 Feb 2023 13:48:49 GMT (envelope-from git) Date: Wed, 22 Feb 2023 13:48:49 GMT Message-Id: <202302221348.31MDmnvG056740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: b772fe0d6626 - releng/13.2 - Fix per-jail zfs.mount_snapshot setting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: b772fe0d662650d8a517bc07f3c433486c24b347 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=b772fe0d662650d8a517bc07f3c433486c24b347 commit b772fe0d662650d8a517bc07f3c433486c24b347 Author: Allan Jude AuthorDate: 2023-02-18 01:44:34 +0000 Commit: Allan Jude CommitDate: 2023-02-22 13:48:20 +0000 Fix per-jail zfs.mount_snapshot setting When jail.conf set the nopersist flag during startup, it was incorrectly destroying the per-jail ZFS settings. PR: 260160 Reviewed by: imp (previous version), mm (upstream), freqlabs (upstream) Approved by: re (cperciva) Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38662 (cherry picked from commit 8b04c1cbfc1cb71a1ce53b3a7855f1d45866fcfb) (cherry picked from commit 426ed00525409d084e97dc44397722aff2cc0bb3) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index 85449ebb9d97..6ffd36885655 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -2525,7 +2525,9 @@ zfs_jailparam_set(void *obj, void *data) mount_snapshot = -1; else jsys = JAIL_SYS_NEW; - if (jsys == JAIL_SYS_NEW) { + switch (jsys) { + case JAIL_SYS_NEW: + { /* "zfs=new" or "zfs.*": the prison gets its own ZFS info. */ struct zfs_jailparam *zjp; @@ -2543,12 +2545,22 @@ zfs_jailparam_set(void *obj, void *data) if (mount_snapshot != -1) zjp->mount_snapshot = mount_snapshot; mtx_unlock(&pr->pr_mtx); - } else { + break; + } + case JAIL_SYS_INHERIT: /* "zfs=inherit": inherit the parent's ZFS info. */ mtx_lock(&pr->pr_mtx); osd_jail_del(pr, zfs_jailparam_slot); mtx_unlock(&pr->pr_mtx); + break; + case -1: + /* + * If the setting being changed is not ZFS related + * then do nothing. + */ + break; } + return (0); } From nobody Wed Feb 22 15:14:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMKSb5NTJz3t6J5; Wed, 22 Feb 2023 15:14: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 4PMKSb4s2dz3s41; Wed, 22 Feb 2023 15:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677078863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0qr5DOxO72ivpfSPW+gnzOkv4G15Wu53KgpfLa81eR0=; b=C2occZePTqRlg0ikuP0dauGLwhA45FJri6U6yMsAnIwvhgBchOAqGz8/98oNgW0qlxFxPV cEDzUljJOUKAgN5NWcED4xglaroJD62I5suvzU9URwadZiX9IiWBv0gxhPeEc4JjHbz4xA NvUj3XGQtjV11Mm6K4s0LrOSDCMSlqqxEM64Mlxa1FkDSMgplpxr9fOtCAUKCaIheiFoVG WqKnWtUjGJyJdLyJ0xBNDZFzyKopR/OZaIyIK6+a1P4jFc0aB0CLY3oqpT1YiGvgDYshx1 u+lseV8LZu8iHCZMfyLmB3mBpbwzhmXV3he+4s7e5WGmsIdW6vKcBQtKKp9a9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677078863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0qr5DOxO72ivpfSPW+gnzOkv4G15Wu53KgpfLa81eR0=; b=PmybuR/nwHtmqtowjRAKtdgBTC6fYDXyxavpKkaiOf8yaYLrdVRd/agny3df6pqe4EPzlZ E5steMOeOFklEvkqhC1OcSbNsukm7fr4NI8dD1vPAGyBurUo3qB3B4hvrMWpM9aL0Fect5 CDgy+5GbdRWmuMyG+SY/6mhNefw+wDgkFoP02dUvlgdwu1JXOPh6G3f5NdkwrhBTkEdnnS awFWp8blRvn16LdJ/SHH0UmkQoLlVlzh/rvelV6dov5Jxc32+03HYagQMSqIDvnHA2TQP8 li472YFPipcmqThtmsTNpkMYVUK6eG6Mbo/lBgoTkBDrVIxXkWY448WHFiAI/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677078863; a=rsa-sha256; cv=none; b=kYjM4aK/ULMxTgTFr9VJgTEGwfo8z1jrR84bEG5UJ2VkSktwZA67vBkQWbTfb/u9RslAGp yCU2/niNydJCSfFRFrgEN5L9Xa2VCNVWOpRcLeVPQXqJrAc9JYaOWJfFkPxKxBnQlCuLIl RoHa1oWLL69xVImxvdypjIUslo2s0HNQZV/CDF4owggpA5MjtpqsRnoN87qnXMDLvrxttT Nn5l4ZLVxXzpY5mLreTbiaJilsciyulnbJ8pSQXFuGvd+HCoRpCZfw7tRZaSSbDRUwnzEa xV72VH9EWcvkETeEvSpxiYNYCyG6FQ8X1qxM0U6YFWuUU3LUf/wDgCaF5LZ78g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMKSb3cBYz15dW; Wed, 22 Feb 2023 15:14: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 31MFENHf085231; Wed, 22 Feb 2023 15:14:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MFENwW085230; Wed, 22 Feb 2023 15:14:23 GMT (envelope-from git) Date: Wed, 22 Feb 2023 15:14:23 GMT Message-Id: <202302221514.31MFENwW085230@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: 9a7f7c26c5b2 - main - lockmgr: upgrade panic return checks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a7f7c26c5b280924072e2d9947ad39ef4cc022c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9a7f7c26c5b280924072e2d9947ad39ef4cc022c commit 9a7f7c26c5b280924072e2d9947ad39ef4cc022c Author: Mitchell Horne AuthorDate: 2023-02-22 15:11:15 +0000 Commit: Mitchell Horne CommitDate: 2023-02-22 15:12:22 +0000 lockmgr: upgrade panic return checks We short-circuit lockmgr functions in the face of a kernel panic. Other lock implementations do this with a SCHEDULER_STOPPED() check, which covers the additional case where the debugger is active but the system has not panicked. Update this code to match that behaviour. Reviewed by: mjg, kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38655 --- sys/kern/kern_lock.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 2eb4feb7c4b5..ee34e03188a5 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -603,7 +603,7 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, #endif struct lock_delay_arg lda; - if (KERNEL_PANICKED()) + if (SCHEDULER_STOPPED()) goto out; tid = (uintptr_t)curthread; @@ -789,7 +789,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, #endif struct lock_delay_arg lda; - if (KERNEL_PANICKED()) + if (SCHEDULER_STOPPED()) goto out; tid = (uintptr_t)curthread; @@ -985,7 +985,7 @@ lockmgr_upgrade(struct lock *lk, u_int flags, struct lock_object *ilk, int error = 0; int op; - if (KERNEL_PANICKED()) + if (SCHEDULER_STOPPED()) goto out; tid = (uintptr_t)curthread; @@ -1046,7 +1046,7 @@ lockmgr_lock_flags(struct lock *lk, u_int flags, struct lock_object *ilk, u_int op; bool locked; - if (KERNEL_PANICKED()) + if (SCHEDULER_STOPPED()) return (0); op = flags & LK_TYPE_MASK; @@ -1109,7 +1109,7 @@ lockmgr_sunlock_hard(struct lock *lk, uintptr_t x, u_int flags, struct lock_obje { int wakeup_swapper = 0; - if (KERNEL_PANICKED()) + if (SCHEDULER_STOPPED()) goto out; wakeup_swapper = wakeupshlk(lk, file, line); @@ -1128,7 +1128,7 @@ lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_int flags, struct lock_obje u_int realexslp; int queue; - if (KERNEL_PANICKED()) + if (SCHEDULER_STOPPED()) goto out; tid = (uintptr_t)curthread; @@ -1320,7 +1320,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, int contested = 0; #endif - if (KERNEL_PANICKED()) + if (SCHEDULER_STOPPED()) return (0); error = 0; @@ -1729,7 +1729,7 @@ _lockmgr_assert(const struct lock *lk, int what, const char *file, int line) { int slocked = 0; - if (KERNEL_PANICKED()) + if (SCHEDULER_STOPPED()) return; switch (what) { case KA_SLOCKED: From nobody Wed Feb 22 16:53:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMMfs1vTvz3tBrw; Wed, 22 Feb 2023 16:53: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 4PMMfs1MzVz45vp; Wed, 22 Feb 2023 16:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677084805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F0mOG08oO0wxZz5x/NnZ+/rQd6ATrsP2SNVIiTbMPIk=; b=QTocPbZJNLKPz2zrH55ywFk09WSdvYT3Pfdg29t/ztJN5tQa2J55vd+neaN7TqhpMtLmzs NAQXfSf/vmns7nBwg0Wvurh93bHmznTQ7IjFz8qc4MK4eDiEYO8cqlYNQGnQSEr13Pqhjm +La1Xz7J3+N1ALyltgZ3VdQzl5ZKBz2uYw1sm9a7YWBM/8nSU5NbcdMhuZQt4O4Z91Dd3p 2aF8YVLHromOOg2HMVSWU/A6OwFURG+yYig3QGvLZK2ZDaeDkr8BJUryE8OL/7s7KZxsgB uIY3rB8K4uBdQrjcbT5upTB77SXG2tEqKIiDPr4IVWH079/DyYYV68rTk0ODrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677084805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F0mOG08oO0wxZz5x/NnZ+/rQd6ATrsP2SNVIiTbMPIk=; b=MfHjuzptDobrJLsOWj/R9qpoCAKrKNhzWdmsvi2XTtqgxNdiJCI6xLxXzzkopsA+KiUQZ8 lNJT6Vijzks19Oyo+dsD2amviOBORlm2e08GvvuU2opf0TT4Bv/ZU6YhQNziFyKMvGr6+Y 04uuuu7u689Bx1V2TMBJpkxgkGE3kYeuNVL6l+0EUksRlVXH4UM1uGGIBqpEI69GHtVp6K 8luIRRY3rTfpM+K+gI9AqGhImwNvDBAxkxGr+x7s/I9OQAExRKrbIJwPmpEBBwxprm0VxJ MRf82IqT0wL+RRdNNbtjHt1JQHYgrcZUD6bE3fTlKjjaw/FzcR0ZUHma+px/Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677084805; a=rsa-sha256; cv=none; b=XmpYOuvcpTnlIAiLg/po1x9WJZVf79yqBMz7KcKJUEZRvXOg9OYKMuiKnrrs24nQELIClg 8CB8bAIg9ejZJmreyTthzEznDsGThCZM0Ol/gE9XSrvpdbYAoNiDlUVsUFg3aATlu7reG9 kxnTAkrDJIltPLxk2jUrJFQJ8e5aQZukXEw/PLN8Td71rTfoLL9ZFrqsRPBPkHThol/GBS GVhXHkxUUtqGCAClrmo14jhLEwCxERSqfRLBZez4uK1arHfKZV5cwME2yvT7DPA7vDjbFA 2cUVktGGlhwK5oc10+smKRnjnrK2ibqm2AEZy7i9RnfpGTmfC6TkClb6Y6UI2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMMfs0Mchz17rN; Wed, 22 Feb 2023 16:53: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 31MGrOqR028662; Wed, 22 Feb 2023 16:53:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MGrO0U028661; Wed, 22 Feb 2023 16:53:24 GMT (envelope-from git) Date: Wed, 22 Feb 2023 16:53:24 GMT Message-Id: <202302221653.31MGrO0U028661@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: ce7db385f50a - main - include: Fix typos List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce7db385f50a29e73170c4e7cedfe4706bba34fc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ce7db385f50a29e73170c4e7cedfe4706bba34fc commit ce7db385f50a29e73170c4e7cedfe4706bba34fc Author: Elyes Haouas AuthorDate: 2023-02-22 08:33:35 +0000 Commit: Ed Maste CommitDate: 2023-02-22 16:52:57 +0000 include: Fix typos Signed-off-by: Elyes Haouas --- include/nsswitch.h | 2 +- include/protocols/talkd.h | 2 +- include/rpc/rpc_msg.h | 2 +- include/stdlib.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/nsswitch.h b/include/nsswitch.h index 2be7a59fd1b9..0db8a8118594 100644 --- a/include/nsswitch.h +++ b/include/nsswitch.h @@ -186,7 +186,7 @@ typedef ns_mtab *(*nss_module_register_fn)(const char *, unsigned int *, /* * Many NSS interfaces follow the getXXnam, getXXid, getXXent pattern. - * Developers are encouraged to use nss_lookup_type where approriate. + * Developers are encouraged to use nss_lookup_type where appropriate. */ enum nss_lookup_type { nss_lt_name = 1, diff --git a/include/protocols/talkd.h b/include/protocols/talkd.h index dc79bef77b6e..d361fb0d12db 100644 --- a/include/protocols/talkd.h +++ b/include/protocols/talkd.h @@ -56,7 +56,7 @@ /* * The talk protocol embeds a 4.3BSD sockaddr. Define our own version - * rather then relying on namespace polution in kernel headers. + * rather then relying on namespace pollution in kernel headers. */ struct tsockaddr { unsigned short sa_family; diff --git a/include/rpc/rpc_msg.h b/include/rpc/rpc_msg.h index 136b617f58e8..a384c92606c9 100644 --- a/include/rpc/rpc_msg.h +++ b/include/rpc/rpc_msg.h @@ -49,7 +49,7 @@ /* * Bottom up definition of an rpc message. - * NOTE: call and reply use the same overall stuct but + * NOTE: call and reply use the same overall struct but * different parts of unions within it. */ diff --git a/include/stdlib.h b/include/stdlib.h index 754e8f5f5fd4..01629ed84a11 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -131,7 +131,7 @@ size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t); * is not supported in the compilation environment (which therefore means * that it can't really be ISO C99). * - * (The only other extension made by C99 in thie header is _Exit().) + * (The only other extension made by C99 in this header is _Exit().) */ #if __ISO_C_VISIBLE >= 1999 || defined(__cplusplus) #ifdef __LONG_LONG_SUPPORTED From nobody Wed Feb 22 17:03:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMMtP4C9rz3tCJs; Wed, 22 Feb 2023 17:03: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 4PMMtP3m79z46tJ; Wed, 22 Feb 2023 17:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677085405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b4ceKR9IaIlUZdadsuzMRnbdCJf5J4LNXAn3vmWvHeg=; b=yIxAL0Q1iJeTS7pR0G/puvBljMmYfFbx9ioBJmVjhhT8JLyfOotsfALNwAY5pPkSW7UCzN U8vV6gsiMfOU29bcLHWN8D3yarA7GIrvBTgkU8TOfn6Ynz4LGBfmpct4lQJjREMHU8o4hl WAD9TKFUVBRLBFVXHtGHJjAHXcOEQ1cXscfApMETNW3ShsjFuTrFy/Zcz9bCP1lnHi21rw UusFXnracC/1ta2KCyYRuWf5O9zLaV+chDSu/JdxaVq/Tu0Rzj+W1wjccs48F0PtLb94Mr A++dGVQWFW8vK5Uf2pA19/AGbmtwsg8zyS33g6s0vvL3YUaB/1GuTao061hU3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677085405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b4ceKR9IaIlUZdadsuzMRnbdCJf5J4LNXAn3vmWvHeg=; b=FV0IuYmYbT5R1wKH/xS26gy8oqmVGcgsgH3yhyEcXESIct14/GZ14JCxR+vvxR4Sbbqx2R EC0gVIYcBK8IOxvptE6G6GwhdHDF/U5lR4KnzSZebbjuQbQzXPZytVJRL2kx98wMZubuiE LLnQH6Cu+F2m6NXin6tjN2wgMrw54YNXD/ddZN8XzysrMAIPcp87EBk5DVkfO/as+0GwXG pmquSmbmoPndvdjOb/HlW7lQoyn8DZvKtQiSIoZunIIJSCQUVvWs9VzDjlh2nA4Exb+7dv MqZJ35EjXcZT2qJtlPa0RgHZj+sF6Utym5UuV3qC7NqRlPogJX7YlxjjqB85PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677085405; a=rsa-sha256; cv=none; b=aq0eX2AAaXjTKHnC80faZaajvGH5OEhZeoezT2IcXJLpCcF5i4KqiMRVaLXPdtRE77kwwD dk8T/ngAQRWAuVgYo9G8/7dEMiLXGPSjVU8liL4IYHHJnpL760v5afMlP+Xm+Hm42PNIWv YTL6bieSz/tPHPSyrps3f/4JFHm7qMgSOKhB4mpgvj51Gn74kVpFPRucsLHPvxnkqJn+hE wohYuW4eycRWY5t+GUcv9BkeDdKth/+c/Yfwv6qtPtRPA0WcMBfnxOJ4PC1yC9I0aEUcKK MkcVqDZC0I5aRSbHPjmc8VQ9nZ8wZdzDedTys1rnJK9STbixImn4Nq2vq1q+hQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMMtP2rx5z17vW; Wed, 22 Feb 2023 17:03: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 31MH3PIQ043480; Wed, 22 Feb 2023 17:03:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MH3PPt043479; Wed, 22 Feb 2023 17:03:25 GMT (envelope-from git) Date: Wed, 22 Feb 2023 17:03:25 GMT Message-Id: <202302221703.31MH3PPt043479@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: 0c9df4afc239 - main - fusefs: fix a buffer overflow in the tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c9df4afc239ee52961443e95bca8be81f0dea9e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=0c9df4afc239ee52961443e95bca8be81f0dea9e commit 0c9df4afc239ee52961443e95bca8be81f0dea9e Author: Alan Somers AuthorDate: 2023-02-22 00:13:56 +0000 Commit: Alan Somers CommitDate: 2023-02-22 17:03:01 +0000 fusefs: fix a buffer overflow in the tests The actual overflow occured in the ReadAhead.readahead test. Surprisingly it has never segfaulted or resulted in any bad behavior. MFC after: 1 week Sponsored by: Axcient Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38718 --- tests/sys/fs/fusefs/bmap.cc | 2 ++ tests/sys/fs/fusefs/fallocate.cc | 3 +++ tests/sys/fs/fusefs/io.cc | 3 +++ tests/sys/fs/fusefs/mockfs.hh | 2 +- tests/sys/fs/fusefs/setattr.cc | 1 + tests/sys/fs/fusefs/utils.cc | 6 ++++++ tests/sys/fs/fusefs/write.cc | 2 ++ 7 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/sys/fs/fusefs/bmap.cc b/tests/sys/fs/fusefs/bmap.cc index 56821f367a82..91d8ab563690 100644 --- a/tests/sys/fs/fusefs/bmap.cc +++ b/tests/sys/fs/fusefs/bmap.cc @@ -210,6 +210,8 @@ TEST_P(BmapEof, eof) _) ).WillOnce(Invoke(ReturnImmediate([=](auto in, auto& out) { size_t osize = in.body.read.size; + + assert(osize < sizeof(out.body.bytes)); out.header.len = sizeof(struct fuse_out_header) + osize; bzero(out.body.bytes, osize); }))); diff --git a/tests/sys/fs/fusefs/fallocate.cc b/tests/sys/fs/fusefs/fallocate.cc index 7ad2644980cf..e9d0ea997aa1 100644 --- a/tests/sys/fs/fusefs/fallocate.cc +++ b/tests/sys/fs/fusefs/fallocate.cc @@ -70,6 +70,7 @@ void expect_vop_stddeallocate(uint64_t ino, uint64_t off, uint64_t length) }, Eq(true)), _) ).WillOnce(Invoke(ReturnImmediate([=](auto in, auto& out) { + assert(in.body.read.size <= sizeof(out.body.bytes)); out.header.len = sizeof(struct fuse_out_header) + in.body.read.size; memset(out.body.bytes, 'X', in.body.read.size); @@ -79,6 +80,8 @@ void expect_vop_stddeallocate(uint64_t ino, uint64_t off, uint64_t length) const char *buf = (const char*)in.body.bytes + sizeof(struct fuse_write_in); + assert(length <= sizeof(in.body.bytes) - + sizeof(struct fuse_write_in)); return (in.header.opcode == FUSE_WRITE && in.header.nodeid == ino && in.body.write.offset == off && diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc index 1502bd263f51..a8815434c6d8 100644 --- a/tests/sys/fs/fusefs/io.cc +++ b/tests/sys/fs/fusefs/io.cc @@ -141,6 +141,8 @@ void SetUp() ssize_t isize = in.body.write.size; off_t iofs = in.body.write.offset; + assert((size_t)isize <= sizeof(in.body.bytes) - + sizeof(struct fuse_write_in)); ASSERT_EQ(isize, pwrite(m_backing_fd, buf, isize, iofs)) << strerror(errno); SET_OUT_HEADER_LEN(out, write); @@ -158,6 +160,7 @@ void SetUp() void *buf = out.body.bytes; ssize_t osize; + assert((size_t)isize <= sizeof(out.body.bytes)); osize = pread(m_backing_fd, buf, isize, iofs); ASSERT_LE(0, osize) << strerror(errno); out.header.len = sizeof(struct fuse_out_header) + osize; diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index 121d985e56fe..edbaf7ef770f 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -206,7 +206,7 @@ union fuse_payloads_out { * The protocol places no limits on the size of bytes. Choose * a size big enough for anything we'll test. */ - uint8_t bytes[0x20000]; + uint8_t bytes[0x40000]; fuse_entry_out entry; fuse_entry_out_7_8 entry_7_8; fuse_lk_out getlk; diff --git a/tests/sys/fs/fusefs/setattr.cc b/tests/sys/fs/fusefs/setattr.cc index e245c274ba07..e08f2124e06f 100644 --- a/tests/sys/fs/fusefs/setattr.cc +++ b/tests/sys/fs/fusefs/setattr.cc @@ -530,6 +530,7 @@ TEST_F(Setattr, truncate_discards_cached_data) { auto osize = std::min( static_cast(cur_size) - in.body.read.offset, static_cast(in.body.read.size)); + assert(osize <= sizeof(out.body.bytes)); out.header.len = sizeof(struct fuse_out_header) + osize; if (should_have_data) memset(out.body.bytes, 'X', osize); diff --git a/tests/sys/fs/fusefs/utils.cc b/tests/sys/fs/fusefs/utils.cc index d4edca5ca945..b13ecfd9cb88 100644 --- a/tests/sys/fs/fusefs/utils.cc +++ b/tests/sys/fs/fusefs/utils.cc @@ -400,6 +400,7 @@ void FuseTest::expect_read(uint64_t ino, uint64_t offset, uint64_t isize, }, Eq(true)), _) ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + assert(osize <= sizeof(out.body.bytes)); out.header.len = sizeof(struct fuse_out_header) + osize; memmove(out.body.bytes, contents, osize); }))).RetiresOnSaturation(); @@ -502,6 +503,8 @@ void FuseTest::expect_write(uint64_t ino, uint64_t offset, uint64_t isize, bool pid_ok; uint32_t wf = in.body.write.write_flags; + assert(isize <= sizeof(in.body.bytes) - + sizeof(struct fuse_write_in)); if (wf & FUSE_WRITE_CACHE) pid_ok = true; else @@ -534,6 +537,9 @@ void FuseTest::expect_write_7_8(uint64_t ino, uint64_t offset, uint64_t isize, const char *buf = (const char*)in.body.bytes + FUSE_COMPAT_WRITE_IN_SIZE; bool pid_ok = (pid_t)in.header.pid == getpid(); + + assert(isize <= sizeof(in.body.bytes) - + FUSE_COMPAT_WRITE_IN_SIZE); return (in.header.opcode == FUSE_WRITE && in.header.nodeid == ino && in.body.write.fh == FH && diff --git a/tests/sys/fs/fusefs/write.cc b/tests/sys/fs/fusefs/write.cc index 4e76414a601a..800376395e97 100644 --- a/tests/sys/fs/fusefs/write.cc +++ b/tests/sys/fs/fusefs/write.cc @@ -97,6 +97,8 @@ void maybe_expect_write(uint64_t ino, uint64_t offset, uint64_t size, const char *buf = (const char*)in.body.bytes + sizeof(struct fuse_write_in); + assert(size <= sizeof(in.body.bytes) - + sizeof(struct fuse_write_in)); return (in.header.opcode == FUSE_WRITE && in.header.nodeid == ino && in.body.write.offset == offset && From nobody Wed Feb 22 17:04:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMMvf5DHxz3tCCG; Wed, 22 Feb 2023 17: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 4PMMvf4hTSz472s; Wed, 22 Feb 2023 17: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=1677085470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UytV9qLbyhhrF0epgL8AdX37VYwH1RUH2HcyWwiXE28=; b=wGjzdijdTHrj3UmLaSq2UFm3BsOgDgcebLUKoGMf7sMaGoG+GmwytRUUNmsFyT+XybAHda D5ag8mYqxsC4kDeg6DYbD0L7E4ilWgx0HJrehsCMoYgHM04k0FKEzDhEBmLGBuaG535ule mBbLzxwM8frz0+sV+FLqtJ00GN6gZI/IQJq1LwvhMAWQ4ImULEPwJ68T4Hq/WKcAQNUHM2 tI6IFJXl3/EFp5cS+0oJA+5ZespVK/DvFEzA/Mna6LhO4rELR4OENPgfoEm1Hbie+2chnS INiv8FPQ4JTtQL3JnqI4Ts0SPRmF8NWUKqDwnQq08nFAOZBc9DOMdjORZGbxYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677085470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UytV9qLbyhhrF0epgL8AdX37VYwH1RUH2HcyWwiXE28=; b=pKH2ZgzkLs2Y4J0Mo5OzS2idLVg42Kxbk+4e7/Lk9A6FV6SdVPGtvQWZSNt47VWrYMBH5f hkAqki30X12BTIds6aTX7TYeU3RgK0P6MexXTZMoKqtMQSm+LTbdamasn58YCwm7vJFx9u TVw6tgTR4tWCGZ/dlTgsh55UVdRouQ9v1zDAaMDO6dVYWq3nkuY0+CjA7z6XzynzkMvW1B Tvpln7ihY3HuOjWfeTrlLYhPGJ10bNpYVoWsFAv2GGAhILSSmTf4Re6Qff5+M7V20bIMD9 AA2+CZyXCnfQ7xfEs2kCACN1UuFsDmPIiZlowx35ZK+Q/joLrhaNug3huJXtcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677085470; a=rsa-sha256; cv=none; b=cGOdb+sOiQTPx8AEGXohSjC51EXThYq55bvcZ8MCdAD0ruh9I3TpEUNolXt0u79pPAJwXz ET+mATesbtzVl2baBto0TlXucndxZWdPBy0+yz+yHB9wTsPpA8N92hv7TzAh8tOzoMzs8E Zfk2J3AyCRLiKM/CgsJnDd1uzRgh5B0jfyDiNNmXJ0HWgvNRMbfn+w3JvDndKFtYnEPjaF upbnkyDdVgjvAlB7D1+j6duJ1hfCUJvP9y+3u7P8+ESaRqfxaz70kEhu/9zG6dEntJkCf4 rxCR+gSAtbh3oTq8B7rnBv26XG2JGzaJvqBTGfhvR/TITuALT/v5ySBW5RrAjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMMvf3m29z17s2; Wed, 22 Feb 2023 17: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 31MH4UT7043698; Wed, 22 Feb 2023 17: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 31MH4Uxx043697; Wed, 22 Feb 2023 17:04:30 GMT (envelope-from git) Date: Wed, 22 Feb 2023 17:04:30 GMT Message-Id: <202302221704.31MH4Uxx043697@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: 5f51c9c328a6 - main - fusefs: add some more test cases for bad fuse servers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f51c9c328a63d7290f634b1742f03545eaa2c1c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=5f51c9c328a63d7290f634b1742f03545eaa2c1c commit 5f51c9c328a63d7290f634b1742f03545eaa2c1c Author: Alan Somers AuthorDate: 2023-02-21 23:26:37 +0000 Commit: Alan Somers CommitDate: 2023-02-22 17:03:58 +0000 fusefs: add some more test cases for bad fuse servers MFC after: 1 week Sponsored by: Axcient Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38719 --- tests/sys/fs/fusefs/Makefile | 1 + tests/sys/fs/fusefs/bad_server.cc | 105 ++++++++++++++++++++++++++++++++++++++ tests/sys/fs/fusefs/lookup.cc | 2 +- tests/sys/fs/fusefs/mockfs.cc | 6 +-- tests/sys/fs/fusefs/mockfs.hh | 7 ++- 5 files changed, 112 insertions(+), 9 deletions(-) diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile index 04b68681ec9a..df3753967603 100644 --- a/tests/sys/fs/fusefs/Makefile +++ b/tests/sys/fs/fusefs/Makefile @@ -11,6 +11,7 @@ TESTSDIR= ${TESTSBASE}/sys/fs/fusefs # out, so we get more granular reporting. GTESTS+= access GTESTS+= allow_other +GTESTS+= bad_server GTESTS+= bmap GTESTS+= cache GTESTS+= copy_file_range diff --git a/tests/sys/fs/fusefs/bad_server.cc b/tests/sys/fs/fusefs/bad_server.cc new file mode 100644 index 000000000000..34392da0090a --- /dev/null +++ b/tests/sys/fs/fusefs/bad_server.cc @@ -0,0 +1,105 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2023 Axcient + * + * 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$ + */ + +extern "C" { +#include +#include +} + +#include "mockfs.hh" +#include "utils.hh" + +using namespace testing; + +class BadServer: public FuseTest {}; + +/* + * If the server sends a response for an unknown request, the kernel should + * gracefully return EINVAL. + */ +TEST_F(BadServer, UnknownUnique) +{ + mockfs_buf_out out; + + out.header.len = sizeof(out.header); + out.header.error = 0; + out.header.unique = 99999; // Invalid! + out.expected_errno = EINVAL; + m_mock->write_response(out); +} + +/* + * If the server sends less than a header's worth of data, the kernel should + * gracefully return EINVAL. + */ +TEST_F(BadServer, ShortWrite) +{ + mockfs_buf_out out; + + out.header.len = sizeof(out.header) - 1; + out.header.error = 0; + out.header.unique = 0; // Asynchronous notification + out.expected_errno = EINVAL; + m_mock->write_response(out); +} + +/* + * It is illegal to report an error, and also send back a payload. + */ +TEST_F(BadServer, ErrorWithPayload) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillOnce(Invoke([&](auto in, auto &out) { + // First send an invalid response + std::unique_ptr out0(new mockfs_buf_out); + out0->header.unique = in.header.unique; + out0->header.error = -ENOENT; + SET_OUT_HEADER_LEN(*out0, entry); // Invalid! + out0->expected_errno = EINVAL; + out.push_back(std::move(out0)); + + // Then, respond to the lookup so we can complete the test + std::unique_ptr out1(new mockfs_buf_out); + out1->header.unique = in.header.unique; + out1->header.error = -ENOENT; + out1->header.len = sizeof(out1->header); + out.push_back(std::move(out1)); + + // The kernel may disconnect us for bad behavior, so don't try + // to read any more. + m_mock->m_quit = true; + })); + + EXPECT_NE(0, access(FULLPATH, F_OK)); + + EXPECT_EQ(ENOENT, errno); +} diff --git a/tests/sys/fs/fusefs/lookup.cc b/tests/sys/fs/fusefs/lookup.cc index c654dd46bae5..7a5be84b48be 100644 --- a/tests/sys/fs/fusefs/lookup.cc +++ b/tests/sys/fs/fusefs/lookup.cc @@ -289,7 +289,7 @@ TEST_F(Lookup, ejustreturn) .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { out.header.len = sizeof(out.header); out.header.error = 2; - m_mock->m_expected_write_errno = EINVAL; + out.expected_errno = EINVAL; }))); EXPECT_NE(0, access(FULLPATH, F_OK)); diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index e012df8c3488..43e8dd3b0371 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -431,7 +431,6 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, const bool trueval = true; m_daemon_id = NULL; - m_expected_write_errno = 0; m_kernel_minor_version = kernel_minor_version; m_maxreadahead = max_readahead; m_maxwrite = MIN(max_write, max_max_write); @@ -801,7 +800,6 @@ void MockFS::loop() { bzero(in.get(), sizeof(*in)); read_request(*in, buflen); - m_expected_write_errno = 0; if (m_quit) break; if (verbosity > 0) @@ -1034,9 +1032,9 @@ void MockFS::write_response(const mockfs_buf_out &out) { FAIL() << "not yet implemented"; } r = write(m_fuse_fd, &out, out.header.len); - if (m_expected_write_errno) { + if (out.expected_errno) { ASSERT_EQ(-1, r); - ASSERT_EQ(m_expected_write_errno, errno) << strerror(errno); + ASSERT_EQ(out.expected_errno, errno) << strerror(errno); } else { ASSERT_TRUE(r > 0 || errno == EAGAIN) << strerror(errno); } diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index edbaf7ef770f..51ed5ad72ee6 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -233,6 +233,8 @@ union fuse_payloads_out { struct mockfs_buf_out { fuse_out_header header; union fuse_payloads_out body; + /* the expected errno of the write to /dev/fuse */ + int expected_errno; /* Default constructor: zero everything */ mockfs_buf_out() { @@ -333,16 +335,13 @@ class MockFS { */ void read_request(mockfs_buf_in& in, ssize_t& res); + public: /* Write a single response back to the kernel */ void write_response(const mockfs_buf_out &out); - public: /* pid of child process, for two-process test cases */ pid_t m_child_pid; - /* the expected errno of the next write to /dev/fuse */ - int m_expected_write_errno; - /* Maximum size of a FUSE_WRITE write */ uint32_t m_maxwrite; From nobody Wed Feb 22 19:05:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMQb03p3zz3tJsM; Wed, 22 Feb 2023 19:05: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 4PMQb03Rsdz4NX6; Wed, 22 Feb 2023 19:05:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677092716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H5pOydV94KaIWUl6STN4DzOap9hStZYFR8upLX+gYxw=; b=lM7nbqIUmtKpSWhEeHhplPgbEuCXjGRZBRszRtIvKjUhUXGq7wBwVvyLS9IPdr0eDWX30P W45kJWjgvNwpQYNQ+pCotbed7pltmEjoXLGbj2YV+KDgrjwlYW+9WIhCNCUKvYFQKa7k0F 3brhgVLUY/3o78s01eTzrJciAsqUGa1l1FbQAqgwvZIoVk8UEeM7pZYkzaNH1Ki69rG4HI gdn25V+gfprT41WQxb6byT1yZrpjwo1tRP2Xnm6egB74gz2tJnNtdWTCzxuLqSTKEmdtHd Ix6w3htlx5+HjuRHBLFUSAyfrxAyOEGh/gCaP/WwferxBiS+jONQf3E4HKsmig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677092716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H5pOydV94KaIWUl6STN4DzOap9hStZYFR8upLX+gYxw=; b=MW39fhG8w4fjR4oBdI4yMkMNwmYGr1epfuX41AAJAtJ7D1yMjRwlYx/Sbki95fGZwcoE5f lHNvrdPIlPOo3DVmByr8Vld5uv1ZBWy3b6io18e7XfVAPhwMAVXh5Tu88e/XDOjDzYzL9A tgmt3eWG+XcB77+0genWD7g74akVffId/6Oe6sW3lnLWejtzx8S/PjuchEv/+g0Xuakz8V vSb2PuiqEbX7kZzbtRze/IJ8pD2L+zIlEFcfWlZxUxQeBwa2xa8ZcujeuX3UhbSG5kKXWA OFExhdpTMIWm8sfBha0hl3VAPvD9CnIdFCiFZgjz+d1zWkk4p25CDc0rykyQQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677092716; a=rsa-sha256; cv=none; b=d+BnJt/jVQeUMaTZWP+4ZGvyEBBfopna1l7kPAbBlEgQ3wrUBWfuIra4pRT8kWJI+K/0Qa NCJJLNzcXxwPgKNlQkLfEg/aI0U6rIgEA0/NgWiiLA3qNHe7Sklf9Zkv3yBZRo60k/wQiv q3U8IsalFTZA+56qSKsv4X+sXmVVfonPhIV3HT2JV4fDExK7XLVwFQM/0Q2A3GY+mmJg5D oIEtrg853e2wWiGNdSHNReGQbNRnUHz/A1fw955bkpR9I6e9PBYD9kyHnXDlHydIszxa5n zQYcNkDvnSjmsw6o1YNo9TqAMFDrdlSoWDIKIjSQQ7MTdaQZbx6+JyAkvWZuMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMQb02PFyz1Bjg; Wed, 22 Feb 2023 19:05: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 31MJ5GJT015699; Wed, 22 Feb 2023 19:05:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MJ5G4O015698; Wed, 22 Feb 2023 19:05:16 GMT (envelope-from git) Date: Wed, 22 Feb 2023 19:05:16 GMT Message-Id: <202302221905.31MJ5G4O015698@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: 30c91a3cee6d - main - byacc: Adjust expected test output to match our patches. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30c91a3cee6d29106a1c5f13ae1d25321d8ab35f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=30c91a3cee6d29106a1c5f13ae1d25321d8ab35f commit 30c91a3cee6d29106a1c5f13ae1d25321d8ab35f Author: Dag-Erling Smørgrav AuthorDate: 2023-02-22 19:04:06 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-22 19:05:02 +0000 byacc: Adjust expected test output to match our patches. Sponsored by: Klara, Inc. --- contrib/byacc/test/btyacc/btyacc_calc1.tab.c | 2 +- contrib/byacc/test/btyacc/btyacc_calc1.tab.h | 2 +- contrib/byacc/test/btyacc/btyacc_demo.tab.c | 2 +- contrib/byacc/test/btyacc/btyacc_demo.tab.h | 2 +- contrib/byacc/test/btyacc/btyacc_destroy1.tab.c | 2 +- contrib/byacc/test/btyacc/btyacc_destroy1.tab.h | 2 +- contrib/byacc/test/btyacc/btyacc_destroy2.tab.c | 2 +- contrib/byacc/test/btyacc/btyacc_destroy2.tab.h | 2 +- contrib/byacc/test/btyacc/btyacc_destroy3.tab.c | 2 +- contrib/byacc/test/btyacc/btyacc_destroy3.tab.h | 2 +- contrib/byacc/test/btyacc/calc1.tab.c | 2 +- contrib/byacc/test/btyacc/calc1.tab.h | 2 +- contrib/byacc/test/btyacc/err_inherit3.tab.c | 2 +- contrib/byacc/test/btyacc/err_inherit3.tab.h | 2 +- contrib/byacc/test/btyacc/err_inherit4.tab.c | 2 +- contrib/byacc/test/btyacc/err_inherit4.tab.h | 2 +- contrib/byacc/test/btyacc/expr.oxout.tab.c | 2 +- contrib/byacc/test/btyacc/expr.oxout.tab.h | 2 +- contrib/byacc/test/btyacc/inherit1.tab.c | 2 +- contrib/byacc/test/btyacc/inherit1.tab.h | 2 +- contrib/byacc/test/btyacc/inherit2.tab.c | 2 +- contrib/byacc/test/btyacc/inherit2.tab.h | 2 +- contrib/byacc/test/btyacc/ok_syntax1.tab.c | 2 +- contrib/byacc/test/btyacc/ok_syntax1.tab.h | 2 +- contrib/byacc/test/btyacc/varsyntax_calc1.tab.c | 2 +- contrib/byacc/test/btyacc/varsyntax_calc1.tab.h | 2 +- contrib/byacc/test/yacc/calc1.tab.c | 2 +- contrib/byacc/test/yacc/calc1.tab.h | 2 +- contrib/byacc/test/yacc/expr.oxout.tab.c | 2 +- contrib/byacc/test/yacc/expr.oxout.tab.h | 2 +- contrib/byacc/test/yacc/ok_syntax1.tab.c | 2 +- contrib/byacc/test/yacc/ok_syntax1.tab.h | 2 +- contrib/byacc/test/yacc/varsyntax_calc1.tab.c | 2 +- contrib/byacc/test/yacc/varsyntax_calc1.tab.h | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/contrib/byacc/test/btyacc/btyacc_calc1.tab.c b/contrib/byacc/test/btyacc/btyacc_calc1.tab.c index f2057aa37997..36765d09ec09 100644 --- a/contrib/byacc/test/btyacc/btyacc_calc1.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_calc1.tab.c @@ -147,7 +147,7 @@ INTERVAL vreg[26]; #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 29 "btyacc_calc1.y" -typedef union YYSTYPE +typedef union { int ival; double dval; diff --git a/contrib/byacc/test/btyacc/btyacc_calc1.tab.h b/contrib/byacc/test/btyacc/btyacc_calc1.tab.h index 114d213cd962..9cf4e75ba38a 100644 --- a/contrib/byacc/test/btyacc/btyacc_calc1.tab.h +++ b/contrib/byacc/test/btyacc/btyacc_calc1.tab.h @@ -11,7 +11,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { int ival; double dval; diff --git a/contrib/byacc/test/btyacc/btyacc_demo.tab.c b/contrib/byacc/test/btyacc/btyacc_demo.tab.c index 04557cd2d356..73b7a1073127 100644 --- a/contrib/byacc/test/btyacc/btyacc_demo.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_demo.tab.c @@ -152,7 +152,7 @@ typedef struct Decl { #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 36 "btyacc_demo.y" -typedef union YYSTYPE { +typedef union { Scope *scope; Expr *expr; Expr_List *elist; diff --git a/contrib/byacc/test/btyacc/btyacc_demo.tab.h b/contrib/byacc/test/btyacc/btyacc_demo.tab.h index 082f5cdbfa96..5c2b96cf3310 100644 --- a/contrib/byacc/test/btyacc/btyacc_demo.tab.h +++ b/contrib/byacc/test/btyacc/btyacc_demo.tab.h @@ -20,7 +20,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE { +typedef union { Scope *scope; Expr *expr; Expr_List *elist; diff --git a/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c b/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c index a95e13341eee..ce8d58593d88 100644 --- a/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_destroy1.tab.c @@ -148,7 +148,7 @@ extern symbol *mksymbol(type t, class c, name id); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 50 "btyacc_destroy1.y" -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/btyacc_destroy1.tab.h b/contrib/byacc/test/btyacc/btyacc_destroy1.tab.h index fd25e13b0019..21b0bc21fe86 100644 --- a/contrib/byacc/test/btyacc/btyacc_destroy1.tab.h +++ b/contrib/byacc/test/btyacc/btyacc_destroy1.tab.h @@ -12,7 +12,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c b/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c index 1c7ac86fc24f..8f0dd0975fe2 100644 --- a/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_destroy2.tab.c @@ -148,7 +148,7 @@ extern symbol *mksymbol(type t, class c, name id); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 50 "btyacc_destroy2.y" -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/btyacc_destroy2.tab.h b/contrib/byacc/test/btyacc/btyacc_destroy2.tab.h index 5f59abdea129..6f8c2b029b4d 100644 --- a/contrib/byacc/test/btyacc/btyacc_destroy2.tab.h +++ b/contrib/byacc/test/btyacc/btyacc_destroy2.tab.h @@ -12,7 +12,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c b/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c index c0f897891d4e..dc93094e6116 100644 --- a/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c +++ b/contrib/byacc/test/btyacc/btyacc_destroy3.tab.c @@ -148,7 +148,7 @@ extern symbol *mksymbol(type t, class c, name id); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 53 "btyacc_destroy3.y" -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/btyacc_destroy3.tab.h b/contrib/byacc/test/btyacc/btyacc_destroy3.tab.h index 5a84568a6c04..1ef7d6b370f0 100644 --- a/contrib/byacc/test/btyacc/btyacc_destroy3.tab.h +++ b/contrib/byacc/test/btyacc/btyacc_destroy3.tab.h @@ -12,7 +12,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/calc1.tab.c b/contrib/byacc/test/btyacc/calc1.tab.c index 54d7014a4b27..cc40060143b9 100644 --- a/contrib/byacc/test/btyacc/calc1.tab.c +++ b/contrib/byacc/test/btyacc/calc1.tab.c @@ -150,7 +150,7 @@ INTERVAL vreg[26]; #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 31 "calc1.y" -typedef union YYSTYPE +typedef union { int ival; double dval; diff --git a/contrib/byacc/test/btyacc/calc1.tab.h b/contrib/byacc/test/btyacc/calc1.tab.h index 0162b2107474..1802350b0d2a 100644 --- a/contrib/byacc/test/btyacc/calc1.tab.h +++ b/contrib/byacc/test/btyacc/calc1.tab.h @@ -11,7 +11,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { int ival; double dval; diff --git a/contrib/byacc/test/btyacc/err_inherit3.tab.c b/contrib/byacc/test/btyacc/err_inherit3.tab.c index 072d23b59cbb..2a2bde418a5d 100644 --- a/contrib/byacc/test/btyacc/err_inherit3.tab.c +++ b/contrib/byacc/test/btyacc/err_inherit3.tab.c @@ -143,7 +143,7 @@ extern symbol *mksymbol(type t, class c, name id); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 39 "err_inherit3.y" -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/err_inherit3.tab.h b/contrib/byacc/test/btyacc/err_inherit3.tab.h index 1018167b685a..5fa781de315b 100644 --- a/contrib/byacc/test/btyacc/err_inherit3.tab.h +++ b/contrib/byacc/test/btyacc/err_inherit3.tab.h @@ -12,7 +12,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/err_inherit4.tab.c b/contrib/byacc/test/btyacc/err_inherit4.tab.c index 4d84c3abf220..71a460d6c606 100644 --- a/contrib/byacc/test/btyacc/err_inherit4.tab.c +++ b/contrib/byacc/test/btyacc/err_inherit4.tab.c @@ -151,7 +151,7 @@ extern symbol *mksymbol(type t, class c, name id); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 41 "err_inherit4.y" -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/err_inherit4.tab.h b/contrib/byacc/test/btyacc/err_inherit4.tab.h index b8c5c281761e..657f87f078fa 100644 --- a/contrib/byacc/test/btyacc/err_inherit4.tab.h +++ b/contrib/byacc/test/btyacc/err_inherit4.tab.h @@ -12,7 +12,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/expr.oxout.tab.c b/contrib/byacc/test/btyacc/expr.oxout.tab.c index f83485d97710..9c16860461f0 100644 --- a/contrib/byacc/test/btyacc/expr.oxout.tab.c +++ b/contrib/byacc/test/btyacc/expr.oxout.tab.c @@ -137,7 +137,7 @@ extern void yyerror(const char *); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 31 "expr.oxout.y" -typedef union YYSTYPE { +typedef union { struct yyyOxAttrbs { struct yyyStackItem *yyyOxStackItem; } yyyOxAttrbs; diff --git a/contrib/byacc/test/btyacc/expr.oxout.tab.h b/contrib/byacc/test/btyacc/expr.oxout.tab.h index cafc41cae56e..eb8596306bdc 100644 --- a/contrib/byacc/test/btyacc/expr.oxout.tab.h +++ b/contrib/byacc/test/btyacc/expr.oxout.tab.h @@ -9,7 +9,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE { +typedef union { struct yyyOxAttrbs { struct yyyStackItem *yyyOxStackItem; } yyyOxAttrbs; diff --git a/contrib/byacc/test/btyacc/inherit1.tab.c b/contrib/byacc/test/btyacc/inherit1.tab.c index 60af07cb10f1..b8e7c5a7935b 100644 --- a/contrib/byacc/test/btyacc/inherit1.tab.c +++ b/contrib/byacc/test/btyacc/inherit1.tab.c @@ -145,7 +145,7 @@ extern void YYERROR_DECL(); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 32 "inherit1.y" -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/inherit1.tab.h b/contrib/byacc/test/btyacc/inherit1.tab.h index 41b0e2937d3d..3b8aa3d2a914 100644 --- a/contrib/byacc/test/btyacc/inherit1.tab.h +++ b/contrib/byacc/test/btyacc/inherit1.tab.h @@ -12,7 +12,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/inherit2.tab.c b/contrib/byacc/test/btyacc/inherit2.tab.c index 8fb8e39cf2bc..db6fd30b0a24 100644 --- a/contrib/byacc/test/btyacc/inherit2.tab.c +++ b/contrib/byacc/test/btyacc/inherit2.tab.c @@ -143,7 +143,7 @@ extern symbol *mksymbol(type t, class c, name id); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 39 "inherit2.y" -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/inherit2.tab.h b/contrib/byacc/test/btyacc/inherit2.tab.h index 333dab588b3a..efaf4555d6dd 100644 --- a/contrib/byacc/test/btyacc/inherit2.tab.h +++ b/contrib/byacc/test/btyacc/inherit2.tab.h @@ -12,7 +12,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { class cval; type tval; diff --git a/contrib/byacc/test/btyacc/ok_syntax1.tab.c b/contrib/byacc/test/btyacc/ok_syntax1.tab.c index c7458178ddc2..6d94e6d2f5c8 100644 --- a/contrib/byacc/test/btyacc/ok_syntax1.tab.c +++ b/contrib/byacc/test/btyacc/ok_syntax1.tab.c @@ -137,7 +137,7 @@ static void YYERROR_DECL(); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 43 "ok_syntax1.y" -typedef union YYSTYPE +typedef union { char * cval; int ival; diff --git a/contrib/byacc/test/btyacc/ok_syntax1.tab.h b/contrib/byacc/test/btyacc/ok_syntax1.tab.h index 9f7028913ee2..44b8dc3e95d3 100644 --- a/contrib/byacc/test/btyacc/ok_syntax1.tab.h +++ b/contrib/byacc/test/btyacc/ok_syntax1.tab.h @@ -23,7 +23,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { char * cval; int ival; diff --git a/contrib/byacc/test/btyacc/varsyntax_calc1.tab.c b/contrib/byacc/test/btyacc/varsyntax_calc1.tab.c index 381102f7207f..2d35aade2579 100644 --- a/contrib/byacc/test/btyacc/varsyntax_calc1.tab.c +++ b/contrib/byacc/test/btyacc/varsyntax_calc1.tab.c @@ -151,7 +151,7 @@ INTERVAL vreg[26]; #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 32 "varsyntax_calc1.y" -typedef union YYSTYPE +typedef union { int ival; /* dreg & vreg array index values*/ double dval; /* floating point values*/ diff --git a/contrib/byacc/test/btyacc/varsyntax_calc1.tab.h b/contrib/byacc/test/btyacc/varsyntax_calc1.tab.h index 5c28ca8ef131..49e269cdb8a4 100644 --- a/contrib/byacc/test/btyacc/varsyntax_calc1.tab.h +++ b/contrib/byacc/test/btyacc/varsyntax_calc1.tab.h @@ -11,7 +11,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { int ival; /* dreg & vreg array index values*/ double dval; /* floating point values*/ diff --git a/contrib/byacc/test/yacc/calc1.tab.c b/contrib/byacc/test/yacc/calc1.tab.c index b78999115ee5..c8c7b6cff9be 100644 --- a/contrib/byacc/test/yacc/calc1.tab.c +++ b/contrib/byacc/test/yacc/calc1.tab.c @@ -130,7 +130,7 @@ INTERVAL vreg[26]; #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 31 "calc1.y" -typedef union YYSTYPE +typedef union { int ival; double dval; diff --git a/contrib/byacc/test/yacc/calc1.tab.h b/contrib/byacc/test/yacc/calc1.tab.h index dd493d013c26..c0633e37dfa8 100644 --- a/contrib/byacc/test/yacc/calc1.tab.h +++ b/contrib/byacc/test/yacc/calc1.tab.h @@ -8,7 +8,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { int ival; double dval; diff --git a/contrib/byacc/test/yacc/expr.oxout.tab.c b/contrib/byacc/test/yacc/expr.oxout.tab.c index 1e2ad2cab7bd..56e3b59d6f44 100644 --- a/contrib/byacc/test/yacc/expr.oxout.tab.c +++ b/contrib/byacc/test/yacc/expr.oxout.tab.c @@ -117,7 +117,7 @@ extern void yyerror(const char *); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 31 "expr.oxout.y" -typedef union YYSTYPE { +typedef union { struct yyyOxAttrbs { struct yyyStackItem *yyyOxStackItem; } yyyOxAttrbs; diff --git a/contrib/byacc/test/yacc/expr.oxout.tab.h b/contrib/byacc/test/yacc/expr.oxout.tab.h index 03527bb036a4..1084ea4abf79 100644 --- a/contrib/byacc/test/yacc/expr.oxout.tab.h +++ b/contrib/byacc/test/yacc/expr.oxout.tab.h @@ -6,7 +6,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE { +typedef union { struct yyyOxAttrbs { struct yyyStackItem *yyyOxStackItem; } yyyOxAttrbs; diff --git a/contrib/byacc/test/yacc/ok_syntax1.tab.c b/contrib/byacc/test/yacc/ok_syntax1.tab.c index 8714a0bbe73b..f035bed50053 100644 --- a/contrib/byacc/test/yacc/ok_syntax1.tab.c +++ b/contrib/byacc/test/yacc/ok_syntax1.tab.c @@ -117,7 +117,7 @@ static void YYERROR_DECL(); #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 43 "ok_syntax1.y" -typedef union YYSTYPE +typedef union { char * cval; int ival; diff --git a/contrib/byacc/test/yacc/ok_syntax1.tab.h b/contrib/byacc/test/yacc/ok_syntax1.tab.h index ca92fd77dfc2..892b211c8a71 100644 --- a/contrib/byacc/test/yacc/ok_syntax1.tab.h +++ b/contrib/byacc/test/yacc/ok_syntax1.tab.h @@ -20,7 +20,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { char * cval; int ival; diff --git a/contrib/byacc/test/yacc/varsyntax_calc1.tab.c b/contrib/byacc/test/yacc/varsyntax_calc1.tab.c index 6c7f2f8b12fe..5ac5c9c07b78 100644 --- a/contrib/byacc/test/yacc/varsyntax_calc1.tab.c +++ b/contrib/byacc/test/yacc/varsyntax_calc1.tab.c @@ -131,7 +131,7 @@ INTERVAL vreg[26]; #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 #line 32 "varsyntax_calc1.y" -typedef union YYSTYPE +typedef union { int ival; /* dreg & vreg array index values*/ double dval; /* floating point values*/ diff --git a/contrib/byacc/test/yacc/varsyntax_calc1.tab.h b/contrib/byacc/test/yacc/varsyntax_calc1.tab.h index 50369b226429..fd07f2cc3d41 100644 --- a/contrib/byacc/test/yacc/varsyntax_calc1.tab.h +++ b/contrib/byacc/test/yacc/varsyntax_calc1.tab.h @@ -8,7 +8,7 @@ #endif #ifndef YYSTYPE_IS_DECLARED #define YYSTYPE_IS_DECLARED 1 -typedef union YYSTYPE +typedef union { int ival; /* dreg & vreg array index values*/ double dval; /* floating point values*/ From nobody Wed Feb 22 20:53:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMSzY23M9z3sBTm for ; Wed, 22 Feb 2023 20:53:13 +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 4PMSzY062mz3Khx for ; Wed, 22 Feb 2023 20:53:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x536.google.com with SMTP id h16so35838403edz.10 for ; Wed, 22 Feb 2023 12:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=3f4ARSBgEmnSwizap2H1K+k17ODgaw1BUgNw58ZsFYo=; b=XoGcM65uR6Y7YmRz3mZjnYf2s8fnEEcb4ylCnXP5d40f5hU/HzBBYsmUh86WoicDpT kvnFiPX2nK3lwDoFn5aQootAw+MXCy54eYYZiX2ekGHZOUnvZnveEX+wfEoN3nSK9jf6 nTF+WQHhLSH8NEc8gmbdI1E9VTq2Kzkfk2XPCZewcKhsn3/nAi/PYPtmhJ9WmEPe5yXD 6cPlhFH15WDa3KFyk1BckzPh8lzfqgVAGBAp9aHRStNKemguxxNaQkbgUCMhvu1TQrRz Z0jVnUKcO9ojMzpKe1dED+hTin58sPgcbwoMbWZHJsjWbWX/YB8jnI1uUV2qAYMdoKoh 5LDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=3f4ARSBgEmnSwizap2H1K+k17ODgaw1BUgNw58ZsFYo=; b=4wceh/7V9hnN/hPjr9soIVSlsP/HjssQ2hY6mRHU5tP/abLjhV00j0syroJcohJQ/4 vEvpr3/hK52naI3arfx7KCikAFlFXkj25vZji9i+9NZIgLFku870SVzl+VtDdzMhyUe4 JEcZSKlS/icMEcBSyv4m+ev8i7n9E8Uuy8V7BuSVPji+tje3kAiyOI9hAH6prtzGnCQu kIWi9tnlG1E6zdbPImiKUjgfsRglYBp+YIJDQDyvrf+2Bg+aeJ2mrAb9EgLoeiNCNAzx DOvdXwqQnBhOdzYQTqs2C/CBx82GBdUixrV7s1vEc/OyGCbj5ogRV1SLgsInBio0Z5tO VTYQ== X-Gm-Message-State: AO0yUKUKK5PhncXTDlIF1W/1ELG5FHtdqc8BNcxISbWt/ogQgV3dyXTX CwadlrT1w9FmyL1S9lPCBqp7GWlWXjTuGlawl/uhKg== X-Google-Smtp-Source: AK7set9fV3RrB1+1+RRALDNwTYJ+jXyjPV8WV16f831lfZHM2qxT7BkHFsdEaefpHRabIR97PjuT+0fYx5lcm8/1HXA= X-Received: by 2002:a17:906:119b:b0:8d1:57cf:ef3c with SMTP id n27-20020a170906119b00b008d157cfef3cmr5471174eja.2.1677099191537; Wed, 22 Feb 2023 12:53:11 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302220431.31M4VgwO065942@gitrepo.freebsd.org> <20230222043708.GQ95670@funkthat.com> <20230222070900.GR95670@funkthat.com> In-Reply-To: <20230222070900.GR95670@funkthat.com> From: Warner Losh Date: Wed, 22 Feb 2023 13:53:02 -0700 Message-ID: Subject: Re: git: ee97f198b42d - main - Support SMBIOS v3 for 64-bit entry systems To: John-Mark Gurney , Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org, Warner Losh Content-Type: multipart/alternative; boundary="00000000000090a59a05f550156f" X-Rspamd-Queue-Id: 4PMSzY062mz3Khx 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 --00000000000090a59a05f550156f Content-Type: text/plain; charset="UTF-8" On Wed, Feb 22, 2023 at 12:09 AM John-Mark Gurney wrote: > Warner Losh wrote this message on Tue, Feb 21, 2023 at 22:04 -0700: > > On Tue, Feb 21, 2023, 9:37 PM John-Mark Gurney wrote: > > > > > John-Mark Gurney wrote this message on Wed, Feb 22, 2023 at 04:31 > +0000: > > > > The branch main has been updated by jmg: > > > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=ee97f198b42d50437f87aa4111d478eca2a5be16 > > > > > > > > commit ee97f198b42d50437f87aa4111d478eca2a5be16 > > > > Author: John-Mark Gurney > > > > AuthorDate: 2023-02-22 02:27:37 +0000 > > > > Commit: John-Mark Gurney > > > > CommitDate: 2023-02-22 04:10:12 +0000 > > > > > > > > Support SMBIOS v3 for 64-bit entry systems > > > > > > > > Summary: > > > > Under QEMU on arm64 systems, the smbios table is above 4GB > > > > requiring a 64-bit address to access. > > > > > > > > Reviewers: manu > > > > > > > > Subscribers: imp, bcran, dab > > > > > > > > Differential Revision: https://reviews.freebsd.org/D38721 > > > > > > Sorry, but this commit message is incorrect, it should be > > > Reviewed by: imp > > > > > > and the Reviewers and subscriber lines dropped. > > > > > > I had editted the file, but due to wonkyness w/ git, that amended > > > commit got lost and the original one was submitted instead. > > > > > > Not sure if there is a way to fix it though. > > > > > > > You can't fix it. But it's not a huge deal... > > Yeah, I figured, and the info is there in the review... > > > How'd you land this? with 'arc' or 'git arc' Since I've started using the > > latter, I've not had issues... Raw 'arc' seems to have an extra layer of > > wonkiness... > > I did the dev on another box than the one that I can commit from.. So it > took some git push/fetch to get it onto the correct box... > > I had amended the commit, but then I got a bit confused about how to push > from the branch to main, and so I checked out the branch again that didn't > the amended commit and then pushed it: > git push origin HEAD:main > > It just teaches me to make sure I amend the commits sooner rather than > later.. > Indeed. You can also push a branch with the above syntax without having it checked it, which I do from time to time when I 'copy branches' from one repo to another for pushing upstream. Though it wouldn't help with this situation... Warner --00000000000090a59a05f550156f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Feb 22, 2023 at 12:09 AM John= -Mark Gurney <jmg@funkthat.com&g= t; wrote:
Warner= Losh wrote this message on Tue, Feb 21, 2023 at 22:04 -0700:
> On Tue, Feb 21, 2023, 9:37 PM John-Mark Gurney <jmg@funkthat.com> wrote:
>
> > John-Mark Gurney wrote this message on Wed, Feb 22, 2023 at 04:31= +0000:
> > > The branch main has been updated by jmg:
> > >
> > > URL:
> > https://= cgit.FreeBSD.org/src/commit/?id=3Dee97f198b42d50437f87aa4111d478eca2a5be16<= /a>
> > >
> > > commit ee97f198b42d50437f87aa4111d478eca2a5be16
> > > Author:=C2=A0 =C2=A0 =C2=A0John-Mark Gurney <jmg@FreeBSD.= org>
> > > AuthorDate: 2023-02-22 02:27:37 +0000
> > > Commit:=C2=A0 =C2=A0 =C2=A0John-Mark Gurney <jmg@FreeBSD.= org>
> > > CommitDate: 2023-02-22 04:10:12 +0000
> > >
> > >=C2=A0 =C2=A0 =C2=A0Support SMBIOS v3 for 64-bit entry system= s
> > >
> > >=C2=A0 =C2=A0 =C2=A0Summary:
> > >=C2=A0 =C2=A0 =C2=A0Under QEMU on arm64 systems, the smbios t= able is above 4GB
> > >=C2=A0 =C2=A0 =C2=A0requiring a 64-bit address to access.
> > >
> > >=C2=A0 =C2=A0 =C2=A0Reviewers: manu
> > >
> > >=C2=A0 =C2=A0 =C2=A0Subscribers: imp, bcran, dab
> > >
> > >=C2=A0 =C2=A0 =C2=A0Differential Revision:
https://r= eviews.freebsd.org/D38721
> >
> > Sorry, but this commit message is incorrect, it should be
> > Reviewed by: imp
> >
> > and the Reviewers and subscriber lines dropped.
> >
> > I had editted the file, but due to wonkyness w/ git, that amended=
> > commit got lost and the original one was submitted instead.
> >
> > Not sure if there is a way to fix it though.
> >
>
> You can't fix it. But it's not a huge deal...

Yeah, I figured, and the info is there in the review...

> How'd you land this? with 'arc' or 'git arc' Since= I've started using the
> latter, I've not had issues... Raw 'arc' seems to have an = extra layer of
> wonkiness...

I did the dev on another box than the one that I can commit from..=C2=A0 So= it
took some git push/fetch to get it onto the correct box...

I had amended the commit, but then I got a bit confused about how to push from the branch to main, and so I checked out the branch again that didn= 9;t
the amended commit and then pushed it:
git push origin HEAD:main

It just teaches me to make sure I amend the commits sooner rather than
later..

Indeed. You can also push a bra= nch with the above syntax without
having it checked it, which I d= o from time to time when I 'copy branches'
from one repo = to another for pushing upstream. Though it wouldn't
help with= this situation...

Warner
--00000000000090a59a05f550156f-- From nobody Wed Feb 22 21:19:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMTZQ2kR2z3sDF1; Wed, 22 Feb 2023 21:19: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 4PMTZQ1N1tz3MsV; Wed, 22 Feb 2023 21:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Trt2Dys3j9mMQqghPldwomiZn7u7gh6UUenBuY+Ms4k=; b=WS9LB7NXC7lpx5Hh5DGSVQDjn86ePlVVAoKSYFvuV77r2oft12lkweRPeQSLdXE39vPbhW +O9UDClkyaB6+J/sQuquK1lwl2s/Uk8FZXjd8QYJ8YD0Dqqcn6vhYCDjpp3EgPIV4PjYaN nl1/XrlYxCn/1Mq0mCZSi3wIpdSvKPDb7fqYs/14Q/RP+YnyXuiGNb8QHLJPb1RvecI+v9 uBRoWeCS0hD+IXFpeP/rvAa93a8xoSYHvEFE4lh9hZcoVfBpQo6vB4T4pSuj7UQyWGNJm1 mgXIy+KEK3kxh+Y9XLrhbSkdPj0CG9J7F+fzrFZSWLMHhw938yBjonJHaUAC+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Trt2Dys3j9mMQqghPldwomiZn7u7gh6UUenBuY+Ms4k=; b=BV2399W7EN+B5GtyRbU3mmJyfOu0PIDDHniToqgsAs532g0KUAcIusMxb1Yiw7N3re/CfT LvZh/KSmG2JcOZ53W6oYiD/GiN5vw5k+PY7jDhyx+aJGfNUYQeYqLjdnqL0gp9YcBgL1ff CzrWMwxzHbONLMFIptSzaPLSsq+nr6B9MELidyPcYmLpkT2Mylz7HGunMJjfnI8c6C0xtR HeHGMlgu3DBfMcI6zf3yMZn7RGNdzOMA2Dgd56nZQpQKbr84yMSeOWfLvJHsSaSEQACpKy sIbeI6KZq1XpkvWJxvTfNu2kzSH+fYkVeFG4WqhLqNpW2+ZNKQxFxiLW8S7/Hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677100798; a=rsa-sha256; cv=none; b=sjSGnE292c6CAQG/GPDEZlx5l6T9GxhfYUYs0yuoDAL8lichXqvRQ8ewUVgKRGLlQpcdAb pQBNxhatrz4Wr6XtoAUtNP6QanHFgZsAHlg/dR1FI3aRxz+jOhMUo2PMO8eeiFor0Ju4T2 qouNMNXoj+Ud/Fz9Gq0/UkyT8jPlN5/GNOp0VXyolCkakYPWxVLPpibLeab3atQ4k8kZve m+YJxLSo8oBFz12ouP3MdgIbpcYrp2fKNb4mChnOVU/sTAzYU3qbrbxtQhaI2MSlP920vH 4njPugXB3Irr9OWNlpEHh+QjdoUXdmUTvJpBulXEG4Sa/EPJ9llHhmeXCjx4BA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMTZQ0PxdzGcV; Wed, 22 Feb 2023 21:19: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 31MLJv34001759; Wed, 22 Feb 2023 21:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MLJvpU001758; Wed, 22 Feb 2023 21:19:57 GMT (envelope-from git) Date: Wed, 22 Feb 2023 21:19:57 GMT Message-Id: <202302222119.31MLJvpU001758@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: 10dff9da9748 - main - nfsd: Return ENXIO instead of EPERM when nfsd(8) already running List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10dff9da9748b0eadd2d02dded3afd2321d15537 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=10dff9da9748b0eadd2d02dded3afd2321d15537 commit 10dff9da9748b0eadd2d02dded3afd2321d15537 Author: Rick Macklem AuthorDate: 2023-02-22 21:19:07 +0000 Commit: Rick Macklem CommitDate: 2023-02-22 21:19:07 +0000 nfsd: Return ENXIO instead of EPERM when nfsd(8) already running The nfsd(8) daemon generates an error message that does not indicate that the nfsd daemon is already running when the nfssvc(2) syscall fails for the NFSSVC_STABLERESTART. Also, the check for running nfsd(8) in a vnet prison will return EPERM when it fails. This patch replaces EPERM with ENXIO so that the nfsd(8) daemon can generate more reasonable failure messages. The nfsd(8) daemon will be patched in a future commit. MFC after: 3 months --- sys/fs/nfsserver/nfs_nfsdport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 34b2f114bd7a..9c7169d7daac 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -4007,7 +4007,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *uap, struct ucred *cred) if (!error && (NFSFPFLAG(fp) & (FREAD | FWRITE)) != (FREAD | FWRITE)) error = EBADF; if (!error && NFSD_VNET(nfsrv_numnfsd) != 0) - error = EPERM; + error = ENXIO; if (!error) { NFSD_VNET(nfsrv_stablefirst).nsf_fp = fp; nfsrv_setupstable(p); From nobody Wed Feb 22 21:22:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMTdc4l2Zz3sCxy; Wed, 22 Feb 2023 21:22: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 4PMTdc4D1Mz3NWK; Wed, 22 Feb 2023 21:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9R23zo62Hq/I+zzVB1FJD958oNhY2MEASl8Uog7tzG0=; b=i+S9s6ia1hQkaQ+V03Dk0WmaZIDfQ+pOZ0eyWgXHNNw3h57tApatpruP4PN8Bu4jEVaDPB 20jpBdPCQxLJlg5XzF9T9oihWqBs98QV9RWjScGCH/liBjP2h4jFkvExrtWjeCcWtE2VLk 9vNJd/MyT5VReg2TMkNffbR0JNha57bBnzIuNbiovUGZWyXG9JRkyjW6VLbxfZYQ9l3e9Z gcQdVTSzREtn9udrIh/tgEPNUR1er1qIM9Vu9PfnX0Bb7yrp9ihCgpk8N6rTNCvmL1A29s Cv7J6lkKP40jwgIFPePjL4L+4+fsDqlt5slgCQa0sGk7Pi+ezXu1nqnO5IYYNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9R23zo62Hq/I+zzVB1FJD958oNhY2MEASl8Uog7tzG0=; b=qEgd08IHiJsHa6TK5cknF4349hfHJjSmSlQH/Ab8CzrpctFZ3VadeNwl3+aXq+IWn9pIoi DV668qe/CZc593VUYVixaC9R/hZkHmtACULJpng08ElwRputHZxC2KAd0cvNzZvKrfBbUt fCE2TI8Jwc54CjnLVyTcrEtrenFv/VOl32m8azxena+CrUDoWSE3bFPhnDkkEGCa4XClAs RUmCG1ZfCcfpBnFP/i0fsEF/Tqq+ngeN1z2LP3fXrn/i4lIDeVsH9sFEU8P34BdJMQShLA PujYZVk0d9xUhR+FZEYqLXGCT3AkQV6gD16bBGq4Wcogj2jpzX/qMzZWwp2fzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677100964; a=rsa-sha256; cv=none; b=bdWyO/INn3LOMTIlnTt3BhfLJrjztf0ziVhjIJUzJ0thYWpHDZKgSIL1P/eqc5+uvqILBX y02WCqxOU2jsItU+wc0QUdb+9SGFZ2YtUtNnKORiO9kcFg11arGVODCwuv4W09i19uEt5F FXSObjeojW+0U6o4hlssoX95elJx8l1iQrihAvuy5dQx8jCxvIcflFLOWUocB7x8swQN3H wa+7+waPD7Ao2yNxecrBnTybzcs4XY1e3xociZYCqnBRJvy4mEn1Z5Ss441Qm6j4w0Aub1 gzIuCrUCxkTg2Y/0mNa2w1MLf33a3ona63pTahgSZcYGF1FcmSi1v3XYxwB8rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMTdc3HS8zGcx; Wed, 22 Feb 2023 21:22: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 31MLMiUs014897; Wed, 22 Feb 2023 21:22:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MLMiZw014896; Wed, 22 Feb 2023 21:22:44 GMT (envelope-from git) Date: Wed, 22 Feb 2023 21:22:44 GMT Message-Id: <202302222122.31MLMiZw014896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: df2b1d059158 - stable/13 - ptrace.2: Fix warnings from igor. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df2b1d0591584d9e63456349080357d00ccb94d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=df2b1d0591584d9e63456349080357d00ccb94d8 commit df2b1d0591584d9e63456349080357d00ccb94d8 Author: John Baldwin AuthorDate: 2022-12-15 19:25:27 +0000 Commit: John Baldwin CommitDate: 2023-02-22 20:43:39 +0000 ptrace.2: Fix warnings from igor. Reviewed by: pauamma, imp Differential Revision: https://reviews.freebsd.org/D37689 (cherry picked from commit 120eff994aeb31671c144a1835c62d9d8789a5a0) --- lib/libc/sys/ptrace.2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index a5e67c745422..06c427419c41 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd January 27, 2022 +.Dd December 15, 2022 .Dt PTRACE 2 .Os .Sh NAME @@ -151,7 +151,7 @@ The following controls are provided for this: .Bl -tag -width security.bsd.unprivileged_proc_debug .It Dv security.bsd.allow_ptrace Setting this sysctl to zero value makes -.Xr ptrace 2 +.Nm return .Er ENOSYS always as if the syscall is not implemented by the kernel. @@ -450,11 +450,11 @@ given as the signal to be delivered. .It Dv PT_ATTACH This request allows a process to gain control of an otherwise unrelated process and begin tracing it. -It does not need any cooperation from the to-be-traced process. +It does not need any cooperation from the process to trace. In this case, .Fa pid -specifies the process ID of the to-be-traced process, and the other +specifies the process ID of the process to trace, and the other two arguments are ignored. This request requires that the target process must have the same real UID as the tracing process, and that it must not be executing a setuid From nobody Wed Feb 22 21:22:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMTdd5pJnz3sDbj; Wed, 22 Feb 2023 21:22: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 4PMTdd57Dmz3NX2; Wed, 22 Feb 2023 21:22:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZO4NDZcNqX8FvuRCaSlYDIoiDve3x8qwxwb3a+EsU48=; b=ewJebeapPCF8A2d9iT7l/NEbRUhfd9yAxG7REh/J5IiQe2GKlBW5i9HVHEktJFI4caJeYh XFsMqx1e3uNKxdGU0j+iLtLOz0gZ2/Rd+mg4ujHQqSNB25OoYsctnRM6ytTqiOL9EBGv3f VmhoaO4iNnJx/LoQrtZOHX+gp+gKHp/Ol9Rv3oG+Q/0rhZra0BJAUT4WF0e2sc0Jt9c8Uo xkmRu8b9Q/vdVWd+LNiSfVqoluuZja5+d6KExFcnPAhNtByNFJDM342keyFic2vflmtEYG v0IIKCM1/E4tmyhdQxnG2qYOEPMuelN4iyJ0rjybWoIqTL670m3FldoyNitxbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZO4NDZcNqX8FvuRCaSlYDIoiDve3x8qwxwb3a+EsU48=; b=JGOSP7fGF4bVRnHwdiAnaMCenk3OIYe1t3plXOi/iaShWvfESQoAKt6m6BZJ3IGuJoaphz mRkENEtn50E/ihvYIrc9e5wJhW4/B4YKACBj+3Pd+QT6AABsqZ1a/OsU8RyjsmgOPetb22 53FtIIjGCrEDoy7jw9uOMVmjyI65OmM2UpnZYpdnj5oEqfNk5+ob6Af+AgQQ6RpyN7c4Z3 QR34o729DfevVhKLFeVtfySEV0Rw6dDMX9SicPDlyWKDATawHXB2HEPrEofGAZwFl8LK// Uf4ixmRls4KVQfath7Ge6t3hqNNhvE3KjREkKQ3oHWbM76vjUKae17VOvvTL+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677100965; a=rsa-sha256; cv=none; b=V5B1JY3WF9et1LQ5S96YV8LLantO/3EbDydXYVepMlv6xw+O4C/BySYMr1ipFkCCpbG+/S ZWQ2GRhn+IBV4+mc1q1mbcRJw4DMxt497U3cQA4kODf7LEKddu09TfD/TlQ9oDBO4vWuyu nO2ZMNZcoAJCqQlGF1aWy+mc27tonZomNFfoI1jiCfTCqWZ7J+M0dqnODu6tWvH358/+mw /cuF1UN/40krPdZ77BmBvGcoA5OXF+e+Wz7IqnGQFpmsyziVTN69Ke3nGH/Mez1BbafDlm 0fKo9NcT8D57YUG0sa+9mIxE9TMLBzW3UdkZMCk/h17SvFM1N15ICYKavVjY4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMTdd4D7vzGmg; Wed, 22 Feb 2023 21:22: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 31MLMjvS014916; Wed, 22 Feb 2023 21:22:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MLMjtG014915; Wed, 22 Feb 2023 21:22:45 GMT (envelope-from git) Date: Wed, 22 Feb 2023 21:22:45 GMT Message-Id: <202302222122.31MLMjtG014915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f9345b915b26 - stable/13 - .github: Switch to v3 of actions/checkout. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f9345b915b26b2eb9393687e6d2617f320004a04 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f9345b915b26b2eb9393687e6d2617f320004a04 commit f9345b915b26b2eb9393687e6d2617f320004a04 Author: John Baldwin AuthorDate: 2022-12-21 00:27:17 +0000 Commit: John Baldwin CommitDate: 2023-02-22 20:44:23 +0000 .github: Switch to v3 of actions/checkout. GitHub is emitting a warning that v2 is deprecated due to using Node.js 12. Reported by: GitHub Reviewed by: arichardson, emaste Differential Revision: https://reviews.freebsd.org/D37769 (cherry picked from commit 54f3a781a2ff980034dfe13ff6323c96fc587f1b) --- .github/workflows/cross-bootstrap-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index 2d981b3fdff2..4ef496f4636b 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -34,7 +34,7 @@ jobs: - target_arch: aarch64 target: arm64 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install packages (Ubuntu) if: runner.os == 'Linux' run: | From nobody Wed Feb 22 21:22:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMTdf6bGVz3sDM4; Wed, 22 Feb 2023 21:22: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 4PMTdf69vpz3NLn; Wed, 22 Feb 2023 21:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I9HvVail79//ul9amRAxHKomLTzNH4u6NVFwm8OEvRU=; b=IRYPIzTx9k7Sc5VTOT9NRsZqZ7Ns0P+ZMx+AHORdvD9rFurD9zZnF02XGrZXRm2DXnVmL9 HEddMCz72dq7HhGajLBvaJC0E1RAT0JCV81ZnZO7yKqADbSk1AqyHwwg4UiuZkI/EOr+H8 mQ5pSmhRdCXUh+oPUoC7XueDqZL8XFwsLhYI70iNvcrCHlF6Ls7+uriV/C8/M5t6mOvW+D MHEGa6XUao6btE405oJcEf/o1rJqnPV2MzKwmezVLaxzKeQlueDnZb4JhmPx8CATC9USEl OnuOSxjESKjTidvqwvsVwcUmLo/GMppzaQkPD6H/Jkm50oRl4iTGx9SH3A3xQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I9HvVail79//ul9amRAxHKomLTzNH4u6NVFwm8OEvRU=; b=yE1JQFEsDsSKwIzS54BgPXFyyjcz14oFk+qTym1YolyYPBCh1d/cRrsrPkmFhEBsEG8kVY JsGqhQsXTLvr8xecid67V0i6xbIfOsyZ4SykwYs61tdUVVgnMQ2vmD4KjvrY1oxC4of/lI XAzPaxJ09RkxdKDRFnqJfH20T5o5xUwFXqeksGFz4EdMrRZSkdUGFEp+D+vNrqbGeLXe/V PSurFvlv4d3tJurTVyfX29BSufzgMqQyBkrs1LlL+0BmXq+WKxRw10lBo8RHkgEqQBHa6G et6Ymhk+ScA5wj/XwGL8QOgB+fMoh8DssJT0pezRHQk6GltjjektIU4+vmrwCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677100966; a=rsa-sha256; cv=none; b=gXlBu19CGP90VEKazuS7ZuZse+c9IuJp9nAxAJW+UWsv686GtfYBsBjO4ZNs3OlQZPVxTd 4Sw5HkC7IjLJ1XZrojO+m1lGnNPo8F8Sox3QBJL5yg3GRJTpM1FDJVHmYGhNeNwZ/tGGaU F7zROwxRUoLlJtSleXs+JtJuTNOhPiFIoqM1sEuTJ7xQet/Rv6E5h3avT6AF5gJGDRtU6c UXQw2iyYGhrgDMxeISSg9U9xuULE9EilvseWobNSkUsha7VIwsmKKnzaLogHIPxVVvpGDU cHKptmmJ2QgQO7n+3LjLIjLAxoJ3IRMcR0B26xCYQ/KdfPjQImdRe/bCrsvC+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 4PMTdf57wdzH7k; Wed, 22 Feb 2023 21:22: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 31MLMkLT014935; Wed, 22 Feb 2023 21:22:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MLMkqJ014934; Wed, 22 Feb 2023 21:22:46 GMT (envelope-from git) Date: Wed, 22 Feb 2023 21:22:46 GMT Message-Id: <202302222122.31MLMkqJ014934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: fe67dc3e0797 - stable/13 - ccr,ccp: Fix argument order to sglist_append_vmpages. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fe67dc3e0797bacd009cd8e632e21ccfb83099d6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fe67dc3e0797bacd009cd8e632e21ccfb83099d6 commit fe67dc3e0797bacd009cd8e632e21ccfb83099d6 Author: John Baldwin AuthorDate: 2023-02-06 21:51:57 +0000 Commit: John Baldwin CommitDate: 2023-02-22 20:45:28 +0000 ccr,ccp: Fix argument order to sglist_append_vmpages. The offset comes before the byte count. Reported by: br Reviewed by: asomers, markj MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D38375 (cherry picked from commit 70efe1a2fe13642732e56c7f040fe63f62bc6a6b) --- sys/crypto/ccp/ccp.c | 2 +- sys/dev/cxgbe/crypto/t4_crypto.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/crypto/ccp/ccp.c b/sys/crypto/ccp/ccp.c index 2b059dcee2ca..6e224d5f1544 100644 --- a/sys/crypto/ccp/ccp.c +++ b/sys/crypto/ccp/ccp.c @@ -112,7 +112,7 @@ ccp_populate_sglist(struct sglist *sg, struct crypto_buffer *cb) break; case CRYPTO_BUF_VMPAGE: error = sglist_append_vmpages(sg, cb->cb_vm_page, - cb->cb_vm_page_len, cb->cb_vm_page_offset); + cb->cb_vm_page_offset, cb->cb_vm_page_len); break; default: error = EINVAL; diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 3d667ac5a405..a7d69d2d2bb0 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -295,7 +295,7 @@ ccr_populate_sglist(struct sglist *sg, struct crypto_buffer *cb) break; case CRYPTO_BUF_VMPAGE: error = sglist_append_vmpages(sg, cb->cb_vm_page, - cb->cb_vm_page_len, cb->cb_vm_page_offset); + cb->cb_vm_page_offset, cb->cb_vm_page_len); break; default: error = EINVAL; From nobody Wed Feb 22 21:22:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMTdh0LF9z3sDM6; Wed, 22 Feb 2023 21:22: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 4PMTdg6yVHz3NlT; Wed, 22 Feb 2023 21:22:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4y1aGYHCZfLgW4Se0rs5u1Ipo16wbTBxhU7iP0r2Lwk=; b=VwJZ1XfnMuJrnzUa6fkDvcyrxWzVJBc2Yi1WomhmI0hfyC09V38BTAmVF18TTwDGj87Mpz Fthgx8GZv4NE78cBp4cAMyHu53siCM+wfSQRaGuc2vMlIaKz/lVLmf1yun7P8s0ucthgos AOUYo2/8vUsnViyJ0IdDyQdDUQDTkNefSnBXC3Tb9X1Q4w59PM7elr3ZEq+n4ygg/uazvm OyH8bC11mYwBOMRLyHEAUBjR1/fvTE5pq4vYPtZ8DmRqERlx8r9p/DGztEQWV1tPPmRFOl VG8ptrhUKj/lC1rcuR6zhw9J2UuTSTXK25belp9Yp23F9wtNsx0KoQOoKUx8oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4y1aGYHCZfLgW4Se0rs5u1Ipo16wbTBxhU7iP0r2Lwk=; b=RyJeCa6xsb4gaQbAaWZBX7lqnRyupyf8y9mNiuQ/NvzrxY4mEXUN400nsvyQYQ+5qVWP6r mq6kNnLtQfFpKvFhVZUjRT5aTKBZbe+wrcMn5AlH8nOmCTQljLd7X1uNkEDeXg759bD2Zz m0Asego8814c22hunb9la3LjBAvjeMU7b92PBTFszrSFBRl0GV9iPJ5Vyngdc7UN90AYfl tS8zVK6/5rUTk5TJn1sw8qzif+9rE4zBLXyOERJma8+zm+r+ljSxGn4YaNq7+9fmUZZnAF qkgToIBfoL/Mzww6mOpWTFir/VxXTS89eUiS4HewuNuYtf9KIV/LbtbswZeopQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677100968; a=rsa-sha256; cv=none; b=d+/X9tKzFcqHukuTLsXQ7TT2p3qhz9GIbKGsQQcjwJ6eHXoptRNioWdqGJvnGqcTL/yZcX uufpBR/dzaRl+/ko0ZiIxe6y+UXB38kCVAijOycJoryDpZqIQJPnJyG64GiF6V45x4645e tZ7TaQ8IKrDGxhdQ/+EqOxJEMNxgjDn1cp2fm6UkEdiWxldKwDXBUBCuxtVU06wPPSVjAr V7hEsfyHbZMwDbEJlSHEYGKGqHLPqSc2T77zwGxf8CFyF/awf2USQB3bDXH4Wcacrr+vj0 otCkZsdD6Wz98npCrYY1jyJaRFtIt1qUwdKbxxedsR9IaqgxgTegevPBgh3zMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMTdg631ZzGxj; Wed, 22 Feb 2023 21:22: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 31MLMlaF014960; Wed, 22 Feb 2023 21:22:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MLMlvc014959; Wed, 22 Feb 2023 21:22:47 GMT (envelope-from git) Date: Wed, 22 Feb 2023 21:22:47 GMT Message-Id: <202302222122.31MLMlvc014959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ff5b04fddebd - stable/13 - .github: Restrict permissions on cross-build jobs. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ff5b04fddebd129be42a60e7ee8666c9286db57c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ff5b04fddebd129be42a60e7ee8666c9286db57c commit ff5b04fddebd129be42a60e7ee8666c9286db57c Author: Alex AuthorDate: 2023-02-09 20:12:17 +0000 Commit: John Baldwin CommitDate: 2023-02-22 20:46:09 +0000 .github: Restrict permissions on cross-build jobs. (cherry picked from commit aca7ff471acffb59f0f9e2cc4de6363872444fcc) --- .github/workflows/cross-bootstrap-tools.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index 4ef496f4636b..c6df31e4fbee 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [ main ] +permissions: + contents: read + jobs: build: name: ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) From nobody Wed Feb 22 21:22:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMTdj3JNxz3sD8l; Wed, 22 Feb 2023 21:22: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 4PMTdj0lNrz3Ndv; Wed, 22 Feb 2023 21:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vQ1D2NB0OAvWH5VCg6fejaYz4UdvsYaKlQmuSUO3cWM=; b=j3DAHd5U0CCx/FWx7FBkcc3rTYP+LeLLG9sYy/p+IHsQm8muGIzBbU8WzJGCHWaohbqoji wnzLzexPqaAQ7aS8pRt6zH6hqFfCiPnVU8SL4wjmjZ0NdyNkJyYGD3RW54F8vlk43bMfjl hGcAUlwf7CdvM6y5QnMdRL7S92RDXRJWeJ/nV/OBE1Uosm1UrlDZQds3NhI0TafsYWWGF9 648QHVXse+WFaDJnz3hataPnL+Qy3h+WUv9QHMRqqNo3X/xSAlceE/wXCzV9F0bg/XNUSb 6uxQjyVVmGB9fYIQnbrO+4gZWl1GKhZIIc55YhJhDtFrdgXXoLDSU//OEhJnQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677100969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vQ1D2NB0OAvWH5VCg6fejaYz4UdvsYaKlQmuSUO3cWM=; b=wmChdi2xtvfh/qrgQ+LLDQQhQ/ZaJbNzfH5TFZ6RQ1+RN3vt5QIzLZNfeJKjtN0ur2a0Li pngtQlu2HKkj18q3AshDiPQSV22Ib+XlKugiuWUF/uX4JWDDY70rxRJEKyhSHCbu6XGpjd BEGzpfKNxkJWvS1jJ0U+awl/tVDeuU4qFXvV/fgzS/pMmjZn1HCPUKYEOdNv5Tt29XxmnX PjvMwieB18CH25uSuih4yxMjDZiwwagzRjZIv4GnhwODXGaDis9z3dRxvwDqeB0jc6O781 0NELm2ssGmIMtb6h8i0MxMw9Vl8QddOuNfl/voT1xnf+ngEOSpVHwW8obdJrfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677100969; a=rsa-sha256; cv=none; b=IBMO44P8qZgYZxFJGTiJnexFEBMBWHnkI9Irybi8M9AW13eJ3zF9R1NjUUp9cgkMKeTNfF 8qPvki3GUBUZrLpz1QAy+kSJby9IsjJHhROHkuWUGebmqkQdX8wvPR1J+ssNhtCYpsR1R8 N9hjKelDFDE1Wke3NorAlzt0f6MPDKS/oB9Y24CtjLgPCg15mtmmxlaH6/0zJCxEmOuBLg SeE7JGYaE2saa84pIHxKjKhHgz9f7m376O1cc3k+WUoWS8bdFZOub1Yj/yiVtVuxpRgDLN 154j/dGgy+cVkBCzZIQTvJmv0oN6HVxKmGdPmDEY7EgqLmC8ArZDB0pVEztrHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMTdh6yqtzH8J; Wed, 22 Feb 2023 21:22: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 31MLMmhn014981; Wed, 22 Feb 2023 21:22:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MLMmRI014980; Wed, 22 Feb 2023 21:22:48 GMT (envelope-from git) Date: Wed, 22 Feb 2023 21:22:48 GMT Message-Id: <202302222122.31MLMmRI014980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: bc68c55166ad - stable/13 - .github: Attempt to fix and increase robustness of macOS action List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bc68c55166ada973141542c9c719f562475cb80c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bc68c55166ada973141542c9c719f562475cb80c commit bc68c55166ada973141542c9c719f562475cb80c Author: Jessica Clarke AuthorDate: 2022-06-30 20:03:26 +0000 Commit: John Baldwin CommitDate: 2023-02-22 20:47:12 +0000 .github: Attempt to fix and increase robustness of macOS action Homebrew has added LLVM 14 and made that the default version, but GitHub continues to install LLVM 13 for now, so it ends up only accessible via the versioned name and not the unversioned one. We also add an explicit installation of llvm@13 so that, if GitHub updates the image to using LLVM 14, the action continues to work, albeit slightly more slowly. This also ensures the compiler label remains correct rather than outdated, as has occurred in the past, and that we don't get new versions of LLVM before we're ready for them, which is especially relevant for stable branches. This all mirrors how the Ubuntu jobs are configured. (cherry picked from commit 22f731486e80fdbf679712b2a99605ba97a50264) --- .github/workflows/cross-bootstrap-tools.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index c6df31e4fbee..9630470d0420 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -30,8 +30,8 @@ jobs: pkgs: bmake libarchive-dev clang-14 lld-14 - os: macos-latest compiler: clang-13 - cross-bindir: /usr/local/opt/llvm/bin - pkgs: bmake libarchive + cross-bindir: /usr/local/opt/llvm@13/bin + pkgs: bmake libarchive llvm@13 - target_arch: amd64 target: amd64 - target_arch: aarch64 From nobody Wed Feb 22 21:41:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMV3T5mm5z3sFV7; Wed, 22 Feb 2023 21:41:41 +0000 (UTC) (envelope-from jhb@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 4PMV3T5LGjz3RD7; Wed, 22 Feb 2023 21:41:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677102101; h=from:from:reply-to:subject: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=ZEQrUa1dlcp+Y/8YCP61zCsPZU7j6mqRU0eYVI4SK7M=; b=t91SfcOQJcEIKCGmEvOItIWBGaOztaDNMQtCX0shmkN+1dmIdxW9OnXiJrRWgZUaibHZF5 XQjQEmVo7fVKwzfWFgxPdIUn6CL01wKdsoWGy+lezlMaydJm8aKDMSPScqNpH64ha7Tpvc stvHVJN5RFR/jjQL+bHOGuWODOpEYsezq/CTcHLvOd62V1S+YPLBcRAyR6hst7PU6pRICt AzIa7BTVdK49U8qT9wXGMc5Hz7aeqmYrAMNHtalpiSdA2JpHSMCwF5CmN98GQW5KXENQOa gyEoKQzNQnRfIJEtSEzS8nWnPYcONX8vfcI2qB4h0UQDApfdQHdLuG1ZQhmwHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677102101; h=from:from:reply-to:subject: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=ZEQrUa1dlcp+Y/8YCP61zCsPZU7j6mqRU0eYVI4SK7M=; b=mupt6hTArpIptgr7St8s/G6gRaZ7rNLTsjySpp0nZwIfRW/4w/7S8g51h9B8sCZ68pEAFQ RQXF+QGiwbYBSCArD3FAgGgTUqYuacYIfT6Dq1NGPEjQf+E54Ws+bHR7JBLfr/vZrntUHb cZoZ4rOBuB2z739Lv392UYpNaAtB7inKThR72+k3YjE2GhS/VMbSZPp+HqHhHH6vaK8TnW 3hsi7z7NQ0nM+tKBcmvios6RC5cOOslmRIgReEc1LEBTY2YyxQ1TU1YQkeJYG4CsjRBOAi 9JRTzL6gIqLV293ahDTc3uXVfBMEXDhWJzzJiBIhqIxdf2bAK0l57+bPu7CHkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677102101; a=rsa-sha256; cv=none; b=ybP6aiFIufOjfem1QTDHxLi6DASyVTX6X0myXlwZnOtv3akfkuFCQAzbmX4CU8v/sRqUym /rgtHGS5Zt+jMlDTiRxfXwI6iX2Y3D8tS1ui6Np412cYsblSbysPkQ8YJfxbuN77wWMmdT XAsrM7jMmaRqZhBYkEYmYyIuRYjOL1wBP8ZData6sxlz77uYaep5akLavZLephqPk62KZC Jk6IXdYYqwhny6qjKZVrB9UaOiMzLtGA5Jx1nx9VUE3hHhUFH3q2tabAEtjzjdlAtnQeKX yeIz8Ba0RlpDd1+KwY1WtIcb2YApMAKW+XH/KZdZ1Ms4uRx80gp8sGYMqhFcWQ== Received: from [IPV6:2601:648:8680:16b0:a016:f345:edc0:be49] (unknown [IPv6:2601:648:8680:16b0:a016:f345:edc0:be49]) (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 4PMV3T0YWhz184F; Wed, 22 Feb 2023 21:41:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Wed, 22 Feb 2023 13:41:39 -0800 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: git: 29c5f8bf9a01 - main - config: drop dependency on libnv Content-Language: en-US To: Kyle Evans , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202302080610.3186AOCE091192@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202302080610.3186AOCE091192@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 2/7/23 10:10 PM, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=29c5f8bf9a011d92462977bae59b4889ec5d95ad > > commit 29c5f8bf9a011d92462977bae59b4889ec5d95ad > Author: Kyle Evans > AuthorDate: 2023-02-08 06:02:56 +0000 > Commit: Kyle Evans > CommitDate: 2023-02-08 06:09:19 +0000 > > config: drop dependency on libnv > > Compile mkmakefile.c as C++ instead and use an std::unordered_map to > accomplish the same goal. > > Reviewed by: imp > Sponsored by: Klara, Inc. > Sponsored by: NetApp, Inc. > Differential Revision: https://reviews.freebsd.org/D38275 I'm not quite sure how to fix it, but I believe this change is what has broken the clang-12 cross-build jobs on GitHub's actions. The error is a mismatch in the declarations of getopt() as the Linux one adds a 'throw ()' specifier. Note that clang-13 on the newer Ubuntu 22.04 builds file. I haven't tried examining the includes on 22.04 to see what has changed to avoid the error there. Here is the error from a recent run: In file included from /usr/include/x86_64-linux-gnu/bits/getopt_posix.h:27, 14356 from /usr/include/unistd.h:869, 14357 from /home/runner/work/freebsd-src/freebsd-src/tools/build/cross-build/include/linux/unistd.h:53, 14358 from /home/runner/work/freebsd-src/freebsd-src/tools/build/cross-build/include/common/unistd.h:39, 14359 from /home/runner/work/freebsd-src/freebsd-src/usr.sbin/config/main.cc:61: 14360 /usr/include/x86_64-linux-gnu/bits/getopt_core.h:91:12: error: declaration of ‘int getopt(int, char* const*, const char*) throw ()’ has a different exception specifier 14361 91 | extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) 14362 | ^~~~~~ 14363 In file included from /home/runner/work/freebsd-src/freebsd-src/tools/build/cross-build/include/linux/unistd.h:52, 14364 from /home/runner/work/freebsd-src/freebsd-src/tools/build/cross-build/include/common/unistd.h:39, 14365 from /home/runner/work/freebsd-src/freebsd-src/usr.sbin/config/main.cc:61: 14366 /home/runner/work/freebsd-src/build/home/runner/work/freebsd-src/freebsd-src/amd64.amd64/tmp/legacy/usr/include/getopt.h:69:6: note: from previous declaration ‘int getopt(int, char* const*, const char*)’ 14367 69 | int getopt(int, char * const [], const char *); 14368 | ^~~~~~ (FWIW, one odd thing here that I can't figure out yet is that it appears that our local getopt.h was #included prior to the unistd.h wrapper which I think is probably the root issue, may just need to wrap some other header?) -- John Baldwin From nobody Wed Feb 22 22:10:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMVhb4ZSBz3sH2h; Wed, 22 Feb 2023 22:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMVhb45cnz3kt6; Wed, 22 Feb 2023 22:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677103823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eOmFlQ7peqyNYfJtpXY2gvgB4j3X9aqJFB1bZ0t+m80=; b=LjfFSM/IbFv6QZqQtE0d0Yi/WSYDq2GZxiCGOo4xZaNERN0HClQ/rGALjFIh0QvNMkuxSz F81K/Ey+wm7NEhyXQGliMG/Ev+odXyvOmChlB58UHiHMHpC0OeoGlupHLZudfMUbWr8b9T qlD6njwpteO7N7m/Db1YDH+rR++4gTukI/1D0Go1uJy/TfMwlODkFPX9ehCQ5mydQR6You kNdq8I9nzozt6LWyX0VPU4NLf+swEVnKZ06NUqbiAsnJ61LhaemF3GXiMkO6ve59aaEo7/ eEX2ysm/kuK/L5Eiqhy4Djm5XAMCjLbu1PPRUf+PpoxX05g72A46Faplh9kyIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677103823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eOmFlQ7peqyNYfJtpXY2gvgB4j3X9aqJFB1bZ0t+m80=; b=Rj/he8I5EzWAU6zZcye+K4o3iquCFnJks2Fg/rKk0o052W/89Se4a6B5wOYirx9AXeBMnl xAALi07nA96AneMLvEUxabhdMNxwscCUzkcMUyEZ31WWvxA61ScwDYA9uxF0P1gtrZ/l6/ AKk+jZW8jrE3idXlLfeoAcy8WxkHw6kIJWmdL5pbIfIGNpipyI1p7fltKYDdQanV4l7z8P 4WsOTZOTqlKQpoBpXsSK5OdOx4PhChw607NImH8moUJvZPtpetvbpeZdHOAgBHwMWg7FpE 4iAjjwyEdg1waFvIpSISlNSCqxNhXRklaUPBRFEJ6MU5dP58WDEjkmvVJME/9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677103823; a=rsa-sha256; cv=none; b=Pld1YEIZRuFXwTAPK98y3a1E9hv6On5/cPuHmmbbilkH0pMIz6G2imkNUfla9UYMFeAOfo rcH4LL2FncUA7XyvkjSLr+ptQSmjwD0UbuHeVOiLExIweQlA7Lkxx9DTdqcHX/8sccOMtg gBQLo8fZHsQUnlp9Si6SdyrldT6fJgEoR5py6exfZhEeFEInntE4nVEEjAAb+dDYUppCbs lEZ2vdI541JzWqGZFfw2oeiMGcgKKt2U+pKgBoKLClGEm+2N+uvuNOhH9cKgT04dSXFgZq BxU2oFJ+d8bhdkYTfE9j+Nv7bUekVwvMQKsk0zQN2KvSwi5edegGf8bqpH0ueA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMVhb32QwzJ2V; Wed, 22 Feb 2023 22:10: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 31MMANCW081920; Wed, 22 Feb 2023 22:10:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31MMANLQ081919; Wed, 22 Feb 2023 22:10:23 GMT (envelope-from git) Date: Wed, 22 Feb 2023 22:10:23 GMT Message-Id: <202302222210.31MMANLQ081919@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: fe5c211ba873 - main - nfsd.c: Log a more meaningful failure message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe5c211ba87315b098769a7e6d50b41f00f6fed4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=fe5c211ba87315b098769a7e6d50b41f00f6fed4 commit fe5c211ba87315b098769a7e6d50b41f00f6fed4 Author: Rick Macklem AuthorDate: 2023-02-22 22:09:15 +0000 Commit: Rick Macklem CommitDate: 2023-02-22 22:09:15 +0000 nfsd.c: Log a more meaningful failure message For the cases where the nfsd(8) daemon is already running or has failed to start within a prison due to an incorrect prison configuration, the failure message logged is: Can't read stable storage file: operation not permitted This patch replaces the above with more meaningful messages. It depends on commit 10dff9da9748 to differentiate between the above two cases, however even without this commit, the messages should be an improvement. MFC after: 3 months --- usr.sbin/nfsd/nfsd.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c index 0222d23f2312..3a7f58c7b4e5 100644 --- a/usr.sbin/nfsd/nfsd.c +++ b/usr.sbin/nfsd/nfsd.c @@ -170,8 +170,8 @@ main(int argc, char **argv) int udpflag, ecode, error, s; int bindhostc, bindanyflag, rpcbreg, rpcbregcnt; int nfssvc_addsock; - int longindex = 0; - size_t nfs_minvers_size; + int jailed, longindex = 0; + size_t jailed_size, nfs_minvers_size; const char *lopt; char **bindhost = NULL; pid_t pid; @@ -465,7 +465,21 @@ main(int argc, char **argv) /* This system call will fail for old kernels, but that's ok. */ nfssvc(NFSSVC_BACKUPSTABLE, NULL); if (nfssvc(NFSSVC_STABLERESTART, (caddr_t)&stablefd) < 0) { - syslog(LOG_ERR, "Can't read stable storage file: %m\n"); + if (errno == EPERM) { + jailed = 0; + jailed_size = sizeof(jailed); + sysctlbyname("security.jail.jailed", &jailed, + &jailed_size, NULL, 0); + if (jailed != 0) + syslog(LOG_ERR, "nfssvc stablerestart failed: " + "allow.nfsd might not be configured"); + else + syslog(LOG_ERR, "nfssvc stablerestart failed"); + } else if (errno == ENXIO) + syslog(LOG_ERR, "nfssvc stablerestart failed: is nfsd " + "already running?"); + else + syslog(LOG_ERR, "Can't read stable storage file: %m\n"); exit(1); } nfssvc_addsock = NFSSVC_NFSDADDSOCK; From nobody Wed Feb 22 23:25:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMXM02rYPz3sbjh; Wed, 22 Feb 2023 23:25:16 +0000 (UTC) (envelope-from kevans@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 4PMXM02DDKz3s1t; Wed, 22 Feb 2023 23:25:16 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677108316; 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=Ry5A5QPIsUfxVzgA/GCERv3B2ozWnz1kc1sCwGYXnP8=; b=mRyC+1YRl1lhZGvslLc4RHn6BaRJhZXD8fp24JtVPbEcNoG9qymMC9CLQEB3fJI/VbIwmS o2WccCWWlH8OdE7Csh7tD70nGu7tVrlm+XDgO3QCsYFzi6+S8FNgjwPv7lDj+OAONRV7Vs djd1PU+Ft3DLiFM5To/+VYRDyW2K4ZWs5iMUHrru/5miVuZyly4gZdeFTsN+lSsYIVaMzX KoixeztQsARBX34LkcWHiIf1BtVkuqnvtHAxWTpqu1LkXejUVpGnFzqE0OqTVJWs+9ienH ULz3Tp1wMM/C9uZKfzZThsLbbTFBFTjLqcmEgkstWcZMdXLzHYeJeYp+MrBcjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677108316; 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=Ry5A5QPIsUfxVzgA/GCERv3B2ozWnz1kc1sCwGYXnP8=; b=cdTgtzI009WMgSW7fi0n7TZpVxfmtJICY+sJlIHl+yE29c/TWiGaHqojJpuv7ZSvpSasPt vd2ZC18jSBYj8abLDvQlJ+WOaqj3uInBeXmEeqDzbxd6WqyuR3vbUptGzXTILNax0ol4K/ KJUQ1Ai7Rb76/2NBdpqwbB3HaoyXeU6Vg8amuRLmwa8CkWqJ2EuEF3H55XIlPlLCvgSkX3 6qO4WIYGdWfBP4GTEw6JvSakQi18saPFobOcRcnlprZQZ6zXqh+WNuoz7Tj9gtf2jlylFi cVbZAGkmp1v7ZeX8vqEhH4kb4dS9WszlozCUDI9Se/mcOTn52x74A3Yi0b4u/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677108316; a=rsa-sha256; cv=none; b=eadhh9tttIQ9hAFmBefWedJk4VuPf8lvWKHv/h8zw68i1SK8KZuXNSWK7+a8XlFhy3HQxV OmevffMU3XD1QNR8AH+gRd9OriKP+0kj3briKwZ+WzPk9wDBXb0cZZcCZnuFQjNfMzQWr3 lSvaf6pZ/DCBD9ABNO3FjOt7oqYbt1bWyw/5yIeji9AWUpNssV8IQU5XE5dcokXrDsG3na HlhDqa/8HNSlrQkjFV/T9Yf0NgymkBwP5clWFB+A3HzXhMpw/j8ibacfMPoj9L/x8eM3nW YatbuJ7PEeTfnZQVjs1kCRJzfrqxWbXAY/7wHsLMA5mrHnJnck+GJg2FOfsE2w== Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PMXM014LNz1C20; Wed, 22 Feb 2023 23:25:16 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f177.google.com with SMTP id d5so9158088qtn.13; Wed, 22 Feb 2023 15:25:16 -0800 (PST) X-Gm-Message-State: AO0yUKWOUu3UVLuEF0BLHbuRrpiJsNAI9a57tYvOLAVU746JsBa69o10 qPoH0UpaQn9Zu3IEYmrsakPJ3S1rAWIHzcRfW8E= X-Google-Smtp-Source: AK7set966P7wg9QGHvUT3s957aZTbzZ1TPbVBJADdAc/BRRwa82f8fGJ/ffTlrcFen4RXq3zQATPAQrPhFecoQ96mSU= X-Received: by 2002:ac8:40c8:0:b0:3b8:5484:d3eb with SMTP id f8-20020ac840c8000000b003b85484d3ebmr1392701qtm.1.1677108315480; Wed, 22 Feb 2023 15:25:15 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302080610.3186AOCE091192@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 22 Feb 2023 17:25:08 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 29c5f8bf9a01 - main - config: drop dependency on libnv 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-ThisMailContainsUnwantedMimeParts: N On Wed, Feb 22, 2023 at 3:41 PM John Baldwin wrote: > > On 2/7/23 10:10 PM, Kyle Evans wrote: > > The branch main has been updated by kevans: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=29c5f8bf9a011d92462977bae59b4889ec5d95ad > > > > commit 29c5f8bf9a011d92462977bae59b4889ec5d95ad > > Author: Kyle Evans > > AuthorDate: 2023-02-08 06:02:56 +0000 > > Commit: Kyle Evans > > CommitDate: 2023-02-08 06:09:19 +0000 > > > > config: drop dependency on libnv > > > > Compile mkmakefile.c as C++ instead and use an std::unordered_map to > > accomplish the same goal. > > > > Reviewed by: imp > > Sponsored by: Klara, Inc. > > Sponsored by: NetApp, Inc. > > Differential Revision: https://reviews.freebsd.org/D38275 > > I'm not quite sure how to fix it, but I believe this change is what has broken > the clang-12 cross-build jobs on GitHub's actions. The error is a mismatch > in the declarations of getopt() as the Linux one adds a 'throw ()' specifier. > > Note that clang-13 on the newer Ubuntu 22.04 builds file. I haven't tried > examining the includes on 22.04 to see what has changed to avoid the error > there. > > [... snip ...] > > (FWIW, one odd thing here that I can't figure out yet is that it appears that > our local getopt.h was #included prior to the unistd.h wrapper which I think > is probably the root issue, may just need to wrap some other header?) > Yeah, this was pointed out to me a couple days ago. =( I looked at the include situation and couldn't make heads or tails of what was going on. jrtc27@ looked at it a bit and found some oddities in -I ordering. I don't think we've ended up at a solution to this problem quite yet. Thanks, Kyle Evans From nobody Thu Feb 23 00:23:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMYf04pljz3sfdk; Thu, 23 Feb 2023 00:23: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 4PMYf04Jmdz3ww2; Thu, 23 Feb 2023 00:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677111800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dzcf66wgy6zIR0tIOdQRZBEC6VXvSBOI+RxfXEnYSz4=; b=GlpTiD+7a4h7GsKOPMp4nsFYeDydCuLcpJmC++n3z6rgNuiYM1w/9RTSVttKs2o1G3WyuC 0JFicviBZKgUaSYKBz8RPDukB4fc6dut+XIrZWyhbp61/kIbOY2LURZMibNmIp9MY+QoZ6 vBSq2H4b7ZyuBXy4PrcB/EvuK8Io5O9pRqVjytW/VasuEj36FRc+sl7wHjpmeYqVYgWegG sEahre8he07eWiE7ftsFmDvhB/pXf1OOy/qpSg+rHoRP70Ss9GMA0fibL6ubGygb4wHYuf z3XsvA3cdkp9wkebXBti6UMizJd5cVFWMvCKble0S82caeOp+BaWchLnK4PJ8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677111800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dzcf66wgy6zIR0tIOdQRZBEC6VXvSBOI+RxfXEnYSz4=; b=WCsa/VXZG+D3QsBP136b0pWZKSCWl7YJO+4+TybXKsA5CXtZ7uoYtvipBLj+FWAByN3j2z 9PUqHte7JPmChu8RNb7blVp3ASv1mYlKRdharLtZrs2cFDJrZAp1On6J4JbKQrQiFuVpT0 CKOf5EopZ7nUF/ACfSAUsahxMW4F80RB+Csfp3xSJJkm6ftvvPuKnxbrmqGZ8yLZWJ4Pzq YrvW36IxBW8e9YYDbwCd5bVFj8kObRJNn1ttoaj8DMxULQRM8cQjT22IOdO0O1f5nhDqgU PVMEoyNvdgvtL76I45vMDfz+O2apTSx/BLUSUy8AqFru57rQxDcG1M5+zjuIdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677111800; a=rsa-sha256; cv=none; b=gm6bqg84XMnZkFf47YDxEKpfBKW1DNqMEth0wYVqKSFRdNIMV/9dob9lQz54/F7j9o+yHa GvUxWRD4bkfEiI40DSzbyMMqGwQGf45nE8eV7tkAolQWw9aC32zulOUjgUHymr1Us6VVgL J1u4udSZeOh0iYCEtCz95E/PKMVFbiN0kuvhsYFJi9sspP0NQx0nAM4+JRKgDULU8uZodV Wavvre2CNz/S69yHxctv19dRuvqYe2kqHzarzxA4Uyu2nUBNRAJwGFCa/uvryYLuuk4/RC 2IOCnPHdgipKXJXt1rHyA39yfx/a3u7QuUpP5cIL3SnN8UqCcx8hNyNxU0Dovg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMYf03MNbzMWQ; Thu, 23 Feb 2023 00:23: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 31N0NKWs071346; Thu, 23 Feb 2023 00:23:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N0NK7i071345; Thu, 23 Feb 2023 00:23:20 GMT (envelope-from git) Date: Thu, 23 Feb 2023 00:23:20 GMT Message-Id: <202302230023.31N0NK7i071345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 5e8a9a8193f9 - stable/13 - e1000: Remove redundant disable_ulp for ich8lan List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5e8a9a8193f99bb0266f45546f1dbb6349c797db Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=5e8a9a8193f99bb0266f45546f1dbb6349c797db commit 5e8a9a8193f99bb0266f45546f1dbb6349c797db Author: Kevin Bowling AuthorDate: 2023-02-08 23:17:03 +0000 Commit: Kevin Bowling CommitDate: 2023-02-23 00:23:06 +0000 e1000: Remove redundant disable_ulp for ich8lan This call only makes sense for ich8lan, and the shared code does it in e1000_setup_init_funcs() above this deletion. Obtained from: DPDK Sponsored by: BBOX.io Pull Request: https://github.com/freebsd/freebsd-src/pull/539 (cherry picked from commit d36fbdb08ff567393a698aaf16f726275901ec96) --- sys/dev/e1000/e1000_ich8lan.c | 10 +++++----- sys/dev/e1000/if_em.c | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 3f3e2307f83f..9c640e7b9667 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -72,6 +72,7 @@ #include "e1000_api.h" +static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state); static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw); static void e1000_release_swflag_ich8lan(struct e1000_hw *hw); static s32 e1000_acquire_nvm_ich8lan(struct e1000_hw *hw); @@ -330,7 +331,9 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) * so forcibly disable it. */ hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_unknown; - e1000_disable_ulp_lpt_lp(hw, TRUE); + ret_val = e1000_disable_ulp_lpt_lp(hw, true); + if (ret_val) + ERROR_REPORT("Failed to disable ULP\n"); ret_val = hw->phy.ops.acquire(hw); if (ret_val) { @@ -1290,14 +1293,12 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) if (!to_sx) { int i = 0; - /* Poll up to 5 seconds for Cable Disconnected indication */ while (!(E1000_READ_REG(hw, E1000_FEXT) & E1000_FEXT_PHY_CABLE_DISCONNECTED)) { /* Bail if link is re-acquired */ if (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU) return -E1000_ERR_PHY; - if (i++ == 100) break; @@ -1310,7 +1311,6 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) if (!(E1000_READ_REG(hw, E1000_FEXT) & E1000_FEXT_PHY_CABLE_DISCONNECTED)) return 0; - } ret_val = hw->phy.ops.acquire(hw); @@ -4318,7 +4318,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) (u8)(data >> 8)); if (ret_val) break; - } + } /* Don't bother writing the segment valid bits if sector * programming failed. diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 408b76c6876f..25f0c533094a 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1105,9 +1105,6 @@ em_if_attach_pre(if_ctx_t ctx) em_print_fw_version(sc); - /* Disable ULP support */ - e1000_disable_ulp_lpt_lp(hw, true); - /* * Get Wake-on-Lan and Management info for later use */ From nobody Thu Feb 23 00:24:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMYfn4097z3sfkQ; Thu, 23 Feb 2023 00:24: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 4PMYfn3RWmz3x7y; Thu, 23 Feb 2023 00:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677111841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aYo/wpeIOLgCGcAE/P5bO3E+8eF6gCDd8oYexdZu3ZE=; b=t4yN7Lnm/LHKujl7t3YpjlTjk8RkTEcwFkWm7dKR1DnuX6a0chknKpWhx97U1dJwkG+9Ue oWB0H278goyqVqDHo2OKW0IOX6/WIZOeeHo2L9JzDMG71p6lOo7eZE/GkgT5Dcseh4H/+a VC8BKzZG/UwSBHxg9jRUF3tJJpcDfCp/bLWPZoaDBKGBNf4thcYef43HuaPkaBSyJ3QyIf 7DhGRYvlNqPEPsIugNEYJcddcapweWzULKRw2yQvxNAEHM40GNrgkCfKNIlaDfcnBUvPv/ 4fFC4nCmr4ocHZRsCKNtJ7MHrBOBSbiKwTJAKHt0OO9qA0XKvkjiOyM9swRhow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677111841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aYo/wpeIOLgCGcAE/P5bO3E+8eF6gCDd8oYexdZu3ZE=; b=VC4z7VC+sRTUE62m5AKEH7ygKR+PGgOC9nHnzWAj+0HFA4IWEjG9cwiRZZ+86iQH/RlpU1 0wld6s44WI7/EqAtQvFQHtJwT6LO+5eXKZZ2iR+oed3e/d7mFwwimwjZiqQcWT06IORW+m oVLGNp/Arg/fdiA1BJT5jBq8tLqYHaCjJYiSrStlgBUTE3zdC23pjKXI4NZ9KQ2PDRo9rh A5z9hwarhI86pIl0HJW75EMh63AhOAqY8JWZRol5NAH3Fz8USusBMwiSgiyCF34yWaasYh OPhppX0YPu/uzz8Q0R4nt5wVZTWftmsdvIFhmF9wNdvegmSsrVFWa7VRUzXqfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677111841; a=rsa-sha256; cv=none; b=gzOnh1ew+znQxSaoHNYIdRg1SjbTTSXezAzUEARNvGyyApwvK2A2UxLLz1D8pHe8W3MRfn 44i3YdRRoT5h1i/Dlhw8a+4KzXVZe6PbyIvJ6qsi2sBEjqoFriY4u4mrmCeRGr68AlskVJ uNQLHlUuqoaFl4QLnJjvQbdsfeSagEo+v/ITSoNy6kfObqntUQM4Rofm3+sjFscv6LeiNB UuNLWq1beJoMnJxMCoqAP4Yv83lJeXp6D3hRk/LEZxZUVbW+n+7jIH/heNKECuHhYVSdxJ 7pwST6WQrW0BiqlkVUV6cEqf+UA1LThpVietSxQ97wy8W9XkHVO9iheBZ8XfXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMYfn2VwdzM8b; Thu, 23 Feb 2023 00:24: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 31N0O1EK071527; Thu, 23 Feb 2023 00:24:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N0O1S8071526; Thu, 23 Feb 2023 00:24:01 GMT (envelope-from git) Date: Thu, 23 Feb 2023 00:24:01 GMT Message-Id: <202302230024.31N0O1S8071526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 15d2f480b604 - stable/12 - e1000: Remove redundant disable_ulp for ich8lan List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 15d2f480b604b4e2b7ca2cf51c7244d4ffa148e3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=15d2f480b604b4e2b7ca2cf51c7244d4ffa148e3 commit 15d2f480b604b4e2b7ca2cf51c7244d4ffa148e3 Author: Kevin Bowling AuthorDate: 2023-02-08 23:17:03 +0000 Commit: Kevin Bowling CommitDate: 2023-02-23 00:23:46 +0000 e1000: Remove redundant disable_ulp for ich8lan This call only makes sense for ich8lan, and the shared code does it in e1000_setup_init_funcs() above this deletion. Obtained from: DPDK Sponsored by: BBOX.io Pull Request: https://github.com/freebsd/freebsd-src/pull/539 (cherry picked from commit d36fbdb08ff567393a698aaf16f726275901ec96) --- sys/dev/e1000/e1000_ich8lan.c | 10 +++++----- sys/dev/e1000/if_em.c | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 4dec3e22c3a9..b7c30555b55c 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -72,6 +72,7 @@ #include "e1000_api.h" +static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state); static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw); static void e1000_release_swflag_ich8lan(struct e1000_hw *hw); static s32 e1000_acquire_nvm_ich8lan(struct e1000_hw *hw); @@ -330,7 +331,9 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) * so forcibly disable it. */ hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_unknown; - e1000_disable_ulp_lpt_lp(hw, TRUE); + ret_val = e1000_disable_ulp_lpt_lp(hw, true); + if (ret_val) + ERROR_REPORT("Failed to disable ULP\n"); ret_val = hw->phy.ops.acquire(hw); if (ret_val) { @@ -1290,14 +1293,12 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) if (!to_sx) { int i = 0; - /* Poll up to 5 seconds for Cable Disconnected indication */ while (!(E1000_READ_REG(hw, E1000_FEXT) & E1000_FEXT_PHY_CABLE_DISCONNECTED)) { /* Bail if link is re-acquired */ if (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU) return -E1000_ERR_PHY; - if (i++ == 100) break; @@ -1310,7 +1311,6 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) if (!(E1000_READ_REG(hw, E1000_FEXT) & E1000_FEXT_PHY_CABLE_DISCONNECTED)) return 0; - } ret_val = hw->phy.ops.acquire(hw); @@ -4318,7 +4318,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) (u8)(data >> 8)); if (ret_val) break; - } + } /* Don't bother writing the segment valid bits if sector * programming failed. diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 869ce4fb4cf4..c4a4f54cb80d 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1106,9 +1106,6 @@ em_if_attach_pre(if_ctx_t ctx) em_print_fw_version(sc); - /* Disable ULP support */ - e1000_disable_ulp_lpt_lp(hw, true); - /* * Get Wake-on-Lan and Management info for later use */ From nobody Thu Feb 23 00:26:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMYk807nzz3sgFg; Thu, 23 Feb 2023 00:26: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 4PMYk76g6Fz3xbd; Thu, 23 Feb 2023 00:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677112015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mg3ACBeHYRrktW9oghw2FrxmNcsjlhukCixWcw1WY28=; b=T02m+4z1bMnm3Dz/jMlptoknMmoJSs0qBQ1kchlhFZ26PESrMpzXWgQF0pWNS40UBiYFXH yzs4nGY8pTPDHO6hntW24zzcx+qihe//FGkvUegahJkMo3i/EGqwnIdaMteB1j8SsCXNJ7 0VoqAoPMYZx9/SqDCksQtgFPCesSK+H0dpZ68MG5lpFq7aHNOADWjTvh1pbiMzQf6qjDUw IrVYNyZ0NR/8Rg4bKHb51M6fFsPVY+KYi41RVz5C3ov+SQSEJfkWXaazbRq3JfDsQQRRqX dGrDDt+ucibku0UHr3M+ffl7lQcoP0Oveh7/tVR+SO66rBgshWyGgX0QHVCeXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677112015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mg3ACBeHYRrktW9oghw2FrxmNcsjlhukCixWcw1WY28=; b=vXlaF8+DWzZnDjVWyi9vuN+xmv2d94o83ZG7GUoe3VQJqJxPPQ8mWh5t3WCkNc34TnKyjM MZG3QTM5sEg9rfJ+wgYIpZd8XQU/ftoe/bkYJBZocXBe5I8TEYtkUxr5c2w+XsNCO62ilo UMae/TzgKozx2clW+3Ijn+ikRkpP1oP0Em3p+ZLM/OizxnvmpltnnkozvyXbNm9xUpp9ST +L9zUwAnUqDVJBdByLQ1io17X/wwBKOCYKuxId1nycDUU+J1TCrTedxlcS1PIc729mNr3r EendJ+ZJZVNMRbOEryvwJSefNexCMs8k7atflqf60EzKO5wPaSk5hgBFh8w46Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677112015; a=rsa-sha256; cv=none; b=Hj01kUEO0u74+KoxpUem/9PQxvHNmZmA5G8I0KQP1wchmP+q5Z51Yb9+wTzFlGwZJiatyn kci6p0tsRDjkKNIZ7vmjwiw6fheuoPnopuGiQqxicC1mJ1v2QPpfPLIEu3dwtew7Krip35 NxNHgZU0Fw8OndwqdtYARHZ+2Vk/AbndSjtJjCc7w5lC/foZj1vDZ4esfg0/FZ6NbRkris wihuy8erGxJuEHmb9v2ACaI9ZHd2WituBwa+LQ0RCzHTk2RD1FRI0R+DNrcgjKgwNcFUDW oRqZ1GQEx15wQVdvUllsbVQgYLe+2ozIpTSyPAjUk9yQFYtutixH9Is/SVAeFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMYk75gTGzMVB; Thu, 23 Feb 2023 00:26: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 31N0Qtcp071976; Thu, 23 Feb 2023 00:26:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N0QtPX071975; Thu, 23 Feb 2023 00:26:55 GMT (envelope-from git) Date: Thu, 23 Feb 2023 00:26:55 GMT Message-Id: <202302230026.31N0QtPX071975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 25b788e49782 - stable/13 - e1000: Add support for future client platforms List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25b788e4978255dad726ff3d264473ce01527f09 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=25b788e4978255dad726ff3d264473ce01527f09 commit 25b788e4978255dad726ff3d264473ce01527f09 Author: Kevin Bowling AuthorDate: 2023-02-09 01:14:41 +0000 Commit: Kevin Bowling CommitDate: 2023-02-23 00:26:05 +0000 e1000: Add support for future client platforms Sponsored by: BBOX.io (cherry picked from commit 905ae5881bdc1b9742e08d660d787204c08d6022) --- sys/dev/e1000/e1000_api.c | 11 +++++++++++ sys/dev/e1000/e1000_hw.h | 17 +++++++++++++++++ sys/dev/e1000/e1000_ich8lan.c | 7 +++++++ sys/dev/e1000/if_em.c | 19 +++++++++++++++++++ 4 files changed, 54 insertions(+) diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index 5c778a48bba0..19ba4f1cf377 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -347,6 +347,16 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_MTP_I219_V19: mac->type = e1000_pch_mtp; break; + case E1000_DEV_ID_PCH_ARL_I219_LM24: + case E1000_DEV_ID_PCH_ARL_I219_V24: + case E1000_DEV_ID_PCH_PTP_I219_LM25: + case E1000_DEV_ID_PCH_PTP_I219_V25: + case E1000_DEV_ID_PCH_PTP_I219_LM26: + case E1000_DEV_ID_PCH_PTP_I219_V26: + case E1000_DEV_ID_PCH_PTP_I219_LM27: + case E1000_DEV_ID_PCH_PTP_I219_V27: + mac->type = e1000_pch_ptp; + break; case E1000_DEV_ID_82575EB_COPPER: case E1000_DEV_ID_82575EB_FIBER_SERDES: case E1000_DEV_ID_82575GB_QUAD_COPPER: @@ -503,6 +513,7 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: e1000_init_function_pointers_ich8lan(hw); break; case e1000_82575: diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index 6ee252e147a4..463bd6bd8a5b 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -175,6 +175,22 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_MTP_I219_V18 0x550B #define E1000_DEV_ID_PCH_MTP_I219_LM19 0x550C #define E1000_DEV_ID_PCH_MTP_I219_V19 0x550D +#define E1000_DEV_ID_PCH_LNL_I219_LM20 0x550E +#define E1000_DEV_ID_PCH_LNL_I219_V20 0x550F +#define E1000_DEV_ID_PCH_LNL_I219_LM21 0x5510 +#define E1000_DEV_ID_PCH_LNL_I219_V21 0x5511 +#define E1000_DEV_ID_PCH_RPL_I219_LM22 0x0DC7 +#define E1000_DEV_ID_PCH_RPL_I219_V22 0x0DC8 +#define E1000_DEV_ID_PCH_RPL_I219_LM23 0x0DC5 +#define E1000_DEV_ID_PCH_RPL_I219_V23 0x0DC6 +#define E1000_DEV_ID_PCH_ARL_I219_LM24 0x57A0 +#define E1000_DEV_ID_PCH_ARL_I219_V24 0x57A1 +#define E1000_DEV_ID_PCH_PTP_I219_LM25 0x57B3 +#define E1000_DEV_ID_PCH_PTP_I219_V25 0x57B4 +#define E1000_DEV_ID_PCH_PTP_I219_LM26 0x57B5 +#define E1000_DEV_ID_PCH_PTP_I219_V26 0x57B6 +#define E1000_DEV_ID_PCH_PTP_I219_LM27 0x57B7 +#define E1000_DEV_ID_PCH_PTP_I219_V27 0x57B8 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -266,6 +282,7 @@ enum e1000_mac_type { e1000_pch_tgp, e1000_pch_adp, e1000_pch_mtp, + e1000_pch_ptp, e1000_82575, e1000_82576, e1000_82580, diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 9c640e7b9667..f74ef5f9c7b3 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -352,6 +352,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: if (e1000_phy_is_accessible_pchlan(hw)) break; @@ -504,6 +505,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: /* In case the PHY needs to be in mdio slow mode, * set slow mode and try to get the PHY id again. */ @@ -806,6 +808,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: /* multicast address update for pch2 */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_pch2lan; @@ -1851,6 +1854,7 @@ void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: hw->phy.ops.init_params = e1000_init_phy_params_pchlan; break; default: @@ -2310,6 +2314,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; break; default: @@ -3435,6 +3440,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: bank1_offset = nvm->flash_bank_size; act_offset = E1000_ICH_NVM_SIG_WORD; @@ -4409,6 +4415,7 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: word = NVM_COMPAT; valid_csum_mask = NVM_COMPAT_VALID_CSUM; break; diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 25f0c533094a..527789622169 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -195,6 +195,22 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V18, "Intel(R) I219-V MTP(18)"), PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_LM19, "Intel(R) I219-LM MTP(19)"), PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V19, "Intel(R) I219-V MTP(19)"), + PVID(0x8086, E1000_DEV_ID_PCH_LNL_I219_LM20, "Intel(R) I219-LM LNL(20)"), + PVID(0x8086, E1000_DEV_ID_PCH_LNL_I219_V20, "Intel(R) I219-V LNL(20)"), + PVID(0x8086, E1000_DEV_ID_PCH_LNL_I219_LM21, "Intel(R) I219-LM LNL(21)"), + PVID(0x8086, E1000_DEV_ID_PCH_LNL_I219_V21, "Intel(R) I219-V LNL(21)"), + PVID(0x8086, E1000_DEV_ID_PCH_RPL_I219_LM22, "Intel(R) I219-LM RPL(22)"), + PVID(0x8086, E1000_DEV_ID_PCH_RPL_I219_V22, "Intel(R) I219-V RPL(22)"), + PVID(0x8086, E1000_DEV_ID_PCH_RPL_I219_LM23, "Intel(R) I219-LM RPL(23)"), + PVID(0x8086, E1000_DEV_ID_PCH_RPL_I219_V23, "Intel(R) I219-V RPL(23)"), + PVID(0x8086, E1000_DEV_ID_PCH_ARL_I219_LM24, "Intel(R) I219-LM ARL(24)"), + PVID(0x8086, E1000_DEV_ID_PCH_ARL_I219_V24, "Intel(R) I219-V ARL(24)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_LM25, "Intel(R) I219-LM PTP(25)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_V25, "Intel(R) I219-V PTP(25)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_LM26, "Intel(R) I219-LM PTP(26)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_V26, "Intel(R) I219-V PTP(26)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_LM27, "Intel(R) I219-LM PTP(27)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_V27, "Intel(R) I219-V PTP(27)"), /* required last entry */ PVID_END }; @@ -1250,6 +1266,7 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: case e1000_82574: case e1000_82583: case e1000_80003es2lan: @@ -2649,6 +2666,7 @@ em_reset(if_ctx_t ctx) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: pba = E1000_PBA_26K; break; case e1000_82575: @@ -2762,6 +2780,7 @@ em_reset(if_ctx_t ctx) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: hw->fc.high_water = 0x5C20; hw->fc.low_water = 0x5048; hw->fc.pause_time = 0x0650; From nobody Thu Feb 23 00:29:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMYmZ33k5z3sgLh; Thu, 23 Feb 2023 00:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMYmZ2KSJz3xd9; Thu, 23 Feb 2023 00:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677112142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ky1iewNtHRFc/sA3GkZP+S0Ji5ZUdpVmOUxnzRtmKCI=; b=KfI6mlIvi1ptfRMz6Kll44Zg+WlrykcmLfvvAvGMHsJHIMJFhETz7HUFKgUiI9gROxd/Ho 1RDbYlRu7T/bJIZRT+g0p7fTV2cLgBYEsGZlLqjZswRuSyhA26NZ1fd+8iZur5VlqutTHU +Ku0pmbZHCvOQ28g8I4XgTpAkFl+hfhQKJVGmak2oDhyG9LKqEGhLpgmCKulh4jMZw8g6H 6IP3hAimtbJ8JtAINYOdeivJ/1uRocbyOENQewOT+isE6fKYuFgvYGJky7Uemir8YP7Gxp cnWOL+a75a+9VR1i67ys0O9LzAQqrsLkhBe6UnCbuvqj9SWadQACyYrz4DxSdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677112142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ky1iewNtHRFc/sA3GkZP+S0Ji5ZUdpVmOUxnzRtmKCI=; b=Nwh3biRlI3dmRHCyzBFOKGtwFPRThhRP5I70MhSkUtnfn16ryvwaooc+yOILQx1SRYVNmU 947BOeKcanItxMxi3APIuFFA5XnDGsedOfzygHHezP9ThD6QHCYgpqikgSyskTcXVdVRL9 x7Dsiy0Mb2D5FobkfP6vf2KUYq2CfBNMz4uCp9AyhKFWeRy+tT1pvsoXOuoF815f4nUgpp GCKQPlHNqfXXSv1P4eH6Z1wxP1T/QHzHPZwDNN5Bd3wjFVnF7MuRmIzJZrGJtEBrcNHtHr Kh1oK35UZJXO+LIVI+D1WeR6PhRAyMtC3zIVHOxPl0UpiG60QL5yclrdRfffZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677112142; a=rsa-sha256; cv=none; b=AqonGqncJLcU0BVKCXqd4+L3QSS0jsY4opH8REf7fT1zRb7gwPIdWWn439+nc7SgIYQYgt 1rxCoAeegPGccG1jAzV9gdUfjCtmTF5BlrsH3AuO1d1PQjXEk6ZJlNaKPcL55uooGoTZfb yzKu8teOK4LIDVXhKOxkyiqrDl20tApFwmm7w/50uSYZqioC9d0iKUQ0Lfpyj+D5rK+/5i NSQJnuFWvg3+kZzUXK+F4nzHf3mi4LV84iXytRNs6MsMGHDSWn19xL1AcRu3Gsz8buHOs5 8y7ecFQuh5uw46aCmnLHdJ7s4f1UDb/l3rvx6voFsrVF8bQvdln+CaTHWnqing== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMYmZ1QjvzLtw; Thu, 23 Feb 2023 00:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31N0T2YM072325; Thu, 23 Feb 2023 00:29:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N0T2ex072324; Thu, 23 Feb 2023 00:29:02 GMT (envelope-from git) Date: Thu, 23 Feb 2023 00:29:02 GMT Message-Id: <202302230029.31N0T2ex072324@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 0aacd7084394 - stable/12 - e1000: Add support for future client platforms List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0aacd70843949f793a8cc9cbba76472137644032 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=0aacd70843949f793a8cc9cbba76472137644032 commit 0aacd70843949f793a8cc9cbba76472137644032 Author: Kevin Bowling AuthorDate: 2023-02-09 01:14:41 +0000 Commit: Kevin Bowling CommitDate: 2023-02-23 00:28:49 +0000 e1000: Add support for future client platforms Sponsored by: BBOX.io (cherry picked from commit 905ae5881bdc1b9742e08d660d787204c08d6022) --- sys/dev/e1000/e1000_api.c | 11 +++++++++++ sys/dev/e1000/e1000_hw.h | 17 +++++++++++++++++ sys/dev/e1000/e1000_ich8lan.c | 7 +++++++ sys/dev/e1000/if_em.c | 19 +++++++++++++++++++ 4 files changed, 54 insertions(+) diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index 5c778a48bba0..19ba4f1cf377 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -347,6 +347,16 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_MTP_I219_V19: mac->type = e1000_pch_mtp; break; + case E1000_DEV_ID_PCH_ARL_I219_LM24: + case E1000_DEV_ID_PCH_ARL_I219_V24: + case E1000_DEV_ID_PCH_PTP_I219_LM25: + case E1000_DEV_ID_PCH_PTP_I219_V25: + case E1000_DEV_ID_PCH_PTP_I219_LM26: + case E1000_DEV_ID_PCH_PTP_I219_V26: + case E1000_DEV_ID_PCH_PTP_I219_LM27: + case E1000_DEV_ID_PCH_PTP_I219_V27: + mac->type = e1000_pch_ptp; + break; case E1000_DEV_ID_82575EB_COPPER: case E1000_DEV_ID_82575EB_FIBER_SERDES: case E1000_DEV_ID_82575GB_QUAD_COPPER: @@ -503,6 +513,7 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: e1000_init_function_pointers_ich8lan(hw); break; case e1000_82575: diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index dc46c590d7c0..2baf6b99a33c 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -175,6 +175,22 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_MTP_I219_V18 0x550B #define E1000_DEV_ID_PCH_MTP_I219_LM19 0x550C #define E1000_DEV_ID_PCH_MTP_I219_V19 0x550D +#define E1000_DEV_ID_PCH_LNL_I219_LM20 0x550E +#define E1000_DEV_ID_PCH_LNL_I219_V20 0x550F +#define E1000_DEV_ID_PCH_LNL_I219_LM21 0x5510 +#define E1000_DEV_ID_PCH_LNL_I219_V21 0x5511 +#define E1000_DEV_ID_PCH_RPL_I219_LM22 0x0DC7 +#define E1000_DEV_ID_PCH_RPL_I219_V22 0x0DC8 +#define E1000_DEV_ID_PCH_RPL_I219_LM23 0x0DC5 +#define E1000_DEV_ID_PCH_RPL_I219_V23 0x0DC6 +#define E1000_DEV_ID_PCH_ARL_I219_LM24 0x57A0 +#define E1000_DEV_ID_PCH_ARL_I219_V24 0x57A1 +#define E1000_DEV_ID_PCH_PTP_I219_LM25 0x57B3 +#define E1000_DEV_ID_PCH_PTP_I219_V25 0x57B4 +#define E1000_DEV_ID_PCH_PTP_I219_LM26 0x57B5 +#define E1000_DEV_ID_PCH_PTP_I219_V26 0x57B6 +#define E1000_DEV_ID_PCH_PTP_I219_LM27 0x57B7 +#define E1000_DEV_ID_PCH_PTP_I219_V27 0x57B8 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -266,6 +282,7 @@ enum e1000_mac_type { e1000_pch_tgp, e1000_pch_adp, e1000_pch_mtp, + e1000_pch_ptp, e1000_82575, e1000_82576, e1000_82580, diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index b7c30555b55c..7d079ee5d1b3 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -352,6 +352,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: if (e1000_phy_is_accessible_pchlan(hw)) break; @@ -504,6 +505,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: /* In case the PHY needs to be in mdio slow mode, * set slow mode and try to get the PHY id again. */ @@ -806,6 +808,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: /* multicast address update for pch2 */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_pch2lan; @@ -1851,6 +1854,7 @@ void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: hw->phy.ops.init_params = e1000_init_phy_params_pchlan; break; default: @@ -2310,6 +2314,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; break; default: @@ -3435,6 +3440,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: bank1_offset = nvm->flash_bank_size; act_offset = E1000_ICH_NVM_SIG_WORD; @@ -4409,6 +4415,7 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: word = NVM_COMPAT; valid_csum_mask = NVM_COMPAT_VALID_CSUM; break; diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index c4a4f54cb80d..8a489c48bf85 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -195,6 +195,22 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V18, "Intel(R) I219-V MTP(18)"), PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_LM19, "Intel(R) I219-LM MTP(19)"), PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V19, "Intel(R) I219-V MTP(19)"), + PVID(0x8086, E1000_DEV_ID_PCH_LNL_I219_LM20, "Intel(R) I219-LM LNL(20)"), + PVID(0x8086, E1000_DEV_ID_PCH_LNL_I219_V20, "Intel(R) I219-V LNL(20)"), + PVID(0x8086, E1000_DEV_ID_PCH_LNL_I219_LM21, "Intel(R) I219-LM LNL(21)"), + PVID(0x8086, E1000_DEV_ID_PCH_LNL_I219_V21, "Intel(R) I219-V LNL(21)"), + PVID(0x8086, E1000_DEV_ID_PCH_RPL_I219_LM22, "Intel(R) I219-LM RPL(22)"), + PVID(0x8086, E1000_DEV_ID_PCH_RPL_I219_V22, "Intel(R) I219-V RPL(22)"), + PVID(0x8086, E1000_DEV_ID_PCH_RPL_I219_LM23, "Intel(R) I219-LM RPL(23)"), + PVID(0x8086, E1000_DEV_ID_PCH_RPL_I219_V23, "Intel(R) I219-V RPL(23)"), + PVID(0x8086, E1000_DEV_ID_PCH_ARL_I219_LM24, "Intel(R) I219-LM ARL(24)"), + PVID(0x8086, E1000_DEV_ID_PCH_ARL_I219_V24, "Intel(R) I219-V ARL(24)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_LM25, "Intel(R) I219-LM PTP(25)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_V25, "Intel(R) I219-V PTP(25)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_LM26, "Intel(R) I219-LM PTP(26)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_V26, "Intel(R) I219-V PTP(26)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_LM27, "Intel(R) I219-LM PTP(27)"), + PVID(0x8086, E1000_DEV_ID_PCH_PTP_I219_V27, "Intel(R) I219-V PTP(27)"), /* required last entry */ PVID_END }; @@ -1251,6 +1267,7 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: case e1000_82574: case e1000_82583: case e1000_80003es2lan: @@ -2637,6 +2654,7 @@ em_reset(if_ctx_t ctx) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: pba = E1000_PBA_26K; break; case e1000_82575: @@ -2750,6 +2768,7 @@ em_reset(if_ctx_t ctx) case e1000_pch_tgp: case e1000_pch_adp: case e1000_pch_mtp: + case e1000_pch_ptp: hw->fc.high_water = 0x5C20; hw->fc.low_water = 0x5048; hw->fc.pause_time = 0x0650; From nobody Thu Feb 23 00:29:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMYnM72PYz3sg55; Thu, 23 Feb 2023 00:29: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 4PMYnM6bx3z3y1V; Thu, 23 Feb 2023 00:29:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677112183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Y6khRJ/urNFduiZHdAQniCaRa9MtZbij4llsDafWVk=; b=r+jOLOz/lO5My8K6qc3GGmSLF7eOtpi8Wjyfq1f3SfY4h3/bwEM4tEinaWPFRlNGBVgghZ 8csAzb7epluklkIc8DrDYGVfIWk6QzWD1EqWOMu+OQVWVJk+HlN6IVmcLgBs+6zMc2EhuI k1zD1mThdFCekQOr/i0D8pHyu2klzOXiArsPPs6Lcy4v6j+8Fd0wz1Gx0Zb0hS7zzw4LFn pDxeQrQA4e1fO+ztsxvYdXtRMw3Tb0Kv/1HHT5QhaoDRpGLY72nt11mqvt9nwNTypD+aR7 YanOVvUMRJyWYTPRefDk0Xg2M/RHeLcgN7x2FEDvQWll6uk8JPtOaPzwUyne1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677112183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Y6khRJ/urNFduiZHdAQniCaRa9MtZbij4llsDafWVk=; b=hcvD5eJt4usAbPd9nli6w4ijc7QsiJ+HAX6RMImaGM5Og2ZujVCI/aTevDwvINElomG5my fK08T6Tt8n8RajiMpNivEyjhLaQudDkasnp7B4dSWYDDusbk4g4bXg4pqgLWaBMxY30IXb /tcHFLAbloX10vx3Ja2g5wr95sFktX8DbuzSIYQ2jxYv05TBzoP/umu3lDZOYMC5B7y1RJ bS733HtVfK0HNb8+0DINaK+FxWik72GYloFdGfsr4m3/lC/jOqZTXPuEVPF19feD+7kN19 UnXMRAtSJcAQcAvK8gr3s8e2fBzY6uIKGKsgUAtr7tRyh9OPzgEPA6E/olmWhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677112183; a=rsa-sha256; cv=none; b=TvYut7u6Bsttj2K0bef9U74InCgesWHihfoHu/qkICsHkllTFuAV1CMhHqakljk6L66g6P uiulhov0rzgkaM0cZ8qfu/oF2df4LYTMeD+CpMojXLkefCFNc8wxOriC4GoHg27Jxj4Jpn hyxkEIKal/ubPwAEhR6MUlQoto6Q8GJ1d1Fx0V1+VnSCsh1uE/AZXOeKKvcsylxT/PeOOu +Y3CtbiEXVurc242RLWHAz/w3hG74vyFe9V8FXPk1g0pCP7IEdDGhlUaYvAfco9oqyUHMm ZCTUhTHKiUmEG1gigme0zgpwOsauHvu2q07w/VYqwBhOEya3KvkrUi9QMrINqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMYnM5fBvzLph; Thu, 23 Feb 2023 00:29: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 31N0ThV6072523; Thu, 23 Feb 2023 00:29:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N0Thin072522; Thu, 23 Feb 2023 00:29:43 GMT (envelope-from git) Date: Thu, 23 Feb 2023 00:29:43 GMT Message-Id: <202302230029.31N0Thin072522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b0b1fa9efed8 - stable/13 - e1000: Fix packet loss on 11th gen and later List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b0b1fa9efed8d3a4aeb8e365c4f3356de9cc0f6d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b0b1fa9efed8d3a4aeb8e365c4f3356de9cc0f6d commit b0b1fa9efed8d3a4aeb8e365c4f3356de9cc0f6d Author: Kevin Bowling AuthorDate: 2023-02-09 00:32:54 +0000 Commit: Kevin Bowling CommitDate: 2023-02-23 00:29:33 +0000 e1000: Fix packet loss on 11th gen and later Ungate DMA clock on TGP and later to avoid packet loss. A similar fix appears in Linux 639e298f432fb058a9496ea16863f53b1ce935fe This may be needed as far back as SPT but no confirmation from intel or other OS yet. Obtained from: OpenBSD (if_em_hw.c 1.116) Sponsored by: BBOX.io (cherry picked from commit 56365902147791994157c3a8f75784dafd46dbd8) --- sys/dev/e1000/e1000_ich8lan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index f74ef5f9c7b3..86b3d1194edd 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -5174,6 +5174,13 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) snoop = (u32) ~(PCIE_NO_SNOOP_ALL); e1000_set_pcie_no_snoop_generic(hw, snoop); + /* ungate DMA clock to avoid packet loss */ + if (mac->type >= e1000_pch_tgp) { + uint32_t fflt_dbg = E1000_READ_REG(hw, E1000_FFLT_DBG); + fflt_dbg |= (1 << 12); + E1000_WRITE_REG(hw, E1000_FFLT_DBG, fflt_dbg); + } + ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); ctrl_ext |= E1000_CTRL_EXT_RO_DIS; E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); From nobody Thu Feb 23 00:30:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMYnr4PtWz3sgRq; Thu, 23 Feb 2023 00:30:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMYnr3sVXz40bP; Thu, 23 Feb 2023 00:30:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677112208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gyOH/ge0pDkgcG2oGvYAG6zDtk10UjJB5AU+BIM+LYg=; b=KtlNuA5N/RxsI0tP3ITC1RVGBm25qjrA+6oLzGgKRjru/LQGrDYGcQwX+v9jiQSJf78nQI W4H4L8/WR0S0ZTIkCNF9+M1Zd1K6CfZZw1/hsVwrmQum+1+gLtSe6WSM4M+yvi7UAyHdF0 yATc+9yWWyfwKsXYYOno7tzsm+NAkMhH9PpUawRSR5TQG/n2Z8modITNaJsGUBaZ/WBZTw 6eddVMMXeQ0T2dmnVO4pSKyiPIxbM2qk3RR2Sd9xxt3G8ExbJMzT1m91BuKK7hVBCht0MH pUmmLuzJHPGxP9lBRTI9wIPZ34sMoZa6iEW++VNaxWW/suViqCJcNq92+AGGDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677112208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gyOH/ge0pDkgcG2oGvYAG6zDtk10UjJB5AU+BIM+LYg=; b=l+u7Q53Xg5CoDss+AtL/NFDrr+YQDe5O9P21HKQ3cbhMg8CMB7mf58K8uZYuX2mlZUB5Dt 4MzwT67s6N3H2xbDh3e5wGPZC36NZLXhzblM+wLkiAiQm8k6vi07omnDUWjmy0ILEiW63W CupNdBYqTVeQEj1s901YPGMXwdVTGexop/bR3AeQuxHAJmXtFpt+qKYkErIr77tN3WtU7n FRLcmDPE8xv81GdOP05SpVhjLFrSljtiWUA23KsJ+7+5T9wbhtIoiG19zeRqp27gcnzKR8 N6AcWBxbqKV4sAS7cnOQhtRdgG4W9Wl68OW1Y2lM1QqxpBByR6HmfEVwo1QzsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677112208; a=rsa-sha256; cv=none; b=yg8u2E/YbYpTCDAveyPOdokHaFC3eYO4ydJTUfnaRvF+WTciUwqzVR3bnvVXTqhflwPASy n8ysibDQxDusyZYMgUohAdFcMHeR+olLhqUPHFIL45HaOEVzD2p7zfcE5h5PXX8io2o1w9 SRAldoPQWNX+t8/dEZ5KGptrVfp91jOLS96SrlIsj9dcchXjFGeuBNK4Hqbuiu3mNII29r dMZf5MDqO8WJOURVK83gn+UbPGUKHJoBaw3U1yECCvJj2NNRt+I4qW1QUvlbZ8Xw1pviYr UKzF6MThfuGKzrGl8wuNfMwegon4Ap5BgDzNn5YNnzDVqLVjuAzAEX7d/m35uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMYnr2x8pzMWX; Thu, 23 Feb 2023 00:30: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 31N0U8MB076003; Thu, 23 Feb 2023 00:30:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N0U8U0076001; Thu, 23 Feb 2023 00:30:08 GMT (envelope-from git) Date: Thu, 23 Feb 2023 00:30:08 GMT Message-Id: <202302230030.31N0U8U0076001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e7de5b89b72d - stable/12 - e1000: Fix packet loss on 11th gen and later List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e7de5b89b72da29933f0e7f2852b33b1ba0eb442 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e7de5b89b72da29933f0e7f2852b33b1ba0eb442 commit e7de5b89b72da29933f0e7f2852b33b1ba0eb442 Author: Kevin Bowling AuthorDate: 2023-02-09 00:32:54 +0000 Commit: Kevin Bowling CommitDate: 2023-02-23 00:29:58 +0000 e1000: Fix packet loss on 11th gen and later Ungate DMA clock on TGP and later to avoid packet loss. A similar fix appears in Linux 639e298f432fb058a9496ea16863f53b1ce935fe This may be needed as far back as SPT but no confirmation from intel or other OS yet. Obtained from: OpenBSD (if_em_hw.c 1.116) Sponsored by: BBOX.io (cherry picked from commit 56365902147791994157c3a8f75784dafd46dbd8) --- sys/dev/e1000/e1000_ich8lan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 7d079ee5d1b3..9893aa413b2c 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -5174,6 +5174,13 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) snoop = (u32) ~(PCIE_NO_SNOOP_ALL); e1000_set_pcie_no_snoop_generic(hw, snoop); + /* ungate DMA clock to avoid packet loss */ + if (mac->type >= e1000_pch_tgp) { + uint32_t fflt_dbg = E1000_READ_REG(hw, E1000_FFLT_DBG); + fflt_dbg |= (1 << 12); + E1000_WRITE_REG(hw, E1000_FFLT_DBG, fflt_dbg); + } + ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); ctrl_ext |= E1000_CTRL_EXT_RO_DIS; E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); From nobody Thu Feb 23 01:04:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMZYb2FwDz3sjDS; Thu, 23 Feb 2023 01:04: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 4PMZYb1mhSz45f6; Thu, 23 Feb 2023 01:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677114275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxsJfJonMk/7ACitNX0g8fHnny9wmHbexptSnrUjIic=; b=MYRR3iqIXqdc8wmgx5ZnIctI0fhyC3nVwzJSC2pDu2DrF0bN9S8UE2aumOQDnXsZZ4b/gE Nxeaw0rw4zAaZuoF9bXhcn0HB4nii35rbqdE44r1bew6k/PYrgmzlgw/X+E2iuFMeyBfJB Ph8gFWR6RLlOZClmPaaHKCkChcyxQTJrda0mx0z/xA5YIcrmvRIsChfRjvV79JAQ1bNake wmBB5R6pEQj+RD03EX9Hbz/utgQzZ/67Sdt0NP3hqac25F5Uogdr319g5Xga/JVVM+FThr 8vO5TPhBJZQWeCAZJmbmZx770sYjx5Mzo0/iDZOjdWaPrYNwI+ZoTWySVAjcrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677114275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NxsJfJonMk/7ACitNX0g8fHnny9wmHbexptSnrUjIic=; b=YoS651sXsZReSs+zX4bQsbWFsygJblaRBerShNlUB9JyUirR2ua0arKftBbuv10J/hc4fB /sH64TBnKRFFB+7RF1jyfsJ5xRWjsXISG01dp+ym8zG/5XPXqBU6G4v0OQX2+Hz8CmItJ3 DdfgGojcVOtOYHtVbUJE9R2nrq+rmfyhjJmdyizoRfca5pAB/YIVJRlatOEtP38+CIiXmD jZQaATDxokQU9aX1tbZJmcTJk4l8VE47ZKZJhiEnVuOvsgTYa6hpxQkPjNifoKjP1B1HoC xF72fdr7n82d+XD+L5g020mG0GAhOoRSCIo+ZOX9TS9EHCls3rcvH43qv9ZBnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677114275; a=rsa-sha256; cv=none; b=IeulXHeb5gBJ3hJUMIEWeO8lOe5xWqNfsvG+6wj526BogLSRbj9y3ooz5X6vdmcg+Qmi67 YTAJdgtDl0N7ONcjmjCqU6YHTUC2wb3VAsJa06bfKkYWkn5HW+eiECG/SBOrp9Cn01Fcr2 Ik4IZZayQnvRV4LvNPaXHwW+IC4rUAsK8MN6aqp1gwkuy7SSR1gM3isqwZixoAnzlf/w4C kyTHfDcZRt5rfx3PcGcoGkOBrjprjhfoT4CnsnwCaRVEDpR1n/BPhNL9uyt6UQiYqNwVW7 JQJubsF4nshae7ufpkfnz6QjMesfGShlQDsmjWg52eqWRRFmaiMkb1xmAbLqHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMZYb0qhvzNLX; Thu, 23 Feb 2023 01:04: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 31N14ZiK029778; Thu, 23 Feb 2023 01:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N14Z9h029777; Thu, 23 Feb 2023 01:04:35 GMT (envelope-from git) Date: Thu, 23 Feb 2023 01:04:35 GMT Message-Id: <202302230104.31N14Z9h029777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 453aa7fac989 - main - tcp: ensure the tcpcb is not NULL when logging an event List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 commit 453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 Author: Michael Tuexen AuthorDate: 2023-02-23 01:01:53 +0000 Commit: Michael Tuexen CommitDate: 2023-02-23 01:04:17 +0000 tcp: ensure the tcpcb is not NULL when logging an event When calling tcp_bblog_pru() on some error paths, tp is NULL, therefore handle it. Sponsored by: Netflix, Inc. --- sys/netinet/tcp_usrreq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 878e5095eef2..f17285664ce5 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -136,6 +136,9 @@ tcp_bblog_pru(struct tcpcb *tp, uint32_t pru, int error) { struct tcp_log_buffer *lgb; + if (tp == NULL) { + return; + } INP_WLOCK_ASSERT(tptoinpcb(tp)); if (tp->t_logstate != TCP_LOG_STATE_OFF) { lgb = tcp_log_event_(tp, NULL, NULL, NULL, TCP_LOG_PRU, error, From nobody Thu Feb 23 02:42:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMckl2D7Cz3sq43; Thu, 23 Feb 2023 02:42: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 4PMckl0P14z4H25; Thu, 23 Feb 2023 02:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677120159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oXyoPJayPFDCS/hhIv8tmUUCe5FvA3Qaom4RNJhgzgU=; b=t9Z9x/1T579x4qNcn0bFCprhGIIIEIsNwFjEz541sFnlsIhzZKrGutWd+oLYfFnXYS48QC kZz5IgSbzukqeWn2J8CwGCmEbPlrBssIztB0TzEK5+tXAylZEQT7Ell3bSRVsDgr/rvunS EeiMzAbXZGsSIQrweQoems6xdLVjGCcfafQ6wrQ5y8lx5gPwT8vS2i8fDJEt0hL4hwCkib rxogLVdPeE+OvB/J73tiY1IgFgeRvCqSu5+rmBZqibh3zWEmUFxxrnKZN5B9xAyTbZ1rB2 9GcFjwPinXkCz3nnfd1odd5AH7EEuFvV6+QUIvLxYS45KxleZxRn7fuzL1iOMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677120159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oXyoPJayPFDCS/hhIv8tmUUCe5FvA3Qaom4RNJhgzgU=; b=pmvhZacWFEmqeYyPb6Dj87D9mv9W48osnlE2CRt9OIXz8j/x8yZeRBNDy8xoOjY6WGmM92 iZ3wwF7/wPXkl8G20ndwULIII35y8G8K96Rdn/6WG0xCvJyawC1su4OVRatOb7mzgaMeSi hRvWbMpmUMkjiTwLek5ESE6vZZbbuuEkFwCLWf8OdHY334+qC8askTijG5aKd16gxOrQ/t 7BYNcZxRy8tPqZTggF6ucFiZNtKq/ItmMCfneMW7f+kRXyxgkLB9kWUSKxSh9VlH6HAXos feQ6Yv6zTwgPacvIpPXUbLy70qVrHG3jxu3y3RQbAdXlh58bjlfM46XrYceKGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677120159; a=rsa-sha256; cv=none; b=lx8UXwgxp3e2DKjBE/yATCz5UjrEC01LVnUCwQQcNOUc/5brWpJLQNVUASHctgitW2bMno qPmI6l+DSQk6FT27oJr88qWTWndOthpXdTRCUqa/+ufTC8Qvuq3Zs37xC2dR4fLWpM9sk6 JaMzAEIXTmOO26T5w9XFaIf78EJmJ/gNAHHamD87wgYAJ1gc3+cT8mgG+wZnVWvecjvPwi i08l3W/kILLMzrk39b+NnKLIFTtQBDm+U5aKnv+7dBqBiTY6Da8Ck0HL3xiyK+BxMtZD/M 8LFI0f+i6Bjm8dFJS4BcTssVdOnkVdn2sbRhYLMXXJrkeKeT5tmRMbwZTL5LjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMckk6cYjzQpm; Thu, 23 Feb 2023 02:42: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 31N2gcvq071346; Thu, 23 Feb 2023 02:42:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N2gc67071345; Thu, 23 Feb 2023 02:42:38 GMT (envelope-from git) Date: Thu, 23 Feb 2023 02:42:38 GMT Message-Id: <202302230242.31N2gc67071345@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: 3ff497061b33 - main - Fix Coverity issue in the NVDIMM driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ff497061b3323021ae5f8cceed075fc2bc25e40 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=3ff497061b3323021ae5f8cceed075fc2bc25e40 commit 3ff497061b3323021ae5f8cceed075fc2bc25e40 Author: Robert Herndon AuthorDate: 2022-10-13 17:02:28 +0000 Commit: David Bright CommitDate: 2023-02-23 02:42:12 +0000 Fix Coverity issue in the NVDIMM driver Summary: Coverity reports a potential memory leak in the nvdimm driver. Examination shows it's real; fix it. 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/D38676 --- sys/dev/nvdimm/nvdimm_acpi.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvdimm/nvdimm_acpi.c b/sys/dev/nvdimm/nvdimm_acpi.c index 7e41b04fd60f..11afe44f9477 100644 --- a/sys/dev/nvdimm/nvdimm_acpi.c +++ b/sys/dev/nvdimm/nvdimm_acpi.c @@ -67,14 +67,18 @@ find_dimm(ACPI_HANDLE handle, UINT32 nesting_level, void *context, ACPI_DEVICE_INFO *device_info; ACPI_STATUS status; + device_info = NULL; status = AcpiGetObjectInfo(handle, &device_info); if (ACPI_FAILURE(status)) return_ACPI_STATUS(AE_ERROR); if (device_info->Address == (uintptr_t)context) { *(ACPI_HANDLE *)return_value = handle; - return_ACPI_STATUS(AE_CTRL_TERMINATE); - } - return_ACPI_STATUS(AE_OK); + status = AE_CTRL_TERMINATE; + } else + status = AE_OK; + + AcpiOsFree(device_info); + return_ACPI_STATUS(status); } static ACPI_HANDLE From nobody Thu Feb 23 02:59:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMd6r3lssz3sqv0; Thu, 23 Feb 2023 03:00:04 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4PMd6r1VCNz4J31; Thu, 23 Feb 2023 03:00:04 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by glebi.us (Postfix, from userid 1000) id B6FF23A868; Wed, 22 Feb 2023 18:59:57 -0800 (PST) Date: Wed, 22 Feb 2023 18:59:57 -0800 From: Gleb Smirnoff To: Michael Tuexen Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 453aa7fac989 - main - tcp: ensure the tcpcb is not NULL when logging an event Message-ID: References: <202302230104.31N14Z9h029777@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202302230104.31N14Z9h029777@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4PMd6r1VCNz4J31 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Thu, Feb 23, 2023 at 01:04:35AM +0000, Michael Tuexen wrote: M> The branch main has been updated by tuexen: M> M> URL: https://cgit.FreeBSD.org/src/commit/?id=453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 M> M> commit 453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 M> Author: Michael Tuexen M> AuthorDate: 2023-02-23 01:01:53 +0000 M> Commit: Michael Tuexen M> CommitDate: 2023-02-23 01:04:17 +0000 M> M> tcp: ensure the tcpcb is not NULL when logging an event M> M> When calling tcp_bblog_pru() on some error paths, tp is NULL, M> therefore handle it. I wonder when does that happen? IMHO better fix such calls than plug the problem here. -- Gleb Smirnoff From nobody Thu Feb 23 04:50:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMgZd1GB7z3sxmh; Thu, 23 Feb 2023 04:50: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 4PMgZd0r51z4V2y; Thu, 23 Feb 2023 04:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677127849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rEwf7tWUBqVlBKLJlcnyXUqCx/bNR3p/y6gCZ1wvbgg=; b=iqV+E7glUVKNIFN8fr91kabnoWKIllN6whi21Y+430wMNeNz4VcixlFkTYpBeECgsLY4ZN Uyv11Ya7DqxvyCVtJOC61YNzksvugZnn+WPDJufVB0JEigQoYoBl8XtJZvxrjlZonDaanw /F+hO7fKOIr2d1WPi8QS0J5B1HVvZR5nLgi2m1MuY2sO5+B4kBN1/QRUTGQmOD/Vn1sFVX +xml16qyG+RGCndwKiug4oy3r+YY2RTuW9zaih+jtvT4Z34boc6wTftkDTwThajyE4sjQS U1OGIbnsj5VCVWfaedATV2gTX3dLmSLnDgN3phOZSKytcKlM16Zz/Jr1vWQ9YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677127849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rEwf7tWUBqVlBKLJlcnyXUqCx/bNR3p/y6gCZ1wvbgg=; b=ZGFsa2qG2ZZ1iOHotdVWMP6+8rnouSWG9IoyRbuQw8LMbon8dQIy4EeDPoY03ET7nlqk8R t/vyk8hxF18NF7D0Gq06ez/xUStkjm+5Cyu4b4paOyMNXG35NQ/T/tdJl++BBeMfcNYU1F HbRPMnD4UZSo0IpefTheI354FTiWieVNBOH4qv49bPkRZrcpTw5iulW1bftoN8D+QhaVSm eC19Tl22ivHC4lkHJqFf2yye8ZKehPlw+Sd5IwAMxt/gRyJXXPYxYXdI0EfOadCNwa8pkx el5g3NgTGj/ItuQY8koyuSJ5JeONp1pPFQA91kvGIuqUmXGy7Om2yRLIVlO2rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677127849; a=rsa-sha256; cv=none; b=ItiFJ6PUyCBeKif2S4YDW/ggWVE85S7nVKeRXTuVBzCaS0XVVzKiM0Qx26X2iSkDHhd3Cu 1TOtKkD+tdsDsbZju6x/Nk/tjimRnPA/HJRqhgG4ak4qCPLTFUsC3h/UD06nN15fg/TEPd q+emLTLS8msHWAFx/JcNKtR6R62TYClKQZhH8tLjH6S8LHFpJgLtx5xQTSe+ADS0ExLqVk 23gvbWyWPbG3NBtBQNsaMBe6eT8wQ3iVMnfaKmq5QDVLJg+nr6UHJkq3hZeguZNzDamCLk 2SgSXk57MA9//Mv5K27RqgNzL0ijdF7qsDCvevGDkonDuC9cKiat1MuWMQsz2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMgZc6zzpzTrg; Thu, 23 Feb 2023 04:50: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 31N4omJb052400; Thu, 23 Feb 2023 04:50:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N4omBc052399; Thu, 23 Feb 2023 04:50:48 GMT (envelope-from git) Date: Thu, 23 Feb 2023 04:50:48 GMT Message-Id: <202302230450.31N4omBc052399@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: a17065710862 - main - unix/dgram tests: match the kernel behavior List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a170657108623cd48e3d695ca74c428a564912ee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=a170657108623cd48e3d695ca74c428a564912ee commit a170657108623cd48e3d695ca74c428a564912ee Author: Gleb Smirnoff AuthorDate: 2023-02-23 04:44:46 +0000 Commit: Gleb Smirnoff CommitDate: 2023-02-23 04:44:46 +0000 unix/dgram tests: match the kernel behavior In CURRENT for some time an overflowed unix/dgram socket would return EAGAIN if it has O_NONBLOCK set. This proved to be undesired. See 71e70c25c00 for details. Update tests to match the "new" behavior, which actually is the historical behavior. --- tests/sys/kern/unix_dgram.c | 7 +++++-- tests/sys/kern/unix_passfd_test.c | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/unix_dgram.c b/tests/sys/kern/unix_dgram.c index 891cc4a58f5c..9e9d4881a61e 100644 --- a/tests/sys/kern/unix_dgram.c +++ b/tests/sys/kern/unix_dgram.c @@ -156,10 +156,13 @@ ATF_TC_BODY(basic, tc) ATF_REQUIRE(send(fd[0], buf, maxdgram, 0) == -1); ATF_REQUIRE(errno == ENOBUFS); - /* Fail with EAGAIN with O_NONBLOCK set. */ + /* + * Fail with ENOBUFS with O_NONBLOCK set, too. See 71e70c25c00 + * for explanation why this behavior needs to be preserved. + */ ATF_REQUIRE(fcntl(fd[0], F_SETFL, O_NONBLOCK) != -1); ATF_REQUIRE(send(fd[0], buf, maxdgram, 0) == -1); - ATF_REQUIRE(errno == EAGAIN); + ATF_REQUIRE(errno == ENOBUFS); /* Remote side closed -> ECONNRESET. */ close(fd[1]); diff --git a/tests/sys/kern/unix_passfd_test.c b/tests/sys/kern/unix_passfd_test.c index 92b8d73f2f4a..16a9a304bf3a 100644 --- a/tests/sys/kern/unix_passfd_test.c +++ b/tests/sys/kern/unix_passfd_test.c @@ -532,8 +532,13 @@ ATF_TC_BODY(send_overflow, tc) nfiles = openfiles(); tempfile(&putfd); len = sendfd_payload(fd[0], putfd, buf, sendspace); +#if TEST_PROTO == SOCK_STREAM ATF_REQUIRE_MSG(len == -1 && errno == EAGAIN, "sendmsg: %zu bytes sent, errno %d", len, errno); +#elif TEST_PROTO == SOCK_DGRAM + ATF_REQUIRE_MSG(len == -1 && errno == ENOBUFS, + "sendmsg: %zu bytes sent, errno %d", len, errno); +#endif close(putfd); ATF_REQUIRE(nfiles == openfiles()); closesocketpair(fd); From nobody Thu Feb 23 04:58:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMglY5C4qz3syKH; Thu, 23 Feb 2023 04:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMglY4m74z4WRt; Thu, 23 Feb 2023 04:58:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677128313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73dxv8jctJLzeR5UdrLrXd7fRDQCgyucuOlb+WYkwMs=; b=MhpUF4K3tNiCQSdew4vqHTOKVjqgs3FF9q1Y7C3ikvWqiAaRxxO3J44pt5OpWwCzXhSjkf YGHKcgqmJxLO8w0oQ5ukF0/F1pws76a9tyKe7xLkQtS64cHtO4JLv/GRnLnzz9uBomZJmh LpSDIBOzrpTIHPk8UECKEV5smzhtyL+u+qcnWM335bq/pU2Xek8k3yeivTzJldmtmxKuBE Nz2LSQeoWuzWPRwzJs0prtTCbK6C0aglWHHQnsGiGuUGrcZIriKAArLCBFzrvvZGUIQsmJ Ch958ZE5GnNK31UbV3BNplmXQkfs2bZ4oCp3+6O1frd5zxkLeNE50Zd6a1rLyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677128313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73dxv8jctJLzeR5UdrLrXd7fRDQCgyucuOlb+WYkwMs=; b=DSN6YHDON1SVVVpcIgtertbXGKnbTlOlT4IHnWHk0ITOsfhucNtZBke1aADSj/3wEfn08O JJQAeCe2YPKr8Dqn7TzW1/qYTqKDjbRVA3WsvZk6lmmqRG6uaMVdwstodraNGZ7cRPcNqn G/NZe1m5zFCiz2AIi/4k0FlvJAWK70y4jVyQk4GWa3k87gkeNLAXRtfY/VrPHGkUd53Mlv ftC/ypKe/StbgFyv8A9KNvqEay7Aa1AUKAhWBwfK7HmBFy9/50KDjKlxQvJci6pJVdybUk qC7/VuforlP/Z7B7USlAgy4rxq5laBHSi+ipU13qXj+KItVXYNsBoN+mEu2Wgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677128313; a=rsa-sha256; cv=none; b=clbb5LgssfOD0DmhIicvCITyzDvTJg05mFDYh1+SNyDkTddusRcze8vL4/KPs0taUTqLP0 FmA9R42HZTugTDRDpK1OnAaiSynu6TWc5MF/y6s6APU8WdHMd6C4GB0vInDLSvDak0+rZU EGQ2ZcuYW1u62aINPvw0ifet7nf036xrbWXHMMCjH9BjDONnL8uz6NjUCjvR+jpFgqyMyz CiifUx+mP12eaaCK69UGgX52QRNCbqmGoI/pX8jCIJyLbbLoADO9t5+jOh3XCtGjcb9LWu TKa2EVPmCTPVrwjlkmuarPhBfRgswuqJh0lviOwdbQZ/w1i41KFvJCosJMG5SA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMglY3pPWzT7G; Thu, 23 Feb 2023 04:58: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 31N4wXLu058252; Thu, 23 Feb 2023 04:58:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N4wXkC058251; Thu, 23 Feb 2023 04:58:33 GMT (envelope-from git) Date: Thu, 23 Feb 2023 04:58:33 GMT Message-Id: <202302230458.31N4wXkC058251@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: 57fcf46dee45 - main - if_ovpn: ovpn_find_peer_by_ip() is unused without INET List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57fcf46dee45369c5f424ce2b0b79e6b2aab0177 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=57fcf46dee45369c5f424ce2b0b79e6b2aab0177 commit 57fcf46dee45369c5f424ce2b0b79e6b2aab0177 Author: Kristof Provost AuthorDate: 2023-02-23 02:58:14 +0000 Commit: Kristof Provost CommitDate: 2023-02-23 04:56:56 +0000 if_ovpn: ovpn_find_peer_by_ip() is unused without INET Don't define ovpn_find_peer_by_ip() if INET is not set, and do the same for ovpn_find_peer_by_ip6() and INET6. Reported by: mjg Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if_ovpn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 169a17ec6083..bf07d23f0235 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -1663,6 +1663,7 @@ ovpn_get_af(struct mbuf *m) return (0); } +#ifdef INET static struct ovpn_kpeer * ovpn_find_peer_by_ip(struct ovpn_softc *sc, const struct in_addr addr) { @@ -1678,7 +1679,9 @@ ovpn_find_peer_by_ip(struct ovpn_softc *sc, const struct in_addr addr) return (peer); } +#endif +#ifdef INET6 static struct ovpn_kpeer * ovpn_find_peer_by_ip6(struct ovpn_softc *sc, const struct in6_addr *addr) { @@ -1694,6 +1697,7 @@ ovpn_find_peer_by_ip6(struct ovpn_softc *sc, const struct in6_addr *addr) return (peer); } +#endif static struct ovpn_kpeer * ovpn_route_peer(struct ovpn_softc *sc, struct mbuf **m0, From nobody Thu Feb 23 05:03:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMgsc3Q1Xz3syZ8; Thu, 23 Feb 2023 05:03: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 4PMgsc2VTpz4WvG; Thu, 23 Feb 2023 05:03:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677128628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8vDqw21LpmJGwKPKFd0RaZQ3ox2vOi49YkDvGTCcEQo=; b=CsrGR4gGXZIKPoVgnCGvC78K+BucYDtJe8PnxAHnhvFIlLZla7EQp3az3OWZ7JD8AGRUI2 umMUCo27xDJIERBtlG2nxiqAOmNGeJyUNW1jBUoGwue57cgJEYLS0ASgQy95nSxDja/QOq U1Ic+RgECsBgHeglD0l+CRdk/j+3I683Ho4Ix134T8VJjoBad0W0wE5yMqHjqAU1bmoUYu pTbM3CkoaiarZOlsYtbpUk18hSokJMS+cD7Eg5ta+p/HGm1hJG2i40GP6kyMIogjgju3/Q TEe+AIJZVG7BRXkSruv7NnDlV92OrZ6uwgb1Bls0YrA4YqXDPgsfp2vBlptj7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677128628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8vDqw21LpmJGwKPKFd0RaZQ3ox2vOi49YkDvGTCcEQo=; b=WaZYdeuQfUgCSoc6UH//STaqAacQKCnSeInf71J/K2/wzxTDZYSxtLukwGHXLRzthn/P0H RNCOYOb2GN0YkdSXfOUdvbZvwYWMyRx85j0aYpc/cwcuRbngOLPv9aGnZtgDiIyz5KCG1r x+NvixsQ8CxwlZ0gZIoX6wn1LiY2IggOQkCBYoYhIfZJy5lwwhTv5PVpASLc+rgaFP5MOe aSu+ulqlzX7uAIGpHd0fET7QDT+EqEVYAazT0M3W/tRfApYISUUEnfnm5Obi6qTSVWol6z aPk23g53sEc3qYoQsAVn+rn7mtLhDZpwFtmljAPVXW/OQ+Ggt32tXwd8rpqxrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677128628; a=rsa-sha256; cv=none; b=vLpTaq8ebuSBKeeoTM1XDR+hpIhxULxZ2rWX7k8PZNLqZPwR059WgesINd8D6zhoDeKRsF kia2uUvDoZJxzCVE7L3IrLrKnS9sCYEF4YtcJ9FTT6+gHp5pDo/68ZC/ApkTbHGA0Y1Hr8 XTuTu4/93kECWe+Xd/eV/JVW9K+4JSY7tBBeOH2HgzGSE1osr0GPA30sZ5wffNKpwKzb18 07qy4dMo43r05yVV3MHtGOhNH0MbaYFcyPtqMC+2r7GxBIVVb3CZWMnHZr8nycwCcjhS2i AmIf1WkfksinTfFG9REQAWU1oCXi8Qpa0pTKp6UM9pVbi793TL67QRobH+SkEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMgsc1DtCzVL2; Thu, 23 Feb 2023 05:03: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 31N53mJE072831; Thu, 23 Feb 2023 05:03:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N53mTT072830; Thu, 23 Feb 2023 05:03:48 GMT (envelope-from git) Date: Thu, 23 Feb 2023 05:03:48 GMT Message-Id: <202302230503.31N53mTT072830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 7dbedbcfe079 - stable/13 - hastd and hastctl: use zlib's crc32 implementation. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7dbedbcfe079cfbd1d192ca80cb151443bc8a675 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=7dbedbcfe079cfbd1d192ca80cb151443bc8a675 commit 7dbedbcfe079cfbd1d192ca80cb151443bc8a675 Author: Xin LI AuthorDate: 2023-02-03 07:14:21 +0000 Commit: Xin LI CommitDate: 2023-02-23 05:03:11 +0000 hastd and hastctl: use zlib's crc32 implementation. (cherry picked from commit 6998572a74a98721781ecd5b6829435259f9825a) (cherry picked from commit fdbfaefefa585537273955fc88d7daf5e86c6f2d) --- sbin/hastctl/Makefile | 3 +- sbin/hastd/Makefile | 4 +- sbin/hastd/crc32.c | 115 --------------------------------------------- sbin/hastd/crc32.h | 28 ----------- sbin/hastd/hast_checksum.c | 6 ++- 5 files changed, 7 insertions(+), 149 deletions(-) diff --git a/sbin/hastctl/Makefile b/sbin/hastctl/Makefile index 00c89ef4f743..3f2198e74df6 100644 --- a/sbin/hastctl/Makefile +++ b/sbin/hastctl/Makefile @@ -7,7 +7,6 @@ PACKAGE=hast PROG= hastctl SRCS= activemap.c -SRCS+= crc32.c SRCS+= ebuf.c SRCS+= hast_checksum.c hast_compression.c hast_proto.c hastctl.c SRCS+= lzf.c @@ -33,7 +32,7 @@ CFLAGS+=-DINET6 CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT -LIBADD= md util +LIBADD= md util z YFLAGS+=-v diff --git a/sbin/hastd/Makefile b/sbin/hastd/Makefile index d3854850d3b3..20a9c8333d2a 100644 --- a/sbin/hastd/Makefile +++ b/sbin/hastd/Makefile @@ -5,7 +5,7 @@ PACKAGE=hast PROG= hastd SRCS= activemap.c -SRCS+= control.c crc32.c +SRCS+= control.c SRCS+= ebuf.c event.c SRCS+= hast_checksum.c hast_compression.c hast_proto.c hastd.c hooks.c SRCS+= lzf.c @@ -31,7 +31,7 @@ CFLAGS+=-DINET CFLAGS+=-DINET6 .endif -LIBADD= geom md pthread util +LIBADD= geom md pthread util z YFLAGS+=-v diff --git a/sbin/hastd/crc32.c b/sbin/hastd/crc32.c deleted file mode 100644 index e8bc74a97f2b..000000000000 --- a/sbin/hastd/crc32.c +++ /dev/null @@ -1,115 +0,0 @@ -/*- - * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or - * code or tables extracted from it, as desired without restriction. - */ - -/* - * First, the polynomial itself and its table of feedback terms. The - * polynomial is - * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 - * - * Note that we take it "backwards" and put the highest-order term in - * the lowest-order bit. The X^32 term is "implied"; the LSB is the - * X^31 term, etc. The X^0 term (usually shown as "+1") results in - * the MSB being 1 - * - * Note that the usual hardware shift register implementation, which - * is what we're using (we're merely optimizing it by doing eight-bit - * chunks at a time) shifts bits into the lowest-order term. In our - * implementation, that means shifting towards the right. Why do we - * do it this way? Because the calculated CRC must be transmitted in - * order from highest-order term to lowest-order term. UARTs transmit - * characters in order from LSB to MSB. By storing the CRC this way - * we hand it to the UART in the order low-byte to high-byte; the UART - * sends each low-bit to hight-bit; and the result is transmission bit - * by bit from highest- to lowest-order term without requiring any bit - * shuffling on our part. Reception works similarly - * - * The feedback terms table consists of 256, 32-bit entries. Notes - * - * The table can be generated at runtime if desired; code to do so - * is shown later. It might not be obvious, but the feedback - * terms simply represent the results of eight shift/xor opera - * tions for all combinations of data and CRC register values - * - * The values must be right-shifted by eight bits by the "updcrc - * logic; the shift must be unsigned (bring in zeroes). On some - * hardware you could probably optimize the shift in assembler by - * using byte-swap instructions - * polynomial $edb88320 - * - * - * CRC32 code derived from work by Gary S. Brown. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include - -#include - -uint32_t crc32_tab[] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, - 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, - 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, - 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, - 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, - 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, - 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, - 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, - 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, - 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, - 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, - 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, - 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, - 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, - 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, - 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, - 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, - 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, - 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d -}; - -/* - * A function that calculates the CRC-32 based on the table above is - * given below for documentation purposes. An equivalent implementation - * of this function that's actually used in the kernel can be found - * in sys/libkern.h, where it can be inlined. - * - * uint32_t - * crc32(const void *buf, size_t size) - * { - * const uint8_t *p = buf; - * uint32_t crc; - * - * crc = ~0U; - * while (size--) - * crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); - * return crc ^ ~0U; - * } - */ diff --git a/sbin/hastd/crc32.h b/sbin/hastd/crc32.h deleted file mode 100644 index 3812a83f971f..000000000000 --- a/sbin/hastd/crc32.h +++ /dev/null @@ -1,28 +0,0 @@ -/*- - * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or - * code or tables extracted from it, as desired without restriction. - * - * $FreeBSD$ - */ - -#ifndef _CRC32_H_ -#define _CRC32_H_ - -#include /* uint32_t */ -#include /* size_t */ - -extern uint32_t crc32_tab[]; - -static __inline uint32_t -crc32(const void *buf, size_t size) -{ - const uint8_t *p = buf; - uint32_t crc; - - crc = ~0U; - while (size--) - crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); - return (crc ^ ~0U); -} - -#endif /* !_CRC32_H_ */ diff --git a/sbin/hastd/hast_checksum.c b/sbin/hastd/hast_checksum.c index f7ef6a64b4e1..dccba3752cb1 100644 --- a/sbin/hastd/hast_checksum.c +++ b/sbin/hastd/hast_checksum.c @@ -33,10 +33,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include +#include #include #include "hast_checksum.h" @@ -49,7 +49,9 @@ hast_crc32_checksum(const unsigned char *data, size_t size, { uint32_t crc; - crc = crc32(data, size); + crc = crc32(0L, Z_NULL, 0); + crc = crc32(crc, data, size); + /* XXXPJD: Do we have to use htole32() on crc first? */ bcopy(&crc, hash, sizeof(crc)); *hsizep = sizeof(crc); From nobody Thu Feb 23 05:05:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMgvn1kV0z3synY; Thu, 23 Feb 2023 05:05: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 4PMgvn17yxz4XTQ; Thu, 23 Feb 2023 05:05:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677128741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jmbcswcC+Is6iACKC3TK/0oIixpH+BXTY0XXIt+/AVg=; b=V1vtWLFqGywHne7awo3dej25YSBH3gdS4xt+k5LMhBted5XO3EWx7RJMatlvo3Q7JWi2Df UJgN2pG45bOap1p/BKbOd3FDeYkH+etML1f4RAeoqhxWZROSin8TOrNrY7oLfHgqrt1Fux 7lp7LhdjXhLJEebQtd6abwob0Ywv0WqMwB0dgzKb9IjWpbmAktvsNW9WDHoUuh77YPs0+m +VJrCHIf0kqaew5GOlL3WpFlZtvdoUrg8mV6SytsMJkZveRHj2gG25Q9yHNUqn/4/y7p7b zCVFCaSvY57wuTOv4GqUbabmxcOF1cqXzH3hWFIfoeHca6NeBrtAcNEz0/QVEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677128741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jmbcswcC+Is6iACKC3TK/0oIixpH+BXTY0XXIt+/AVg=; b=ac6sWkszw6vVNcFPOTMkfe7vyWV0R18HGRtlxq0MoA0sn7bGPjlivwzlMWZays3vrxNort zDGbdCuv5ohjKUHVWGHgEh/zYUTQRvPktYzzsry+jDywyLKTweE/NrBeF4o1NU0zBnpuA+ bqjwkWWaR0zGybiDIQbAJutfvfKvW4MCGrIPIETTSXMHtfkjpUfhxSRHBCSAnvKyUg0ENx toJc1jkbP8P5JahyPUQUpuRy2JrPyxfrBqntfm40rvbk3VdhSgTamh+wBxBvBD6r8P6YTq HMafRB1X5H1ZZdupo2YfyjHleTBFTvIP7BaTZVTS+t3s3WYPzTxr3lLSqar8ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677128741; a=rsa-sha256; cv=none; b=hnWi61j0PyHz5MZSv2B/2UcaKy7SFDgwLkeGeH7HTaL1vzSRQTKpCb+6bRyu5kMkhyFLYI 2ZSf0yy8lXvOxk7Kqf7dZscBO1RO1Ork5o/W0safGVmR0RVv4fWx0/i3bn8q3keUjoL5+T FxmIy2CVDBLWH7l31pIWEVu8F5DYdZzO0vcZIixaYjSYE3y8hZUouafn3Wh6QmMEc53M9+ XDiFKOlRbKtGOxQKYrqDOwYwr1sB1cNJDsHb63Q9FXt8z+ST70TNvbTGzWTVLOm1wHD8SI 4yVjwstS/HueItkUo+y+N/Jb7bF3ACQpeTRBFJ21bEKGxtPEC7D2C5vij8rTGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMgvm754FzVNT; Thu, 23 Feb 2023 05:05: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 31N55eRh073165; Thu, 23 Feb 2023 05:05:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N55edY073164; Thu, 23 Feb 2023 05:05:40 GMT (envelope-from git) Date: Thu, 23 Feb 2023 05:05:40 GMT Message-Id: <202302230505.31N55edY073164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 3a7d654ed82b - stable/13 - MFV: zlib 1.2.13. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3a7d654ed82bc2b379549f8b2ac1e8ac6a638fa5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=3a7d654ed82bc2b379549f8b2ac1e8ac6a638fa5 commit 3a7d654ed82bc2b379549f8b2ac1e8ac6a638fa5 Author: Xin LI AuthorDate: 2023-02-17 07:57:24 +0000 Commit: Xin LI CommitDate: 2023-02-23 05:05:28 +0000 MFV: zlib 1.2.13. Relnotes: yes (cherry picked from commit e37bb444aa945ed0725766e986698a09bd61b1b2) --- sys/contrib/zlib/ChangeLog | 24 +++- sys/contrib/zlib/LICENSE | 22 ++++ sys/contrib/zlib/README | 4 +- sys/contrib/zlib/compress.c | 6 +- sys/contrib/zlib/contrib/README.contrib | 2 +- sys/contrib/zlib/crc32.c | 25 ++-- sys/contrib/zlib/deflate.c | 218 ++++++++++++++++---------------- sys/contrib/zlib/deflate.h | 4 +- sys/contrib/zlib/gzlib.c | 2 +- sys/contrib/zlib/gzread.c | 8 +- sys/contrib/zlib/gzwrite.c | 2 +- sys/contrib/zlib/infback.c | 17 ++- sys/contrib/zlib/inflate.c | 2 + sys/contrib/zlib/inftrees.c | 4 +- sys/contrib/zlib/inftrees.h | 2 +- sys/contrib/zlib/test/example.c | 3 +- sys/contrib/zlib/test/minigzip.c | 2 +- sys/contrib/zlib/trees.c | 123 +++++++++--------- sys/contrib/zlib/uncompr.c | 4 +- sys/contrib/zlib/zconf.h | 19 ++- sys/contrib/zlib/zconf.h.in | 19 ++- sys/contrib/zlib/zlib.3 | 4 +- sys/contrib/zlib/zlib.h | 20 +-- sys/contrib/zlib/zutil.c | 16 ++- sys/contrib/zlib/zutil.h | 1 + 25 files changed, 317 insertions(+), 236 deletions(-) diff --git a/sys/contrib/zlib/ChangeLog b/sys/contrib/zlib/ChangeLog index f0b0e6180921..457526bc6a51 100644 --- a/sys/contrib/zlib/ChangeLog +++ b/sys/contrib/zlib/ChangeLog @@ -1,6 +1,18 @@ ChangeLog file for zlib +Changes in 1.2.13 (13 Oct 2022) +- Fix configure issue that discarded provided CC definition +- Correct incorrect inputs provided to the CRC functions +- Repair prototypes and exporting of new CRC functions +- Fix inflateBack to detect invalid input with distances too far +- Have infback() deliver all of the available output up to any error +- Fix a bug when getting a gzip header extra field with inflate() +- Fix bug in block type selection when Z_FIXED used +- Tighten deflateBound bounds +- Remove deleted assembler code references +- Various portability and appearance improvements + Changes in 1.2.12 (27 Mar 2022) - Cygwin does not have _wopen(), so do not create gzopen_w() there - Permit a deflateParams() parameter change as soon as possible @@ -159,7 +171,7 @@ Changes in 1.2.7.1 (24 Mar 2013) - Fix types in contrib/minizip to match result of get_crc_table() - Simplify contrib/vstudio/vc10 with 'd' suffix - Add TOP support to win32/Makefile.msc -- Suport i686 and amd64 assembler builds in CMakeLists.txt +- Support i686 and amd64 assembler builds in CMakeLists.txt - Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h - Add vc11 and vc12 build files to contrib/vstudio - Add gzvprintf() as an undocumented function in zlib @@ -359,14 +371,14 @@ Changes in 1.2.5.1 (10 Sep 2011) - Use u4 type for crc_table to avoid conversion warnings - Apply casts in zlib.h to avoid conversion warnings - Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller] -- Improve inflateSync() documentation to note indeterminancy +- Improve inflateSync() documentation to note indeterminacy - Add deflatePending() function to return the amount of pending output - Correct the spelling of "specification" in FAQ [Randers-Pehrson] - Add a check in configure for stdarg.h, use for gzprintf() - Check that pointers fit in ints when gzprint() compiled old style - Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler] - Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt] -- Add debug records in assmebler code [Londer] +- Add debug records in assembler code [Londer] - Update RFC references to use http://tools.ietf.org/html/... [Li] - Add --archs option, use of libtool to configure for Mac OS X [Borstel] @@ -1033,7 +1045,7 @@ Changes in 1.2.0.1 (17 March 2003) - Include additional header file on VMS for off_t typedef - Try to use _vsnprintf where it supplants vsprintf [Vollant] - Add some casts in inffast.c -- Enchance comments in zlib.h on what happens if gzprintf() tries to +- Enhance comments in zlib.h on what happens if gzprintf() tries to write more than 4095 bytes before compression - Remove unused state from inflateBackEnd() - Remove exit(0) from minigzip.c, example.c @@ -1211,7 +1223,7 @@ Changes in 1.0.9 (17 Feb 1998) - Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 - in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) - in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with - the declaration of FAR (Gilles VOllant) + the declaration of FAR (Gilles Vollant) - install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) - read_buf buf parameter of type Bytef* instead of charf* - zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) @@ -1567,7 +1579,7 @@ Changes in 0.4: - renamed deflateOptions as deflateInit2, call one or the other but not both - added the method parameter for deflateInit2 - added inflateInit2 -- simplied considerably deflateInit and inflateInit by not supporting +- simplified considerably deflateInit and inflateInit by not supporting user-provided history buffer. This is supported only in deflateInit2 and inflateInit2 diff --git a/sys/contrib/zlib/LICENSE b/sys/contrib/zlib/LICENSE new file mode 100644 index 000000000000..ab8ee6f71428 --- /dev/null +++ b/sys/contrib/zlib/LICENSE @@ -0,0 +1,22 @@ +Copyright notice: + + (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu diff --git a/sys/contrib/zlib/README b/sys/contrib/zlib/README index 024b79d3d8c8..ba34d1894a9b 100644 --- a/sys/contrib/zlib/README +++ b/sys/contrib/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.12 is a general purpose data compression library. All the code is +zlib 1.2.13 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.12 are documented in the file ChangeLog. +The changes made in version 1.2.13 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . diff --git a/sys/contrib/zlib/compress.c b/sys/contrib/zlib/compress.c index e2db404abf88..2ad5326c14ec 100644 --- a/sys/contrib/zlib/compress.c +++ b/sys/contrib/zlib/compress.c @@ -19,7 +19,7 @@ memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) +int ZEXPORT compress2(dest, destLen, source, sourceLen, level) Bytef *dest; uLongf *destLen; const Bytef *source; @@ -65,7 +65,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) /* =========================================================================== */ -int ZEXPORT compress (dest, destLen, source, sourceLen) +int ZEXPORT compress(dest, destLen, source, sourceLen) Bytef *dest; uLongf *destLen; const Bytef *source; @@ -78,7 +78,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen) If the default memLevel or windowBits for deflateInit() is changed, then this function needs to be updated. */ -uLong ZEXPORT compressBound (sourceLen) +uLong ZEXPORT compressBound(sourceLen) uLong sourceLen; { return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + diff --git a/sys/contrib/zlib/contrib/README.contrib b/sys/contrib/zlib/contrib/README.contrib index 335e43508be2..5e5f95054090 100644 --- a/sys/contrib/zlib/contrib/README.contrib +++ b/sys/contrib/zlib/contrib/README.contrib @@ -1,4 +1,4 @@ -All files under this contrib directory are UNSUPPORTED. There were +All files under this contrib directory are UNSUPPORTED. They were provided by users of zlib and were not tested by the authors of zlib. Use at your own risk. Please contact the authors of the contributions for help about these, not the zlib authors. Thanks. diff --git a/sys/contrib/zlib/crc32.c b/sys/contrib/zlib/crc32.c index 382b9a322fda..7b0e60462dda 100644 --- a/sys/contrib/zlib/crc32.c +++ b/sys/contrib/zlib/crc32.c @@ -98,13 +98,22 @@ # endif #endif +/* If available, use the ARM processor CRC32 instruction. */ +#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 +# define ARMCRC32 +#endif + /* Local functions. */ local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); -/* If available, use the ARM processor CRC32 instruction. */ -#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 -# define ARMCRC32 +#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) + local z_word_t byte_swap OF((z_word_t word)); +#endif + +#if defined(W) && !defined(ARMCRC32) + local z_crc_t crc_word OF((z_word_t data)); + local z_word_t crc_word_big OF((z_word_t data)); #endif #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) @@ -647,8 +656,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) len &= 7; /* Do three interleaved CRCs to realize the throughput of one crc32x - instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three - CRCs are combined into a single CRC after each set of batches. */ + instruction per cycle. Each CRC is calculated on Z_BATCH words. The + three CRCs are combined into a single CRC after each set of batches. */ while (num >= 3 * Z_BATCH) { crc1 = 0; crc2 = 0; @@ -1092,7 +1101,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2) uLong crc2; z_off_t len2; { - return crc32_combine64(crc1, crc2, len2); + return crc32_combine64(crc1, crc2, (z_off64_t)len2); } /* ========================================================================= */ @@ -1109,11 +1118,11 @@ uLong ZEXPORT crc32_combine_gen64(len2) uLong ZEXPORT crc32_combine_gen(len2) z_off_t len2; { - return crc32_combine_gen64(len2); + return crc32_combine_gen64((z_off64_t)len2); } /* ========================================================================= */ -uLong crc32_combine_op(crc1, crc2, op) +uLong ZEXPORT crc32_combine_op(crc1, crc2, op) uLong crc1; uLong crc2; uLong op; diff --git a/sys/contrib/zlib/deflate.c b/sys/contrib/zlib/deflate.c index af9e4bcf2918..cffe335093d6 100644 --- a/sys/contrib/zlib/deflate.c +++ b/sys/contrib/zlib/deflate.c @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.13 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -87,13 +87,7 @@ local void lm_init OF((deflate_state *s)); local void putShortMSB OF((deflate_state *s, uInt b)); local void flush_pending OF((z_streamp strm)); local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifdef ASMV -# pragma message("Assembler code may have bugs -- use at your own risk") - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif #ifdef ZLIB_DEBUG local void check_match OF((deflate_state *s, IPos start, IPos match, @@ -160,7 +154,7 @@ local const config configuration_table[10] = { * characters, so that a running hash key can be computed from the previous * key instead of complete recalculation each time. */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) +#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask) /* =========================================================================== @@ -191,9 +185,9 @@ local const config configuration_table[10] = { */ #define CLEAR_HASH(s) \ do { \ - s->head[s->hash_size-1] = NIL; \ + s->head[s->hash_size - 1] = NIL; \ zmemzero((Bytef *)s->head, \ - (unsigned)(s->hash_size-1)*sizeof(*s->head)); \ + (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \ } while (0) /* =========================================================================== @@ -285,6 +279,8 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, if (windowBits < 0) { /* suppress zlib wrapper */ wrap = 0; + if (windowBits < -15) + return Z_STREAM_ERROR; windowBits = -windowBits; } #ifdef GZIP @@ -314,7 +310,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, s->hash_bits = (uInt)memLevel + 7; s->hash_size = 1 << s->hash_bits; s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + s->hash_shift = ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH); s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); @@ -340,11 +336,11 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, * sym_buf value to read moves forward three bytes. From that symbol, up to * 31 bits are written to pending_buf. The closest the written pending_buf * bits gets to the next sym_buf symbol to read is just before the last - * code is written. At that time, 31*(n-2) bits have been written, just - * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at - * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1 + * code is written. At that time, 31*(n - 2) bits have been written, just + * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at + * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1 * symbols are written.) The closest the writing gets to what is unread is - * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and + * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and * can range from 128 to 32768. * * Therefore, at a minimum, there are 142 bits of space between what is @@ -390,7 +386,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, /* ========================================================================= * Check for a valid deflate stream state. Return 0 if ok, 1 if not. */ -local int deflateStateCheck (strm) +local int deflateStateCheck(strm) z_streamp strm; { deflate_state *s; @@ -413,7 +409,7 @@ local int deflateStateCheck (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) +int ZEXPORT deflateSetDictionary(strm, dictionary, dictLength) z_streamp strm; const Bytef *dictionary; uInt dictLength; @@ -482,7 +478,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) +int ZEXPORT deflateGetDictionary(strm, dictionary, dictLength) z_streamp strm; Bytef *dictionary; uInt *dictLength; @@ -504,7 +500,7 @@ int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateResetKeep (strm) +int ZEXPORT deflateResetKeep(strm) z_streamp strm; { deflate_state *s; @@ -542,7 +538,7 @@ int ZEXPORT deflateResetKeep (strm) } /* ========================================================================= */ -int ZEXPORT deflateReset (strm) +int ZEXPORT deflateReset(strm) z_streamp strm; { int ret; @@ -554,7 +550,7 @@ int ZEXPORT deflateReset (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) +int ZEXPORT deflateSetHeader(strm, head) z_streamp strm; gz_headerp head; { @@ -565,7 +561,7 @@ int ZEXPORT deflateSetHeader (strm, head) } /* ========================================================================= */ -int ZEXPORT deflatePending (strm, pending, bits) +int ZEXPORT deflatePending(strm, pending, bits) unsigned *pending; int *bits; z_streamp strm; @@ -579,7 +575,7 @@ int ZEXPORT deflatePending (strm, pending, bits) } /* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) +int ZEXPORT deflatePrime(strm, bits, value) z_streamp strm; int bits; int value; @@ -674,36 +670,50 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) } /* ========================================================================= - * For the default windowBits of 15 and memLevel of 8, this function returns - * a close to exact, as well as small, upper bound on the compressed size. - * They are coded as constants here for a reason--if the #define's are - * changed, then this function needs to be changed as well. The return - * value for 15 and 8 only works for those exact settings. + * For the default windowBits of 15 and memLevel of 8, this function returns a + * close to exact, as well as small, upper bound on the compressed size. This + * is an expansion of ~0.03%, plus a small constant. + * + * For any setting other than those defaults for windowBits and memLevel, one + * of two worst case bounds is returned. This is at most an expansion of ~4% or + * ~13%, plus a small constant. * - * For any setting other than those defaults for windowBits and memLevel, - * the value returned is a conservative worst case for the maximum expansion - * resulting from using fixed blocks instead of stored blocks, which deflate - * can emit on compressed data for some combinations of the parameters. + * Both the 0.03% and 4% derive from the overhead of stored blocks. The first + * one is for stored blocks of 16383 bytes (memLevel == 8), whereas the second + * is for stored blocks of 127 bytes (the worst case memLevel == 1). The + * expansion results from five bytes of header for each stored block. * - * This function could be more sophisticated to provide closer upper bounds for - * every combination of windowBits and memLevel. But even the conservative - * upper bound of about 14% expansion does not seem onerous for output buffer - * allocation. + * The larger expansion of 13% results from a window size less than or equal to + * the symbols buffer size (windowBits <= memLevel + 7). In that case some of + * the data being compressed may have slid out of the sliding window, impeding + * a stored block from being emitted. Then the only choice is a fixed or + * dynamic block, where a fixed block limits the maximum expansion to 9 bits + * per 8-bit byte, plus 10 bits for every block. The smallest block size for + * which this can occur is 255 (memLevel == 2). + * + * Shifts are used to approximate divisions, for speed. */ uLong ZEXPORT deflateBound(strm, sourceLen) z_streamp strm; uLong sourceLen; { deflate_state *s; - uLong complen, wraplen; + uLong fixedlen, storelen, wraplen; + + /* upper bound for fixed blocks with 9-bit literals and length 255 + (memLevel == 2, which is the lowest that may not use stored blocks) -- + ~13% overhead plus a small constant */ + fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) + + (sourceLen >> 9) + 4; - /* conservative upper bound for compressed data */ - complen = sourceLen + - ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; + /* upper bound for stored blocks with length 127 (memLevel == 1) -- + ~4% overhead plus a small constant */ + storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) + + (sourceLen >> 11) + 7; - /* if can't get parameters, return conservative bound plus zlib wrapper */ + /* if can't get parameters, return larger bound plus a zlib wrapper */ if (deflateStateCheck(strm)) - return complen + 6; + return (fixedlen > storelen ? fixedlen : storelen) + 6; /* compute wrapper length */ s = strm->state; @@ -740,11 +750,12 @@ uLong ZEXPORT deflateBound(strm, sourceLen) wraplen = 6; } - /* if not default parameters, return conservative bound */ + /* if not default parameters, return one of the conservative bounds */ if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return complen + wraplen; + return (s->w_bits <= s->hash_bits ? fixedlen : storelen) + wraplen; - /* default settings: return tight bound for that case */ + /* default settings: return tight bound for that case -- ~0.03% overhead + plus a small constant */ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13 - 6 + wraplen; } @@ -754,7 +765,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen) * IN assertion: the stream state is correct and there is enough room in * pending_buf. */ -local void putShortMSB (s, b) +local void putShortMSB(s, b) deflate_state *s; uInt b; { @@ -801,7 +812,7 @@ local void flush_pending(strm) } while (0) /* ========================================================================= */ -int ZEXPORT deflate (strm, flush) +int ZEXPORT deflate(strm, flush) z_streamp strm; int flush; { @@ -856,7 +867,7 @@ int ZEXPORT deflate (strm, flush) s->status = BUSY_STATE; if (s->status == INIT_STATE) { /* zlib header */ - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8; uInt level_flags; if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) @@ -1116,7 +1127,7 @@ int ZEXPORT deflate (strm, flush) } /* ========================================================================= */ -int ZEXPORT deflateEnd (strm) +int ZEXPORT deflateEnd(strm) z_streamp strm; { int status; @@ -1142,7 +1153,7 @@ int ZEXPORT deflateEnd (strm) * To simplify the source, this is not supported for 16-bit MSDOS (which * doesn't have enough memory anyway to duplicate compression states). */ -int ZEXPORT deflateCopy (dest, source) +int ZEXPORT deflateCopy(dest, source) z_streamp dest; z_streamp source; { @@ -1231,7 +1242,7 @@ local unsigned read_buf(strm, buf, size) /* =========================================================================== * Initialize the "longest match" routines for a new zlib stream */ -local void lm_init (s) +local void lm_init(s) deflate_state *s; { s->window_size = (ulg)2L*s->w_size; @@ -1252,11 +1263,6 @@ local void lm_init (s) s->match_length = s->prev_length = MIN_MATCH-1; s->match_available = 0; s->ins_h = 0; -#ifndef FASTEST -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -#endif } #ifndef FASTEST @@ -1269,10 +1275,6 @@ local void lm_init (s) * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 * OUT assertion: the match length is not greater than s->lookahead. */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ local uInt longest_match(s, cur_match) deflate_state *s; IPos cur_match; /* current match */ @@ -1297,10 +1299,10 @@ local uInt longest_match(s, cur_match) */ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); + register ush scan_end = *(ushf*)(scan + best_len - 1); #else register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end1 = scan[best_len - 1]; register Byte scan_end = scan[best_len]; #endif @@ -1318,7 +1320,8 @@ local uInt longest_match(s, cur_match) */ if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); do { Assert(cur_match < s->strstart, "no future"); @@ -1336,43 +1339,44 @@ local uInt longest_match(s, cur_match) /* This code assumes sizeof(unsigned short) == 2. Do not use * UNALIGNED_OK if your compiler uses a different size. */ - if (*(ushf*)(match+best_len-1) != scan_end || + if (*(ushf*)(match + best_len - 1) != scan_end || *(ushf*)match != scan_start) continue; /* It is not necessary to compare scan[2] and match[2] since they are * always equal when the other bytes match, given that the hash keys * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient + * strstart + 3, + 5, up to strstart + 257. We check for insufficient * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is * necessary to put more guard bytes at the end of the window, or * to check more often for insufficient lookahead. */ Assert(scan[2] == match[2], "scan[2]?"); scan++, match++; do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && scan < strend); /* The funny "do {}" generates better code on most compilers */ - /* Here, scan <= window+strstart+257 */ - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + /* Here, scan <= window + strstart + 257 */ + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); if (*scan == *match) scan++; - len = (MAX_MATCH - 1) - (int)(strend-scan); + len = (MAX_MATCH - 1) - (int)(strend - scan); scan = strend - (MAX_MATCH-1); #else /* UNALIGNED_OK */ - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; + if (match[best_len] != scan_end || + match[best_len - 1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1382,7 +1386,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1391,7 +1395,8 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); len = MAX_MATCH - (int)(strend - scan); scan = strend - MAX_MATCH; @@ -1403,9 +1408,9 @@ local uInt longest_match(s, cur_match) best_len = len; if (len >= nice_match) break; #ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); + scan_end = *(ushf*)(scan + best_len - 1); #else - scan_end1 = scan[best_len-1]; + scan_end1 = scan[best_len - 1]; scan_end = scan[best_len]; #endif } @@ -1415,7 +1420,6 @@ local uInt longest_match(s, cur_match) if ((uInt)best_len <= s->lookahead) return (uInt)best_len; return s->lookahead; } -#endif /* ASMV */ #else /* FASTEST */ @@ -1436,7 +1440,8 @@ local uInt longest_match(s, cur_match) */ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); Assert(cur_match < s->strstart, "no future"); @@ -1446,7 +1451,7 @@ local uInt longest_match(s, cur_match) */ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1456,7 +1461,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1465,7 +1470,7 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), "wild scan"); len = MAX_MATCH - (int)(strend - scan); @@ -1501,7 +1506,7 @@ local void check_match(s, start, match, length) z_error("invalid match"); } if (z_verbose > 1) { - fprintf(stderr,"\\[%d,%d]", start-match, length); + fprintf(stderr,"\\[%d,%d]", start - match, length); do { putc(s->window[start++], stderr); } while (--length != 0); } } @@ -1547,9 +1552,9 @@ local void fill_window(s) /* If the window is almost full and there is insufficient lookahead, * move the upper half to the lower one to make room in the upper half. */ - if (s->strstart >= wsize+MAX_DIST(s)) { + if (s->strstart >= wsize + MAX_DIST(s)) { - zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more); + zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more); s->match_start -= wsize; s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ s->block_start -= (long) wsize; @@ -1682,7 +1687,7 @@ local void fill_window(s) * * deflate_stored() is written to minimize the number of times an input byte is * copied. It is most efficient with large input and output buffers, which - * maximizes the opportunites to have a single copy from next_in to next_out. + * maximizes the opportunities to have a single copy from next_in to next_out. */ local block_state deflate_stored(s, flush) deflate_state *s; @@ -1892,7 +1897,7 @@ local block_state deflate_fast(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -1940,7 +1945,7 @@ local block_state deflate_fast(s, flush) s->strstart += s->match_length; s->match_length = 0; s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); + UPDATE_HASH(s, s->ins_h, s->window[s->strstart + 1]); #if MIN_MATCH != 3 Call UPDATE_HASH() MIN_MATCH-3 more times #endif @@ -1951,7 +1956,7 @@ local block_state deflate_fast(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -1995,7 +2000,7 @@ local block_state deflate_slow(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -2037,17 +2042,17 @@ local block_state deflate_slow(s, flush) uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ - check_match(s, s->strstart-1, s->prev_match, s->prev_length); + check_match(s, s->strstart - 1, s->prev_match, s->prev_length); - _tr_tally_dist(s, s->strstart -1 - s->prev_match, + _tr_tally_dist(s, s->strstart - 1 - s->prev_match, s->prev_length - MIN_MATCH, bflush); /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not + * strstart - 1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ - s->lookahead -= s->prev_length-1; + s->lookahead -= s->prev_length - 1; s->prev_length -= 2; do { if (++s->strstart <= max_insert) { @@ -2065,8 +2070,8 @@ local block_state deflate_slow(s, flush) * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); if (bflush) { FLUSH_BLOCK_ONLY(s, 0); } @@ -2084,8 +2089,8 @@ local block_state deflate_slow(s, flush) } Assert (flush != Z_NO_FLUSH, "no flush?"); if (s->match_available) { - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); s->match_available = 0; } s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; @@ -2142,7 +2147,8 @@ local block_state deflate_rle(s, flush) if (s->match_length > s->lookahead) s->match_length = s->lookahead; } - Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (uInt)(s->window_size - 1), + "wild scan"); } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ @@ -2157,7 +2163,7 @@ local block_state deflate_rle(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -2197,7 +2203,7 @@ local block_state deflate_huff(s, flush) /* Output a literal byte */ s->match_length = 0; Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; if (bflush) FLUSH_BLOCK(s, 0); diff --git a/sys/contrib/zlib/deflate.h b/sys/contrib/zlib/deflate.h index 17c226113b08..1a06cd5f25d1 100644 --- a/sys/contrib/zlib/deflate.h +++ b/sys/contrib/zlib/deflate.h @@ -329,8 +329,8 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, # define _tr_tally_dist(s, distance, length, flush) \ { uch len = (uch)(length); \ ush dist = (ush)(distance); \ - s->sym_buf[s->sym_next++] = dist; \ - s->sym_buf[s->sym_next++] = dist >> 8; \ + s->sym_buf[s->sym_next++] = (uch)dist; \ + s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \ s->sym_buf[s->sym_next++] = len; \ dist--; \ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ diff --git a/sys/contrib/zlib/gzlib.c b/sys/contrib/zlib/gzlib.c index 9370974647b4..40830201e4e9 100644 --- a/sys/contrib/zlib/gzlib.c +++ b/sys/contrib/zlib/gzlib.c @@ -34,7 +34,7 @@ local gzFile gz_open OF((const void *, int, const char *)); The gz_strwinerror function does not change the current setting of GetLastError. */ -char ZLIB_INTERNAL *gz_strwinerror (error) +char ZLIB_INTERNAL *gz_strwinerror(error) DWORD error; { static char buf[1024]; diff --git a/sys/contrib/zlib/gzread.c b/sys/contrib/zlib/gzread.c index a0d48949e681..3cc1f84ad690 100644 --- a/sys/contrib/zlib/gzread.c +++ b/sys/contrib/zlib/gzread.c @@ -160,11 +160,9 @@ local int gz_look(state) the output buffer is larger than the input buffer, which also assures space for gzungetc() */ state->x.next = state->out; - if (strm->avail_in) { - memcpy(state->x.next, strm->next_in, strm->avail_in); - state->x.have = strm->avail_in; - strm->avail_in = 0; - } + memcpy(state->x.next, strm->next_in, strm->avail_in); + state->x.have = strm->avail_in; + strm->avail_in = 0; state->how = COPY; state->direct = 1; return 0; diff --git a/sys/contrib/zlib/gzwrite.c b/sys/contrib/zlib/gzwrite.c index a02b87e565ed..5a9aebb6ff8d 100644 --- a/sys/contrib/zlib/gzwrite.c +++ b/sys/contrib/zlib/gzwrite.c @@ -477,7 +477,7 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) #else /* !STDC && !Z_HAVE_STDARG_H */ /* -- see zlib.h -- */ -int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, +int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) gzFile file; const char *format; diff --git a/sys/contrib/zlib/infback.c b/sys/contrib/zlib/infback.c index 3a1282bb88ce..ab9810070c09 100644 --- a/sys/contrib/zlib/infback.c +++ b/sys/contrib/zlib/infback.c @@ -66,6 +66,7 @@ int stream_size; state->window = window; state->wnext = 0; state->whave = 0; + state->sane = 1; return Z_OK; } @@ -605,25 +606,27 @@ void FAR *out_desc; break; case DONE: - /* inflate stream terminated properly -- write leftover output */ + /* inflate stream terminated properly */ ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } goto inf_leave; case BAD: ret = Z_DATA_ERROR; goto inf_leave; - default: /* can't happen, but makes compilers happy */ + default: + /* can't happen, but makes compilers happy */ ret = Z_STREAM_ERROR; goto inf_leave; } - /* Return unused input */ + /* Write leftover output and return unused input */ inf_leave: + if (left < state->wsize) { *** 782 LINES SKIPPED *** From nobody Thu Feb 23 05:06:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMgwR214Tz3syr5; Thu, 23 Feb 2023 05:06: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 4PMgwR1NnLz4Xrm; Thu, 23 Feb 2023 05:06:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677128775; h=from:from:reply-to:subject:subject: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/XXTqKoLd7w9dqDHnWcbVybEJ/CSFwhLasuvXNvxyI=; b=Cm09oFWlHVn8umx5dRhobXmG/vXX6UB5fKWHoBo9ramp/HHtlwpWJBgYJu5+jHDPzIAmYJ RGGqGi0s9gwR6a1N1AlVaenqyeKWgNwsOzKOhMBLo6HITcpWmSdh1dVqCzcs+NUYhrnMzi KNgu+Zbn9HrA/Wq9uHa15hg8PjdKDn+O5mJqRI8U+Y9MUTS6fq/8ZbQ6qnobm57gvz3nDM OTIeFqsYMV4kWLQK8Io8OaH9vIfmEYA6fet0DwSX783vAwkdJX2k5x8vgDUjCHeUPAEw3E 25U6koheJSOBUK8/xvb6M5g9LrV8zdoxYwk9WDLy2bYm/rp/KgS056a/ZpC1Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677128775; h=from:from:reply-to:subject:subject: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/XXTqKoLd7w9dqDHnWcbVybEJ/CSFwhLasuvXNvxyI=; b=FL88vbtAnUxPYQkabhQJzBpiau+fpVVnyU2uxUdy2BhCdkFbqGjnxhj2XRsH8q9i00C9Kt DRJOdloVbSiwU0Mto28j2YFd0TFz2PNUzhfOH30QZNL6IWYQLK1Wb3sFZG4wZ3m+YRH5G8 1fi8SItWLHfARRDdDWBPeXSPnyrf/WoF1MZIOHHSGbJlFi8RsYgAqzlymfA3NqSX31wcpv fJ2NM/W8fekKYPPQUjsiSjZMaoKzjCe1Qak+EvFy+/fy0JutcJlOWQ/IwsTu8+CvQtQe9C TRR98YouAGwHJ21jSCBRpYn5yMqJPwI6UQ0InTGqE+LDqEAfSmWIIiAePhlXGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677128775; a=rsa-sha256; cv=none; b=Uz3dpeBCBuDkEQqrBLOx39cMgmpoMu3AuveFS3Pt6evykxsNJFYF6xkQtrLeyrtWZLKnR7 6OFG2CureALXYYdTzZbJ+xzPAFb2xg1EsoSp15ArSsOENIToZP7VK9aCNukwFUoujGhZ+x 2yTPoR6E43DChHZqHct4hZ0TJstfIguzLH0qBcT9Phg0i+A2TtUolXcq5b/Evsx5E4Hq+v WP5ibxZvoNwS4mckzUdUQNSgAqYIeS2/0l+N8VAODuBVHmui0RgcG7yd5Ds8EorbNOz2Dd llzdorP8Olzi6OXwCX7qWClYUEnSZca7WBc17mjHLZ573maU3POLV7bdVE9LpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMgwR0RSvzVYh; Thu, 23 Feb 2023 05:06: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 31N56Fa4073350; Thu, 23 Feb 2023 05:06:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N56ELq073349; Thu, 23 Feb 2023 05:06:14 GMT (envelope-from git) Date: Thu, 23 Feb 2023 05:06:14 GMT Message-Id: <202302230506.31N56ELq073349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: fc9f4715432a - stable/12 - MFV: zlib 1.2.13. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fc9f4715432a820a85428ea7774891674fabf5ea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=fc9f4715432a820a85428ea7774891674fabf5ea commit fc9f4715432a820a85428ea7774891674fabf5ea Author: Xin LI AuthorDate: 2023-02-17 07:57:24 +0000 Commit: Xin LI CommitDate: 2023-02-23 05:06:09 +0000 MFV: zlib 1.2.13. Relnotes: yes (cherry picked from commit e37bb444aa945ed0725766e986698a09bd61b1b2) --- sys/contrib/zlib/ChangeLog | 24 +++- sys/contrib/zlib/LICENSE | 22 ++++ sys/contrib/zlib/README | 4 +- sys/contrib/zlib/compress.c | 6 +- sys/contrib/zlib/contrib/README.contrib | 2 +- sys/contrib/zlib/crc32.c | 25 ++-- sys/contrib/zlib/deflate.c | 218 ++++++++++++++++---------------- sys/contrib/zlib/deflate.h | 4 +- sys/contrib/zlib/gzlib.c | 2 +- sys/contrib/zlib/gzread.c | 8 +- sys/contrib/zlib/gzwrite.c | 2 +- sys/contrib/zlib/infback.c | 17 ++- sys/contrib/zlib/inflate.c | 2 + sys/contrib/zlib/inftrees.c | 4 +- sys/contrib/zlib/inftrees.h | 2 +- sys/contrib/zlib/test/example.c | 3 +- sys/contrib/zlib/test/minigzip.c | 2 +- sys/contrib/zlib/trees.c | 123 +++++++++--------- sys/contrib/zlib/uncompr.c | 4 +- sys/contrib/zlib/zconf.h | 19 ++- sys/contrib/zlib/zconf.h.in | 19 ++- sys/contrib/zlib/zlib.3 | 4 +- sys/contrib/zlib/zlib.h | 20 +-- sys/contrib/zlib/zutil.c | 16 ++- sys/contrib/zlib/zutil.h | 1 + 25 files changed, 317 insertions(+), 236 deletions(-) diff --git a/sys/contrib/zlib/ChangeLog b/sys/contrib/zlib/ChangeLog index f0b0e6180921..457526bc6a51 100644 --- a/sys/contrib/zlib/ChangeLog +++ b/sys/contrib/zlib/ChangeLog @@ -1,6 +1,18 @@ ChangeLog file for zlib +Changes in 1.2.13 (13 Oct 2022) +- Fix configure issue that discarded provided CC definition +- Correct incorrect inputs provided to the CRC functions +- Repair prototypes and exporting of new CRC functions +- Fix inflateBack to detect invalid input with distances too far +- Have infback() deliver all of the available output up to any error +- Fix a bug when getting a gzip header extra field with inflate() +- Fix bug in block type selection when Z_FIXED used +- Tighten deflateBound bounds +- Remove deleted assembler code references +- Various portability and appearance improvements + Changes in 1.2.12 (27 Mar 2022) - Cygwin does not have _wopen(), so do not create gzopen_w() there - Permit a deflateParams() parameter change as soon as possible @@ -159,7 +171,7 @@ Changes in 1.2.7.1 (24 Mar 2013) - Fix types in contrib/minizip to match result of get_crc_table() - Simplify contrib/vstudio/vc10 with 'd' suffix - Add TOP support to win32/Makefile.msc -- Suport i686 and amd64 assembler builds in CMakeLists.txt +- Support i686 and amd64 assembler builds in CMakeLists.txt - Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h - Add vc11 and vc12 build files to contrib/vstudio - Add gzvprintf() as an undocumented function in zlib @@ -359,14 +371,14 @@ Changes in 1.2.5.1 (10 Sep 2011) - Use u4 type for crc_table to avoid conversion warnings - Apply casts in zlib.h to avoid conversion warnings - Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller] -- Improve inflateSync() documentation to note indeterminancy +- Improve inflateSync() documentation to note indeterminacy - Add deflatePending() function to return the amount of pending output - Correct the spelling of "specification" in FAQ [Randers-Pehrson] - Add a check in configure for stdarg.h, use for gzprintf() - Check that pointers fit in ints when gzprint() compiled old style - Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler] - Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt] -- Add debug records in assmebler code [Londer] +- Add debug records in assembler code [Londer] - Update RFC references to use http://tools.ietf.org/html/... [Li] - Add --archs option, use of libtool to configure for Mac OS X [Borstel] @@ -1033,7 +1045,7 @@ Changes in 1.2.0.1 (17 March 2003) - Include additional header file on VMS for off_t typedef - Try to use _vsnprintf where it supplants vsprintf [Vollant] - Add some casts in inffast.c -- Enchance comments in zlib.h on what happens if gzprintf() tries to +- Enhance comments in zlib.h on what happens if gzprintf() tries to write more than 4095 bytes before compression - Remove unused state from inflateBackEnd() - Remove exit(0) from minigzip.c, example.c @@ -1211,7 +1223,7 @@ Changes in 1.0.9 (17 Feb 1998) - Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 - in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) - in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with - the declaration of FAR (Gilles VOllant) + the declaration of FAR (Gilles Vollant) - install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) - read_buf buf parameter of type Bytef* instead of charf* - zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) @@ -1567,7 +1579,7 @@ Changes in 0.4: - renamed deflateOptions as deflateInit2, call one or the other but not both - added the method parameter for deflateInit2 - added inflateInit2 -- simplied considerably deflateInit and inflateInit by not supporting +- simplified considerably deflateInit and inflateInit by not supporting user-provided history buffer. This is supported only in deflateInit2 and inflateInit2 diff --git a/sys/contrib/zlib/LICENSE b/sys/contrib/zlib/LICENSE new file mode 100644 index 000000000000..ab8ee6f71428 --- /dev/null +++ b/sys/contrib/zlib/LICENSE @@ -0,0 +1,22 @@ +Copyright notice: + + (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu diff --git a/sys/contrib/zlib/README b/sys/contrib/zlib/README index 024b79d3d8c8..ba34d1894a9b 100644 --- a/sys/contrib/zlib/README +++ b/sys/contrib/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.12 is a general purpose data compression library. All the code is +zlib 1.2.13 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.12 are documented in the file ChangeLog. +The changes made in version 1.2.13 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . diff --git a/sys/contrib/zlib/compress.c b/sys/contrib/zlib/compress.c index e2db404abf88..2ad5326c14ec 100644 --- a/sys/contrib/zlib/compress.c +++ b/sys/contrib/zlib/compress.c @@ -19,7 +19,7 @@ memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) +int ZEXPORT compress2(dest, destLen, source, sourceLen, level) Bytef *dest; uLongf *destLen; const Bytef *source; @@ -65,7 +65,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) /* =========================================================================== */ -int ZEXPORT compress (dest, destLen, source, sourceLen) +int ZEXPORT compress(dest, destLen, source, sourceLen) Bytef *dest; uLongf *destLen; const Bytef *source; @@ -78,7 +78,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen) If the default memLevel or windowBits for deflateInit() is changed, then this function needs to be updated. */ -uLong ZEXPORT compressBound (sourceLen) +uLong ZEXPORT compressBound(sourceLen) uLong sourceLen; { return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + diff --git a/sys/contrib/zlib/contrib/README.contrib b/sys/contrib/zlib/contrib/README.contrib index 335e43508be2..5e5f95054090 100644 --- a/sys/contrib/zlib/contrib/README.contrib +++ b/sys/contrib/zlib/contrib/README.contrib @@ -1,4 +1,4 @@ -All files under this contrib directory are UNSUPPORTED. There were +All files under this contrib directory are UNSUPPORTED. They were provided by users of zlib and were not tested by the authors of zlib. Use at your own risk. Please contact the authors of the contributions for help about these, not the zlib authors. Thanks. diff --git a/sys/contrib/zlib/crc32.c b/sys/contrib/zlib/crc32.c index 451887bc7ce4..f8357b083f76 100644 --- a/sys/contrib/zlib/crc32.c +++ b/sys/contrib/zlib/crc32.c @@ -98,13 +98,22 @@ # endif #endif +/* If available, use the ARM processor CRC32 instruction. */ +#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 +# define ARMCRC32 +#endif + /* Local functions. */ local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); -/* If available, use the ARM processor CRC32 instruction. */ -#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 -# define ARMCRC32 +#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) + local z_word_t byte_swap OF((z_word_t word)); +#endif + +#if defined(W) && !defined(ARMCRC32) + local z_crc_t crc_word OF((z_word_t data)); + local z_word_t crc_word_big OF((z_word_t data)); #endif #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) @@ -645,8 +654,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) len &= 7; /* Do three interleaved CRCs to realize the throughput of one crc32x - instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three - CRCs are combined into a single CRC after each set of batches. */ + instruction per cycle. Each CRC is calculated on Z_BATCH words. The + three CRCs are combined into a single CRC after each set of batches. */ while (num >= 3 * Z_BATCH) { crc1 = 0; crc2 = 0; @@ -1086,7 +1095,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2) uLong crc2; z_off_t len2; { - return crc32_combine64(crc1, crc2, len2); + return crc32_combine64(crc1, crc2, (z_off64_t)len2); } /* ========================================================================= */ @@ -1103,11 +1112,11 @@ uLong ZEXPORT crc32_combine_gen64(len2) uLong ZEXPORT crc32_combine_gen(len2) z_off_t len2; { - return crc32_combine_gen64(len2); + return crc32_combine_gen64((z_off64_t)len2); } /* ========================================================================= */ -uLong crc32_combine_op(crc1, crc2, op) +uLong ZEXPORT crc32_combine_op(crc1, crc2, op) uLong crc1; uLong crc2; uLong op; diff --git a/sys/contrib/zlib/deflate.c b/sys/contrib/zlib/deflate.c index af9e4bcf2918..cffe335093d6 100644 --- a/sys/contrib/zlib/deflate.c +++ b/sys/contrib/zlib/deflate.c @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.13 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -87,13 +87,7 @@ local void lm_init OF((deflate_state *s)); local void putShortMSB OF((deflate_state *s, uInt b)); local void flush_pending OF((z_streamp strm)); local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifdef ASMV -# pragma message("Assembler code may have bugs -- use at your own risk") - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif #ifdef ZLIB_DEBUG local void check_match OF((deflate_state *s, IPos start, IPos match, @@ -160,7 +154,7 @@ local const config configuration_table[10] = { * characters, so that a running hash key can be computed from the previous * key instead of complete recalculation each time. */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) +#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask) /* =========================================================================== @@ -191,9 +185,9 @@ local const config configuration_table[10] = { */ #define CLEAR_HASH(s) \ do { \ - s->head[s->hash_size-1] = NIL; \ + s->head[s->hash_size - 1] = NIL; \ zmemzero((Bytef *)s->head, \ - (unsigned)(s->hash_size-1)*sizeof(*s->head)); \ + (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \ } while (0) /* =========================================================================== @@ -285,6 +279,8 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, if (windowBits < 0) { /* suppress zlib wrapper */ wrap = 0; + if (windowBits < -15) + return Z_STREAM_ERROR; windowBits = -windowBits; } #ifdef GZIP @@ -314,7 +310,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, s->hash_bits = (uInt)memLevel + 7; s->hash_size = 1 << s->hash_bits; s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + s->hash_shift = ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH); s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); @@ -340,11 +336,11 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, * sym_buf value to read moves forward three bytes. From that symbol, up to * 31 bits are written to pending_buf. The closest the written pending_buf * bits gets to the next sym_buf symbol to read is just before the last - * code is written. At that time, 31*(n-2) bits have been written, just - * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at - * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1 + * code is written. At that time, 31*(n - 2) bits have been written, just + * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at + * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1 * symbols are written.) The closest the writing gets to what is unread is - * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and + * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and * can range from 128 to 32768. * * Therefore, at a minimum, there are 142 bits of space between what is @@ -390,7 +386,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, /* ========================================================================= * Check for a valid deflate stream state. Return 0 if ok, 1 if not. */ -local int deflateStateCheck (strm) +local int deflateStateCheck(strm) z_streamp strm; { deflate_state *s; @@ -413,7 +409,7 @@ local int deflateStateCheck (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) +int ZEXPORT deflateSetDictionary(strm, dictionary, dictLength) z_streamp strm; const Bytef *dictionary; uInt dictLength; @@ -482,7 +478,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) +int ZEXPORT deflateGetDictionary(strm, dictionary, dictLength) z_streamp strm; Bytef *dictionary; uInt *dictLength; @@ -504,7 +500,7 @@ int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateResetKeep (strm) +int ZEXPORT deflateResetKeep(strm) z_streamp strm; { deflate_state *s; @@ -542,7 +538,7 @@ int ZEXPORT deflateResetKeep (strm) } /* ========================================================================= */ -int ZEXPORT deflateReset (strm) +int ZEXPORT deflateReset(strm) z_streamp strm; { int ret; @@ -554,7 +550,7 @@ int ZEXPORT deflateReset (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) +int ZEXPORT deflateSetHeader(strm, head) z_streamp strm; gz_headerp head; { @@ -565,7 +561,7 @@ int ZEXPORT deflateSetHeader (strm, head) } /* ========================================================================= */ -int ZEXPORT deflatePending (strm, pending, bits) +int ZEXPORT deflatePending(strm, pending, bits) unsigned *pending; int *bits; z_streamp strm; @@ -579,7 +575,7 @@ int ZEXPORT deflatePending (strm, pending, bits) } /* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) +int ZEXPORT deflatePrime(strm, bits, value) z_streamp strm; int bits; int value; @@ -674,36 +670,50 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) } /* ========================================================================= - * For the default windowBits of 15 and memLevel of 8, this function returns - * a close to exact, as well as small, upper bound on the compressed size. - * They are coded as constants here for a reason--if the #define's are - * changed, then this function needs to be changed as well. The return - * value for 15 and 8 only works for those exact settings. + * For the default windowBits of 15 and memLevel of 8, this function returns a + * close to exact, as well as small, upper bound on the compressed size. This + * is an expansion of ~0.03%, plus a small constant. + * + * For any setting other than those defaults for windowBits and memLevel, one + * of two worst case bounds is returned. This is at most an expansion of ~4% or + * ~13%, plus a small constant. * - * For any setting other than those defaults for windowBits and memLevel, - * the value returned is a conservative worst case for the maximum expansion - * resulting from using fixed blocks instead of stored blocks, which deflate - * can emit on compressed data for some combinations of the parameters. + * Both the 0.03% and 4% derive from the overhead of stored blocks. The first + * one is for stored blocks of 16383 bytes (memLevel == 8), whereas the second + * is for stored blocks of 127 bytes (the worst case memLevel == 1). The + * expansion results from five bytes of header for each stored block. * - * This function could be more sophisticated to provide closer upper bounds for - * every combination of windowBits and memLevel. But even the conservative - * upper bound of about 14% expansion does not seem onerous for output buffer - * allocation. + * The larger expansion of 13% results from a window size less than or equal to + * the symbols buffer size (windowBits <= memLevel + 7). In that case some of + * the data being compressed may have slid out of the sliding window, impeding + * a stored block from being emitted. Then the only choice is a fixed or + * dynamic block, where a fixed block limits the maximum expansion to 9 bits + * per 8-bit byte, plus 10 bits for every block. The smallest block size for + * which this can occur is 255 (memLevel == 2). + * + * Shifts are used to approximate divisions, for speed. */ uLong ZEXPORT deflateBound(strm, sourceLen) z_streamp strm; uLong sourceLen; { deflate_state *s; - uLong complen, wraplen; + uLong fixedlen, storelen, wraplen; + + /* upper bound for fixed blocks with 9-bit literals and length 255 + (memLevel == 2, which is the lowest that may not use stored blocks) -- + ~13% overhead plus a small constant */ + fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) + + (sourceLen >> 9) + 4; - /* conservative upper bound for compressed data */ - complen = sourceLen + - ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; + /* upper bound for stored blocks with length 127 (memLevel == 1) -- + ~4% overhead plus a small constant */ + storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) + + (sourceLen >> 11) + 7; - /* if can't get parameters, return conservative bound plus zlib wrapper */ + /* if can't get parameters, return larger bound plus a zlib wrapper */ if (deflateStateCheck(strm)) - return complen + 6; + return (fixedlen > storelen ? fixedlen : storelen) + 6; /* compute wrapper length */ s = strm->state; @@ -740,11 +750,12 @@ uLong ZEXPORT deflateBound(strm, sourceLen) wraplen = 6; } - /* if not default parameters, return conservative bound */ + /* if not default parameters, return one of the conservative bounds */ if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return complen + wraplen; + return (s->w_bits <= s->hash_bits ? fixedlen : storelen) + wraplen; - /* default settings: return tight bound for that case */ + /* default settings: return tight bound for that case -- ~0.03% overhead + plus a small constant */ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13 - 6 + wraplen; } @@ -754,7 +765,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen) * IN assertion: the stream state is correct and there is enough room in * pending_buf. */ -local void putShortMSB (s, b) +local void putShortMSB(s, b) deflate_state *s; uInt b; { @@ -801,7 +812,7 @@ local void flush_pending(strm) } while (0) /* ========================================================================= */ -int ZEXPORT deflate (strm, flush) +int ZEXPORT deflate(strm, flush) z_streamp strm; int flush; { @@ -856,7 +867,7 @@ int ZEXPORT deflate (strm, flush) s->status = BUSY_STATE; if (s->status == INIT_STATE) { /* zlib header */ - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8; uInt level_flags; if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) @@ -1116,7 +1127,7 @@ int ZEXPORT deflate (strm, flush) } /* ========================================================================= */ -int ZEXPORT deflateEnd (strm) +int ZEXPORT deflateEnd(strm) z_streamp strm; { int status; @@ -1142,7 +1153,7 @@ int ZEXPORT deflateEnd (strm) * To simplify the source, this is not supported for 16-bit MSDOS (which * doesn't have enough memory anyway to duplicate compression states). */ -int ZEXPORT deflateCopy (dest, source) +int ZEXPORT deflateCopy(dest, source) z_streamp dest; z_streamp source; { @@ -1231,7 +1242,7 @@ local unsigned read_buf(strm, buf, size) /* =========================================================================== * Initialize the "longest match" routines for a new zlib stream */ -local void lm_init (s) +local void lm_init(s) deflate_state *s; { s->window_size = (ulg)2L*s->w_size; @@ -1252,11 +1263,6 @@ local void lm_init (s) s->match_length = s->prev_length = MIN_MATCH-1; s->match_available = 0; s->ins_h = 0; -#ifndef FASTEST -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -#endif } #ifndef FASTEST @@ -1269,10 +1275,6 @@ local void lm_init (s) * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 * OUT assertion: the match length is not greater than s->lookahead. */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ local uInt longest_match(s, cur_match) deflate_state *s; IPos cur_match; /* current match */ @@ -1297,10 +1299,10 @@ local uInt longest_match(s, cur_match) */ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); + register ush scan_end = *(ushf*)(scan + best_len - 1); #else register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end1 = scan[best_len - 1]; register Byte scan_end = scan[best_len]; #endif @@ -1318,7 +1320,8 @@ local uInt longest_match(s, cur_match) */ if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); do { Assert(cur_match < s->strstart, "no future"); @@ -1336,43 +1339,44 @@ local uInt longest_match(s, cur_match) /* This code assumes sizeof(unsigned short) == 2. Do not use * UNALIGNED_OK if your compiler uses a different size. */ - if (*(ushf*)(match+best_len-1) != scan_end || + if (*(ushf*)(match + best_len - 1) != scan_end || *(ushf*)match != scan_start) continue; /* It is not necessary to compare scan[2] and match[2] since they are * always equal when the other bytes match, given that the hash keys * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient + * strstart + 3, + 5, up to strstart + 257. We check for insufficient * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is * necessary to put more guard bytes at the end of the window, or * to check more often for insufficient lookahead. */ Assert(scan[2] == match[2], "scan[2]?"); scan++, match++; do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && scan < strend); /* The funny "do {}" generates better code on most compilers */ - /* Here, scan <= window+strstart+257 */ - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + /* Here, scan <= window + strstart + 257 */ + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); if (*scan == *match) scan++; - len = (MAX_MATCH - 1) - (int)(strend-scan); + len = (MAX_MATCH - 1) - (int)(strend - scan); scan = strend - (MAX_MATCH-1); #else /* UNALIGNED_OK */ - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; + if (match[best_len] != scan_end || + match[best_len - 1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1382,7 +1386,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1391,7 +1395,8 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); len = MAX_MATCH - (int)(strend - scan); scan = strend - MAX_MATCH; @@ -1403,9 +1408,9 @@ local uInt longest_match(s, cur_match) best_len = len; if (len >= nice_match) break; #ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); + scan_end = *(ushf*)(scan + best_len - 1); #else - scan_end1 = scan[best_len-1]; + scan_end1 = scan[best_len - 1]; scan_end = scan[best_len]; #endif } @@ -1415,7 +1420,6 @@ local uInt longest_match(s, cur_match) if ((uInt)best_len <= s->lookahead) return (uInt)best_len; return s->lookahead; } -#endif /* ASMV */ #else /* FASTEST */ @@ -1436,7 +1440,8 @@ local uInt longest_match(s, cur_match) */ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); Assert(cur_match < s->strstart, "no future"); @@ -1446,7 +1451,7 @@ local uInt longest_match(s, cur_match) */ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1456,7 +1461,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1465,7 +1470,7 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), "wild scan"); len = MAX_MATCH - (int)(strend - scan); @@ -1501,7 +1506,7 @@ local void check_match(s, start, match, length) z_error("invalid match"); } if (z_verbose > 1) { - fprintf(stderr,"\\[%d,%d]", start-match, length); + fprintf(stderr,"\\[%d,%d]", start - match, length); do { putc(s->window[start++], stderr); } while (--length != 0); } } @@ -1547,9 +1552,9 @@ local void fill_window(s) /* If the window is almost full and there is insufficient lookahead, * move the upper half to the lower one to make room in the upper half. */ - if (s->strstart >= wsize+MAX_DIST(s)) { + if (s->strstart >= wsize + MAX_DIST(s)) { - zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more); + zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more); s->match_start -= wsize; s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ s->block_start -= (long) wsize; @@ -1682,7 +1687,7 @@ local void fill_window(s) * * deflate_stored() is written to minimize the number of times an input byte is * copied. It is most efficient with large input and output buffers, which - * maximizes the opportunites to have a single copy from next_in to next_out. + * maximizes the opportunities to have a single copy from next_in to next_out. */ local block_state deflate_stored(s, flush) deflate_state *s; @@ -1892,7 +1897,7 @@ local block_state deflate_fast(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -1940,7 +1945,7 @@ local block_state deflate_fast(s, flush) s->strstart += s->match_length; s->match_length = 0; s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); + UPDATE_HASH(s, s->ins_h, s->window[s->strstart + 1]); #if MIN_MATCH != 3 Call UPDATE_HASH() MIN_MATCH-3 more times #endif @@ -1951,7 +1956,7 @@ local block_state deflate_fast(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -1995,7 +2000,7 @@ local block_state deflate_slow(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -2037,17 +2042,17 @@ local block_state deflate_slow(s, flush) uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ - check_match(s, s->strstart-1, s->prev_match, s->prev_length); + check_match(s, s->strstart - 1, s->prev_match, s->prev_length); - _tr_tally_dist(s, s->strstart -1 - s->prev_match, + _tr_tally_dist(s, s->strstart - 1 - s->prev_match, s->prev_length - MIN_MATCH, bflush); /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not + * strstart - 1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ - s->lookahead -= s->prev_length-1; + s->lookahead -= s->prev_length - 1; s->prev_length -= 2; do { if (++s->strstart <= max_insert) { @@ -2065,8 +2070,8 @@ local block_state deflate_slow(s, flush) * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); if (bflush) { FLUSH_BLOCK_ONLY(s, 0); } @@ -2084,8 +2089,8 @@ local block_state deflate_slow(s, flush) } Assert (flush != Z_NO_FLUSH, "no flush?"); if (s->match_available) { - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); s->match_available = 0; } s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; @@ -2142,7 +2147,8 @@ local block_state deflate_rle(s, flush) if (s->match_length > s->lookahead) s->match_length = s->lookahead; } - Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (uInt)(s->window_size - 1), + "wild scan"); } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ @@ -2157,7 +2163,7 @@ local block_state deflate_rle(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -2197,7 +2203,7 @@ local block_state deflate_huff(s, flush) /* Output a literal byte */ s->match_length = 0; Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; if (bflush) FLUSH_BLOCK(s, 0); diff --git a/sys/contrib/zlib/deflate.h b/sys/contrib/zlib/deflate.h index 17c226113b08..1a06cd5f25d1 100644 --- a/sys/contrib/zlib/deflate.h +++ b/sys/contrib/zlib/deflate.h @@ -329,8 +329,8 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, # define _tr_tally_dist(s, distance, length, flush) \ { uch len = (uch)(length); \ ush dist = (ush)(distance); \ - s->sym_buf[s->sym_next++] = dist; \ - s->sym_buf[s->sym_next++] = dist >> 8; \ + s->sym_buf[s->sym_next++] = (uch)dist; \ + s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \ s->sym_buf[s->sym_next++] = len; \ dist--; \ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ diff --git a/sys/contrib/zlib/gzlib.c b/sys/contrib/zlib/gzlib.c index 4637ea4a0524..93f4dbba1801 100644 --- a/sys/contrib/zlib/gzlib.c +++ b/sys/contrib/zlib/gzlib.c @@ -33,7 +33,7 @@ local gzFile gz_open OF((const void *, int, const char *)); The gz_strwinerror function does not change the current setting of GetLastError. */ -char ZLIB_INTERNAL *gz_strwinerror (error) +char ZLIB_INTERNAL *gz_strwinerror(error) DWORD error; { static char buf[1024]; diff --git a/sys/contrib/zlib/gzread.c b/sys/contrib/zlib/gzread.c index a0d48949e681..3cc1f84ad690 100644 --- a/sys/contrib/zlib/gzread.c +++ b/sys/contrib/zlib/gzread.c @@ -160,11 +160,9 @@ local int gz_look(state) the output buffer is larger than the input buffer, which also assures space for gzungetc() */ state->x.next = state->out; - if (strm->avail_in) { - memcpy(state->x.next, strm->next_in, strm->avail_in); - state->x.have = strm->avail_in; - strm->avail_in = 0; - } + memcpy(state->x.next, strm->next_in, strm->avail_in); + state->x.have = strm->avail_in; + strm->avail_in = 0; state->how = COPY; state->direct = 1; return 0; diff --git a/sys/contrib/zlib/gzwrite.c b/sys/contrib/zlib/gzwrite.c index a02b87e565ed..5a9aebb6ff8d 100644 --- a/sys/contrib/zlib/gzwrite.c +++ b/sys/contrib/zlib/gzwrite.c @@ -477,7 +477,7 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) #else /* !STDC && !Z_HAVE_STDARG_H */ /* -- see zlib.h -- */ -int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, +int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) gzFile file; const char *format; diff --git a/sys/contrib/zlib/infback.c b/sys/contrib/zlib/infback.c index 3a1282bb88ce..ab9810070c09 100644 --- a/sys/contrib/zlib/infback.c +++ b/sys/contrib/zlib/infback.c @@ -66,6 +66,7 @@ int stream_size; state->window = window; state->wnext = 0; state->whave = 0; + state->sane = 1; return Z_OK; } @@ -605,25 +606,27 @@ void FAR *out_desc; break; case DONE: - /* inflate stream terminated properly -- write leftover output */ + /* inflate stream terminated properly */ ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } goto inf_leave; case BAD: ret = Z_DATA_ERROR; goto inf_leave; - default: /* can't happen, but makes compilers happy */ + default: + /* can't happen, but makes compilers happy */ ret = Z_STREAM_ERROR; goto inf_leave; } - /* Return unused input */ + /* Write leftover output and return unused input */ inf_leave: + if (left < state->wsize) { *** 782 LINES SKIPPED *** From nobody Thu Feb 23 06:28:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMjlq3hfnz3t3sJ; Thu, 23 Feb 2023 06:28:55 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4PMjlp3FFsz3GMD; Thu, 23 Feb 2023 06:28:54 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 162.251.186.162 is neither permitted nor denied by domain of glebius@freebsd.org) smtp.mailfrom=glebius@freebsd.org; dmarc=none Received: by glebi.us (Postfix, from userid 1000) id 3FD5D3B026; Wed, 22 Feb 2023 22:28:53 -0800 (PST) Date: Wed, 22 Feb 2023 22:28:53 -0800 From: Gleb Smirnoff To: Rick Macklem Cc: Rick Macklem , bz@freebsd.org, jamie@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup Message-ID: References: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [0.50 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_TO(0.00)[gmail.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[glebius]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TAGGED_RCPT(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4PMjlp3FFsz3GMD X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N Rick, On Tue, Feb 21, 2023 at 07:29:30PM -0800, Rick Macklem wrote: R> I did that for one of the ones related to nfsd (sys/fs/nfsserver/nfs_fha_new.c). This one actually doesn't look correct to me. What happens here is that the sysctls will affect only the default VNET. I think the VNET-itezation of this file went a bit wrong. You don't need to convert static structures to malloced when you VNET-ize a module. The infrastructure should take care of memory management. The dynamic sysctl context seems to be unneeded from the very beginning. It was always attached to the static softc. Suggested patch: https://reviews.freebsd.org/D38742 It gets rid of one case of IS_DEFAULT_VNET. Tested very little: run two jails and observed difference in sysctl. R> It so happens it doesn't work for this case. If you look at the patch, you'll R> see that the variable is vnet'd. It happens that it is only malloc'd for prisons R> other than prison0. (For prison0, it points to a global structure that is not R> malloc'd and is shared with the NFS client, which is not vnet'd. I think all of this instances can be fixed. For example nfsstatsv1, which is now malloced for non-default vnets and static for the default. Lots of modules still incorrectly update the global one. This patch makes it right: https://reviews.freebsd.org/D38743 Tested very little: run two jails, use some NFS, observe difference in nfsstat. Removes another IS_DEFAULT_VNET. Note that D38743 is still far from perfect. NFS would benefit a lot if used macros for per-VNET per-CPU (raceless!) stats, that are used in TCP/IP. Sorry, they aren't documented :( You can find them in vnet.h starting from VNET_PCPUSTAT_DECLARE() and look for example usage in TCP/IP. Please fill free to commandeer those reviews from me and finalize them if you agree with general idea. -- Gleb Smirnoff From nobody Thu Feb 23 06:56:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMkMj5Vjdz3t5cf; Thu, 23 Feb 2023 06:56: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 4PMkMj5D5hz3Kcp; Thu, 23 Feb 2023 06:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677135393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AeS1UdWcd0VmDifuipSRq7IvdPJt8zwJgMcCUQB2kXc=; b=MUmJHW4ji2sEeVlFuogc6gBEURfdSTeKehcIXo1oXSVw0CScbiBeMpsHHYhLwNtWBilqHY Xho9avU9fyY6GLkaSIg/HOk34kCNeGi1DiT1mGY7HI5gYI//9yaYD4ThA6sQshjqsx3/PB P1wsYJjKHKltD5cf5vK37CR9GC/vsxCoueqWzqLy1N5Zj3tbKaH//DaPU7J+Pu/2Qjo9Ki l66VWQ0TjPFPdINU8lgC054IXe5aDCL5OWPOuIjItH+6zg4yeEgSrNNUzsQ9pFH3xS+r8J 3f+U2N5ForVG8+3yzZWAD3j9ATLqYH9pridlUsONpN1QfLNoMGoDRzpInyXxVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677135393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AeS1UdWcd0VmDifuipSRq7IvdPJt8zwJgMcCUQB2kXc=; b=djVV/G9BzXhIynz/SvuGtLAXZUGNHFaUwjFEdvaQL0cMdxX8/EGYGinlXkenyFRUyWY4aa ez05tI/doWj6bslHH9KQf9spZZ4pOKQGVv0hSRyi/yxh2Xn1hjtHCSDPPzNsXmFQnVOKgR SXSIVBRPWnbwpLDBblCkUSu8biUPiDtiUPaD12RBPL0uLAcckspndclnxJTnF4D6K8KAlL I4z+qkZrGYyHZBDDaxJVts/8yxYX/RM/VQt91UVPwbfFYY7SDJWUqbIgEppWMzbTLqmAv4 FqbUtYPSGPVZEjAQhqnfihryQ+0R3cYMFPKzog4JBzv1NMbFj1ACMx+KAOVkwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677135393; a=rsa-sha256; cv=none; b=ReCwoXJnGnz6G7vk82JVrU55R9bQa7Q8NwtoXDHElj9EnivDeSvqgLibbEKJVfXYdT5LSF mIgIYSq+8VZ5bCcpghSowg8FOL+UkjZRZ+GLipXOfXqxzP/YXw449QaUQ4i3sxzlWSNG/E RSq6ijy875Czj+aRAMDUxzOlehi0UneJpAOGv3R5yaj18I+k4huWo/u75bWru3H1fxFIMv cg8Vcpksow4E4yllRyb56ugMucTFD2BpsprTFkUfsuNSTQ9ykm3c2FnZkyDtI9HyUJ4yZN UUvOlxnnw1cFyx1rGsCWEnh8VLLXGM0QDmAGZnHCgAMbdmH56SLxrjIEt+kRTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMkMj4JsJzXGj; Thu, 23 Feb 2023 06:56: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 31N6uXCG029344; Thu, 23 Feb 2023 06:56:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N6uXHJ029343; Thu, 23 Feb 2023 06:56:33 GMT (envelope-from git) Date: Thu, 23 Feb 2023 06:56:33 GMT Message-Id: <202302230656.31N6uXHJ029343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 16a1df8f2dac - releng/13.2 - MFV: zlib 1.2.13. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 16a1df8f2dace0d33fededc8f17afb87c9a8a9f6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=16a1df8f2dace0d33fededc8f17afb87c9a8a9f6 commit 16a1df8f2dace0d33fededc8f17afb87c9a8a9f6 Author: Xin LI AuthorDate: 2023-02-17 07:57:24 +0000 Commit: Xin LI CommitDate: 2023-02-23 06:56:20 +0000 MFV: zlib 1.2.13. Relnotes: yes Approved by: re (cperciva) (cherry picked from commit e37bb444aa945ed0725766e986698a09bd61b1b2) (cherry picked from commit 3a7d654ed82bc2b379549f8b2ac1e8ac6a638fa5) --- sys/contrib/zlib/ChangeLog | 24 +++- sys/contrib/zlib/LICENSE | 22 ++++ sys/contrib/zlib/README | 4 +- sys/contrib/zlib/compress.c | 6 +- sys/contrib/zlib/contrib/README.contrib | 2 +- sys/contrib/zlib/crc32.c | 25 ++-- sys/contrib/zlib/deflate.c | 218 ++++++++++++++++---------------- sys/contrib/zlib/deflate.h | 4 +- sys/contrib/zlib/gzlib.c | 2 +- sys/contrib/zlib/gzread.c | 8 +- sys/contrib/zlib/gzwrite.c | 2 +- sys/contrib/zlib/infback.c | 17 ++- sys/contrib/zlib/inflate.c | 2 + sys/contrib/zlib/inftrees.c | 4 +- sys/contrib/zlib/inftrees.h | 2 +- sys/contrib/zlib/test/example.c | 3 +- sys/contrib/zlib/test/minigzip.c | 2 +- sys/contrib/zlib/trees.c | 123 +++++++++--------- sys/contrib/zlib/uncompr.c | 4 +- sys/contrib/zlib/zconf.h | 19 ++- sys/contrib/zlib/zconf.h.in | 19 ++- sys/contrib/zlib/zlib.3 | 4 +- sys/contrib/zlib/zlib.h | 20 +-- sys/contrib/zlib/zutil.c | 16 ++- sys/contrib/zlib/zutil.h | 1 + 25 files changed, 317 insertions(+), 236 deletions(-) diff --git a/sys/contrib/zlib/ChangeLog b/sys/contrib/zlib/ChangeLog index f0b0e6180921..457526bc6a51 100644 --- a/sys/contrib/zlib/ChangeLog +++ b/sys/contrib/zlib/ChangeLog @@ -1,6 +1,18 @@ ChangeLog file for zlib +Changes in 1.2.13 (13 Oct 2022) +- Fix configure issue that discarded provided CC definition +- Correct incorrect inputs provided to the CRC functions +- Repair prototypes and exporting of new CRC functions +- Fix inflateBack to detect invalid input with distances too far +- Have infback() deliver all of the available output up to any error +- Fix a bug when getting a gzip header extra field with inflate() +- Fix bug in block type selection when Z_FIXED used +- Tighten deflateBound bounds +- Remove deleted assembler code references +- Various portability and appearance improvements + Changes in 1.2.12 (27 Mar 2022) - Cygwin does not have _wopen(), so do not create gzopen_w() there - Permit a deflateParams() parameter change as soon as possible @@ -159,7 +171,7 @@ Changes in 1.2.7.1 (24 Mar 2013) - Fix types in contrib/minizip to match result of get_crc_table() - Simplify contrib/vstudio/vc10 with 'd' suffix - Add TOP support to win32/Makefile.msc -- Suport i686 and amd64 assembler builds in CMakeLists.txt +- Support i686 and amd64 assembler builds in CMakeLists.txt - Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h - Add vc11 and vc12 build files to contrib/vstudio - Add gzvprintf() as an undocumented function in zlib @@ -359,14 +371,14 @@ Changes in 1.2.5.1 (10 Sep 2011) - Use u4 type for crc_table to avoid conversion warnings - Apply casts in zlib.h to avoid conversion warnings - Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller] -- Improve inflateSync() documentation to note indeterminancy +- Improve inflateSync() documentation to note indeterminacy - Add deflatePending() function to return the amount of pending output - Correct the spelling of "specification" in FAQ [Randers-Pehrson] - Add a check in configure for stdarg.h, use for gzprintf() - Check that pointers fit in ints when gzprint() compiled old style - Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler] - Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt] -- Add debug records in assmebler code [Londer] +- Add debug records in assembler code [Londer] - Update RFC references to use http://tools.ietf.org/html/... [Li] - Add --archs option, use of libtool to configure for Mac OS X [Borstel] @@ -1033,7 +1045,7 @@ Changes in 1.2.0.1 (17 March 2003) - Include additional header file on VMS for off_t typedef - Try to use _vsnprintf where it supplants vsprintf [Vollant] - Add some casts in inffast.c -- Enchance comments in zlib.h on what happens if gzprintf() tries to +- Enhance comments in zlib.h on what happens if gzprintf() tries to write more than 4095 bytes before compression - Remove unused state from inflateBackEnd() - Remove exit(0) from minigzip.c, example.c @@ -1211,7 +1223,7 @@ Changes in 1.0.9 (17 Feb 1998) - Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 - in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) - in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with - the declaration of FAR (Gilles VOllant) + the declaration of FAR (Gilles Vollant) - install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) - read_buf buf parameter of type Bytef* instead of charf* - zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) @@ -1567,7 +1579,7 @@ Changes in 0.4: - renamed deflateOptions as deflateInit2, call one or the other but not both - added the method parameter for deflateInit2 - added inflateInit2 -- simplied considerably deflateInit and inflateInit by not supporting +- simplified considerably deflateInit and inflateInit by not supporting user-provided history buffer. This is supported only in deflateInit2 and inflateInit2 diff --git a/sys/contrib/zlib/LICENSE b/sys/contrib/zlib/LICENSE new file mode 100644 index 000000000000..ab8ee6f71428 --- /dev/null +++ b/sys/contrib/zlib/LICENSE @@ -0,0 +1,22 @@ +Copyright notice: + + (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu diff --git a/sys/contrib/zlib/README b/sys/contrib/zlib/README index 024b79d3d8c8..ba34d1894a9b 100644 --- a/sys/contrib/zlib/README +++ b/sys/contrib/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.12 is a general purpose data compression library. All the code is +zlib 1.2.13 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.12 are documented in the file ChangeLog. +The changes made in version 1.2.13 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . diff --git a/sys/contrib/zlib/compress.c b/sys/contrib/zlib/compress.c index e2db404abf88..2ad5326c14ec 100644 --- a/sys/contrib/zlib/compress.c +++ b/sys/contrib/zlib/compress.c @@ -19,7 +19,7 @@ memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) +int ZEXPORT compress2(dest, destLen, source, sourceLen, level) Bytef *dest; uLongf *destLen; const Bytef *source; @@ -65,7 +65,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) /* =========================================================================== */ -int ZEXPORT compress (dest, destLen, source, sourceLen) +int ZEXPORT compress(dest, destLen, source, sourceLen) Bytef *dest; uLongf *destLen; const Bytef *source; @@ -78,7 +78,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen) If the default memLevel or windowBits for deflateInit() is changed, then this function needs to be updated. */ -uLong ZEXPORT compressBound (sourceLen) +uLong ZEXPORT compressBound(sourceLen) uLong sourceLen; { return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + diff --git a/sys/contrib/zlib/contrib/README.contrib b/sys/contrib/zlib/contrib/README.contrib index 335e43508be2..5e5f95054090 100644 --- a/sys/contrib/zlib/contrib/README.contrib +++ b/sys/contrib/zlib/contrib/README.contrib @@ -1,4 +1,4 @@ -All files under this contrib directory are UNSUPPORTED. There were +All files under this contrib directory are UNSUPPORTED. They were provided by users of zlib and were not tested by the authors of zlib. Use at your own risk. Please contact the authors of the contributions for help about these, not the zlib authors. Thanks. diff --git a/sys/contrib/zlib/crc32.c b/sys/contrib/zlib/crc32.c index 382b9a322fda..7b0e60462dda 100644 --- a/sys/contrib/zlib/crc32.c +++ b/sys/contrib/zlib/crc32.c @@ -98,13 +98,22 @@ # endif #endif +/* If available, use the ARM processor CRC32 instruction. */ +#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 +# define ARMCRC32 +#endif + /* Local functions. */ local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); -/* If available, use the ARM processor CRC32 instruction. */ -#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 -# define ARMCRC32 +#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) + local z_word_t byte_swap OF((z_word_t word)); +#endif + +#if defined(W) && !defined(ARMCRC32) + local z_crc_t crc_word OF((z_word_t data)); + local z_word_t crc_word_big OF((z_word_t data)); #endif #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) @@ -647,8 +656,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) len &= 7; /* Do three interleaved CRCs to realize the throughput of one crc32x - instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three - CRCs are combined into a single CRC after each set of batches. */ + instruction per cycle. Each CRC is calculated on Z_BATCH words. The + three CRCs are combined into a single CRC after each set of batches. */ while (num >= 3 * Z_BATCH) { crc1 = 0; crc2 = 0; @@ -1092,7 +1101,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2) uLong crc2; z_off_t len2; { - return crc32_combine64(crc1, crc2, len2); + return crc32_combine64(crc1, crc2, (z_off64_t)len2); } /* ========================================================================= */ @@ -1109,11 +1118,11 @@ uLong ZEXPORT crc32_combine_gen64(len2) uLong ZEXPORT crc32_combine_gen(len2) z_off_t len2; { - return crc32_combine_gen64(len2); + return crc32_combine_gen64((z_off64_t)len2); } /* ========================================================================= */ -uLong crc32_combine_op(crc1, crc2, op) +uLong ZEXPORT crc32_combine_op(crc1, crc2, op) uLong crc1; uLong crc2; uLong op; diff --git a/sys/contrib/zlib/deflate.c b/sys/contrib/zlib/deflate.c index af9e4bcf2918..cffe335093d6 100644 --- a/sys/contrib/zlib/deflate.c +++ b/sys/contrib/zlib/deflate.c @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.13 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -87,13 +87,7 @@ local void lm_init OF((deflate_state *s)); local void putShortMSB OF((deflate_state *s, uInt b)); local void flush_pending OF((z_streamp strm)); local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifdef ASMV -# pragma message("Assembler code may have bugs -- use at your own risk") - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif #ifdef ZLIB_DEBUG local void check_match OF((deflate_state *s, IPos start, IPos match, @@ -160,7 +154,7 @@ local const config configuration_table[10] = { * characters, so that a running hash key can be computed from the previous * key instead of complete recalculation each time. */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) +#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask) /* =========================================================================== @@ -191,9 +185,9 @@ local const config configuration_table[10] = { */ #define CLEAR_HASH(s) \ do { \ - s->head[s->hash_size-1] = NIL; \ + s->head[s->hash_size - 1] = NIL; \ zmemzero((Bytef *)s->head, \ - (unsigned)(s->hash_size-1)*sizeof(*s->head)); \ + (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \ } while (0) /* =========================================================================== @@ -285,6 +279,8 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, if (windowBits < 0) { /* suppress zlib wrapper */ wrap = 0; + if (windowBits < -15) + return Z_STREAM_ERROR; windowBits = -windowBits; } #ifdef GZIP @@ -314,7 +310,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, s->hash_bits = (uInt)memLevel + 7; s->hash_size = 1 << s->hash_bits; s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + s->hash_shift = ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH); s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); @@ -340,11 +336,11 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, * sym_buf value to read moves forward three bytes. From that symbol, up to * 31 bits are written to pending_buf. The closest the written pending_buf * bits gets to the next sym_buf symbol to read is just before the last - * code is written. At that time, 31*(n-2) bits have been written, just - * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at - * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1 + * code is written. At that time, 31*(n - 2) bits have been written, just + * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at + * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1 * symbols are written.) The closest the writing gets to what is unread is - * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and + * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and * can range from 128 to 32768. * * Therefore, at a minimum, there are 142 bits of space between what is @@ -390,7 +386,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, /* ========================================================================= * Check for a valid deflate stream state. Return 0 if ok, 1 if not. */ -local int deflateStateCheck (strm) +local int deflateStateCheck(strm) z_streamp strm; { deflate_state *s; @@ -413,7 +409,7 @@ local int deflateStateCheck (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) +int ZEXPORT deflateSetDictionary(strm, dictionary, dictLength) z_streamp strm; const Bytef *dictionary; uInt dictLength; @@ -482,7 +478,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) +int ZEXPORT deflateGetDictionary(strm, dictionary, dictLength) z_streamp strm; Bytef *dictionary; uInt *dictLength; @@ -504,7 +500,7 @@ int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateResetKeep (strm) +int ZEXPORT deflateResetKeep(strm) z_streamp strm; { deflate_state *s; @@ -542,7 +538,7 @@ int ZEXPORT deflateResetKeep (strm) } /* ========================================================================= */ -int ZEXPORT deflateReset (strm) +int ZEXPORT deflateReset(strm) z_streamp strm; { int ret; @@ -554,7 +550,7 @@ int ZEXPORT deflateReset (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) +int ZEXPORT deflateSetHeader(strm, head) z_streamp strm; gz_headerp head; { @@ -565,7 +561,7 @@ int ZEXPORT deflateSetHeader (strm, head) } /* ========================================================================= */ -int ZEXPORT deflatePending (strm, pending, bits) +int ZEXPORT deflatePending(strm, pending, bits) unsigned *pending; int *bits; z_streamp strm; @@ -579,7 +575,7 @@ int ZEXPORT deflatePending (strm, pending, bits) } /* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) +int ZEXPORT deflatePrime(strm, bits, value) z_streamp strm; int bits; int value; @@ -674,36 +670,50 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) } /* ========================================================================= - * For the default windowBits of 15 and memLevel of 8, this function returns - * a close to exact, as well as small, upper bound on the compressed size. - * They are coded as constants here for a reason--if the #define's are - * changed, then this function needs to be changed as well. The return - * value for 15 and 8 only works for those exact settings. + * For the default windowBits of 15 and memLevel of 8, this function returns a + * close to exact, as well as small, upper bound on the compressed size. This + * is an expansion of ~0.03%, plus a small constant. + * + * For any setting other than those defaults for windowBits and memLevel, one + * of two worst case bounds is returned. This is at most an expansion of ~4% or + * ~13%, plus a small constant. * - * For any setting other than those defaults for windowBits and memLevel, - * the value returned is a conservative worst case for the maximum expansion - * resulting from using fixed blocks instead of stored blocks, which deflate - * can emit on compressed data for some combinations of the parameters. + * Both the 0.03% and 4% derive from the overhead of stored blocks. The first + * one is for stored blocks of 16383 bytes (memLevel == 8), whereas the second + * is for stored blocks of 127 bytes (the worst case memLevel == 1). The + * expansion results from five bytes of header for each stored block. * - * This function could be more sophisticated to provide closer upper bounds for - * every combination of windowBits and memLevel. But even the conservative - * upper bound of about 14% expansion does not seem onerous for output buffer - * allocation. + * The larger expansion of 13% results from a window size less than or equal to + * the symbols buffer size (windowBits <= memLevel + 7). In that case some of + * the data being compressed may have slid out of the sliding window, impeding + * a stored block from being emitted. Then the only choice is a fixed or + * dynamic block, where a fixed block limits the maximum expansion to 9 bits + * per 8-bit byte, plus 10 bits for every block. The smallest block size for + * which this can occur is 255 (memLevel == 2). + * + * Shifts are used to approximate divisions, for speed. */ uLong ZEXPORT deflateBound(strm, sourceLen) z_streamp strm; uLong sourceLen; { deflate_state *s; - uLong complen, wraplen; + uLong fixedlen, storelen, wraplen; + + /* upper bound for fixed blocks with 9-bit literals and length 255 + (memLevel == 2, which is the lowest that may not use stored blocks) -- + ~13% overhead plus a small constant */ + fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) + + (sourceLen >> 9) + 4; - /* conservative upper bound for compressed data */ - complen = sourceLen + - ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; + /* upper bound for stored blocks with length 127 (memLevel == 1) -- + ~4% overhead plus a small constant */ + storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) + + (sourceLen >> 11) + 7; - /* if can't get parameters, return conservative bound plus zlib wrapper */ + /* if can't get parameters, return larger bound plus a zlib wrapper */ if (deflateStateCheck(strm)) - return complen + 6; + return (fixedlen > storelen ? fixedlen : storelen) + 6; /* compute wrapper length */ s = strm->state; @@ -740,11 +750,12 @@ uLong ZEXPORT deflateBound(strm, sourceLen) wraplen = 6; } - /* if not default parameters, return conservative bound */ + /* if not default parameters, return one of the conservative bounds */ if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return complen + wraplen; + return (s->w_bits <= s->hash_bits ? fixedlen : storelen) + wraplen; - /* default settings: return tight bound for that case */ + /* default settings: return tight bound for that case -- ~0.03% overhead + plus a small constant */ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13 - 6 + wraplen; } @@ -754,7 +765,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen) * IN assertion: the stream state is correct and there is enough room in * pending_buf. */ -local void putShortMSB (s, b) +local void putShortMSB(s, b) deflate_state *s; uInt b; { @@ -801,7 +812,7 @@ local void flush_pending(strm) } while (0) /* ========================================================================= */ -int ZEXPORT deflate (strm, flush) +int ZEXPORT deflate(strm, flush) z_streamp strm; int flush; { @@ -856,7 +867,7 @@ int ZEXPORT deflate (strm, flush) s->status = BUSY_STATE; if (s->status == INIT_STATE) { /* zlib header */ - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8; uInt level_flags; if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) @@ -1116,7 +1127,7 @@ int ZEXPORT deflate (strm, flush) } /* ========================================================================= */ -int ZEXPORT deflateEnd (strm) +int ZEXPORT deflateEnd(strm) z_streamp strm; { int status; @@ -1142,7 +1153,7 @@ int ZEXPORT deflateEnd (strm) * To simplify the source, this is not supported for 16-bit MSDOS (which * doesn't have enough memory anyway to duplicate compression states). */ -int ZEXPORT deflateCopy (dest, source) +int ZEXPORT deflateCopy(dest, source) z_streamp dest; z_streamp source; { @@ -1231,7 +1242,7 @@ local unsigned read_buf(strm, buf, size) /* =========================================================================== * Initialize the "longest match" routines for a new zlib stream */ -local void lm_init (s) +local void lm_init(s) deflate_state *s; { s->window_size = (ulg)2L*s->w_size; @@ -1252,11 +1263,6 @@ local void lm_init (s) s->match_length = s->prev_length = MIN_MATCH-1; s->match_available = 0; s->ins_h = 0; -#ifndef FASTEST -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -#endif } #ifndef FASTEST @@ -1269,10 +1275,6 @@ local void lm_init (s) * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 * OUT assertion: the match length is not greater than s->lookahead. */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ local uInt longest_match(s, cur_match) deflate_state *s; IPos cur_match; /* current match */ @@ -1297,10 +1299,10 @@ local uInt longest_match(s, cur_match) */ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); + register ush scan_end = *(ushf*)(scan + best_len - 1); #else register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end1 = scan[best_len - 1]; register Byte scan_end = scan[best_len]; #endif @@ -1318,7 +1320,8 @@ local uInt longest_match(s, cur_match) */ if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); do { Assert(cur_match < s->strstart, "no future"); @@ -1336,43 +1339,44 @@ local uInt longest_match(s, cur_match) /* This code assumes sizeof(unsigned short) == 2. Do not use * UNALIGNED_OK if your compiler uses a different size. */ - if (*(ushf*)(match+best_len-1) != scan_end || + if (*(ushf*)(match + best_len - 1) != scan_end || *(ushf*)match != scan_start) continue; /* It is not necessary to compare scan[2] and match[2] since they are * always equal when the other bytes match, given that the hash keys * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient + * strstart + 3, + 5, up to strstart + 257. We check for insufficient * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is * necessary to put more guard bytes at the end of the window, or * to check more often for insufficient lookahead. */ Assert(scan[2] == match[2], "scan[2]?"); scan++, match++; do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && scan < strend); /* The funny "do {}" generates better code on most compilers */ - /* Here, scan <= window+strstart+257 */ - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + /* Here, scan <= window + strstart + 257 */ + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); if (*scan == *match) scan++; - len = (MAX_MATCH - 1) - (int)(strend-scan); + len = (MAX_MATCH - 1) - (int)(strend - scan); scan = strend - (MAX_MATCH-1); #else /* UNALIGNED_OK */ - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; + if (match[best_len] != scan_end || + match[best_len - 1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1382,7 +1386,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1391,7 +1395,8 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); len = MAX_MATCH - (int)(strend - scan); scan = strend - MAX_MATCH; @@ -1403,9 +1408,9 @@ local uInt longest_match(s, cur_match) best_len = len; if (len >= nice_match) break; #ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); + scan_end = *(ushf*)(scan + best_len - 1); #else - scan_end1 = scan[best_len-1]; + scan_end1 = scan[best_len - 1]; scan_end = scan[best_len]; #endif } @@ -1415,7 +1420,6 @@ local uInt longest_match(s, cur_match) if ((uInt)best_len <= s->lookahead) return (uInt)best_len; return s->lookahead; } -#endif /* ASMV */ #else /* FASTEST */ @@ -1436,7 +1440,8 @@ local uInt longest_match(s, cur_match) */ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); Assert(cur_match < s->strstart, "no future"); @@ -1446,7 +1451,7 @@ local uInt longest_match(s, cur_match) */ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1456,7 +1461,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1465,7 +1470,7 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), "wild scan"); len = MAX_MATCH - (int)(strend - scan); @@ -1501,7 +1506,7 @@ local void check_match(s, start, match, length) z_error("invalid match"); } if (z_verbose > 1) { - fprintf(stderr,"\\[%d,%d]", start-match, length); + fprintf(stderr,"\\[%d,%d]", start - match, length); do { putc(s->window[start++], stderr); } while (--length != 0); } } @@ -1547,9 +1552,9 @@ local void fill_window(s) /* If the window is almost full and there is insufficient lookahead, * move the upper half to the lower one to make room in the upper half. */ - if (s->strstart >= wsize+MAX_DIST(s)) { + if (s->strstart >= wsize + MAX_DIST(s)) { - zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more); + zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more); s->match_start -= wsize; s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ s->block_start -= (long) wsize; @@ -1682,7 +1687,7 @@ local void fill_window(s) * * deflate_stored() is written to minimize the number of times an input byte is * copied. It is most efficient with large input and output buffers, which - * maximizes the opportunites to have a single copy from next_in to next_out. + * maximizes the opportunities to have a single copy from next_in to next_out. */ local block_state deflate_stored(s, flush) deflate_state *s; @@ -1892,7 +1897,7 @@ local block_state deflate_fast(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -1940,7 +1945,7 @@ local block_state deflate_fast(s, flush) s->strstart += s->match_length; s->match_length = 0; s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); + UPDATE_HASH(s, s->ins_h, s->window[s->strstart + 1]); #if MIN_MATCH != 3 Call UPDATE_HASH() MIN_MATCH-3 more times #endif @@ -1951,7 +1956,7 @@ local block_state deflate_fast(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -1995,7 +2000,7 @@ local block_state deflate_slow(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -2037,17 +2042,17 @@ local block_state deflate_slow(s, flush) uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ - check_match(s, s->strstart-1, s->prev_match, s->prev_length); + check_match(s, s->strstart - 1, s->prev_match, s->prev_length); - _tr_tally_dist(s, s->strstart -1 - s->prev_match, + _tr_tally_dist(s, s->strstart - 1 - s->prev_match, s->prev_length - MIN_MATCH, bflush); /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not + * strstart - 1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ - s->lookahead -= s->prev_length-1; + s->lookahead -= s->prev_length - 1; s->prev_length -= 2; do { if (++s->strstart <= max_insert) { @@ -2065,8 +2070,8 @@ local block_state deflate_slow(s, flush) * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); if (bflush) { FLUSH_BLOCK_ONLY(s, 0); } @@ -2084,8 +2089,8 @@ local block_state deflate_slow(s, flush) } Assert (flush != Z_NO_FLUSH, "no flush?"); if (s->match_available) { - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); s->match_available = 0; } s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; @@ -2142,7 +2147,8 @@ local block_state deflate_rle(s, flush) if (s->match_length > s->lookahead) s->match_length = s->lookahead; } - Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (uInt)(s->window_size - 1), + "wild scan"); } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ @@ -2157,7 +2163,7 @@ local block_state deflate_rle(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -2197,7 +2203,7 @@ local block_state deflate_huff(s, flush) /* Output a literal byte */ s->match_length = 0; Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; if (bflush) FLUSH_BLOCK(s, 0); diff --git a/sys/contrib/zlib/deflate.h b/sys/contrib/zlib/deflate.h index 17c226113b08..1a06cd5f25d1 100644 --- a/sys/contrib/zlib/deflate.h +++ b/sys/contrib/zlib/deflate.h @@ -329,8 +329,8 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, # define _tr_tally_dist(s, distance, length, flush) \ { uch len = (uch)(length); \ ush dist = (ush)(distance); \ - s->sym_buf[s->sym_next++] = dist; \ - s->sym_buf[s->sym_next++] = dist >> 8; \ + s->sym_buf[s->sym_next++] = (uch)dist; \ + s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \ s->sym_buf[s->sym_next++] = len; \ dist--; \ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ diff --git a/sys/contrib/zlib/gzlib.c b/sys/contrib/zlib/gzlib.c index 9370974647b4..40830201e4e9 100644 --- a/sys/contrib/zlib/gzlib.c +++ b/sys/contrib/zlib/gzlib.c @@ -34,7 +34,7 @@ local gzFile gz_open OF((const void *, int, const char *)); The gz_strwinerror function does not change the current setting of GetLastError. */ -char ZLIB_INTERNAL *gz_strwinerror (error) +char ZLIB_INTERNAL *gz_strwinerror(error) DWORD error; { static char buf[1024]; diff --git a/sys/contrib/zlib/gzread.c b/sys/contrib/zlib/gzread.c index a0d48949e681..3cc1f84ad690 100644 --- a/sys/contrib/zlib/gzread.c +++ b/sys/contrib/zlib/gzread.c @@ -160,11 +160,9 @@ local int gz_look(state) the output buffer is larger than the input buffer, which also assures space for gzungetc() */ state->x.next = state->out; - if (strm->avail_in) { - memcpy(state->x.next, strm->next_in, strm->avail_in); - state->x.have = strm->avail_in; - strm->avail_in = 0; - } + memcpy(state->x.next, strm->next_in, strm->avail_in); + state->x.have = strm->avail_in; + strm->avail_in = 0; state->how = COPY; state->direct = 1; return 0; diff --git a/sys/contrib/zlib/gzwrite.c b/sys/contrib/zlib/gzwrite.c index a02b87e565ed..5a9aebb6ff8d 100644 --- a/sys/contrib/zlib/gzwrite.c +++ b/sys/contrib/zlib/gzwrite.c @@ -477,7 +477,7 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) #else /* !STDC && !Z_HAVE_STDARG_H */ /* -- see zlib.h -- */ -int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, +int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) gzFile file; const char *format; diff --git a/sys/contrib/zlib/infback.c b/sys/contrib/zlib/infback.c index 3a1282bb88ce..ab9810070c09 100644 --- a/sys/contrib/zlib/infback.c +++ b/sys/contrib/zlib/infback.c @@ -66,6 +66,7 @@ int stream_size; state->window = window; state->wnext = 0; state->whave = 0; + state->sane = 1; return Z_OK; } @@ -605,25 +606,27 @@ void FAR *out_desc; break; case DONE: - /* inflate stream terminated properly -- write leftover output */ + /* inflate stream terminated properly */ ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } goto inf_leave; case BAD: ret = Z_DATA_ERROR; goto inf_leave; - default: /* can't happen, but makes compilers happy */ + default: + /* can't happen, but makes compilers happy */ ret = Z_STREAM_ERROR; goto inf_leave; } - /* Return unused input */ + /* Write leftover output and return unused input */ *** 784 LINES SKIPPED *** From nobody Thu Feb 23 08:01:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMlpl5lz0z3t8ym; Thu, 23 Feb 2023 08:01: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 4PMlpl5L71z3R33; Thu, 23 Feb 2023 08:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677139295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ERs0usrnbhW07QGeWdphK8k3hIK1ImvSanw/fJ5qwCk=; b=LuofVxEWFjxDtVusIjE6aU08XKsjOHhyTL9rLyEDTtsl9FqdugPJaq08FP9uS8Sz55kmj/ RqlL1UjIQKLpc17UHXcx8ajEO06le9PO69Teuj8sT2m8TC0jkWeFevQfC5noPZm8xqQOtq 1wSt2JFkq1Yjnk8/f8wF0fZgnTKeCrg9G4JFdxcwhJhyHFIyzYa8oQmF7BJhaIdRltY39/ z6RMg8lZ8MoYAfurHLtK1/wSEy+wAz7O+YRL5EsxdJTTy+7Rv2Wa5YzEwiXxwxiGR7rQx0 UMllsA9/oY5w3FTdIT4a2Zjjwpnpwczw8HQE+6wt5yjXUkwe5hXl3Xt9IR4iZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677139295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ERs0usrnbhW07QGeWdphK8k3hIK1ImvSanw/fJ5qwCk=; b=dcF280z6gX7QKFsaP2TPuZx76PnVbMYpc5GE7XpA82mAmbHRz3CNMPJH5ypy/WKW8V6g2y AJiCJzYhyS5xXpqXihNFtnlSUJUl0u+w2Q41r0pRVoKkkM/YAViU26FsCgpf9M0NxgmcI4 zkA4TA7smV1MkLCz8YSw/4xSewGiA3sBmTheB8JBY0c77HTXw8y56WEdtFBxkMBo2dqDjj QKpxL2L8ol1miRtNn9BuYyp+0AcJ13vIQ8fmAIryIarDKXXrvXlRSa2KpOIW72/U1g1jC6 tFu8rkywHGcYTliQm/oJ5dYnB9kzG2NoFY8fQMmwTw6SgpZ1qsscNnL4VS8EuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677139295; a=rsa-sha256; cv=none; b=eZRoki5JyJNZjpL5lQlcpv4aE4Y+LdfBRtQg4ResZaRSQiDuKPa0lu3FltFIVlBH/N3BiE G/0IzuyiMJ6a404pW724/b5JOdc9HAIsFUBbwMq3cxxDC7TGPDqmxJ9di9eb2uyqC00nEb qxth+NEvskVvD9fKuw+ZsfLwwu9Nr+qQmkOD1uuL/11m1iJVU3m1iRrkdIz4bcpQqvCD69 /JYPDb2jkGI/yMVSsBWci15x0SN+bqNeNR+1Q3XPVTwsquNhCAlSKDrYbpAyZzGKlipwmY BLH0REaGJTV1IuDJBXrmtr5+9KItn9wX+by4JuSR/zCPqjjsFtizSTZu5xEYlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMlpl4QyMzZ5g; Thu, 23 Feb 2023 08:01: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 31N81ZEO029584; Thu, 23 Feb 2023 08:01:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N81ZLF029583; Thu, 23 Feb 2023 08:01:35 GMT (envelope-from git) Date: Thu, 23 Feb 2023 08:01:35 GMT Message-Id: <202302230801.31N81ZLF029583@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: 200fe6e3a0c8 - main - linux(4): Use predefined constant instead of hardcoded value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 200fe6e3a0c8f2fc4fb8f48abd6528418a8a370c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=200fe6e3a0c8f2fc4fb8f48abd6528418a8a370c commit 200fe6e3a0c8f2fc4fb8f48abd6528418a8a370c Author: Dmitry Chagin AuthorDate: 2023-02-23 07:59:34 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-23 07:59:34 +0000 linux(4): Use predefined constant instead of hardcoded value Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D38713 MFC after: 3 days --- sys/compat/linux/linux_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_netlink.c b/sys/compat/linux/linux_netlink.c index 8a378d596187..69cd006ce4ef 100644 --- a/sys/compat/linux/linux_netlink.c +++ b/sys/compat/linux/linux_netlink.c @@ -302,7 +302,7 @@ rtnl_newlink_to_linux(struct nlmsghdr *hdr, struct nlpcb *nlp, /* Convert interface type */ switch (ifinfo->ifi_type) { case IFT_ETHER: - ifinfo->ifi_type = 1; // ARPHRD_ETHER + ifinfo->ifi_type = LINUX_ARPHRD_ETHER; break; } ifinfo->ifi_flags = rtnl_if_flags_to_linux(ifinfo->ifi_flags); From nobody Thu Feb 23 08:01:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMlpm6pqkz3t952; Thu, 23 Feb 2023 08:01: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 4PMlpm6Jb7z3h1D; Thu, 23 Feb 2023 08:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677139296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFAmJoy6bLYPKHISAiiELqzXIY7H3mmflmk27rM+OwY=; b=q9RCHcu5LyHYwhUx1IFf4dE5beBkigDqslR6o2rGPS9t/YYISVLBoWV2HebZT02aiRmgku jRFJz3XfxWsHmGCf/gzE/N1Q0aAU5EazsqXOXx015FDeWl4f4dn8vgrpU8hsbUyfDCiFRE g9rljLFLSyfXsGXc84Qd/hiNVGW8K7ChWWZ4zrcZ8byyGlL8WUayt8PZ//hRipjYTjBLsy XCUVjqefeRV3doZ9KgFE+LQ7GSFoPURPFShUu0bBMhsBn7SknOTIIHtf7FDObX4dk2uQfK +4y9prFPVQpZn6qE/tgQICEzPog4cqCzo9hBkbIJ0QeAbvrHwPQjZgvaQItL9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677139296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFAmJoy6bLYPKHISAiiELqzXIY7H3mmflmk27rM+OwY=; b=Fb4kD1Vs3SL2LUNryMS7qQTvUNU+btHTDz3WnGYbLEb6vyFpe4x9yyoGnCIPJxE9yhZ0fg 8gC6lg6yR9tosfdOZtuAvC9O051/sxKpc3qdp7KXekVj6KvH1v2aXUR49ZugnTV2vV5sf9 byB1/sN0mIqAKFWGkuwoqDme235sGMiA6SCTA6omuN3T7TmtzVNTieqYfY9F4fxyCH3lfk Op2K5Sc6G2MI4bNlUKI0vNAM2S1/HahruLlfBV1rKuvKNoRPFwl53c+uCabnojNQhCox1e M08e0XLGc6YW4Dng5AF3Xm0GlnjS91h2UoewcVdpkJ8TtAiS1rNy+PRH/ANrOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677139296; a=rsa-sha256; cv=none; b=bYC0LaS3X/KsIkwxSbF4deqHA9YtQ00juRpkvOUymCPuIHNKWNj4wGgRvh5u78X6MrMytj 6RezUhtaJAk0uq/ZIwHzZ+FESWGpTLCd9VdmuWrH6OoON++q/lR7aoNdB4RrTZ60c3iks+ XNXzscth/L+svYQfsENYOwRFHpGFEwVhXHCHBd7I1IdcWd1hG7twy+cRzPfJ8+IMyfTQJI Sk3tleLE6+imTFQUurXnUmTcVRIBAqZ/omKJOUzjIfWwsvsPFD8fucpwVwFTF37Bvuvb5v N4RHhDUWiKfaaP+vxUHVF8zhV6uWjZ5UoNqm0wU3HbpdXoszL6WbiIBfxUvV2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMlpm4zz3zZKF; Thu, 23 Feb 2023 08:01: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 31N81acD029609; Thu, 23 Feb 2023 08:01:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N81aNX029608; Thu, 23 Feb 2023 08:01:36 GMT (envelope-from git) Date: Thu, 23 Feb 2023 08:01:36 GMT Message-Id: <202302230801.31N81aNX029608@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: 3ab3c9c29cf0 - main - linux(4): Consolidate a FreeBSD interface names translation code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ab3c9c29cf0e5df8dbbaaf2003456445534bad8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=3ab3c9c29cf0e5df8dbbaaf2003456445534bad8 commit 3ab3c9c29cf0e5df8dbbaaf2003456445534bad8 Author: Dmitry Chagin AuthorDate: 2023-02-23 08:00:29 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-23 08:00:29 +0000 linux(4): Consolidate a FreeBSD interface names translation code We have some amount of interface names translation functions which are differs by bugs implementation. Consolidates it in a one place. Fixup loopback interface names translation and use ifnet methods and accessors, where possible. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D38714 MFC after: 3 days X-MFC with: 32fdc75fe7 --- sys/compat/linprocfs/linprocfs.c | 40 +++++------------- sys/compat/linux/linux.c | 87 ++++++++++++++++++++++++++++++++++++++-- sys/compat/linux/linux_common.h | 4 ++ sys/compat/linux/linux_ioctl.c | 56 +++++++------------------- 4 files changed, 113 insertions(+), 74 deletions(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 15c4d3c41749..83b00dc0d7c2 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -111,6 +111,7 @@ __FBSDID("$FreeBSD$"); #endif /* __i386__ || __amd64__ */ #include +#include #include #include #include @@ -1474,36 +1475,13 @@ linprocfs_doprocmem(PFS_FILL_ARGS) return (error); } -static int -linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) -{ - struct ifnet *ifscan; - int ethno; - - IFNET_RLOCK_ASSERT(); - - /* Short-circuit non ethernet interfaces */ - if (linux_use_real_ifname(ifp)) - return (strlcpy(buffer, ifp->if_xname, buflen)); - - /* Determine the (relative) unit number for ethernet interfaces */ - ethno = 0; - CK_STAILQ_FOREACH(ifscan, &V_ifnet, if_link) { - if (ifscan == ifp) - return (snprintf(buffer, buflen, "eth%d", ethno)); - if (!linux_use_real_ifname(ifscan)) - ethno++; - } - - return (0); -} - /* * Filler function for proc/net/dev */ static int linprocfs_donetdev(PFS_FILL_ARGS) { + struct epoch_tracker et; char ifname[16]; /* XXX LINUX_IFNAMSIZ */ struct ifnet *ifp; @@ -1515,9 +1493,9 @@ linprocfs_donetdev(PFS_FILL_ARGS) "bytes packets errs drop fifo colls carrier compressed"); CURVNET_SET(TD_TO_VNET(curthread)); - IFNET_RLOCK(); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - linux_ifname(ifp, ifname, sizeof ifname); + ifname_bsd_to_linux_ifp(ifp, ifname, sizeof(ifname)); sbuf_printf(sb, "%6.6s: ", ifname); sbuf_printf(sb, "%7ju %7ju %4ju %4ju %4lu %5lu %10lu %9ju ", (uintmax_t )ifp->if_get_counter(ifp, IFCOUNTER_IBYTES), @@ -1546,7 +1524,7 @@ linprocfs_donetdev(PFS_FILL_ARGS) * tx_heartbeat_errors*/ 0UL); /* tx_compressed */ } - IFNET_RUNLOCK(); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); @@ -1576,7 +1554,8 @@ linux_route_print(struct rtentry *rt, void *vw) /* select only first route in case of multipath */ nh = nhop_select_func(rnd.rnd_nhop, 0); - linux_ifname(nh->nh_ifp, ifname, sizeof(ifname)); + if (ifname_bsd_to_linux_ifp(nh->nh_ifp, ifname, sizeof(ifname)) <= 0) + return (ENODEV); gw = (nh->nh_flags & NHF_GATEWAY) ? nh->gw4_sa.sin_addr.s_addr : 0; @@ -1605,6 +1584,7 @@ linux_route_print(struct rtentry *rt, void *vw) static int linprocfs_donetroute(PFS_FILL_ARGS) { + struct epoch_tracker et; struct walkarg w = { .sb = sb }; @@ -1615,9 +1595,9 @@ linprocfs_donetroute(PFS_FILL_ARGS) "\tWindow\tIRTT"); CURVNET_SET(TD_TO_VNET(curthread)); - IFNET_RLOCK(); + NET_EPOCH_ENTER(et); rib_walk(fibnum, AF_INET, false, linux_route_print, &w); - IFNET_RUNLOCK(); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index 4e435081b3b6..2570a5fcc89c 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -241,6 +241,84 @@ bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss) } } +/* + * Translate a FreeBSD interface name to a Linux interface name + * by interface name, and return the number of bytes copied to lxname. + */ +int +ifname_bsd_to_linux_name(const char *bsdname, char *lxname, size_t len) +{ + struct epoch_tracker et; + struct ifnet *ifp; + int ret; + + ret = 0; + CURVNET_SET(TD_TO_VNET(curthread)); + NET_EPOCH_ENTER(et); + ifp = ifunit(bsdname); + if (ifp != NULL) + ret = ifname_bsd_to_linux_ifp(ifp, lxname, len); + NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); + return (ret); +} + +/* + * Translate a FreeBSD interface name to a Linux interface name + * by interface index, and return the number of bytes copied to lxname. + */ +int +ifname_bsd_to_linux_idx(u_int idx, char *lxname, size_t len) +{ + struct epoch_tracker et; + struct ifnet *ifp; + int ret; + + ret = 0; + CURVNET_SET(TD_TO_VNET(curthread)); + NET_EPOCH_ENTER(et); + ifp = ifnet_byindex(idx); + if (ifp != NULL) + ret = ifname_bsd_to_linux_ifp(ifp, lxname, len); + NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); + return (ret); +} + +/* + * Translate a FreeBSD interface name to a Linux interface name, + * and return the number of bytes copied to lxname. + */ +int +ifname_bsd_to_linux_ifp(struct ifnet *ifp, char *lxname, size_t len) +{ + struct ifnet *ifscan; + int unit; + + NET_EPOCH_ASSERT(); + + /* + * Linux loopback interface name is lo (not lo0), + * we translate lo to lo0, loX to loX. + */ + if (IFP_IS_LOOP(ifp) && strncmp(ifp->if_xname, "lo0", IFNAMSIZ) == 0) + return (strlcpy(lxname, "lo", len)); + + /* Short-circuit non ethernet interfaces. */ + if (!IFP_IS_ETH(ifp) || linux_use_real_ifname(ifp)) + return (strlcpy(lxname, ifp->if_xname, len)); + + /* Determine the (relative) unit number for ethernet interfaces. */ + unit = 0; + CK_STAILQ_FOREACH(ifscan, &V_ifnet, if_link) { + if (ifscan == ifp) + return (snprintf(lxname, len, "eth%d", unit)); + if (IFP_IS_ETH(ifscan)) + unit++; + } + return (0); +} + /* * Translate a Linux interface name to a FreeBSD interface name, * and return the associated ifnet structure @@ -261,8 +339,11 @@ ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) 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); + /* + * Linux loopback interface name is lo (not lo0), + * we translate lo to lo0, loX to loX. + */ + is_lo = (len == 2 && strncmp(lxname, "lo", LINUX_IFNAMSIZ) == 0); unit = (int)strtoul(lxname + len, &ep, 10); if ((ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) && is_lo == 0) @@ -732,5 +813,5 @@ bool linux_use_real_ifname(const struct ifnet *ifp) { - return (use_real_ifnames || !IFP_IS_ETH(ifp)); + return (use_real_ifnames); } diff --git a/sys/compat/linux/linux_common.h b/sys/compat/linux/linux_common.h index 0eb302bfcd17..9ebaff26b9ff 100644 --- a/sys/compat/linux/linux_common.h +++ b/sys/compat/linux/linux_common.h @@ -30,6 +30,10 @@ #ifndef _LINUX_COMMON_H_ #define _LINUX_COMMON_H_ +int ifname_bsd_to_linux_ifp(struct ifnet *, char *, size_t); +int ifname_bsd_to_linux_idx(u_int, char *, size_t); +int ifname_bsd_to_linux_name(const char *, char *, size_t); + struct ifnet *ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname); void linux_ifflags(struct ifnet *ifp, short *flags); diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 2cb0e9ead23f..bfab28f841a0 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -2092,39 +2092,17 @@ static int linux_ioctl_ifname(struct thread *td, struct l_ifreq *uifr) { struct l_ifreq ifr; - struct ifnet *ifp; - int error, ethno, index; + int error, ret; error = copyin(uifr, &ifr, sizeof(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(); - if (error == 0) - error = copyout(&ifr, uifr, sizeof(ifr)); - CURVNET_RESTORE(); - - return (error); + ret = ifname_bsd_to_linux_idx(ifr.ifr_ifindex, ifr.ifr_name, + LINUX_IFNAMSIZ); + if (ret > 0) + return (copyout(&ifr, uifr, sizeof(ifr))); + else + return (ENODEV); } /* @@ -2134,6 +2112,7 @@ linux_ioctl_ifname(struct thread *td, struct l_ifreq *uifr) static int linux_ifconf(struct thread *td, struct ifconf *uifc) { + struct epoch_tracker et; #ifdef COMPAT_LINUX32 struct l_ifconf ifc; #else @@ -2143,7 +2122,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) struct ifnet *ifp; struct ifaddr *ifa; struct sbuf *sb; - int error, ethno, full = 0, valid_len, max_len; + int error, full = 0, valid_len, max_len; error = copyin(uifc, &ifc, sizeof(ifc)); if (error != 0) @@ -2155,7 +2134,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) /* handle the 'request buffer size' case */ if ((l_uintptr_t)ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; - IFNET_RLOCK(); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; @@ -2163,7 +2142,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) ifc.ifc_len += sizeof(ifr); } } - IFNET_RUNLOCK(); + NET_EPOCH_EXIT(et); error = copyout(&ifc, uifc, sizeof(ifc)); CURVNET_RESTORE(); return (error); @@ -2175,8 +2154,6 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) } again: - /* Keep track of eth interfaces */ - ethno = 0; if (ifc.ifc_len <= max_len) { max_len = ifc.ifc_len; full = 1; @@ -2186,16 +2163,13 @@ again: valid_len = 0; /* Return all AF_INET addresses of all interfaces */ - IFNET_RLOCK(); + NET_EPOCH_ENTER(et); 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); + ifname_bsd_to_linux_ifp(ifp, ifr.ifr_name, + sizeof(ifr.ifr_name)); /* Walk the address list */ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { @@ -2222,7 +2196,7 @@ again: valid_len = sbuf_len(sb); } } - IFNET_RUNLOCK(); + NET_EPOCH_EXIT(et); if (valid_len != max_len && !full) { sbuf_delete(sb); From nobody Thu Feb 23 08:01:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMlpp0WVtz3t97Q; Thu, 23 Feb 2023 08:01: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 4PMlpn6zVhz3R6B; Thu, 23 Feb 2023 08:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677139298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sC27idTw8P0kbb7MQLosgRMBAl/bhuuFTdAD4lycSg4=; b=EWI7nanHhRaPTy2QJszm/CaJbzr0cAPq6aZIJZEzMkUMnLARWWqSaVSVHIiZBdr+3H6e0L 6A0O5e3M/fij6hydUn4RZJNs/tbmGnE95IqUjV7M0uliaEVeZTBbDTSDqy5oJUqCV5pMSU ZYVHzcg9592Eb6foNc1jPLnQA8vIsGCuu6M0hOsruuMfBPw/SUqE8QYsZ1IaWj7ZoDViM5 0JtYp40HYUOzKB+Zuo7rrmk5/Sacl2ETlOEdxFAYCgGQE2+21lpyKyO3NWMTldPHZ65OK7 WkonEw1JIex22nrRHW2BftM9ySBnUik5jOYXzNl35oermBEfg9d75hYRpuxQhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677139298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sC27idTw8P0kbb7MQLosgRMBAl/bhuuFTdAD4lycSg4=; b=jG5ilnYRzd111Sml2L19+Ia+ojwdbU3pZOjCSObb8Z64WYy6G08ji8hPVwYSA1pYvC5c8s +GNm9zspxCg8ny3/oM+BmyARz2+uUgmfuFdb+J+3fLdaOPpQizwQjVTj0mUrGWh1XYayr0 yQg3zHqkUqQei4ouqGv8c/SbK9IegS6dhiiQ35EMgHxwiIuTm0UsJL9+b2RoQHyKm2K57+ 87ofryl2kArGuCWV24McsdZpXTNop0XE7qclpeQDP/2ZnDSNP4JueRbzk9emY41h3zZpft LTfH2MmVWImoeu2ZVLmkVv2W/cqAK1+18lprBNo7wAF6W4/KkjEJE1Q8eSqPvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677139298; a=rsa-sha256; cv=none; b=o/hgxkgylNeZSfgshp1XA5GhNTBWFdbQJ7wmn2Rlq+uSSnOQvW1zdv7B+UzUVJSh9JOybJ C7Rl2Of11/FnF/fOMW6b8Ei6L5gx6v9284WCYDHyrUJACq/LQjWbsM2sUrKiFIXpPRdU94 3ORgc8VLXGVvU+XdAnMiLmB1yNzBz43JC3nv7I43gG4LYP47Oo8CiJU3W/TGmFk5+sz9EA 3CRfiiJqs+4crw1NXqAnp02UEXMgRYR/Bw+9feWzTArQ8kYix+1ap0gXLocRgNBP318bNH fxHP87S4GzkC7kgXhl71+v60FvPhLyw9HlNgl3zgGTaqiQ3s8V2A7N+5aLJhNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMlpn65HPzZfc; Thu, 23 Feb 2023 08:01: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 31N81bMt029628; Thu, 23 Feb 2023 08:01:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N81bj7029627; Thu, 23 Feb 2023 08:01:37 GMT (envelope-from git) Date: Thu, 23 Feb 2023 08:01:37 GMT Message-Id: <202302230801.31N81bj7029627@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: e55e4a6ba3f4 - main - linux(4): Fixup the interface name translation in netlink List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e55e4a6ba3f4cd31d47b74574ea7370d5ab14b48 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e55e4a6ba3f4cd31d47b74574ea7370d5ab14b48 commit e55e4a6ba3f4cd31d47b74574ea7370d5ab14b48 Author: Dmitry Chagin AuthorDate: 2023-02-23 08:01:18 +0000 Commit: Dmitry Chagin CommitDate: 2023-02-23 08:01:18 +0000 linux(4): Fixup the interface name translation in netlink Netlink should translate a FreeBSD interface name to a Linux interface name. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D38715 MFC after: 3 days --- sys/compat/linux/linux_netlink.c | 48 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_netlink.c b/sys/compat/linux/linux_netlink.c index 69cd006ce4ef..9edfbfc2c031 100644 --- a/sys/compat/linux/linux_netlink.c +++ b/sys/compat/linux/linux_netlink.c @@ -224,10 +224,52 @@ nlmsg_copy_nla(const struct nlattr *nla_orig, struct nl_writer *nw) return (false); } +/* + * Translate a FreeBSD interface name to a Linux interface name. + */ +static bool +nlmsg_translate_ifname_nla(struct nlattr *nla, struct nl_writer *nw) +{ + char ifname[LINUX_IFNAMSIZ]; + + if (ifname_bsd_to_linux_name((char *)(nla + 1), ifname, + sizeof(ifname)) <= 0) + return (false); + return (nlattr_add_string(nw, IFLA_IFNAME, ifname)); +} + +#define LINUX_NLA_UNHANDLED -1 +/* + * Translate a FreeBSD attribute to a Linux attribute. + * Returns LINUX_NLA_UNHANDLED when the attribute is not processed + * and the caller must take care of it, otherwise the result is returned. + */ +static int +nlmsg_translate_all_nla(struct nlmsghdr *hdr, struct nlattr *nla, + struct nl_writer *nw) +{ + + switch (hdr->nlmsg_type) { + case NL_RTM_NEWLINK: + case NL_RTM_DELLINK: + case NL_RTM_GETLINK: + switch (nla->nla_type) { + case IFLA_IFNAME: + return (nlmsg_translate_ifname_nla(nla, nw)); + default: + break; + } + default: + break; + } + return (LINUX_NLA_UNHANDLED); +} + static bool nlmsg_copy_all_nla(struct nlmsghdr *hdr, int raw_hdrlen, struct nl_writer *nw) { struct nlattr *nla; + int ret; int hdrlen = NETLINK_ALIGN(raw_hdrlen); int attrs_len = hdr->nlmsg_len - sizeof(struct nlmsghdr) - hdrlen; @@ -238,11 +280,15 @@ nlmsg_copy_all_nla(struct nlmsghdr *hdr, int raw_hdrlen, struct nl_writer *nw) if (nla->nla_len < sizeof(struct nlattr)) { return (false); } - if (!nlmsg_copy_nla(nla, nw)) + ret = nlmsg_translate_all_nla(hdr, nla, nw); + if (ret == LINUX_NLA_UNHANDLED) + ret = nlmsg_copy_nla(nla, nw); + if (!ret) return (false); } return (true); } +#undef LINUX_NLA_UNHANDLED static unsigned int rtnl_if_flags_to_linux(unsigned int if_flags) From nobody Thu Feb 23 10:32:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMq8c2zVtz3tK6y; Thu, 23 Feb 2023 10:32:16 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMq8c0jnCz3xC3; Thu, 23 Feb 2023 10:32:16 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:f554:7e70:9864:3229]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTPSA id BAC797213B540; Thu, 23 Feb 2023 11:32:05 +0100 (CET) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: git: 453aa7fac989 - main - tcp: ensure the tcpcb is not NULL when logging an event From: tuexen@freebsd.org In-Reply-To: Date: Thu, 23 Feb 2023 11:32:05 +0100 Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <850BD1CD-82C6-4ECE-8676-EF1814798B1D@freebsd.org> References: <202302230104.31N14Z9h029777@gitrepo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4PMq8c0jnCz3xC3 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > On 23. Feb 2023, at 03:59, Gleb Smirnoff wrote: >=20 > On Thu, Feb 23, 2023 at 01:04:35AM +0000, Michael Tuexen wrote: > M> The branch main has been updated by tuexen: > M>=20 > M> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D453aa7fac9894945282bcf6ef55c9eba= aa1d7e40 > M>=20 > M> commit 453aa7fac9894945282bcf6ef55c9ebaaa1d7e40 > M> Author: Michael Tuexen > M> AuthorDate: 2023-02-23 01:01:53 +0000 > M> Commit: Michael Tuexen > M> CommitDate: 2023-02-23 01:04:17 +0000 > M>=20 > M> tcp: ensure the tcpcb is not NULL when logging an event > M> =20 > M> When calling tcp_bblog_pru() on some error paths, tp is NULL, > M> therefore handle it. >=20 > I wonder when does that happen? IMHO better fix such calls than > plug the problem here. The way I observed this was hitting https://cgit.freebsd.org/src/tree/sys/netinet/tcp_usrreq.c#n519 via https://cgit.freebsd.org/src/tree/sys/netinet/tcp_usrreq.c#n557 or https://cgit.freebsd.org/src/tree/sys/netinet/tcp_usrreq.c#n561 I wanted to fix the panic() before others are running into it. So I added the check for tp =3D=3D NULL as it was in = https://cgit.freebsd.org/src/tree/sys/netinet/tcp_usrreq.c?h=3Dstable/13#n= 141 I can change the code such that we just avoid calling tcp_bblog_pru() with tp =3D=3D NULL, or ensure tp !=3D NULL in all cases, which is what = I would prefer. We can chat about this in the next transport call. Best regards Michael > --=20 > Gleb Smirnoff From nobody Thu Feb 23 11:15:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMr6L4GJ5z3tbfD; Thu, 23 Feb 2023 11:15: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 4PMr6L3PjYz42fH; Thu, 23 Feb 2023 11:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677150922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k5sx74xHYgoJX+9krb8eCLHJFOQRXLJJ9FrEaJ3OQjQ=; b=TLroXgdQ6k5EF1+7Rez0PwR7HiI1GkNJtVuGaX6cGZtGtoweS4RTc9RoOVeAX3PYtCayGZ 26HPbzQ1XkjO9K9+zjJK7w79bUKrewQNDHV9FRC3dv7kJ4Ymu5svmAGIDTMvUMKZP8cpuO tsuYyvuiKJbEGA3CgMJliMS3j0Y2RHVRVOtL70B+YX78GhLWOaB7ACBdeNycO2gB2cYD2T Krc4LHlt+SDYEW6zFLXUMbRd8FjWhmtFqw5YWcQp6HWm5bMrDXGadbnMhR6kQQ/NBluu7I cFpGHPCJuj/iHSH2BltyuynxfL7zzEN8HsMRLphmj38N7bbr0z2je1gW/Nx1cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677150922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k5sx74xHYgoJX+9krb8eCLHJFOQRXLJJ9FrEaJ3OQjQ=; b=QL/hHbnLs28BDBAeVZg/GGc5ArOqr503VE1CsnGrbFcUXylXZslJdkrpKrUvP379n6TkNI P75l+bg5MGbH2fzCHeW56hpleFiE8aSZPENsMRxQkqB5XvvvjD74FnMCzpdvBYA4eFLZ7Q M5s0gDHaXsLEX+uyeog3auM6g8q5MMuaKRWA6HTAtzUE4a8ByHY+LzysKj5VYkI2hdqBIX RhLpFLmhrCvWYbmFDbRJmkzL8lA9jrwJfm/T0zSrPZ+HP0QA2BH4UTART2N4i8gtfsiyCc J00RJC+T9589I3FUUWS9qcF03UmeeSFvKOrEb/wyTjycOvMKw9rnC3J7qnptOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677150922; a=rsa-sha256; cv=none; b=KOMjZcBiGbAGRy782CdDyWnrBk3MKisjYdhbbkGk/77VqU4f+mu/iocUwMsovwXY8VGbts YsjDHro6vl2S/jCRVegsPyz9KmB0eZEuFyeYTI4TJD8Wb+RggFfRLrOzkLNhixMCllaQU0 e9Fsjweha14ajqfizN43L/vGBZWqhrcWO+5JYSbcUfOTmFYIyETSTXvC7GyweYDxQrhXE7 uHE+eer4h+QmkKpdX4+OgqcJ+cwC7AwfJ+lrnyBNJclbmxGof+AxYLDrexNkuqdyCeXKn4 ewWGhwei3hF6zhbLgkh2DcWkJaFikI030F1QnSF6DQ0Lc4yFDo9dqLxuHB9nUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMr6L2RBGzgJZ; Thu, 23 Feb 2023 11:15: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 31NBFMqV003167; Thu, 23 Feb 2023 11:15:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NBFMVe003166; Thu, 23 Feb 2023 11:15:22 GMT (envelope-from git) Date: Thu, 23 Feb 2023 11:15:22 GMT Message-Id: <202302231115.31NBFMVe003166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 7e2af4f90bb1 - main - veriexec(4): Fix a compiler error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e2af4f90bb1dca907ce024324b1e64c48ca4472 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=7e2af4f90bb1dca907ce024324b1e64c48ca4472 commit 7e2af4f90bb1dca907ce024324b1e64c48ca4472 Author: Mina Galić AuthorDate: 2023-02-23 11:14:41 +0000 Commit: Gordon Bergling CommitDate: 2023-02-23 11:14:41 +0000 veriexec(4): Fix a compiler error When building WITH_BEARSSL=1 veriexec(4) failes to compile. So update the function prototype so that veriexec(4) compiles again. Reported by: gbe Reviewed by: mjg, gbe Approved by: mjg Pull Request: https://github.com/freebsd/freebsd-src/pull/657 --- sbin/veriexec/veriexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/veriexec/veriexec.c b/sbin/veriexec/veriexec.c index 0162eeda5347..407100ab48f1 100644 --- a/sbin/veriexec/veriexec.c +++ b/sbin/veriexec/veriexec.c @@ -50,7 +50,7 @@ const char *Cdir = NULL; * @return always returns code 0 */ static int -veriexec_usage() +veriexec_usage(void) { printf("%s", "Usage:\tveriexec [-h] [-i state] [-C] [-xv state|verbosity] [path]\n"); From nobody Thu Feb 23 13:17:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMtq56FH7z3tjpr; Thu, 23 Feb 2023 13:17: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 4PMtq55kjpz4F3l; Thu, 23 Feb 2023 13:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677158241; h=from:from:reply-to:subject:subject: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/ICg0U1Ugxvl92oBz3V3i5EbMK0D8OdtH7vVZXp5AY=; b=BBKmTY1vIME5s+koOJbZep0NAWkxsZNPkZtuIpYak8/D20KCItVYC2lRBx51y8Pwn+CD2N q+XgYPB0HsWlZ0bxQCTsw6chFUpkZcxY7uEIrfnvs9i+PhtVTNmtTlsvEYmqh2pB7qnY3W 0UtxU1N4AJ08ai34XUP89OkNdaolgGe1hID1T1vs1mS58rvi9dg8grb9d2k9vyS9X51Ucv oLUPPNOzyGYKfkvgmZ/v8k7Dv1G8ezTbXhn5P9rMn+4Bq2F62oIKZkhSUM7WJtdGiqXoMK 44FCaKZOshT4NXNGnMYPETvF+K4ZHp9axT/lS2o84KdtcwmSive8jPnJCJNutw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677158241; h=from:from:reply-to:subject:subject: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/ICg0U1Ugxvl92oBz3V3i5EbMK0D8OdtH7vVZXp5AY=; b=Fiwpir54HuY6Vy62RmXILWR5v6rH4b1rZkTnlRqRvnECK7xDjM3OJ7gAgeDwhhDHksThHo 1NjBLiviNE9plPTOCr1leP/n3wiFJPzM+Wi09FE97Ozuegh2QI85R3reZHkPpb4xSTRAC5 heusvDp7vkbBX7c/7qM6P6rQtvbrifBDmAYIP6/8BZPa/ysxBcHzTTRvmaJpPCWobz8g6h 5u15P/91qMS6KzJkjuF/nYNx51RlteAXXygqEjpyLsoD+dwJgbZ8QhUsGs0oW2a1+LhmQ0 KJn6Yz1NXarnjI3vjxy07ZKQo0qAKBvEoiIjxcCEsaJMJ/qjQ4Y+v/KoGMnc4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677158241; a=rsa-sha256; cv=none; b=gCDBtAVcMi6jbtg61+Kt3Nrc2gkqhXTU4usXNIYVflfK9e3KLlxBPDoIcZLq4llmCFzIGo VFq42btYVPQSVd/AVRVwxwlKTWjRSMk5aQ+U3sjCFJoFvO0bSmKoaE58553nM7E4tkj0a7 iBulchBtcRoKGhpOMubV9stEYtVR4OWYr7Fg2owIiafNpAIcQn9drRgmhWK6ocTJI8/7Gz thBtj78kyVlYFnMHGZQjB2nhthbCpzG/jIP65EYnd1Urq27DfiB3a0b3xFlI+4UPcNE4d4 ntTqjWr5FvuafzoVONOq2Y3aq+qN8ohzZuaOt8vqoMLg5FMH9DmwByHzyflaGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMtq54phLzjjT; Thu, 23 Feb 2023 13:17: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 31NDHLaD075483; Thu, 23 Feb 2023 13:17:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NDHLCl075482; Thu, 23 Feb 2023 13:17:21 GMT (envelope-from git) Date: Thu, 23 Feb 2023 13:17:21 GMT Message-Id: <202302231317.31NDHLCl075482@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: 15df90218bb6 - main - tmpfs: support the nosymfollow mount option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 15df90218bb62df96ce27f47ad9953f4c1f37900 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=15df90218bb62df96ce27f47ad9953f4c1f37900 commit 15df90218bb62df96ce27f47ad9953f4c1f37900 Author: Konstantin Belousov AuthorDate: 2023-02-23 13:15:17 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-23 13:15:17 +0000 tmpfs: support the nosymfollow mount option PR: 269772 Reported by: firk@cantconnect.ru Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/fs/tmpfs/tmpfs_vfsops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index 682636d20725..a856d99e43e5 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -93,11 +93,11 @@ static int tmpfs_statfs(struct mount *, struct statfs *); static const char *tmpfs_opts[] = { "from", "easize", "size", "maxfilesize", "inodes", "uid", "gid", "mode", - "export", "union", "nonc", "nomtime", NULL + "export", "union", "nonc", "nomtime", "nosymfollow", NULL }; static const char *tmpfs_updateopts[] = { - "from", "easize", "export", "nomtime", "size", NULL + "from", "easize", "export", "nomtime", "size", "nosymfollow", NULL }; static int From nobody Thu Feb 23 13:38:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMvHm1YjCz3tkQP; Thu, 23 Feb 2023 13:38: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 4PMvHm15vYz4H0l; Thu, 23 Feb 2023 13:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677159524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cG81X2GhfkB03NlJHbk3J89hR1rjiFlhixOMbqP/6uQ=; b=UqjKuX657xxcganTvxlFUKoLlaeMeNaaGk1pMmbVgMQYpCotahJhfdSlmSfiA7//Fd+43f Kya2yl4snHf5W/Ii9etexwhfjRxAdSbUB1/Ooi7isVMm6s6WCQmJ9wOc+bYzHgR9Xbdp3M iet50H58bEMEPfhDt7DzXfIE2on+ToaLTzwMFYyNXKjY63v4HcOyPygBtEbNP/JDnWUBVr lbrdjpyz+dJAARCRVmk/Bij5xm2d01QVIGF8o83/FgLRxG8xN/4dN824vp0f/nQrhXiHBr L1tLtV3+16HWfyfu4wEX0HM1rrhO/JY0MwYQ+u2sCggfq2vJ5AgBfBRuf6prTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677159524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cG81X2GhfkB03NlJHbk3J89hR1rjiFlhixOMbqP/6uQ=; b=sKovZY+FAr73AsUTHn7nTVBMMcfy1KjHxCzO6oByDlcK/cAOXJBn5L6xQj4o6xNpdZU6Br uGWYqiMdHIDaA/3lK8s22dqSzO0LO1jjKdMpMKYrJVK3ca23+WaLkfleNdMxHXn2TznOY/ hIgtEnM3F4/vg7PKC3IH0F5P3KvZEXVTRhnJuSDKAOw0xN1EeIuDYMWNkCdZ6CjhxcfajN MZCrvTc2rrkO90LxbiLXR0uotjT7DV2XeqLqCSM+/FXzTz34s8aq3DYIm6JxqQNrpve/ry J+XRTMrFoG3WfoZzobag2nk5CLwxo+J6ka9zbjiJv7/AfBRbiI7lYp/N2d26zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677159524; a=rsa-sha256; cv=none; b=nQw3pvWwKLev3AqZeaGtRjtrFYUrLHyoVh/EUfhHxxXXM3qGIZD2tn+KJPECWTupzJwN5D Efk2yYx87GqG/EH7JtSo/7lzJsJ3JxW5H126ieumiFSLDUjc3WbKGcVgmOLAyzAFQPRGIs LUBeq3uyC7W4l3VXt+jSt+gZSz0zUJtNOhLcvNGM1PoI6/7rdFFlYSEqvEIIFeytjL9bge aNwHI9VKHCybj0OY4aXEL8tK+ZF+/dxNob0o2Ho3mhW2tC5amPfy36VgJZVTW7DD8wnQyS qrY+mxlotwcDtv6CVCni6u59lXGk9QI77szAKj9ZJg9YNbSuEuNNW165wbGWDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMvHm00PFzkK0; Thu, 23 Feb 2023 13:38: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 31NDchBe004094; Thu, 23 Feb 2023 13:38:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NDchND004093; Thu, 23 Feb 2023 13:38:43 GMT (envelope-from git) Date: Thu, 23 Feb 2023 13:38:43 GMT Message-Id: <202302231338.31NDchND004093@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: 3a01a97d23a2 - main - mroute: partially sanitize the file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a01a97d23a27cb522b3e9de5d95b825f421cf9b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3a01a97d23a27cb522b3e9de5d95b825f421cf9b commit 3a01a97d23a27cb522b3e9de5d95b825f421cf9b Author: Mateusz Guzik AuthorDate: 2023-02-17 11:23:35 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-23 13:35:44 +0000 mroute: partially sanitize the file There is rampant inconsistent formatting all around, make it mostly style(9)-conformant. While here: - drop malloc casts - rename a rw lock from mroute_mtx to mroute_lock - replace NOTREACHED comment with __assert_unreachable Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D38652 --- sys/netinet/ip_mroute.c | 2783 +++++++++++++++++++++++------------------------ 1 file changed, 1387 insertions(+), 1396 deletions(-) diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 6cabef8a1b16..15abe168e5c2 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -143,19 +143,19 @@ static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast forwarding cache"); * structures. */ -static struct rwlock mrouter_mtx; -#define MRW_RLOCK() rw_rlock(&mrouter_mtx) -#define MRW_WLOCK() rw_wlock(&mrouter_mtx) -#define MRW_RUNLOCK() rw_runlock(&mrouter_mtx) -#define MRW_WUNLOCK() rw_wunlock(&mrouter_mtx) -#define MRW_UNLOCK() rw_unlock(&mrouter_mtx) -#define MRW_LOCK_ASSERT() rw_assert(&mrouter_mtx, RA_LOCKED) -#define MRW_WLOCK_ASSERT() rw_assert(&mrouter_mtx, RA_WLOCKED) -#define MRW_LOCK_TRY_UPGRADE() rw_try_upgrade(&mrouter_mtx) -#define MRW_WOWNED() rw_wowned(&mrouter_mtx) +static struct rwlock mrouter_lock; +#define MRW_RLOCK() rw_rlock(&mrouter_lock) +#define MRW_WLOCK() rw_wlock(&mrouter_lock) +#define MRW_RUNLOCK() rw_runlock(&mrouter_lock) +#define MRW_WUNLOCK() rw_wunlock(&mrouter_lock) +#define MRW_UNLOCK() rw_unlock(&mrouter_lock) +#define MRW_LOCK_ASSERT() rw_assert(&mrouter_lock, RA_LOCKED) +#define MRW_WLOCK_ASSERT() rw_assert(&mrouter_lock, RA_WLOCKED) +#define MRW_LOCK_TRY_UPGRADE() rw_try_upgrade(&mrouter_lock) +#define MRW_WOWNED() rw_wowned(&mrouter_lock) #define MRW_LOCK_INIT() \ - rw_init(&mrouter_mtx, "IPv4 multicast forwarding") -#define MRW_LOCK_DESTROY() rw_destroy(&mrouter_mtx) + rw_init(&mrouter_lock, "IPv4 multicast forwarding") +#define MRW_LOCK_DESTROY() rw_destroy(&mrouter_lock) static int ip_mrouter_cnt; /* # of vnets with active mrouters */ static int ip_mrouter_unloading; /* Allow no more V_ip_mrouter sockets */ @@ -392,7 +392,7 @@ static __inline struct mfc * mfc_alloc(void) { struct mfc *rt; - rt = (struct mfc*) malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT | M_ZERO); + rt = malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT | M_ZERO); if (rt == NULL) return rt; @@ -412,98 +412,94 @@ mfc_alloc(void) static int X_ip_mrouter_set(struct socket *so, struct sockopt *sopt) { - int error, optval; - vifi_t vifi; - struct vifctl vifc; - struct mfcctl2 mfc; - struct bw_upcall bw_upcall; - uint32_t i; - - if (so != V_ip_mrouter && sopt->sopt_name != MRT_INIT) - return EPERM; - - error = 0; - switch (sopt->sopt_name) { - case MRT_INIT: - error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); - if (error) - break; - error = ip_mrouter_init(so, optval); - break; + int error, optval; + vifi_t vifi; + struct vifctl vifc; + struct mfcctl2 mfc; + struct bw_upcall bw_upcall; + uint32_t i; + + if (so != V_ip_mrouter && sopt->sopt_name != MRT_INIT) + return EPERM; + + error = 0; + switch (sopt->sopt_name) { + case MRT_INIT: + error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); + if (error) + break; + error = ip_mrouter_init(so, optval); + break; + case MRT_DONE: + error = ip_mrouter_done(); + break; + case MRT_ADD_VIF: + error = sooptcopyin(sopt, &vifc, sizeof vifc, sizeof vifc); + if (error) + break; + error = add_vif(&vifc); + break; + case MRT_DEL_VIF: + error = sooptcopyin(sopt, &vifi, sizeof vifi, sizeof vifi); + if (error) + break; + error = del_vif(vifi); + break; + case MRT_ADD_MFC: + case MRT_DEL_MFC: + /* + * select data size depending on API version. + */ + if (sopt->sopt_name == MRT_ADD_MFC && + V_mrt_api_config & MRT_API_FLAGS_ALL) { + error = sooptcopyin(sopt, &mfc, sizeof(struct mfcctl2), + sizeof(struct mfcctl2)); + } else { + error = sooptcopyin(sopt, &mfc, sizeof(struct mfcctl), + sizeof(struct mfcctl)); + bzero((caddr_t)&mfc + sizeof(struct mfcctl), + sizeof(mfc) - sizeof(struct mfcctl)); + } + if (error) + break; + if (sopt->sopt_name == MRT_ADD_MFC) + error = add_mfc(&mfc); + else + error = del_mfc(&mfc); + break; - case MRT_DONE: - error = ip_mrouter_done(); - break; + case MRT_ASSERT: + error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); + if (error) + break; + set_assert(optval); + break; - case MRT_ADD_VIF: - error = sooptcopyin(sopt, &vifc, sizeof vifc, sizeof vifc); - if (error) - break; - error = add_vif(&vifc); - break; + case MRT_API_CONFIG: + error = sooptcopyin(sopt, &i, sizeof i, sizeof i); + if (!error) + error = set_api_config(&i); + if (!error) + error = sooptcopyout(sopt, &i, sizeof i); + break; - case MRT_DEL_VIF: - error = sooptcopyin(sopt, &vifi, sizeof vifi, sizeof vifi); - if (error) - break; - error = del_vif(vifi); - break; + case MRT_ADD_BW_UPCALL: + case MRT_DEL_BW_UPCALL: + error = sooptcopyin(sopt, &bw_upcall, sizeof bw_upcall, + sizeof bw_upcall); + if (error) + break; + if (sopt->sopt_name == MRT_ADD_BW_UPCALL) + error = add_bw_upcall(&bw_upcall); + else + error = del_bw_upcall(&bw_upcall); + break; - case MRT_ADD_MFC: - case MRT_DEL_MFC: - /* - * select data size depending on API version. - */ - if (sopt->sopt_name == MRT_ADD_MFC && - V_mrt_api_config & MRT_API_FLAGS_ALL) { - error = sooptcopyin(sopt, &mfc, sizeof(struct mfcctl2), - sizeof(struct mfcctl2)); - } else { - error = sooptcopyin(sopt, &mfc, sizeof(struct mfcctl), - sizeof(struct mfcctl)); - bzero((caddr_t)&mfc + sizeof(struct mfcctl), - sizeof(mfc) - sizeof(struct mfcctl)); + default: + error = EOPNOTSUPP; + break; } - if (error) - break; - if (sopt->sopt_name == MRT_ADD_MFC) - error = add_mfc(&mfc); - else - error = del_mfc(&mfc); - break; - - case MRT_ASSERT: - error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); - if (error) - break; - set_assert(optval); - break; - - case MRT_API_CONFIG: - error = sooptcopyin(sopt, &i, sizeof i, sizeof i); - if (!error) - error = set_api_config(&i); - if (!error) - error = sooptcopyout(sopt, &i, sizeof i); - break; - - case MRT_ADD_BW_UPCALL: - case MRT_DEL_BW_UPCALL: - error = sooptcopyin(sopt, &bw_upcall, sizeof bw_upcall, - sizeof bw_upcall); - if (error) - break; - if (sopt->sopt_name == MRT_ADD_BW_UPCALL) - error = add_bw_upcall(&bw_upcall); - else - error = del_bw_upcall(&bw_upcall); - break; - - default: - error = EOPNOTSUPP; - break; - } - return error; + return error; } /* @@ -512,31 +508,30 @@ X_ip_mrouter_set(struct socket *so, struct sockopt *sopt) static int X_ip_mrouter_get(struct socket *so, struct sockopt *sopt) { - int error; - - switch (sopt->sopt_name) { - case MRT_VERSION: - error = sooptcopyout(sopt, &mrt_api_version, sizeof mrt_api_version); - break; - - case MRT_ASSERT: - error = sooptcopyout(sopt, &V_pim_assert_enabled, - sizeof V_pim_assert_enabled); - break; - - case MRT_API_SUPPORT: - error = sooptcopyout(sopt, &mrt_api_support, sizeof mrt_api_support); - break; - - case MRT_API_CONFIG: - error = sooptcopyout(sopt, &V_mrt_api_config, sizeof V_mrt_api_config); - break; - - default: - error = EOPNOTSUPP; - break; - } - return error; + int error; + + switch (sopt->sopt_name) { + case MRT_VERSION: + error = sooptcopyout(sopt, &mrt_api_version, + sizeof mrt_api_version); + break; + case MRT_ASSERT: + error = sooptcopyout(sopt, &V_pim_assert_enabled, + sizeof V_pim_assert_enabled); + break; + case MRT_API_SUPPORT: + error = sooptcopyout(sopt, &mrt_api_support, + sizeof mrt_api_support); + break; + case MRT_API_CONFIG: + error = sooptcopyout(sopt, &V_mrt_api_config, + sizeof V_mrt_api_config); + break; + default: + error = EOPNOTSUPP; + break; + } + return error; } /* @@ -545,30 +540,30 @@ X_ip_mrouter_get(struct socket *so, struct sockopt *sopt) static int X_mrt_ioctl(u_long cmd, caddr_t data, int fibnum __unused) { - int error = 0; - - /* - * Currently the only function calling this ioctl routine is rtioctl_fib(). - * Typically, only root can create the raw socket in order to execute - * this ioctl method, however the request might be coming from a prison - */ - error = priv_check(curthread, PRIV_NETINET_MROUTE); - if (error) - return (error); - switch (cmd) { - case (SIOCGETVIFCNT): - error = get_vif_cnt((struct sioc_vif_req *)data); - break; - - case (SIOCGETSGCNT): - error = get_sg_cnt((struct sioc_sg_req *)data); - break; - - default: - error = EINVAL; - break; - } - return error; + int error; + + /* + * Currently the only function calling this ioctl routine is rtioctl_fib(). + * Typically, only root can create the raw socket in order to execute + * this ioctl method, however the request might be coming from a prison + */ + error = priv_check(curthread, PRIV_NETINET_MROUTE); + if (error) + return (error); + switch (cmd) { + case (SIOCGETVIFCNT): + error = get_vif_cnt((struct sioc_vif_req *)data); + break; + + case (SIOCGETSGCNT): + error = get_sg_cnt((struct sioc_sg_req *)data); + break; + + default: + error = EINVAL; + break; + } + return error; } /* @@ -577,20 +572,20 @@ X_mrt_ioctl(u_long cmd, caddr_t data, int fibnum __unused) static int get_sg_cnt(struct sioc_sg_req *req) { - struct mfc *rt; - - MRW_RLOCK(); - rt = mfc_find(&req->src, &req->grp); - if (rt == NULL) { - MRW_RUNLOCK(); - req->pktcnt = req->bytecnt = req->wrong_if = 0xffffffff; - return EADDRNOTAVAIL; - } - req->pktcnt = rt->mfc_pkt_cnt; - req->bytecnt = rt->mfc_byte_cnt; - req->wrong_if = rt->mfc_wrong_if; - MRW_RUNLOCK(); - return 0; + struct mfc *rt; + + MRW_RLOCK(); + rt = mfc_find(&req->src, &req->grp); + if (rt == NULL) { + MRW_RUNLOCK(); + req->pktcnt = req->bytecnt = req->wrong_if = 0xffffffff; + return EADDRNOTAVAIL; + } + req->pktcnt = rt->mfc_pkt_cnt; + req->bytecnt = rt->mfc_byte_cnt; + req->wrong_if = rt->mfc_wrong_if; + MRW_RUNLOCK(); + return 0; } /* @@ -599,73 +594,73 @@ get_sg_cnt(struct sioc_sg_req *req) static int get_vif_cnt(struct sioc_vif_req *req) { - vifi_t vifi = req->vifi; + vifi_t vifi = req->vifi; - MRW_RLOCK(); - if (vifi >= V_numvifs) { + MRW_RLOCK(); + if (vifi >= V_numvifs) { + MRW_RUNLOCK(); + return EINVAL; + } + + mtx_lock_spin(&V_viftable[vifi].v_spin); + req->icount = V_viftable[vifi].v_pkt_in; + req->ocount = V_viftable[vifi].v_pkt_out; + req->ibytes = V_viftable[vifi].v_bytes_in; + req->obytes = V_viftable[vifi].v_bytes_out; + mtx_unlock_spin(&V_viftable[vifi].v_spin); MRW_RUNLOCK(); - return EINVAL; - } - - mtx_lock_spin(&V_viftable[vifi].v_spin); - req->icount = V_viftable[vifi].v_pkt_in; - req->ocount = V_viftable[vifi].v_pkt_out; - req->ibytes = V_viftable[vifi].v_bytes_in; - req->obytes = V_viftable[vifi].v_bytes_out; - mtx_unlock_spin(&V_viftable[vifi].v_spin); - MRW_RUNLOCK(); - - return 0; + + return 0; } static void if_detached_event(void *arg __unused, struct ifnet *ifp) { - vifi_t vifi; - u_long i, vifi_cnt = 0; - struct ifnet *free_ptr; + vifi_t vifi; + u_long i, vifi_cnt = 0; + struct ifnet *free_ptr; - MRW_WLOCK(); + MRW_WLOCK(); - if (V_ip_mrouter == NULL) { - MRW_WUNLOCK(); - return; - } - - /* - * Tear down multicast forwarder state associated with this ifnet. - * 1. Walk the vif list, matching vifs against this ifnet. - * 2. Walk the multicast forwarding cache (mfc) looking for - * inner matches with this vif's index. - * 3. Expire any matching multicast forwarding cache entries. - * 4. Free vif state. This should disable ALLMULTI on the interface. - */ - for (vifi = 0; vifi < V_numvifs; vifi++) { - if (V_viftable[vifi].v_ifp != ifp) - continue; - for (i = 0; i < mfchashsize; i++) { - struct mfc *rt, *nrt; + if (V_ip_mrouter == NULL) { + MRW_WUNLOCK(); + return; + } - LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) { - if (rt->mfc_parent == vifi) { - expire_mfc(rt); + /* + * Tear down multicast forwarder state associated with this ifnet. + * 1. Walk the vif list, matching vifs against this ifnet. + * 2. Walk the multicast forwarding cache (mfc) looking for + * inner matches with this vif's index. + * 3. Expire any matching multicast forwarding cache entries. + * 4. Free vif state. This should disable ALLMULTI on the interface. + */ + for (vifi = 0; vifi < V_numvifs; vifi++) { + if (V_viftable[vifi].v_ifp != ifp) + continue; + for (i = 0; i < mfchashsize; i++) { + struct mfc *rt, *nrt; + + LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) { + if (rt->mfc_parent == vifi) { + expire_mfc(rt); + } } } + del_vif_locked(vifi, &free_ptr); + if (free_ptr != NULL) + vifi_cnt++; } - del_vif_locked(vifi, &free_ptr); - if (free_ptr != NULL) - vifi_cnt++; - } - MRW_WUNLOCK(); + MRW_WUNLOCK(); - /* - * Free IFP. We don't have to use free_ptr here as it is the same - * that ifp. Perform free as many times as required in case - * refcount is greater than 1. - */ - for (i = 0; i < vifi_cnt; i++) - if_free(ifp); + /* + * Free IFP. We don't have to use free_ptr here as it is the same + * that ifp. Perform free as many times as required in case + * refcount is greater than 1. + */ + for (i = 0; i < vifi_cnt; i++) + if_free(ifp); } static void @@ -687,55 +682,55 @@ static int ip_mrouter_init(struct socket *so, int version) { - CTR2(KTR_IPMF, "%s: so %p", __func__, so); + CTR2(KTR_IPMF, "%s: so %p", __func__, so); - if (version != 1) - return ENOPROTOOPT; + if (version != 1) + return ENOPROTOOPT; - MRW_WLOCK(); + MRW_WLOCK(); - if (ip_mrouter_unloading) { - MRW_WUNLOCK(); - return ENOPROTOOPT; - } + if (ip_mrouter_unloading) { + MRW_WUNLOCK(); + return ENOPROTOOPT; + } - if (V_ip_mrouter != NULL) { - MRW_WUNLOCK(); - return EADDRINUSE; - } + if (V_ip_mrouter != NULL) { + MRW_WUNLOCK(); + return EADDRINUSE; + } - V_mfchashtbl = hashinit_flags(mfchashsize, M_MRTABLE, &V_mfchash, - HASH_NOWAIT); + V_mfchashtbl = hashinit_flags(mfchashsize, M_MRTABLE, &V_mfchash, + HASH_NOWAIT); - /* Create upcall ring */ - mtx_init(&V_bw_upcalls_ring_mtx, "mroute upcall buf_ring mtx", NULL, MTX_DEF); - V_bw_upcalls_ring = buf_ring_alloc(BW_UPCALLS_MAX, M_MRTABLE, - M_NOWAIT, &V_bw_upcalls_ring_mtx); - if (!V_bw_upcalls_ring) { - MRW_WUNLOCK(); - return (ENOMEM); - } + /* Create upcall ring */ + mtx_init(&V_bw_upcalls_ring_mtx, "mroute upcall buf_ring mtx", NULL, MTX_DEF); + V_bw_upcalls_ring = buf_ring_alloc(BW_UPCALLS_MAX, M_MRTABLE, + M_NOWAIT, &V_bw_upcalls_ring_mtx); + if (!V_bw_upcalls_ring) { + MRW_WUNLOCK(); + return (ENOMEM); + } - TASK_INIT(&V_task, 0, ip_mrouter_upcall_thread, curvnet); - taskqueue_cancel(V_task_queue, &V_task, NULL); - taskqueue_unblock(V_task_queue); + TASK_INIT(&V_task, 0, ip_mrouter_upcall_thread, curvnet); + taskqueue_cancel(V_task_queue, &V_task, NULL); + taskqueue_unblock(V_task_queue); - callout_reset(&V_expire_upcalls_ch, EXPIRE_TIMEOUT, expire_upcalls, - curvnet); - callout_reset(&V_bw_upcalls_ch, BW_UPCALLS_PERIOD, expire_bw_upcalls_send, - curvnet); + callout_reset(&V_expire_upcalls_ch, EXPIRE_TIMEOUT, expire_upcalls, + curvnet); + callout_reset(&V_bw_upcalls_ch, BW_UPCALLS_PERIOD, expire_bw_upcalls_send, + curvnet); - V_ip_mrouter = so; - atomic_add_int(&ip_mrouter_cnt, 1); + V_ip_mrouter = so; + atomic_add_int(&ip_mrouter_cnt, 1); - /* This is a mutex required by buf_ring init, but not used internally */ - mtx_init(&V_buf_ring_mtx, "mroute buf_ring mtx", NULL, MTX_DEF); + /* This is a mutex required by buf_ring init, but not used internally */ + mtx_init(&V_buf_ring_mtx, "mroute buf_ring mtx", NULL, MTX_DEF); - MRW_WUNLOCK(); + MRW_WUNLOCK(); - CTR1(KTR_IPMF, "%s: done", __func__); + CTR1(KTR_IPMF, "%s: done", __func__); - return 0; + return 0; } /* @@ -744,100 +739,100 @@ ip_mrouter_init(struct socket *so, int version) static int X_ip_mrouter_done(void) { - struct ifnet **ifps; - int nifp; - u_long i; - vifi_t vifi; - struct bw_upcall *bu; - - if (V_ip_mrouter == NULL) - return (EINVAL); - - /* - * Detach/disable hooks to the reset of the system. - */ - V_ip_mrouter = NULL; - atomic_subtract_int(&ip_mrouter_cnt, 1); - V_mrt_api_config = 0; - - /* - * Wait for all epoch sections to complete to ensure - * V_ip_mrouter = NULL is visible to others. - */ - epoch_wait_preempt(net_epoch_preempt); - - /* Stop and drain task queue */ - taskqueue_block(V_task_queue); - while (taskqueue_cancel(V_task_queue, &V_task, NULL)) { - taskqueue_drain(V_task_queue, &V_task); - } - - ifps = malloc(MAXVIFS * sizeof(*ifps), M_TEMP, M_WAITOK); - - MRW_WLOCK(); - taskqueue_cancel(V_task_queue, &V_task, NULL); - - /* Destroy upcall ring */ - while ((bu = buf_ring_dequeue_mc(V_bw_upcalls_ring)) != NULL) { - free(bu, M_MRTABLE); - } - buf_ring_free(V_bw_upcalls_ring, M_MRTABLE); - mtx_destroy(&V_bw_upcalls_ring_mtx); - - /* - * For each phyint in use, prepare to disable promiscuous reception - * of all IP multicasts. Defer the actual call until the lock is released; - * just record the list of interfaces while locked. Some interfaces use - * sx locks in their ioctl routines, which is not allowed while holding - * a non-sleepable lock. - */ - KASSERT(V_numvifs <= MAXVIFS, ("More vifs than possible")); - for (vifi = 0, nifp = 0; vifi < V_numvifs; vifi++) { - if (!in_nullhost(V_viftable[vifi].v_lcl_addr) && - !(V_viftable[vifi].v_flags & (VIFF_TUNNEL | VIFF_REGISTER))) { - ifps[nifp++] = V_viftable[vifi].v_ifp; - } - } - bzero((caddr_t)V_viftable, sizeof(*V_viftable) * MAXVIFS); - V_numvifs = 0; - V_pim_assert_enabled = 0; - - callout_stop(&V_expire_upcalls_ch); - callout_stop(&V_bw_upcalls_ch); - - /* - * Free all multicast forwarding cache entries. - * Do not use hashdestroy(), as we must perform other cleanup. - */ - for (i = 0; i < mfchashsize; i++) { - struct mfc *rt, *nrt; - - LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) { - expire_mfc(rt); - } - } - free(V_mfchashtbl, M_MRTABLE); - V_mfchashtbl = NULL; - - bzero(V_nexpire, sizeof(V_nexpire[0]) * mfchashsize); - - V_reg_vif_num = VIFI_INVALID; - - mtx_destroy(&V_buf_ring_mtx); - - MRW_WUNLOCK(); - - /* - * Now drop our claim on promiscuous multicast on the interfaces recorded - * above. This is safe to do now because ALLMULTI is reference counted. - */ - for (vifi = 0; vifi < nifp; vifi++) - if_allmulti(ifps[vifi], 0); - free(ifps, M_TEMP); - - CTR1(KTR_IPMF, "%s: done", __func__); - - return 0; + struct ifnet **ifps; + int nifp; + u_long i; + vifi_t vifi; + struct bw_upcall *bu; + + if (V_ip_mrouter == NULL) + return (EINVAL); + + /* + * Detach/disable hooks to the reset of the system. + */ + V_ip_mrouter = NULL; + atomic_subtract_int(&ip_mrouter_cnt, 1); + V_mrt_api_config = 0; + + /* + * Wait for all epoch sections to complete to ensure + * V_ip_mrouter = NULL is visible to others. + */ + epoch_wait_preempt(net_epoch_preempt); + + /* Stop and drain task queue */ + taskqueue_block(V_task_queue); + while (taskqueue_cancel(V_task_queue, &V_task, NULL)) { + taskqueue_drain(V_task_queue, &V_task); + } + + ifps = malloc(MAXVIFS * sizeof(*ifps), M_TEMP, M_WAITOK); + + MRW_WLOCK(); + taskqueue_cancel(V_task_queue, &V_task, NULL); + + /* Destroy upcall ring */ + while ((bu = buf_ring_dequeue_mc(V_bw_upcalls_ring)) != NULL) { + free(bu, M_MRTABLE); + } + buf_ring_free(V_bw_upcalls_ring, M_MRTABLE); + mtx_destroy(&V_bw_upcalls_ring_mtx); + + /* + * For each phyint in use, prepare to disable promiscuous reception + * of all IP multicasts. Defer the actual call until the lock is released; + * just record the list of interfaces while locked. Some interfaces use + * sx locks in their ioctl routines, which is not allowed while holding + * a non-sleepable lock. + */ + KASSERT(V_numvifs <= MAXVIFS, ("More vifs than possible")); + for (vifi = 0, nifp = 0; vifi < V_numvifs; vifi++) { + if (!in_nullhost(V_viftable[vifi].v_lcl_addr) && + !(V_viftable[vifi].v_flags & (VIFF_TUNNEL | VIFF_REGISTER))) { + ifps[nifp++] = V_viftable[vifi].v_ifp; + } + } + bzero((caddr_t)V_viftable, sizeof(*V_viftable) * MAXVIFS); + V_numvifs = 0; + V_pim_assert_enabled = 0; + + callout_stop(&V_expire_upcalls_ch); + callout_stop(&V_bw_upcalls_ch); + + /* + * Free all multicast forwarding cache entries. + * Do not use hashdestroy(), as we must perform other cleanup. + */ + for (i = 0; i < mfchashsize; i++) { + struct mfc *rt, *nrt; + + LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) { + expire_mfc(rt); + } + } + free(V_mfchashtbl, M_MRTABLE); + V_mfchashtbl = NULL; + + bzero(V_nexpire, sizeof(V_nexpire[0]) * mfchashsize); + + V_reg_vif_num = VIFI_INVALID; + + mtx_destroy(&V_buf_ring_mtx); + + MRW_WUNLOCK(); + + /* + * Now drop our claim on promiscuous multicast on the interfaces recorded + * above. This is safe to do now because ALLMULTI is reference counted. + */ + for (vifi = 0; vifi < nifp; vifi++) + if_allmulti(ifps[vifi], 0); + free(ifps, M_TEMP); + + CTR1(KTR_IPMF, "%s: done", __func__); + + return 0; } /* @@ -846,12 +841,12 @@ X_ip_mrouter_done(void) static int set_assert(int i) { - if ((i != 1) && (i != 0)) - return EINVAL; + if ((i != 1) && (i != 0)) + return EINVAL; - V_pim_assert_enabled = i; + V_pim_assert_enabled = i; - return 0; + return 0; } /* @@ -860,40 +855,40 @@ set_assert(int i) int set_api_config(uint32_t *apival) { - u_long i; - - /* - * We can set the API capabilities only if it is the first operation - * after MRT_INIT. I.e.: - * - there are no vifs installed - * - pim_assert is not enabled - * - the MFC table is empty - */ - if (V_numvifs > 0) { - *apival = 0; - return EPERM; - } - if (V_pim_assert_enabled) { - *apival = 0; - return EPERM; - } - - MRW_RLOCK(); - - for (i = 0; i < mfchashsize; i++) { - if (LIST_FIRST(&V_mfchashtbl[i]) != NULL) { - MRW_RUNLOCK(); - *apival = 0; - return EPERM; - } - } - - MRW_RUNLOCK(); - - V_mrt_api_config = *apival & mrt_api_support; - *apival = V_mrt_api_config; - - return 0; + u_long i; + + /* + * We can set the API capabilities only if it is the first operation + * after MRT_INIT. I.e.: + * - there are no vifs installed + * - pim_assert is not enabled + * - the MFC table is empty + */ + if (V_numvifs > 0) { + *apival = 0; + return EPERM; + } + if (V_pim_assert_enabled) { + *apival = 0; + return EPERM; + } + + MRW_RLOCK(); + + for (i = 0; i < mfchashsize; i++) { + if (LIST_FIRST(&V_mfchashtbl[i]) != NULL) { + MRW_RUNLOCK(); + *apival = 0; + return EPERM; + } + } + + MRW_RUNLOCK(); + + V_mrt_api_config = *apival & mrt_api_support; + *apival = V_mrt_api_config; + + return 0; } /* @@ -902,102 +897,101 @@ set_api_config(uint32_t *apival) static int add_vif(struct vifctl *vifcp) { - struct vif *vifp = V_viftable + vifcp->vifc_vifi; - struct sockaddr_in sin = {sizeof sin, AF_INET}; - struct ifaddr *ifa; - struct ifnet *ifp; - int error; - - - if (vifcp->vifc_vifi >= MAXVIFS) - return EINVAL; - /* rate limiting is no longer supported by this code */ - if (vifcp->vifc_rate_limit != 0) { - log(LOG_ERR, "rate limiting is no longer supported\n"); - return EINVAL; - } - - if (in_nullhost(vifcp->vifc_lcl_addr)) - return EADDRNOTAVAIL; - - /* Find the interface with an address in AF_INET family */ - if (vifcp->vifc_flags & VIFF_REGISTER) { - /* - * XXX: Because VIFF_REGISTER does not really need a valid - * local interface (e.g. it could be 127.0.0.2), we don't - * check its address. - */ - ifp = NULL; - } else { - struct epoch_tracker et; + struct vif *vifp = V_viftable + vifcp->vifc_vifi; + struct sockaddr_in sin = {sizeof sin, AF_INET}; + struct ifaddr *ifa; + struct ifnet *ifp; + int error; - sin.sin_addr = vifcp->vifc_lcl_addr; - NET_EPOCH_ENTER(et); - ifa = ifa_ifwithaddr((struct sockaddr *)&sin); - if (ifa == NULL) { - NET_EPOCH_EXIT(et); - return EADDRNOTAVAIL; + if (vifcp->vifc_vifi >= MAXVIFS) + return EINVAL; + /* rate limiting is no longer supported by this code */ + if (vifcp->vifc_rate_limit != 0) { + log(LOG_ERR, "rate limiting is no longer supported\n"); + return EINVAL; + } + + if (in_nullhost(vifcp->vifc_lcl_addr)) + return EADDRNOTAVAIL; + + /* Find the interface with an address in AF_INET family */ + if (vifcp->vifc_flags & VIFF_REGISTER) { + /* + * XXX: Because VIFF_REGISTER does not really need a valid + * local interface (e.g. it could be 127.0.0.2), we don't + * check its address. + */ + ifp = NULL; + } else { + struct epoch_tracker et; + + sin.sin_addr = vifcp->vifc_lcl_addr; + NET_EPOCH_ENTER(et); + ifa = ifa_ifwithaddr((struct sockaddr *)&sin); + if (ifa == NULL) { + NET_EPOCH_EXIT(et); + return EADDRNOTAVAIL; + } + ifp = ifa->ifa_ifp; + /* XXX FIXME we need to take a ref on ifp and cleanup properly! */ + NET_EPOCH_EXIT(et); + } + + if ((vifcp->vifc_flags & VIFF_TUNNEL) != 0) { + CTR1(KTR_IPMF, "%s: tunnels are no longer supported", __func__); + return EOPNOTSUPP; + } else if (vifcp->vifc_flags & VIFF_REGISTER) { + ifp = V_multicast_register_if = if_alloc(IFT_LOOP); *** 2270 LINES SKIPPED *** From nobody Thu Feb 23 13:56:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMvh82n5mz3tlpv; Thu, 23 Feb 2023 13:56:24 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (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 4PMvh80pc4z4JJ5; Thu, 23 Feb 2023 13:56:24 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1030.google.com with SMTP id qi12-20020a17090b274c00b002341621377cso12850252pjb.2; Thu, 23 Feb 2023 05:56: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:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2l9mJIKquX61zN/10GHvMPC9TH1nyV3mVEZdYHyvQVY=; b=TQXIZQ6cM7vkrAsaKWOzL6OAv1puSSB4vaWjcVtFlIFMtwxL5F6ZOOz2mPyI48Igio 6VafsjSuKUfk+NWCxUuW6bAmdyhP2il4HZRdKY3S7xygWKJJz3VY/L9oqHWfNyPGCNzt 94+f6IAAI7ncZ2YBy5KD1cLzCavt79tX37/1GBeUiROnADGEh4qMmE+q9ImyvgESlOiq 88Fa5SipKxcE5SnO1Mgnn3j5EpQCCV6dNQ0/Khx+atr9LEyDkTQoCkjXqeFL9/wx0IDz /F6G1faQNlLMCO9GJEIByAqe9SPFh9JdeshDpCOzDB2Prhu3/Zzee9i8d4kTM/DLLMev E9QA== 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=2l9mJIKquX61zN/10GHvMPC9TH1nyV3mVEZdYHyvQVY=; b=DXPVcXlv3EHm2W3YOk+8xIs4h88OgXTcWMFuG6mYMBfbzTofm5PSsnsRUOAYQ/zZ8G tUod14kp1uaF7GEtukbs7Ch2HAAR79ZkY1Pais2wdUtSYBR+9Sql7zfK/fgIePJtGqnW DYqUz63Zgw5HzBwcoKx2doVac8mxjmulh1tX2mv3/ITKybG0wyBTGmddRQhmBhl9bswS xaUthfcFfDS1hjTow/Y7BO7PYnq5UskoaIDQJT4QQsGCoo1T03wKRAWVGO9mdxVfWaMV fjzaHFgt466AHnr3HZuLFs9K5auPdAnwmc+DAnyowhJOcK8Hf66cCfnWQksLTb7nDfdm gpZQ== X-Gm-Message-State: AO0yUKXA74y1AE3W2y79t24AMoFvt5CTSe/Dud4u1gQDU64jDZFaUgyn IRyA1wVATuVo9Ahi3rrV+EjNWjRiCsifnmFK0lYiL2TBC8HS X-Google-Smtp-Source: AK7set/R9y1nAR6edYOyGuWiHIPt0nT+KFnnd1AbjZ9nzdn/gbDTezg2/rKXXLNOQ9xCT9e6Czhqy4K2A24dbFUNlQ0= X-Received: by 2002:a17:90b:4a90:b0:237:2eed:6610 with SMTP id lp16-20020a17090b4a9000b002372eed6610mr2067423pjb.4.1677160582511; Thu, 23 Feb 2023 05:56:22 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> In-Reply-To: From: Rick Macklem Date: Thu, 23 Feb 2023 05:56:06 -0800 Message-ID: Subject: Re: git: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup To: Gleb Smirnoff Cc: Rick Macklem , bz@freebsd.org, jamie@freebsd.org, 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: 4PMvh80pc4z4JJ5 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]; TAGGED_FROM(0.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Wed, Feb 22, 2023 at 10:28 PM Gleb Smirnoff wrote: > > Rick, > > On Tue, Feb 21, 2023 at 07:29:30PM -0800, Rick Macklem wrote: > R> I did that for one of the ones related to nfsd (sys/fs/nfsserver/nfs_fha_new.c). > > This one actually doesn't look correct to me. What happens here is that the sysctls > will affect only the default VNET. > Yes, but the sysctls are mostly useless anyhow. I don't know how to make them work in a prison. (I know how to use SYSCTL_FLAG_VNET, but that does not work in this case.) > I think the VNET-itezation of this file went a bit wrong. You don't need to convert > static structures to malloced when you VNET-ize a module. The infrastructure should > take care of memory management. > Not if you want to keep the vnet footprint small. This was necessary so that nfsd.ko (and friends) will load dynamically. Without the conversion to mallocs, it would complain the vnet was out of memory when nfsd.ko tried to load. (I'm sure I didn't need to do all of them, but it made sense to keep the vnet footprint as small as possible.) > The dynamic sysctl context seems to be unneeded from the very beginning. It was > always attached to the static softc. Suggested patch: > > https://reviews.freebsd.org/D38742 > I'll look at it, but if it stops malloc'ng softc, then I will be worried w.r.t. vnet footprint and dynamic loading. (Note that the structure has an array of hash list pointers in it, so it is rather large. Another reason (along with dynamic loading of the modules) for keeping the foot print small is to try and keep the jails that do not use nfsd(8) and friends lightweight. When I originally coded it, I put it under a kernel option called VNET_NFSD (still in kern_jail.c at this time), but others felt that a new kernel option wasn't desirable, (There is a lot of discussion under D37519. The downside of discussions that happen in phabricator is that not as many people see them. I started an email thread on freebsd-current@, but it quickly migrated to D37519. Just the way things currently happen.) > It gets rid of one case of IS_DEFAULT_VNET. > > Tested very little: run two jails and observed difference in sysctl. > > R> It so happens it doesn't work for this case. If you look at the patch, you'll > R> see that the variable is vnet'd. It happens that it is only malloc'd for prisons > R> other than prison0. (For prison0, it points to a global structure that is not > R> malloc'd and is shared with the NFS client, which is not vnet'd. > > I think all of this instances can be fixed. > > For example nfsstatsv1, which is now malloced for non-default vnets and static for > the default. Lots of modules still incorrectly update the global one. > Nope. "struct nfsstatsv1" is a structure that is shared with the NFS client, which is not vnet'd. As such, a static "struct nfsstatsv1" needs to exist for prison0. My original solution was to create a separate structure for the server side stuff (vnet it), but then the result was a messy copying exercise for the system call, which returns the entire structure (with client and server info). Once the client side is vnet'd (I've already had a couple of emails asking me to do it, so I plan on starting to work on it) then, yes, the structure can become a malloc'd vnet'd one and the IS_DEFAULT_VNET can go away. I am not sure why you think IS_DEFAULT_VNET() is such a big deal in the initialization code? It work. I can see an argument for using both SYSINIT() and VNET_SYSINIT() for cases where you have both non-vnet;d and vnet'd data to initialize. However, I don't see any problem with using IS_DEFAULT_VNET() when needed. > This patch makes it right: > > https://reviews.freebsd.org/D38743 > > Tested very little: run two jails, use some NFS, observe difference in nfsstat. > > Removes another IS_DEFAULT_VNET. > > Note that D38743 is still far from perfect. NFS would benefit a lot if used macros > for per-VNET per-CPU (raceless!) stats, that are used in TCP/IP. Sorry, they aren't > documented :( You can find them in vnet.h starting from VNET_PCPUSTAT_DECLARE() > and look for example usage in TCP/IP. > Ok, I was not aware of these. Since the things that are accessed frequently by threads are malloc'd (various lists off of hash tables that are also malloc'd so that they can be sized by tunables), I don't think they will be useful. The data is global to all nfsd threads and not thread specific. W.r.t. stats, it is one structure used for all threads (client and server) and is only updated once per RPC, so I don't see how these are useful there either. But I will take a look. > Please fill free to commandeer those reviews from me and finalize them if you > agree with general idea. > > -- > Gleb Smirnoff From nobody Thu Feb 23 14:17:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMw9F0JFnz3tmWh; Thu, 23 Feb 2023 14:18:09 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (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 4PMw9D3lypz4LNJ; Thu, 23 Feb 2023 14:18:08 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1035.google.com with SMTP id qa18-20020a17090b4fd200b0023750b675f5so4953530pjb.3; Thu, 23 Feb 2023 06:18:08 -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:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uqlZ69Y0aB7cu9Hp1fEOjBnwihG0MSZjIjZn3ZvOFZM=; b=Cssvqs4rIgKm65J+0XD+OTLmEVhXpUzYEUdAnsUo4hVqGD8Kez2l/BW8yTPI7uy4jm 74KKRqxw3w0i6hPBTziWIsBVrhoWgE3aUx1ghxj8itB0jnsq0Kj6yNfcHn5Muoo3ceDr zeXTL78rexiCWZMwuZXcuIV6jsCGBDRWeDj7BovZtLoARn1iUQwljSP8hX8q3/tHHsAC a5RwApV1kgiNk6XPUg0NYVHCuwls2pNxut1Gw/jGoxetT8pL3636WPOh2tjFBCK4JSpe H1WKaEBhRrORzJDRH+J4Tt9mGQNVWfF0Frikgv+G5hGRkMNp1tbWrBL7bzAhGpFCPESw kJXA== 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=uqlZ69Y0aB7cu9Hp1fEOjBnwihG0MSZjIjZn3ZvOFZM=; b=eTmPZCkrxNmikycvwfBU7b53m1cvCdxke5tieivJ5DFGckDfGUMKVSCSvhQgGlTbHB UH4tmL50JBp5C8RdzeXtfu6dZE0KBb+mb20jZQUE+rvVNgqC7MlxNTjT51EnWiyXVA2j umRgX6AUD+6c3ievXpP6Fob8p+K1EngpyblbklU3jIw6m/NZZQ6XN1xq+eQYgyoWITJK dFfyOdBrvrvK+xCyZca3OZnWcVRXgnkWMJvly+wO5XT6BNwANqoZbZeoGx6U9R40mo8p Ovrb6OgH6QqbDpL98SsJ7/QuGj4/4lX1S+fCVhniY9Q3qwXp5xHAWmVrKqI84cROejAY d7aA== X-Gm-Message-State: AO0yUKVqCtBKYzuUBd/Fia62Dj3iRsnzYzblgc7WtdJFB7V3mW3/Vj9U ofCUnJRHGo7rWxGHDu16yTcIWZUSHFX2ZmzL8g8TpQhfBwm9 X-Google-Smtp-Source: AK7set/V1ehriUvEFrHnmHmFotVu2jqv0MuOZJ3XmcBBtdftu+182kgqLYhf3zU4O8ZYx2EHVi0jgT+e6kcPJrjDQSY= X-Received: by 2002:a17:90b:4a90:b0:237:2eed:6610 with SMTP id lp16-20020a17090b4a9000b002372eed6610mr2090392pjb.4.1677161887118; Thu, 23 Feb 2023 06:18:07 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> In-Reply-To: From: Rick Macklem Date: Thu, 23 Feb 2023 06:17:51 -0800 Message-ID: Subject: Re: git: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup To: Gleb Smirnoff Cc: Rick Macklem , bz@freebsd.org, jamie@freebsd.org, 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: 4PMw9D3lypz4LNJ 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]; TAGGED_FROM(0.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Wed, Feb 22, 2023 at 10:28 PM Gleb Smirnoff wrote: > > Rick, > > On Tue, Feb 21, 2023 at 07:29:30PM -0800, Rick Macklem wrote: > R> I did that for one of the ones related to nfsd (sys/fs/nfsserver/nfs_fha_new.c). > > This one actually doesn't look correct to me. What happens here is that the sysctls > will affect only the default VNET. > I can pull the sysctls out of softc and vnet them. I will look at that to-day and should be easy to do. I'll admit I didn't bother, since they are basically of little use, only affect NFSv3 and, yes, I was being lazy. The sysctls in the krpc pool are another story. Not easy to move out of the pool, so I think they are going to be prison0 only for a long time. They probably are rarely used (I didn't code the krpc), so I think having them only on prison0 is ok. The ones people might set (that control how many nfsd threads are generated) can be set in the prisons using the command line options on nfsd(8), so the sysctls are not needed in this case. rick > I think the VNET-itezation of this file went a bit wrong. You don't need to convert > static structures to malloced when you VNET-ize a module. The infrastructure should > take care of memory management. > > The dynamic sysctl context seems to be unneeded from the very beginning. It was > always attached to the static softc. Suggested patch: > > https://reviews.freebsd.org/D38742 > > It gets rid of one case of IS_DEFAULT_VNET. > > Tested very little: run two jails and observed difference in sysctl. > > R> It so happens it doesn't work for this case. If you look at the patch, you'll > R> see that the variable is vnet'd. It happens that it is only malloc'd for prisons > R> other than prison0. (For prison0, it points to a global structure that is not > R> malloc'd and is shared with the NFS client, which is not vnet'd. > > I think all of this instances can be fixed. > > For example nfsstatsv1, which is now malloced for non-default vnets and static for > the default. Lots of modules still incorrectly update the global one. > > This patch makes it right: > > https://reviews.freebsd.org/D38743 > > Tested very little: run two jails, use some NFS, observe difference in nfsstat. > > Removes another IS_DEFAULT_VNET. > > Note that D38743 is still far from perfect. NFS would benefit a lot if used macros > for per-VNET per-CPU (raceless!) stats, that are used in TCP/IP. Sorry, they aren't > documented :( You can find them in vnet.h starting from VNET_PCPUSTAT_DECLARE() > and look for example usage in TCP/IP. > > Please fill free to commandeer those reviews from me and finalize them if you > agree with general idea. > > -- > Gleb Smirnoff From nobody Thu Feb 23 15:36:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMxvb0yyWz3s7q5; Thu, 23 Feb 2023 15:36: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 4PMxvb0Pdjz3Hk9; Thu, 23 Feb 2023 15:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677166587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tiaN5MgJ9ic80Yz2YACe7w1lBcI4yIW0gei95aWw+c4=; b=OaCTIsvoCtbAEP3bn328q1J7VLnsNCjW3X5JUmWh42JyVjdknIU3Yg1AYTLNtScaKnVhJq HBse/PeHj+RODml4PGOJD0NxOTxFKG9uUR/9jZbvggzyywtJS5Jl8KGsiGr6XEGQDDXUAu Vmtl5aPCwD1UAjxXzwDD3xDjqS2U8LeOryv0NesrdOGNNG+yZyE9q1XS/7w4W/UysqoLdE 9x/4XfFaBFPuCs4o2rx8rSwbYQn1mb5qr15c61kvAN70Bwn0KVD00mDV4j0NfOwBefrEek RHFEXCYCKev3r120iVJKv8iP/S6JtEVQy2mKKTueIGRJLlxDnw101wXMozcfsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677166587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tiaN5MgJ9ic80Yz2YACe7w1lBcI4yIW0gei95aWw+c4=; b=ScR+gaJRAB3lO51aucDUwJfzMWvjKCkesTnJxMs19XBk9HRjAw4Gp/S1J3qXLWWPiE9iwb XJ8LhnxZS5TGvO49skgeEdDRfYJfIRaBOqvwcln/CqqHbFvPVo4nTHFNTyPg3rhEJMx3xj VNmMz8mmXq9Kl+CO+AobsJcBl8IrfQ7rDNY7O5bAhDqND59rMnPKYpOaEeq5fsfPP4nfIO E1Nh5OUxm+2r6AllHVMJ0o1bxWmG7AOziMlfb/th9ul9/UOJOpD+5dvl4OpCRpDSnINxvW fBzQjLjQFQ8vQg1FiRn7xQenLdjOnMJe6aiOUXiX6T8UKv2A7b5g7q5LsXWeMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677166587; a=rsa-sha256; cv=none; b=sbF6bPdmZPzrpvj5E6LcXjHHoN/FJ5Vkg077i3GTewvyg/ZDjFcfMXWg+JW5ng6J8+kGo6 F6I9p14Zf6Ni9492SUBSdqC9gq6Pz/kqMoIgkOCuzilkhD+nKrCDYdPPcrT9/4ZSq2EpVi fVfYFtFD4nKwb8qWwwo0Ied4pZUPJd3InblZGrjfn5hHRjvsyGjM5E3m12maT0lzWVMsSO BZIvPFVNVCLm6lpW/zORSKGUZc4OjH4jXFinXs1is94v7frpJgHy7Mglr3pSAtZ3J5uD74 Xd9N/TjRuXvte4adJyMKzVOkhxwwgPUgUeE7j2EOH5jHVuWsG8NCY7J0nTy1DQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMxvZ6CSczn3n; Thu, 23 Feb 2023 15:36: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 31NFaQ4h075083; Thu, 23 Feb 2023 15:36:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NFaQPx075082; Thu, 23 Feb 2023 15:36:26 GMT (envelope-from git) Date: Thu, 23 Feb 2023 15:36:26 GMT Message-Id: <202302231536.31NFaQPx075082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 577a666c3c33 - stable/13 - vmm: Fix AP startup compatibility for old bhyve executables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 577a666c3c33def1d4b996575dc43f8567fdac5c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=577a666c3c33def1d4b996575dc43f8567fdac5c commit 577a666c3c33def1d4b996575dc43f8567fdac5c Author: Mark Johnston AuthorDate: 2023-02-09 20:52:35 +0000 Commit: Mark Johnston CommitDate: 2023-02-23 15:15:47 +0000 vmm: Fix AP startup compatibility for old bhyve executables These changes unbreak AP startup when using a 13.1-RELEASE bhyve executable with a newer kernel: - Correct the destination mask for the VM_EXITCODE_IPI message generated by an INIT or STARTUP IPI in vlapic_icrlo_write_handler(). - Only initialize vlapics on active vCPUs. 13.1-RELEASE bhyve activates AP vCPUs only after the BSP starts them with an IPI, and vmm now allocates vcpu structures lazily, so the STARTUP handling in vm_handle_ipi() could trigger a page fault. - Fix an off-by-one setting the vcpuid in a VM_EXITCODE_SPINUP_AP message. Fixes: 7c326ab5bb9a ("vmm: don't lock a mtx in the icr_low write handler") Reviewed by: jhb, corvink MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38446 (cherry picked from commit b265a2e0d76422f4007e96dd7295ed0aeb846e2d) --- sys/amd64/vmm/io/vlapic.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index a68c68073893..884e232b1422 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -1144,7 +1144,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu) vmexit->exitcode = VM_EXITCODE_IPI; vmexit->u.ipi.mode = mode; vmexit->u.ipi.vector = vec; - vmexit->u.ipi.dmask = dmask; + vmexit->u.ipi.dmask = ipimask; *retu = true; } @@ -1169,16 +1169,22 @@ vm_handle_ipi(struct vcpu *vcpu, struct vm_exit *vme, bool *retu) *retu = true; switch (vme->u.ipi.mode) { - case APIC_DELMODE_INIT: - vm_smp_rendezvous(vcpu, *dmask, vlapic_handle_init, - NULL); + case APIC_DELMODE_INIT: { + cpuset_t active, reinit; + + active = vm_active_cpus(vcpu_vm(vcpu)); + CPU_AND(&reinit, &active, dmask); + if (!CPU_EMPTY(&reinit)) { + vm_smp_rendezvous(vcpu, reinit, vlapic_handle_init, + NULL); + } vm_await_start(vcpu_vm(vcpu), dmask); - if (!vlapic->ipi_exit) { + if (!vlapic->ipi_exit) *retu = false; - } break; + } case APIC_DELMODE_STARTUP: /* * Ignore SIPIs in any state other than wait-for-SIPI @@ -1196,13 +1202,13 @@ vm_handle_ipi(struct vcpu *vcpu, struct vm_exit *vme, bool *retu) */ if (!vlapic->ipi_exit) { vme->exitcode = VM_EXITCODE_SPINUP_AP; - vme->u.spinup_ap.vcpu = CPU_FFS(dmask); + vme->u.spinup_ap.vcpu = CPU_FFS(dmask) - 1; vme->u.spinup_ap.rip = vec << PAGE_SHIFT; } break; default: - return (1); + __assert_unreachable(); } return (0); From nobody Thu Feb 23 16:33:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMz9k04z2z3sC2l; Thu, 23 Feb 2023 16:33: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 4PMz9j6fgtz3Np4; Thu, 23 Feb 2023 16:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677170025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dXSEHeNqUvF+RgZejrcPRwsVivHjPTVGWICXfp0Swjs=; b=bJlv/ejcbHcsM8xgT05yZsm4lJm5vM1ew4+IFsEthSEAklwDD3G/gBSzHATFXBQ2yTeITm v9sNsFWEZ6SrR2Tf6x1pN6H4UNll5tH5+2oxrquGbaFRHeak2vAWPtvTHd89mAdku3bGDe /KonmeAnL8aE9W/XFn2vMs5ZQzJWxVNsJd4UW4AWw2PXrTH3UTQ2eq5WkgZt2qRpu2b6GR SDp6WWY0jK1X5BJBKYeQsXmJoS+EP4TsnxVFTOeZ6CyiGF+MwD6Esx3Gxwq67h3/aJmD8o r2rtI69ZvVAh9Qj4Ve/R4ChxG+8ZQRhopmmu+HE124m4otBLz6vj8g2V8eEkXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677170025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dXSEHeNqUvF+RgZejrcPRwsVivHjPTVGWICXfp0Swjs=; b=x8V+xAvDThMDGXmT4wYPiIBjrTV6pP7khRS/Q0RQPyhSiTH1lJBk8eNq4Q0zea7FgJcpb7 yIpgLn8ppFr+pmTv1lpvceW8yan277kM4E2DjQUn4x3GWgLbHIZCeTodhu/iqVL2LkBeSL Ifhy/1vjZs8YSXPXqYulcci2tHdGRmVxbnXf2kYvF+Pmh684OL2tU6W6/0HaC/FBu/+Qo2 4IiMvqjpNfDPcwyqyPAAufRqMhGSMFda7/w8sPW+sy7xuZIW/UCMg0uvdsZlNmuOd7Q+iH Ak81D5IQXvlbIKWeVaemMVVzTCWudiCxnWGVvbJl5AQHmQdQOtNt20Zm9+2tDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677170025; a=rsa-sha256; cv=none; b=RqTOl/jeOkvG2ForKCrfmTg/2ngWOQO+zcfbMHgVISRawCcgWmoveeeyNBhjwk9ZChsYYg cYRUGmpCEtCzEdmpaYl8vSWSisbTiySZghbOMnblQHIGCYrbK4vSv92O5tfXt3Avr5Oi5P 3g7FuMhGPuiGf+r5jt3o9zleJR8mp6feVdDM6G0abmVPS1g5SjL7tJVmW2zpMsMa7fUjNm G1v0dEw8qGCJL6K7uFssMX2MAhKWZvtYaDJAqc6pmZcY1ZOm3fUMpqhoMssbEXe5JIjzg1 R9D4Ikkfp+mgmu41xJ0klNKLr2Ax1uWhpxg40Omy/TRHZSIs1CWcg0nVn5sKlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMz9j5hj3zpjx; Thu, 23 Feb 2023 16:33: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 31NGXj65061337; Thu, 23 Feb 2023 16:33:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NGXjAq061336; Thu, 23 Feb 2023 16:33:45 GMT (envelope-from git) Date: Thu, 23 Feb 2023 16:33:45 GMT Message-Id: <202302231633.31NGXjAq061336@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: 3dd552426409 - main - ctfdump: Use getprogname() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dd5524264095ed8612c28908e13f80668eff2f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3dd5524264095ed8612c28908e13f80668eff2f9 commit 3dd5524264095ed8612c28908e13f80668eff2f9 Author: Zhenlei Huang AuthorDate: 2023-02-23 16:28:35 +0000 Commit: Zhenlei Huang CommitDate: 2023-02-23 16:28:35 +0000 ctfdump: Use getprogname() Also remove no longer used function `getpname()`. Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38740 --- cddl/contrib/opensolaris/tools/ctf/common/utils.c | 24 ----------------------- cddl/contrib/opensolaris/tools/ctf/dump/dump.c | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/cddl/contrib/opensolaris/tools/ctf/common/utils.c b/cddl/contrib/opensolaris/tools/ctf/common/utils.c index f74eb8de40fa..fda29486d94b 100644 --- a/cddl/contrib/opensolaris/tools/ctf/common/utils.c +++ b/cddl/contrib/opensolaris/tools/ctf/common/utils.c @@ -35,30 +35,6 @@ /*LINTLIBRARY*/ -static const char *pname; - -#pragma init(getpname) -const char * -getpname(void) -{ - const char *p, *q; - - if (pname != NULL) - return (pname); - - if ((p = getexecname()) != NULL) - q = strrchr(p, '/'); - else - q = NULL; - - if (q == NULL) - pname = p; - else - pname = q + 1; - - return (pname); -} - void vdie(const char *format, va_list alist) { diff --git a/cddl/contrib/opensolaris/tools/ctf/dump/dump.c b/cddl/contrib/opensolaris/tools/ctf/dump/dump.c index 06c00a7b0e7f..5cbf46af1b73 100644 --- a/cddl/contrib/opensolaris/tools/ctf/dump/dump.c +++ b/cddl/contrib/opensolaris/tools/ctf/dump/dump.c @@ -856,7 +856,7 @@ print_stats(void) static int print_usage(FILE *fp, int verbose) { - (void) fprintf(fp, "Usage: %s [-dfhlsSt] [-u file] file\n", getpname()); + (void) fprintf(fp, "Usage: %s [-dfhlsSt] [-u file] file\n", getprogname()); if (verbose) { (void) fprintf(fp, From nobody Thu Feb 23 16:42:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMzN22bNFz3sC4Y; Thu, 23 Feb 2023 16:42: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 4PMzN21zg2z3Pyx; Thu, 23 Feb 2023 16:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677170562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RPn3foVUjMET/J9MYM0AzuNjhRhL+sVSaafEAXxBYSc=; b=n8zDAgIxmncfYkSEVQ93iBVscJk2i0yEwoZhHpB/18s45vr31MqNIK306/69hmP70rozNP 0CIa/Cd+oZWRLUahWoaSkCPRxjIuEW6ildXi7gRwSviNneyAmos3h8tV1UpI1I72rs3HHR FaEJ6JEuplR6s+gy9id6M+9utc439LZOeQK+4/guQ8buAyieX0wcIki9o1Su/w3Yg2Watd u/ubdxS2tplX53MJTQzuzfcTVX0FsxvT4G+BqnZ11+Ob+ecxe7S/eOmKgEDGmmD1lXshqG b2/K2+0lmhf76lHx1DqorUniQvmZK0wYESiqFlswaI68PACZEczK5JAfROZ2rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677170562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RPn3foVUjMET/J9MYM0AzuNjhRhL+sVSaafEAXxBYSc=; b=ZAYMIg8g8qbpdxNS9XkRIcWVyqtWrQmyz4Sm4laaTPr41/sG3mS2u4BUAz1eAgn9adsInW 3W/Nia05jHsuMGK8+sLa5tOvVf5/uuKwzlIN/ab6vUbT+NcKz5oJra9Z3tvewccQCwD5VX FvZKIBSiWvv3zeh2WTnA6dMLe4kLkIfyRzMlxiPXENqzZt04LJ4wd9adcer/ZuQto7CAWy O4Xz/H41T1ejxW7PBY4VlmXBNmnslKajCG6woy644G/BuEQJCQbVjhDOw8mWtaiCyELBkc WdRlCrFxz+d1KZWFBHb5x+W5h4MOEZSj/JQ3RpGYefKGdhpUO5M7bNSZzLx2cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677170562; a=rsa-sha256; cv=none; b=urJY8lWLN5A7oaVBWOUxznqYk8eVnIwF8TftiCwEFJRt5XIoYRiHToYsmYcpEoN60Q0Prw pexK1QdLofMkcGZii73Bvd6l0mQ8NdFu9AoGoeJOPoVO7CZxkybwlzC1zQLY9oAHxfwY9F TBVTbZGsx+57ovKLMj/T7msCKxyOt62dcYqZoNjY1sohm37+ENwKOafXpdK+1t+dEoUaTq Oc2LmFiRy7hMyQlnHnOSpkFQzeYyMP1/2SFkslAUVSinzfvUX5swewRytdqgHx/xgt6kt1 WvXSb6p8slxuBi/yz/HjfGdmdS0MYFZh8BuIl4YGa2IyLvsuaIMvMsA5MnE4fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMzN21562zpkX; Thu, 23 Feb 2023 16:42: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 31NGggYI075109; Thu, 23 Feb 2023 16:42:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NGgg9v075108; Thu, 23 Feb 2023 16:42:42 GMT (envelope-from git) Date: Thu, 23 Feb 2023 16:42:42 GMT Message-Id: <202302231642.31NGgg9v075108@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: f4a9e9fc7913 - main - x86: whack kernel gcov vestige List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4a9e9fc79137889d273c06397b3bee8189b4deb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f4a9e9fc79137889d273c06397b3bee8189b4deb commit f4a9e9fc79137889d273c06397b3bee8189b4deb Author: Mateusz Guzik AuthorDate: 2023-02-23 16:40:40 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-23 16:42:38 +0000 x86: whack kernel gcov vestige Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/x86/x86/mp_x86.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 8d305cf76d1e..34c54b27eeff 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -88,9 +88,6 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_CPUS, "cpus", "CPU items"); -/* lock region used by kernel profiling */ -int mcount_lock; - int mp_naps; /* # of Applications processors */ int boot_cpu_id = -1; /* designated BSP */ From nobody Thu Feb 23 16:50:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMzYZ1pjtz3sCYs; Thu, 23 Feb 2023 16:50: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 4PMzYZ13kXz3j2w; Thu, 23 Feb 2023 16:50:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677171058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jh5uNiGc9WPCsIpmsPrj9n/NqwxX3Tl+5vUJAQvROwk=; b=MahEB7cqqTogw9Sit1Ewz18DluOPSLpLlRYS8PrE+yr0GgqalR+mnqDxy8Vl2gXs3fetXw inGtuWzyzqDEhaS/5JYXS18e/wSmKXPpPvSpFEG60kTsAq8qbQ87NSY3ThR1By0X7dJ+LE xa0JR1iH+5vhuW5ttWiNwnhe5Ze1msojppPmk7nwrrIQ+ejOT83ydj8YZYdcxqEnS64eOZ MEpAvCnmg3Z4vNxswvePyN0W1modbHu6DiJgaYbwaQ1qIv8hOwJrJKYlyuBP5y02HBoPCv RFofmollKuK15fS90v/Cj/+IqvmF93wu4Z3fAotjrQIVkkM+rWz7FOh/FzgJIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677171058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jh5uNiGc9WPCsIpmsPrj9n/NqwxX3Tl+5vUJAQvROwk=; b=S/aEUHdg0lLaRwyMWUytqC1TboNLMUc+aP7eoXgRPisp1sCg9624zbQMW+j8sDuNQ+8FRu kXxRYSSm53OwG4ENxr84nNkFkU2e2AKfw9U5HIzMoRq02VL7JIuSJ/vMRHMQz++wlRwqk+ Lbr6QK1W1hlNs4lQ8nmSXGTVWm3kaYLl2zM8Fxfrf20xCJ4nTp3IQYYRJOKrfVuCmTdc4E tL9/erjTEebnR3sH0TLGLYp8qfqHuQOlVjAteuSHJVtd8rnojMUpsd2TiPqAZJqeGR5HnE 3oNpyBLMlr08OewFvqGOhFY01f88q/IcUp5gqEjbLPKeFJ5QPT4egwh6vTQ3QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677171058; a=rsa-sha256; cv=none; b=Kb4gUuF+xMtbIbnp1aOA0zfXeHaJyfhKYiPPQNnac97XGKfMDRDFuFNU8lguFaQbcBYAtX csqEo97nZCxk36KluJBOpmmQeD01v81vbQYFpvEdyLWYntm3pKFaClPiO+ETlYtLKyZmwA CWBVQg04iBpUN13DK1mtTF+QwOq73+Y6Wf3tXRSInf5O0nfV6DHbCgsvkl8aGhVvCfo9w4 GN19iIuqH/7SBTWAw0AK1g6npa30YDHyNnU7LN5IgBr3+KYdHigx76ASfK5p3KwnP5Y/YQ 3u16cwcyY/ht6n2PdTjJIcBmGNlW5O3/NeCjd5US2HnFwrPfq32xFzLlldhxKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMzYZ06hNzpnS; Thu, 23 Feb 2023 16:50: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 31NGovhH086449; Thu, 23 Feb 2023 16:50:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NGovLI086448; Thu, 23 Feb 2023 16:50:57 GMT (envelope-from git) Date: Thu, 23 Feb 2023 16:50:57 GMT Message-Id: <202302231650.31NGovLI086448@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Kornel=20Dul=C4=99ba?= Subject: git: 4d2427f2c445 - main - arm: Unbreak debugging programs that use FP instructions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d2427f2c4451babe1bad600ae02c8a7c66031fe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kd: URL: https://cgit.FreeBSD.org/src/commit/?id=4d2427f2c4451babe1bad600ae02c8a7c66031fe commit 4d2427f2c4451babe1bad600ae02c8a7c66031fe Author: Kornel Dulęba AuthorDate: 2023-02-20 14:44:36 +0000 Commit: Kornel Dulęba CommitDate: 2023-02-23 16:50:26 +0000 arm: Unbreak debugging programs that use FP instructions Contrary to arm64, on armv7 get_vfpcontext/set_vfpcontext can be called from cpu_ptrace. This can be triggered when gdb hits a breakpoint in a userspace program. Relax td == currthread assertion to account for that situation. While here update an outdated comment in vfp_discard. Reported by: Mark Millard Tested by: Mark Millard Differential Revision: https://reviews.freebsd.org/D38696 --- sys/arm/arm/exec_machdep.c | 17 ++++++----------- sys/arm/arm/vfp.c | 2 -- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/sys/arm/arm/exec_machdep.c b/sys/arm/arm/exec_machdep.c index c14bd51146ef..96b382c9083f 100644 --- a/sys/arm/arm/exec_machdep.c +++ b/sys/arm/arm/exec_machdep.c @@ -100,19 +100,18 @@ get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) { struct pcb *pcb; - MPASS(td == curthread); + MPASS(td == curthread || TD_IS_SUSPENDED(td) || + P_SHOULDSTOP(td->td_proc)); pcb = td->td_pcb; - if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) { + if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0 && td == curthread) { critical_enter(); vfp_store(&pcb->pcb_vfpstate, false); critical_exit(); } KASSERT(pcb->pcb_vfpsaved == &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 = pcb->pcb_vfpstate.fpscr; + memcpy(vfp, &pcb->pcb_vfpstate, sizeof(*vfp)); } /* @@ -123,19 +122,15 @@ set_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) { struct pcb *pcb; - MPASS(td == curthread); - pcb = td->td_pcb; - if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) { + if (td == curthread) { critical_enter(); vfp_discard(td); critical_exit(); } KASSERT(pcb->pcb_vfpsaved == &pcb->pcb_vfpstate, ("Called set_vfpcontext while the kernel is using the VFP")); - memcpy(pcb->pcb_vfpstate.reg, vfp->mcv_reg, - sizeof(pcb->pcb_vfpstate.reg)); - pcb->pcb_vfpstate.fpscr = vfp->mcv_fpscr; + memcpy(&pcb->pcb_vfpstate, vfp, sizeof(*vfp)); } #endif diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c index 915d65c1b790..d51c4b6e0618 100644 --- a/sys/arm/arm/vfp.c +++ b/sys/arm/arm/vfp.c @@ -334,8 +334,6 @@ vfp_store(struct vfp_state *vfpsave, boolean_t disable_vfp) * The current thread is dying. If the state currently in the hardware belongs * to the current thread, set fpcurthread to NULL to indicate that the VFP * hardware state does not belong to any thread. If the VFP is on, turn it off. - * Called only from cpu_throw(), so we don't have to worry about a context - * switch here. */ void vfp_discard(struct thread *td) From nobody Thu Feb 23 16:50:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMzYb2jpmz3sDMj; Thu, 23 Feb 2023 16:50: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 4PMzYb2Hdsz3j5n; Thu, 23 Feb 2023 16:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677171059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZF2hbTTiLd7Gn3S1lw+DHdwYUZZtff8YaI8O8PU3XRU=; b=YsjJDdI2kK9muCAC8KgmxTUXfZ5qsAzcU8NG+vrZS12ISXxd2niOp+pHhrA1foS7GEB43t ifTyRparPQ41tFy9LF/mWYfXKyi4zUUyJZtotLfJzqYtmS7HE0bD5nPww2f22T9WA9LvuF yNFozU7eS3SkQsPfxLevrHyJs6fH6LrhsPyRNkQIrAFIGYKnsOHx19jsr65eUpC6kMyLGp SU1UXYgJ+eosCj1YJ00FGmiQOj2HnsBfL5YGvy1nL3X/DPFbq+cMbC49P17n2xaYdhdTNP rpeXCbbIeYovXDonZrp5I93MqR4dkMFRBAMtAxTT/IqNHmfbSBmVPIS864GG4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677171059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZF2hbTTiLd7Gn3S1lw+DHdwYUZZtff8YaI8O8PU3XRU=; b=Atya4/L+TQj7YPN91hokPn+H0MvCAde9BESZp0l6xKPDdnMHn/P2GzG9ZFnNapIWulEJ3K OXSyF9Lews2MugUpmuTwbEMhMJCwuiS7wHk+DrjGrYoaNVMONgXOIHWjkyzXWNba764ZNg THFaQPG96dlXHZmZV3GfmFTwd0Mo78WGs1c0D4IpojUq9PPOYzQRvkhl0nmBJUhO4uslr7 3ljshaNcf+KlzBLUyq4dOsZS/h9Ixlqn2xtM/qkMTDdSN+ps01HblTyVDkK5jT+qodOPzs t0K09HYbHyxEmCO99gThecfa8cGzK1TTca+gv2f8O8F86c99jw064eq8V+2Cew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677171059; a=rsa-sha256; cv=none; b=FPn3TT5Vsrj/Gtc8xul0miZTIsJWx/SENyx9PYowiGSxX4kH7S8JMrxaSWkalhgJDVds8F oVYatIK6ZrZkLMVwEjxZwe73uvNVPFwMrIRoi9wAV4blOjtTAI+IXpGAJntQYp5cbyFsn4 Guhau+mitGPHtuwFu1xo7UP6v/WFCtBECxIzC53LNB/WhThjg5MFxi4kpsCgRTeoxJVdGs DWRWIoBLXDXZx2wZ8SNf486oR8EaSJIlfEOQboDa6cxiP5qH4X6mj5gmUOIinSpRzhq+6q 1qPy4aAAIacQV8s1vO7toletmawg7YbVqqZTlFIEoxXNaXqt88skJvPiFgPQKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMzYb13bbzqLX; Thu, 23 Feb 2023 16:50: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 31NGoxMZ086480; Thu, 23 Feb 2023 16:50:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NGoxWf086479; Thu, 23 Feb 2023 16:50:59 GMT (envelope-from git) Date: Thu, 23 Feb 2023 16:50:59 GMT Message-Id: <202302231650.31NGoxWf086479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Kornel=20Dul=C4=99ba?= Subject: git: 98c666cf8758 - main - arm: Fix initialization of VFP context List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98c666cf875831f252ec5ee5dece2722f02e8706 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kd: URL: https://cgit.FreeBSD.org/src/commit/?id=98c666cf875831f252ec5ee5dece2722f02e8706 commit 98c666cf875831f252ec5ee5dece2722f02e8706 Author: Kornel Dulęba AuthorDate: 2023-02-20 14:48:40 +0000 Commit: Kornel Dulęba CommitDate: 2023-02-23 16:50:26 +0000 arm: Fix initialization of VFP context Make sure that pcb_vfpsaved is always initialized. Create a vfp_new_thread helper that is heavily based on the arm64 logic. While here remove un unnecessary assigment and add an assertion to make sure that it's been properly initialized before we return from a VFP exception. Reported by: Mark Millard Tested by: Mark Millard Differential Revision: https://reviews.freebsd.org/D38698 --- sys/arm/arm/machdep.c | 1 + sys/arm/arm/vfp.c | 33 +++++++++++++++++++++++++++++++-- sys/arm/arm/vm_machdep.c | 10 +++++++--- sys/arm/include/vfp.h | 1 + 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index 0c82190181be..8c0d79caffa8 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -380,6 +380,7 @@ init_proc0(vm_offset_t kstack) thread0.td_pcb->pcb_fpflags = 0; thread0.td_pcb->pcb_vfpcpu = -1; thread0.td_pcb->pcb_vfpstate.fpscr = VFPSCR_DN; + thread0.td_pcb->pcb_vfpsaved = &thread0.td_pcb->pcb_vfpstate; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; } diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c index d51c4b6e0618..b417e02f6998 100644 --- a/sys/arm/arm/vfp.c +++ b/sys/arm/arm/vfp.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #ifdef VFP #include #include +#include #include #include #include @@ -251,17 +252,45 @@ vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) curpcb = curthread->td_pcb; cpu = PCPU_GET(cpuid); if (curpcb->pcb_vfpcpu != cpu || curthread != PCPU_GET(fpcurthread)) { - if (curpcb->pcb_vfpsaved == NULL) - curpcb->pcb_vfpsaved = &curpcb->pcb_vfpstate; vfp_restore(curpcb->pcb_vfpsaved); curpcb->pcb_vfpcpu = cpu; PCPU_SET(fpcurthread, curthread); } critical_exit(); + + KASSERT(curpcb->pcb_vfpsaved == &curpcb->pcb_vfpstate, + ("Kernel VFP state in use when entering userspace")); + return (0); } +/* + * Update the VFP state for a forked process or new thread. The PCB will + * have been copied from the old thread. + * The code is heavily based on arm64 logic. + */ +void +vfp_new_thread(struct thread *newtd, struct thread *oldtd, bool fork) +{ + struct pcb *newpcb; + + newpcb = newtd->td_pcb; + + /* Kernel threads start with clean VFP */ + if ((oldtd->td_pflags & TDP_KTHREAD) != 0) { + newpcb->pcb_fpflags &= + ~(PCB_FP_STARTED | PCB_FP_KERN | PCB_FP_NOSAVE); + } else { + MPASS((newpcb->pcb_fpflags & (PCB_FP_KERN|PCB_FP_NOSAVE)) == 0); + if (!fork) { + newpcb->pcb_fpflags &= ~PCB_FP_STARTED; + } + } + + newpcb->pcb_vfpsaved = &newpcb->pcb_vfpstate; + newpcb->pcb_vfpcpu = UINT_MAX; +} /* * Restore the given state to the VFP hardware. */ diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c index d899e2cd584b..144596162912 100644 --- a/sys/arm/arm/vm_machdep.c +++ b/sys/arm/arm/vm_machdep.c @@ -137,9 +137,9 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) pcb2->pcb_regs.sf_sp = STACKALIGN(td2->td_frame); pcb2->pcb_regs.sf_tpidrurw = (register_t)get_tls(); - pcb2->pcb_vfpcpu = -1; - pcb2->pcb_vfpsaved = &pcb2->pcb_vfpstate; - pcb2->pcb_vfpstate.fpscr = initial_fpscr; +#ifdef VFP + vfp_new_thread(td2, td1, true); +#endif tf = td2->td_frame; tf->tf_spsr &= ~PSR_C; @@ -216,6 +216,10 @@ cpu_copy_thread(struct thread *td, struct thread *td0) td->td_frame->tf_spsr &= ~PSR_C; td->td_frame->tf_r0 = 0; +#ifdef VFP + vfp_new_thread(td, td0, false); +#endif + /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; td->td_md.md_saved_cspr = PSR_SVC32_MODE; diff --git a/sys/arm/include/vfp.h b/sys/arm/include/vfp.h index e15e088970b5..5a27cc68afdd 100644 --- a/sys/arm/include/vfp.h +++ b/sys/arm/include/vfp.h @@ -157,6 +157,7 @@ struct vfp_state { void get_vfpcontext(struct thread *, mcontext_vfp_t *); void set_vfpcontext(struct thread *, mcontext_vfp_t *); void vfp_init(void); +void vfp_new_thread(struct thread*, struct thread*, bool); void vfp_store(struct vfp_state *, boolean_t); void vfp_discard(struct thread *); void vfp_restore_state(void); From nobody Thu Feb 23 17:06:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMzw43DQsz3sFMZ; Thu, 23 Feb 2023 17:07: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 4PMzw42PfVz3kNq; Thu, 23 Feb 2023 17:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677172020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5nYALF20+noAEeHK0xOu8Izlxq0M/Jp+hPjIEZMDJxU=; b=SgNlrHEvomMoz2h/ubQmZBtOMDcpMfPeGkQHnIa1HBMN4Dozcd8faVEwMWsbEmurFJ91Re KOea2MQiOJURLcWuncva9uI9gANNvZP5FiNxDYw4C2lq9G70aaY5q0OYGuT3ROSCVhQ//S D+6XCok70FDfBB0wVr5M4r2vc6fpA8ZHdkeZo3dQcvkK9lF5GZObHk2/c+kK+XzK5KzUDD B7UweUJfeeKqgKzBLJrjQun5XpKxybIe1qtfJlOSxxEF2T7Hd1EHKPLDowpxv0jXpffwBy ZGPaiCrBXlFx0UAjTBSP7guX08zaKY5iCSCgp8JagH4vq6iDiVjgoJYYMKS/QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677172020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5nYALF20+noAEeHK0xOu8Izlxq0M/Jp+hPjIEZMDJxU=; b=r6YTmHDJ0o2f8Xw2TCnAd5+l4Vf6rOFER+mWR97/yT9MwpmNPszTelk0rAfZzuOd+DnMha ioYp4eiNwdhXdBmDZXb2BAjtyctHxFynwMAmXkHCI5xv63Idc8Zyz3iIRmWcRHkdpcBBm5 ECGPktgTQDLzlFS0hm4DZriHSAKky4iwUDwXquXpCv2YBBhlMqC5zP7d9y1Y1yV2AJomjk KlMU7f4CWvfUaiL0LWfmjj48sta7oO+3qLUSI5KW5HFs1gvLrP2DFzxzX1/lwfjBVqIi1S qUxdf0MS5FTVb3LgBJYHvjZnJbKBLOdaM2uIvMn7JF1Ftf9g2h6QGsocHFoIOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677172020; a=rsa-sha256; cv=none; b=VbGFc88Mux5Uj3yIB1c8vdAIRGNc14uuW8ZLga7CFhghslFGuEwlTAZMZRO0J/Z0kbuM9Q papWRJJoHBJRoAudYapGQFhT8ykcTYFAKLF7zQbXRVsDQKpYpkE8qCj18TZyMcLk3OhU+f 8CcsrKQgkJisnQHA4JLc0dOazSNEIq0e+bhdxjozuwUg7ikWvP5bTcS+twKFiYn9A7zHKH 4cAWT7R3W5eesoMDgUnLfV6HVEZpI8hwJvLEneguejPRIazUb1n+r714u4aPkegovuYAjy 6iEYUEXxToUMDvqmLExCleNUuH9Bh/WxttklXRKX6//pBPrwQE2RzS2nbf54Pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMzw41PlPzqfZ; Thu, 23 Feb 2023 17:06: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 31NH6xIo005398; Thu, 23 Feb 2023 17:06:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NH6xqS005397; Thu, 23 Feb 2023 17:06:59 GMT (envelope-from git) Date: Thu, 23 Feb 2023 17:06:59 GMT Message-Id: <202302231706.31NH6xqS005397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 31f9db72a35b - stable/13 - Add nproc(1) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 31f9db72a35bb20ad01d792eaaa1d6048252ab38 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=31f9db72a35bb20ad01d792eaaa1d6048252ab38 commit 31f9db72a35bb20ad01d792eaaa1d6048252ab38 Author: Mateusz Guzik AuthorDate: 2023-02-04 23:33:48 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-23 17:06:41 +0000 Add nproc(1) This program prints the number of CPU threads it can run on, while respecting cpusets (or not, depending on switches). It aims to be compatible with nproc as found in GNU coreutils. Reviewed by: des Reviewed by: pstef Differential Revision: https://reviews.freebsd.org/D38386 (cherry picked from commit 48bfd3597654490cdc43bf0f591a539d3a28b590) --- bin/Makefile | 1 + bin/nproc/Makefile | 4 ++ bin/nproc/nproc.1 | 54 ++++++++++++++++++++ bin/nproc/nproc.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++ usr.bin/cpuset/cpuset.1 | 1 + 5 files changed, 192 insertions(+) diff --git a/bin/Makefile b/bin/Makefile index cdd96d0b84e8..83bf79dcb9f9 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -24,6 +24,7 @@ SUBDIR= cat \ ls \ mkdir \ mv \ + nproc \ pax \ pkill \ ps \ diff --git a/bin/nproc/Makefile b/bin/nproc/Makefile new file mode 100644 index 000000000000..2a57083b9d40 --- /dev/null +++ b/bin/nproc/Makefile @@ -0,0 +1,4 @@ +PACKAGE=runtime +PROG= nproc + +.include diff --git a/bin/nproc/nproc.1 b/bin/nproc/nproc.1 new file mode 100644 index 000000000000..ae252fe0f50c --- /dev/null +++ b/bin/nproc/nproc.1 @@ -0,0 +1,54 @@ +.\"- +.\" * Copyright (c) 2023 Piotr Paweł Stefaniak +.\" +.\" * SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd February 5, 2023 +.Dt NPROC 1 +.Os +.Sh NAME +.Nm nproc +.Nd print the number of processors +.Sh SYNOPSIS +.Nm +.Op Fl -all +.Op Fl -ignore Ns = Ns Ar count +.Nm Fl -help +.Nm Fl -version +.Sh DESCRIPTION +The +.Nm +utility is used to print the number of processors limited to the +.Xr cpuset 2 +of the current process, unless the +.Fl -all +flag is specified. +.Pp +The available flags are: +.Bl -tag -width Ds +.It Fl -all +Count all processors currently online. +.It Fl -ignore Ns = Ns Ar count +The result is decreased by +.Ar count , +but never below 1. +.It Fl -version +Print the current program version and exit. Don't use this option. +.It Fl -help +Print usage information and exit. +.El +.Sh COMPATIBILITY +This program is intended to be compatible with nproc as found in GNU coreutils. +.Sh SEE ALSO +.Xr cpuset 1 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 14.0 . +.Sh AUTHORS +.An -nosplit +.An Mateusz Guzik Aq Mt mjg@FreeBSD.org +wrote the program and +.An Piotr Paweł Stefaniak Aq Mt pstef@FreeBSD.org +wrote this page. diff --git a/bin/nproc/nproc.c b/bin/nproc/nproc.c new file mode 100644 index 000000000000..9037c74dbfff --- /dev/null +++ b/bin/nproc/nproc.c @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 2023 Mateusz Guzik + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* + * This program is intended to be compatible with nproc as found in GNU + * coreutils. + * + * In order to maintain that, do not add any features here if they are not + * present in said program. If you are looking for anything more advanced you + * probably should patch cpuset(1) instead. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define OPT_ALL (CHAR_MAX + 1) +#define OPT_IGNORE (CHAR_MAX + 2) +#define OPT_VERSION (CHAR_MAX + 3) +#define OPT_HELP (CHAR_MAX + 4) + +static struct option long_opts[] = { + { "all", no_argument, NULL, OPT_ALL }, + { "ignore", required_argument, NULL, OPT_IGNORE }, + { "version", no_argument, NULL, OPT_VERSION }, + { "help", no_argument, NULL, OPT_HELP }, + { NULL, 0, NULL, 0 } +}; + +static void +help(void) +{ + fprintf(stderr, + "usage: nproc [--all] [--ignore=count]\n"); + fprintf(stderr, + " nproc --help\n"); + fprintf(stderr, + " nproc --version\n"); +} + +static void +usage(void) +{ + help(); + exit(EX_USAGE); +} + +/* + * GNU variant ships with the --version switch. + * + * While we don't have anything to put there, print something which is + * whitespace-compatible with the original. Version number was taken + * from coreutils this code is in sync with. + */ +static void +version(void) +{ + printf("nproc (neither_GNU nor_coreutils) 8.32\n"); + exit(EXIT_SUCCESS); +} + +int +main(int argc, char *argv[]) +{ + const char *errstr; + cpuset_t mask; + int ch, cpus, ignore; + bool all_flag; + + ignore = 0; + all_flag = false; + + while ((ch = getopt_long(argc, argv, "", long_opts, NULL)) != -1) { + switch (ch) { + case OPT_ALL: + all_flag = true; + break; + case OPT_IGNORE: + ignore = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr) + errx(1, "bad ignore count: %s", errstr); + break; + case OPT_VERSION: + version(); + __builtin_unreachable(); + case OPT_HELP: + help(); + exit(EXIT_SUCCESS); + default: + usage(); + } + } + + argc -= optind; + argv += optind; + + if (argc != 0) + usage(); + + if (all_flag) { + cpus = sysconf(_SC_NPROCESSORS_ONLN); + if (cpus == -1) + err(1, "sysconf"); + } else { + CPU_ZERO(&mask); + if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, + sizeof(mask), &mask) != 0) + err(1, "cpuset_getaffinity"); + cpus = CPU_COUNT(&mask); + } + + if (ignore >= cpus) + cpus = 1; + else + cpus -= ignore; + + printf("%u\n", cpus); + + exit(EXIT_SUCCESS); +} diff --git a/usr.bin/cpuset/cpuset.1 b/usr.bin/cpuset/cpuset.1 index 935164394b31..1d0180c98991 100644 --- a/usr.bin/cpuset/cpuset.1 +++ b/usr.bin/cpuset/cpuset.1 @@ -217,6 +217,7 @@ Create a new cpuset that is restricted to CPUs 0 and 2 and move into the new set: .Dl cpuset -C -c -l 0,2 -p .Sh SEE ALSO +.Xr nproc 1 , .Xr cpuset 2 , .Xr rctl 8 .Sh HISTORY From nobody Thu Feb 23 17:07:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMzw51hqtz3sDqq; Thu, 23 Feb 2023 17:07: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 4PMzw50zZLz3kLt; Thu, 23 Feb 2023 17:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677172021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0kQNCTBe4H7Z1Sk2YiHhN+oxBZhuzhxc0cICGzgcgxw=; b=HvUe7m7Nouu3ZqR+6HSX4IN3uA6AFr+HuhRT6x0M964ywI1jt/8IS3QSxR3wWGDsvrFWV5 36Zrbf6zOq8i4mAJwRRFCg5ge5bBVF6tz8tMDFZcBdBc18jC9L/OLFt5bphijTufi7/aoP 21fNdcbcyD1EzUfunoGo/r1xCpfezRsicLeFzgKc24n/i3k4ATdgZ6W8HLZzarBB4y54GO mNFOZ0vwgCVd3qL4/z1F41UuwJwvqHHePRBhtS73SqHiuPWvRkJbUzYhyJwKAjMniP6q7x 2wZ2iXk/qaON2bc+xNOn3CApHPths20pzaNXev5uRF8EBucjALWafu7qkNgikA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677172021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0kQNCTBe4H7Z1Sk2YiHhN+oxBZhuzhxc0cICGzgcgxw=; b=FjDSWD8xgm7NRVKwe6ju8XO/XPorLpfmTELbV/GUvo3e48rDJOdhEUBO+B5Rn+5CyctQyp qDzyExO7oXlmpuPAcx3xHDyGIWWmXH8kWEly/t45kSfEqfc47zk3yTXWNA2WAiReHB8/ZB vSenYP0FpiI3c/KUs9ltfirb/ex/zZDffnaeXWSIDy7WkCNox0qlnEnR3pBYTnAhFkQBg9 6g6iKW7nZiizna5lTyv1giB5x20s8JrMRxUYYFK6UnqRMmykWlep0dvepgz4/q8BikuX7F O+Hx/krgAqfjiDAzSrVg/GYUaxQ1+UgXPHC1fQx/3hszqJfYMdXCIG/CSksGhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677172021; a=rsa-sha256; cv=none; b=n5c+lU7S7lTu3gV62LL+QdbShTMUJ+AUhJyza0lBl/qN0549gxi+eBfH+jJAAYSv4s9FYa OslIAFRWeydxN+1vn45zBwu6Xqtdvty3JrwzrDaADqvOdlhW57OZaft1q8vAlpGNpgj7ue wEzYTeMkAvdXOWCRq/O13jfD2aI82HyoR48q/u59DSn6Yf2tqTNtn8+y7+EQjHPlYVtdTV XhEQWf3Qrrc8kRicP2gApoaann1aCaKh25gUe6Ip0sn4t1JJJ1TgDJbzcv5VfoNva1RY4H wNfwvxttdvlZubiidUXhvItykNcvIpMXSkC+RZk1vn4iu3dDNSo0Y236QJF0Rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMzw474JrzqMc; Thu, 23 Feb 2023 17:07: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 31NH70d0005417; Thu, 23 Feb 2023 17:07:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NH70RH005416; Thu, 23 Feb 2023 17:07:00 GMT (envelope-from git) Date: Thu, 23 Feb 2023 17:07:00 GMT Message-Id: <202302231707.31NH70RH005416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 117d4cafdcb8 - stable/13 - nproc: denote an incompatiblity with Linux List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 117d4cafdcb806407e38266de44aebe0b4e62b6f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=117d4cafdcb806407e38266de44aebe0b4e62b6f commit 117d4cafdcb806407e38266de44aebe0b4e62b6f Author: Mateusz Guzik AuthorDate: 2023-02-15 20:17:27 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-23 17:06:41 +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. (cherry picked from commit 059320b8c8de73a90514879cd1e2da397584cfde) --- 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 ae252fe0f50c..d4d97ccbb5be 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 @@ -39,6 +39,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 Thu Feb 23 17:08:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMzxm6g6Qz3sDr1; Thu, 23 Feb 2023 17:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMzxm60kvz3ktF; Thu, 23 Feb 2023 17:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677172108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/aZCTiIMVDWC3r1ziFm7b4WAFGMIs0gHGXxKBn6am0k=; b=VRuozLgkgu5qkGLlS7PEIy8xGhY9roQExogJKh2fGcyOnGXUbhJ33AhRphtCQ7loD8EhGv vdSZtJtVvcI8sPpO6ndsoywDfSLt7hmlnaJxawnwdUpynKC5TnhwNq2cs/ySqaWHPJBOAL QMS8XLjXrAw45s94pAIKjLgFut+cBEiN5CjxI9hluKyrYOPwgosXOSl8rIote/SXjWGHHd QZHNlyUlWiOw/DjF0Mtj6+dLiJBEAS1BzPStu2Gp2vcpF9m69ZgoZDUy+9XrapjAcCXpyT 9gvoYUVcetFGfWQjXsn3ACioPL/8fufTU5zQOQFRC8dR0QSzVUx2gdAW1dqdRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677172108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/aZCTiIMVDWC3r1ziFm7b4WAFGMIs0gHGXxKBn6am0k=; b=wt0D7bDyrEh3qVIcxIy9WTEyH9OXdD+dBQULcaOmJGdva47+4K73ir85EpqPjJww18wuS9 gDoHvpEBR9CTLcyi/Bhzw6kltclwDkGcnVvMS7TN6xoVU/N27GPBIIUrql77jW1RdYCEN0 dlK7P6mkUoETVx+vZBcZ4ASfta0tt4ozIvXnp9bBzefxYCVuJ5TgxMy9dg3UUeTQNsJJB8 +WZdiK4L8N3rLWVuU5ho88ik6x6PxGlDvVobgggEtlcn6ZMlBqiRIB4aGtiJFzJ8EayxCV ItQfSN4coj4uHOcU5kln3qAPo8LWzL8mcsBzAMG6U4496ja369e5DMqoBqfD6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677172108; a=rsa-sha256; cv=none; b=d66kESzMkdGvgGOlHJoGZJRmViocC1GMm3gpwu7ukuCG3WqJX9FLPeSmEPpFPSvg1r+z+W kFAeb/sPFhmlBCDdyBV8VJbWvirJSsIYdJJWkQKz9aTJQZJ/9uCBHgLTnePQsfLfcabOlW 7cduTUYguJfTcCehdF3vP/sH4yXK3axhWuIWsEm1CXi1BaMjoymMWv3bZx9nlbfm4vq348 5bHKj8icelRvOXqnKyQ0P0e8R3+MoLTHPO3jfOBstRe4O4izaLjbN+7C+aWdULMaF+i+R+ ZrtkaQZ5SaSd2cYIUEySJ2wCgFeeWyI3pzYmszdmu4Oo5Ne4Ph+cNoU6z+dt/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 4PMzxm54r9zqqq; Thu, 23 Feb 2023 17:08: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 31NH8SSO005686; Thu, 23 Feb 2023 17:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NH8SYK005685; Thu, 23 Feb 2023 17:08:28 GMT (envelope-from git) Date: Thu, 23 Feb 2023 17:08:28 GMT Message-Id: <202302231708.31NH8SYK005685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5e8827063b9f - releng/13.2 - vmm: Fix AP startup compatibility for old bhyve executables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 5e8827063b9f565697135b33399a64ca9f000a02 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5e8827063b9f565697135b33399a64ca9f000a02 commit 5e8827063b9f565697135b33399a64ca9f000a02 Author: Mark Johnston AuthorDate: 2023-02-09 20:52:35 +0000 Commit: Mark Johnston CommitDate: 2023-02-23 17:07:47 +0000 vmm: Fix AP startup compatibility for old bhyve executables These changes unbreak AP startup when using a 13.1-RELEASE bhyve executable with a newer kernel: - Correct the destination mask for the VM_EXITCODE_IPI message generated by an INIT or STARTUP IPI in vlapic_icrlo_write_handler(). - Only initialize vlapics on active vCPUs. 13.1-RELEASE bhyve activates AP vCPUs only after the BSP starts them with an IPI, and vmm now allocates vcpu structures lazily, so the STARTUP handling in vm_handle_ipi() could trigger a page fault. - Fix an off-by-one setting the vcpuid in a VM_EXITCODE_SPINUP_AP message. Approved by: re (cperciva) Fixes: 7c326ab5bb9a ("vmm: don't lock a mtx in the icr_low write handler") Reviewed by: jhb, corvink MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38446 (cherry picked from commit b265a2e0d76422f4007e96dd7295ed0aeb846e2d) (cherry picked from commit 577a666c3c33def1d4b996575dc43f8567fdac5c) --- sys/amd64/vmm/io/vlapic.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 44641cc29035..f7370e440d66 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -1160,7 +1160,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu) vmexit->exitcode = VM_EXITCODE_IPI; vmexit->u.ipi.mode = mode; vmexit->u.ipi.vector = vec; - vmexit->u.ipi.dmask = dmask; + vmexit->u.ipi.dmask = ipimask; *retu = true; } @@ -1185,16 +1185,22 @@ vm_handle_ipi(struct vcpu *vcpu, struct vm_exit *vme, bool *retu) *retu = true; switch (vme->u.ipi.mode) { - case APIC_DELMODE_INIT: - vm_smp_rendezvous(vcpu, *dmask, vlapic_handle_init, - NULL); + case APIC_DELMODE_INIT: { + cpuset_t active, reinit; + + active = vm_active_cpus(vcpu_vm(vcpu)); + CPU_AND(&reinit, &active, dmask); + if (!CPU_EMPTY(&reinit)) { + vm_smp_rendezvous(vcpu, reinit, vlapic_handle_init, + NULL); + } vm_await_start(vcpu_vm(vcpu), dmask); - if (!vlapic->ipi_exit) { + if (!vlapic->ipi_exit) *retu = false; - } break; + } case APIC_DELMODE_STARTUP: /* * Ignore SIPIs in any state other than wait-for-SIPI @@ -1212,13 +1218,13 @@ vm_handle_ipi(struct vcpu *vcpu, struct vm_exit *vme, bool *retu) */ if (!vlapic->ipi_exit) { vme->exitcode = VM_EXITCODE_SPINUP_AP; - vme->u.spinup_ap.vcpu = CPU_FFS(dmask); + vme->u.spinup_ap.vcpu = CPU_FFS(dmask) - 1; vme->u.spinup_ap.rip = vec << PAGE_SHIFT; } break; default: - return (1); + __assert_unreachable(); } return (0); From nobody Thu Feb 23 17:43:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN0k30Knsz3sH94; Thu, 23 Feb 2023 17:43: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 4PN0k26vnNz3pCq; Thu, 23 Feb 2023 17:43:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677174203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pmU2H+oodvshqkDj+RMe+C8UGKQHil5jEvT8g7U3D9g=; b=mkybSQteoO6qqJqdUYNYVcHyk7PEKyI11dlEkmmRZQ9/jsnfPpgw1jlsXxElBUXadUjKjB inb3uRQqjgPlNS65Ih0QC1fiEaDi6hXPcudxqmNezkxrfh04b6AN1XvRIv+fGC6U2C7zoU sArYyGHE6K/yp1yKed7fSjLBIpxMv5Pk9nRgEm8bJgzdMYmZv4AKXUsazrP57ssAPXF707 3GuBx4/yN/j5B2jiLh2eRQv2e+rDcdXebRvtXvrztpXa+o+8YLWwtv1w8eCVKgjZ1Ul4YR cPALRhRJKa6SO9FzmmLNI801lOFP8xMMPbH2gpXVQAJfDTe+QPI+ORBholEVxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677174203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pmU2H+oodvshqkDj+RMe+C8UGKQHil5jEvT8g7U3D9g=; b=j/VUT7kkxZ52M5IQHBsIFfWCt2GH5gESph5ZG6asLYWAvMSoseLnN3qDd2KM4AbR638hhT RQ4vgP6o/V4kqJe5Y53GPFKC5uGt/rGdQieJE/vzdCQOG4SBKvzeWF0QQo//0qV0hCJM3f ykapVBjlP8eVysLam5ZmK3Tv9n3lD26qXhyTyBUmm7n95F9XnGgU0Si/MNApeK5JWaNJPv pkAvKj/NNsoYSJnvanJaKrgTjEvDw3Z01cWjCLm8jbb8LPqucQYvT6HpQwV9S6XH+mIWA+ gKEr5xSDakIEoWj5Or38WABJL4U6GBr9oBjd/Mv59xHQBRoUEDjDV5EF9nWUIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677174203; a=rsa-sha256; cv=none; b=yiXzez5UWrIusr4t0t34VwAiGC7BbfHTRcotxkV8mtMGEjt5B6R1mQ/PrL8/HzXOWP7Y2q Sz7kbB3Ch4LN1mz0ORq8kRcWfuSoX399bmd0+ygwcfAXb9cufx3vGRHwQrqNu2+e2QYbbu 4h5RjgADzEPCxu07v54Mv0jWOJj+ZfVjAOQwZBl7t4BDUXMlyEtGF1KntlL4S16oPsJWhw U5WR+3sNOp5pTVoUr/04Ci1XusvrbS5DJdEq/kYMHu8pYJkfHVUYuhkPQ1a8Rb8d5u5bj7 Bpr0tjU5CMFdWdXCEW0wNWGEGAPMJlKW0M2orM8AFX5tb0O475iSLFj9rS1a9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN0k25y2Tzrg8; Thu, 23 Feb 2023 17:43: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 31NHhMJa061849; Thu, 23 Feb 2023 17:43:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NHhMZE061848; Thu, 23 Feb 2023 17:43:22 GMT (envelope-from git) Date: Thu, 23 Feb 2023 17:43:22 GMT Message-Id: <202302231743.31NHhMZE061848@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: d2deebe21b59 - main - netlink: fix addition of blackhole/reject routes. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2deebe21b591336fbd8915b37d409b25da54d4d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=d2deebe21b591336fbd8915b37d409b25da54d4d commit d2deebe21b591336fbd8915b37d409b25da54d4d Author: Alexander V. Chernikov AuthorDate: 2023-02-23 17:38:18 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-23 17:43:18 +0000 netlink: fix addition of blackhole/reject routes. * Make nhop_set_blackhole() set all necessary properties for the nexthop * Make nexthops blackhole/reject based on the rtm_type netlink property instead of using rtflags. Reported by: Marek Zarychta MFC after: 3 days --- sys/net/route/nhop_ctl.c | 23 +++++++++++++++++++++++ sys/netlink/route/rt.c | 28 ++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 15d4ec394187..73c34f675a04 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -823,6 +823,29 @@ nhop_set_blackhole(struct nhop_object *nh, int blackhole_rt_flag) nh->nh_flags |= NHF_REJECT; nh->nh_priv->rt_flags |= RTF_REJECT; break; + default: + /* Not a blackhole nexthop */ + return; + } + + nh->nh_ifp = V_loif; + nh->nh_flags &= ~NHF_GATEWAY; + nh->nh_priv->rt_flags &= ~RTF_GATEWAY; + nh->nh_priv->nh_neigh_family = nh->nh_priv->nh_upper_family; + + bzero(&nh->gw_sa, sizeof(nh->gw_sa)); + + switch (nh->nh_priv->nh_upper_family) { + case AF_INET: + nh->gw4_sa.sin_family = AF_INET; + nh->gw4_sa.sin_len = sizeof(struct sockaddr_in); + nh->gw4_sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + break; + case AF_INET6: + nh->gw6_sa.sin6_family = AF_INET6; + nh->gw6_sa.sin6_len = sizeof(struct sockaddr_in6); + nh->gw6_sa.sin6_addr = in6addr_loopback; + break; } } diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index dabdaea3e03b..badd8d937be2 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -458,6 +458,7 @@ struct nl_parsed_route { uint8_t rtm_family; uint8_t rtm_dst_len; uint8_t rtm_protocol; + uint8_t rtm_type; }; #define _IN(_field) offsetof(struct rtmsg, _field) @@ -481,9 +482,10 @@ static const struct nlattr_parser nla_p_rtmsg[] = { }; static const struct nlfield_parser nlf_p_rtmsg[] = { - {.off_in = _IN(rtm_family), .off_out = _OUT(rtm_family), .cb = nlf_get_u8 }, - {.off_in = _IN(rtm_dst_len), .off_out = _OUT(rtm_dst_len), .cb = nlf_get_u8 }, - {.off_in = _IN(rtm_protocol), .off_out = _OUT(rtm_protocol), .cb = nlf_get_u8 }, + { .off_in = _IN(rtm_family), .off_out = _OUT(rtm_family), .cb = nlf_get_u8 }, + { .off_in = _IN(rtm_dst_len), .off_out = _OUT(rtm_dst_len), .cb = nlf_get_u8 }, + { .off_in = _IN(rtm_protocol), .off_out = _OUT(rtm_protocol), .cb = nlf_get_u8 }, + { .off_in = _IN(rtm_type), .off_out = _OUT(rtm_type), .cb = nlf_get_u8 }, }; #undef _IN #undef _OUT @@ -828,13 +830,23 @@ create_nexthop_from_attrs(struct nl_parsed_route *attrs, nhop_set_mtu(nh, attrs->rtax_mtu, true); if (attrs->rta_rtflags & RTF_BROADCAST) nhop_set_broadcast(nh, true); - if (attrs->rta_rtflags & RTF_BLACKHOLE) - nhop_set_blackhole(nh, NHF_BLACKHOLE); - if (attrs->rta_rtflags & RTF_REJECT) - nhop_set_blackhole(nh, NHF_REJECT); - nhop_set_rtflags(nh, attrs->rta_rtflags); if (attrs->rtm_protocol > RTPROT_STATIC) nhop_set_origin(nh, attrs->rtm_protocol); + nhop_set_rtflags(nh, attrs->rta_rtflags); + + switch (attrs->rtm_type) { + case RTN_UNICAST: + break; + case RTN_BLACKHOLE: + nhop_set_blackhole(nh, RTF_BLACKHOLE); + break; + case RTN_PROHIBIT: + case RTN_UNREACHABLE: + nhop_set_blackhole(nh, RTF_REJECT); + break; + /* TODO: return ENOTSUP for other types if strict option is set */ + } + nh = finalize_nhop(nh, perror); } From nobody Thu Feb 23 17:52:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN0wx5jwtz3sHpR; Thu, 23 Feb 2023 17:52: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 4PN0wx55v0z3ppZ; Thu, 23 Feb 2023 17:52:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677174769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=btnWCqVeKi2fS3ioZLSrh8ApJERk9D3Y1Tcu7OV3hBU=; b=CUAsj3SSti4F0oMcQ/J/rP35Y7hnVfFnQvgimssqcQpJx4heGrtI44Y95ix66FElfyF7sg p1OMBll8UIDoBkXn9IVIrr6UacpRSyH9yexi5uTTmMDANzjlECzNfmq9uQeuXT/Vae213Q LgISaYgOPKs0QpaFdi5KvLSrZC95JHLShnzIZJovsbBJZ0RyQwmZl+8+ko3+HDhGsq+Ez9 OeQX3laSsSlJAJmva5N63ySOf/CkOeMKU7RfSXlxKfkDkFsTJR9q2Z0ETD0bQB9Jr9z11K 584eG4SNbgoY0nZcYFxxg4N08mf/ao15dZhcm89U4IcJG0GpFiUO3yIInsK9Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677174769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=btnWCqVeKi2fS3ioZLSrh8ApJERk9D3Y1Tcu7OV3hBU=; b=khQ6sI/Gah0uZ6IFMhMisFSEnnPdFHMcwLSjvMcJ3mAOG+80sn+zIgmSnKrJMLT5LR197y eO8de1/t9pu+vwX1ZTf/tATaZtPypgYxxfZt/oCuYGOFHKtl2FSuaPF3h59VQuoxVOsuAi j/UJuVVrDVhS3E4qTq70ZbAzDX7duLhqDRhWqRixt9D+5glNB4SpCbst56NApamf9khgrp pFmi53WBSxhXggeAKWUv0ec7/BppELscxwHhD7xbBs7fGu02fGmW/c6qXXhpJr7HYer2ey ycLQMzYc4S7/Ax2V0oX/pbv+YcIU4VOFoY3j41eHJdK4zXv8+tzpCVzOL+GFfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677174769; a=rsa-sha256; cv=none; b=TcVA2fNcaZYayWIOdlAHdgvaJ3G9x/NkSt+zMOULpv7x97aODmMMw7B8hzajz9g/Z1q7wa dBesRKzzsP9AkJAcndB+Lr/yThIqPRhkF/lKoKqjxwIJLQ240Rlormrt0Fn/29qqb1lBMT Y3Jrz/lDBfRHtfy1iMgvaqDSEbGqk8wgdkjZDkmM9UdSZv1FPO+vKofbOcdfasnaproUPZ vyKdwnwZnZfb74IdeJy92H0EWEXcdnQcW8h6yyDKzF+S54aldLsSbHBukKHKSxf05w2ZXU n1Y/pbP9sw4askNk74v6mgxmiV5Z6smE2saIEWDdaXQSgvMFwl9eiwvYmT5OAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN0wx487zzrSp; Thu, 23 Feb 2023 17:52: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 31NHqnBA075811; Thu, 23 Feb 2023 17:52:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NHqnPd075810; Thu, 23 Feb 2023 17:52:49 GMT (envelope-from git) Date: Thu, 23 Feb 2023 17:52:49 GMT Message-Id: <202302231752.31NHqnPd075810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: eb9e9f1c2533 - releng/13.2 - Add nproc(1) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: eb9e9f1c2533a8b01446e14a46f45eb7b0cd71e2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=eb9e9f1c2533a8b01446e14a46f45eb7b0cd71e2 commit eb9e9f1c2533a8b01446e14a46f45eb7b0cd71e2 Author: Mateusz Guzik AuthorDate: 2023-02-04 23:33:48 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-23 17:51:07 +0000 Add nproc(1) This program prints the number of CPU threads it can run on, while respecting cpusets (or not, depending on switches). It aims to be compatible with nproc as found in GNU coreutils. Approved by: re (cperciva) Reviewed by: des Reviewed by: pstef Differential Revision: https://reviews.freebsd.org/D38386 (cherry picked from commit 48bfd3597654490cdc43bf0f591a539d3a28b590) (cherry picked from commit 31f9db72a35bb20ad01d792eaaa1d6048252ab38) --- bin/Makefile | 1 + bin/nproc/Makefile | 4 ++ bin/nproc/nproc.1 | 54 ++++++++++++++++++++ bin/nproc/nproc.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++ usr.bin/cpuset/cpuset.1 | 1 + 5 files changed, 192 insertions(+) diff --git a/bin/Makefile b/bin/Makefile index cdd96d0b84e8..83bf79dcb9f9 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -24,6 +24,7 @@ SUBDIR= cat \ ls \ mkdir \ mv \ + nproc \ pax \ pkill \ ps \ diff --git a/bin/nproc/Makefile b/bin/nproc/Makefile new file mode 100644 index 000000000000..2a57083b9d40 --- /dev/null +++ b/bin/nproc/Makefile @@ -0,0 +1,4 @@ +PACKAGE=runtime +PROG= nproc + +.include diff --git a/bin/nproc/nproc.1 b/bin/nproc/nproc.1 new file mode 100644 index 000000000000..ae252fe0f50c --- /dev/null +++ b/bin/nproc/nproc.1 @@ -0,0 +1,54 @@ +.\"- +.\" * Copyright (c) 2023 Piotr Paweł Stefaniak +.\" +.\" * SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd February 5, 2023 +.Dt NPROC 1 +.Os +.Sh NAME +.Nm nproc +.Nd print the number of processors +.Sh SYNOPSIS +.Nm +.Op Fl -all +.Op Fl -ignore Ns = Ns Ar count +.Nm Fl -help +.Nm Fl -version +.Sh DESCRIPTION +The +.Nm +utility is used to print the number of processors limited to the +.Xr cpuset 2 +of the current process, unless the +.Fl -all +flag is specified. +.Pp +The available flags are: +.Bl -tag -width Ds +.It Fl -all +Count all processors currently online. +.It Fl -ignore Ns = Ns Ar count +The result is decreased by +.Ar count , +but never below 1. +.It Fl -version +Print the current program version and exit. Don't use this option. +.It Fl -help +Print usage information and exit. +.El +.Sh COMPATIBILITY +This program is intended to be compatible with nproc as found in GNU coreutils. +.Sh SEE ALSO +.Xr cpuset 1 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 14.0 . +.Sh AUTHORS +.An -nosplit +.An Mateusz Guzik Aq Mt mjg@FreeBSD.org +wrote the program and +.An Piotr Paweł Stefaniak Aq Mt pstef@FreeBSD.org +wrote this page. diff --git a/bin/nproc/nproc.c b/bin/nproc/nproc.c new file mode 100644 index 000000000000..9037c74dbfff --- /dev/null +++ b/bin/nproc/nproc.c @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 2023 Mateusz Guzik + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* + * This program is intended to be compatible with nproc as found in GNU + * coreutils. + * + * In order to maintain that, do not add any features here if they are not + * present in said program. If you are looking for anything more advanced you + * probably should patch cpuset(1) instead. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define OPT_ALL (CHAR_MAX + 1) +#define OPT_IGNORE (CHAR_MAX + 2) +#define OPT_VERSION (CHAR_MAX + 3) +#define OPT_HELP (CHAR_MAX + 4) + +static struct option long_opts[] = { + { "all", no_argument, NULL, OPT_ALL }, + { "ignore", required_argument, NULL, OPT_IGNORE }, + { "version", no_argument, NULL, OPT_VERSION }, + { "help", no_argument, NULL, OPT_HELP }, + { NULL, 0, NULL, 0 } +}; + +static void +help(void) +{ + fprintf(stderr, + "usage: nproc [--all] [--ignore=count]\n"); + fprintf(stderr, + " nproc --help\n"); + fprintf(stderr, + " nproc --version\n"); +} + +static void +usage(void) +{ + help(); + exit(EX_USAGE); +} + +/* + * GNU variant ships with the --version switch. + * + * While we don't have anything to put there, print something which is + * whitespace-compatible with the original. Version number was taken + * from coreutils this code is in sync with. + */ +static void +version(void) +{ + printf("nproc (neither_GNU nor_coreutils) 8.32\n"); + exit(EXIT_SUCCESS); +} + +int +main(int argc, char *argv[]) +{ + const char *errstr; + cpuset_t mask; + int ch, cpus, ignore; + bool all_flag; + + ignore = 0; + all_flag = false; + + while ((ch = getopt_long(argc, argv, "", long_opts, NULL)) != -1) { + switch (ch) { + case OPT_ALL: + all_flag = true; + break; + case OPT_IGNORE: + ignore = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr) + errx(1, "bad ignore count: %s", errstr); + break; + case OPT_VERSION: + version(); + __builtin_unreachable(); + case OPT_HELP: + help(); + exit(EXIT_SUCCESS); + default: + usage(); + } + } + + argc -= optind; + argv += optind; + + if (argc != 0) + usage(); + + if (all_flag) { + cpus = sysconf(_SC_NPROCESSORS_ONLN); + if (cpus == -1) + err(1, "sysconf"); + } else { + CPU_ZERO(&mask); + if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, + sizeof(mask), &mask) != 0) + err(1, "cpuset_getaffinity"); + cpus = CPU_COUNT(&mask); + } + + if (ignore >= cpus) + cpus = 1; + else + cpus -= ignore; + + printf("%u\n", cpus); + + exit(EXIT_SUCCESS); +} diff --git a/usr.bin/cpuset/cpuset.1 b/usr.bin/cpuset/cpuset.1 index 935164394b31..1d0180c98991 100644 --- a/usr.bin/cpuset/cpuset.1 +++ b/usr.bin/cpuset/cpuset.1 @@ -217,6 +217,7 @@ Create a new cpuset that is restricted to CPUs 0 and 2 and move into the new set: .Dl cpuset -C -c -l 0,2 -p .Sh SEE ALSO +.Xr nproc 1 , .Xr cpuset 2 , .Xr rctl 8 .Sh HISTORY From nobody Thu Feb 23 17:52:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN0wy6jN2z3sHpT; Thu, 23 Feb 2023 17:52: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 4PN0wy5r48z3phQ; Thu, 23 Feb 2023 17:52:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677174770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOxEBpYk5AQqfOmSgzHA++68njyy3gFNWC4M4XJ9hzQ=; b=yzwEZ1Gzs35iARTAGMgdkiJbfjgMvKVQOuYXkt9MnFv35po+TUDAH87ziM584854QkDDrQ NbJJxScFlFHIDJAeR9hMjpvJYfbcfduYA081xM/zC3vmWSdgNNGvgXTyffWl4YKsKJAli+ dku/Ik4742vJUjSSaQnrSafdHf1grIUPTa3JXTaOKz8hiQsQbuZgxq/DuyvMi6cFlIXYlI qwxcGnLnyEATXVkOY20bYJRuXf6ALXRF6dpiN40E8pc8VAX0dM14JVvBM/azhYJjTER42B Xe4kuUGL4bLAoLHD+VATpP692Ec8BxNnrnCYFy7nioVVURnfPOhQ/ZRRpJUgrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677174770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOxEBpYk5AQqfOmSgzHA++68njyy3gFNWC4M4XJ9hzQ=; b=moy4uq+IZFKVFVGdqReC69jTciW0UqFgThcR3eTeOAccB9XcOBE3fyMls4JYvW4WhxghXU VgH5B/JDfhezOJPnAb+TVKkQ8ZT10CyCTvQHxeXUwgp6tzfVB9H/bRu0AQ+muaijAZKdlg YN57nFdE15ZO2GCJQnAeyCYK4UiDBX8o5jVRcqOcjEOQFv2RvRuwCV8Y+4vIrXu8jFd08O dqLmD8h1lfx/Rek+qQubRLSCMlPE/Cx30P7BRXX5BAiKqretOThFe89uMQFN+1OvLh3xMk YJNlnbSxpa/QpFvWW9HcgLAVpeuu+jSinF6ICbsupLQLYhU5lJxJsLbw/j6FIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677174770; a=rsa-sha256; cv=none; b=xcxwgF1jHakSZsAKJh2Vh6okMBY2juXh3pN+WxY3nrUNOvP9ItfG87yg24ivo9Nz93Kaip EpL9OJvom1t8K0OBy8V9+R/n/Y3sHX1UmvYoDuClZC16B2bacHAIggdPhNrzEFScek8c3S rP7qL6KA9KndkJlptHqS4UD34NcISUkJjQsu17Y3zp33C2bVW1wjwMCNXPp0czpO1eYrMG RkBdLHgKUL2L/SgqNByw18bmE3ueSZy5YmK/46l1T2kCxM70nO/5kiVJpCy6aWKChD6SCW tWISylkdqSvM8Cq9jaJTC0UB8kuAr2MXDhinnyjYSm60viM4iWqGWFlngyoxEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN0wy4xLnzrSq; Thu, 23 Feb 2023 17:52: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 31NHqoFG075830; Thu, 23 Feb 2023 17:52:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NHqoJt075829; Thu, 23 Feb 2023 17:52:50 GMT (envelope-from git) Date: Thu, 23 Feb 2023 17:52:50 GMT Message-Id: <202302231752.31NHqoJt075829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 0ea305c63685 - releng/13.2 - nproc: denote an incompatiblity with Linux List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0ea305c636857d806c351b50a7368ab67c9bfb9f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0ea305c636857d806c351b50a7368ab67c9bfb9f commit 0ea305c636857d806c351b50a7368ab67c9bfb9f Author: Mateusz Guzik AuthorDate: 2023-02-15 20:17:27 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-23 17:51:28 +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. Approved by: re (cperciva) (cherry picked from commit 059320b8c8de73a90514879cd1e2da397584cfde) (cherry picked from commit 117d4cafdcb806407e38266de44aebe0b4e62b6f) --- 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 ae252fe0f50c..d4d97ccbb5be 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 @@ -39,6 +39,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 Thu Feb 23 18:10:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN1KC6JV9z3sKDL; Thu, 23 Feb 2023 18:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PN1KC5Y3sz3rty; Thu, 23 Feb 2023 18:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677175823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DNigWFib7efNBDTRGzMdZjzr/d9CVXZVtgGBiC9WRu4=; b=gDxiDsmGiA3mxgJHsIwdDUq9gD3rdBnmhCGwinq9hyWK4Aeg15fUuLv/RhM7hSDhyVdb1R udLagJd/azxz1Ef2eRaxT9ScSTTHmmZrLAmVuBffmPGnu8rtKYtIUMfN85iSkFaWsAcwPf zv5C8nso6IATlTO87R8nnkZKVow8o9l9Z0KUwabR9qogbIyFwJ4PsoQ8WvktM2p6OLMqSt SeHJeVJSoSkZ6yi6l2MDMJLg6tfGWu59IwW4g2x1PHzp+sb61EWs2NMndprk+/iI5N/gzT RKf1n8aAUI3+G89x+PmiIG7719sMGz0S9uyc/cLPbQTMKu2pGvtS/4YVYjzgsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677175823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DNigWFib7efNBDTRGzMdZjzr/d9CVXZVtgGBiC9WRu4=; b=SiHlbRNH3EjxOUkrI6N4Lov+XHLlJFNd9voXp+WfYH0nissdE4vn+pzZEztuxGHg3jTMUE NoO6vxOGOh73A9Xvpyjr3eyB/+nBICwnRaNYtvk06VIkzrgLXGN4HF+rQU/8HBT4LYZN36 alkqWjweML6srXeanoQmBAp8ZlNOIEi6uwGPf0qvov0RQAFX+OYwe9D7V6kPn6fa0gbEj4 k4/iVrJXQuWXMITeYJVg6yG7GSpiyT9GaMN+Rk4fIhNszILC5OV6Qk9pvfg9v/x5TNST9E kbEEDTIz6EsCGUkm1yn5UrfO4qOo/Fn8YwL6607sFG1OWLIuaLMjAmQnZj6r/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677175823; a=rsa-sha256; cv=none; b=kAw7Kw36x1tDYD27UVPdiftDbn/k1nDRKZrjAoMdctXSp02mkpoNYy60GaZj1fK6E8mGHT uaLlqQlSJ9auGtsrPaToz1MCUVr+KpzMISI0P0zCn4zAxWyvHKpLly03knGvX9nbDnaAgH 8fun1jbGsAO8KYyecO681TGDjL8Ci0y9Wkr4CHFtK7P+UyVzsRqQHkSrEG0Rq+YJqmR3BK eZSnq5xkab7AMrsCGLKrW0ek0laSIzCPDY1yMQLx9cv9XMkT5O9SJthoZi/4RWSJcc2G/z W1kasKwau7Ad2OWr2TKVN+7kIl77xtqj9u3IXasWd8+qLZDN2OrDBr+yqxj2Iw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN1KC4btBzs77; Thu, 23 Feb 2023 18:10: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 31NIANoG099957; Thu, 23 Feb 2023 18:10:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NIAN53099956; Thu, 23 Feb 2023 18:10:23 GMT (envelope-from git) Date: Thu, 23 Feb 2023 18:10:23 GMT Message-Id: <202302231810.31NIAN53099956@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: 7f0ebf0876c8 - main - Delete obsolete Solaris compat header file stdlib.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f0ebf0876c82a098bd5815ea6bf3a8efa6dd6f3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7f0ebf0876c82a098bd5815ea6bf3a8efa6dd6f3 commit 7f0ebf0876c82a098bd5815ea6bf3a8efa6dd6f3 Author: Zhenlei Huang AuthorDate: 2023-02-23 18:00:09 +0000 Commit: Zhenlei Huang CommitDate: 2023-02-23 18:00:09 +0000 Delete obsolete Solaris compat header file stdlib.h This drops function `getexecname()` redirection. Historically `getexecname()` is a compatibility definition. Since openzfs has its own implementation of function `getexecname()` in libspl and has been merged into base, the compat header file stdlib.h is no longer needed and should not be used. Also without this fix libspl will end up an incompatible version of `getprogname()` with libc. In particular, if zfs is enabled, programs such as pgrep in /rescue can be wrongly statically linked with libspl and will not function properly. PR: 269738 Reviewed by: markj Fixes: 9e5787d2284e Merge OpenZFS support in to HEAD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38733 --- cddl/compat/opensolaris/include/stdlib.h | 37 -------------------------------- 1 file changed, 37 deletions(-) diff --git a/cddl/compat/opensolaris/include/stdlib.h b/cddl/compat/opensolaris/include/stdlib.h deleted file mode 100644 index 9ba32322c03b..000000000000 --- a/cddl/compat/opensolaris/include/stdlib.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2007 John Birrell - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY 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 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$ - * - */ - -#include_next - -#ifndef _COMPAT_OPENSOLARIS_STDLIB_H_ -#define _COMPAT_OPENSOLARIS_STDLIB_H_ - -#define getexecname getprogname - -#endif From nobody Thu Feb 23 18:10:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN1Kt6LwLz3sKdN; Thu, 23 Feb 2023 18:10: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 4PN1Kt5wFpz3sFv; Thu, 23 Feb 2023 18:10:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677175858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rm27lNQO/g5OOGio4wnux33U8JWLioRe0lSLGQ7FUd4=; b=jOZHCrJu2TjsPWLJtknHkzDvy+uxY3/vX0fYXJyPNlHhG03xSOR2b7UcCdckGHlBBc3SON 8omSWjrg7x2KjA6B7SsNvEG09TQqHNIlZsJB0OkMZdzqdEKm4/KYvHqxAkf9VumQLiIdRD 3bPmWh2O9mBYldMT+RuxYsqhpXlMWp9P5/NwuQTkAly396OAG3XRQVWKBROLZq4Omq01eP /SORl1Vrq1cb3cCI7J29BK39MzIXvoZJBRce/UrpRg8jsYyz2qfU4S/Eq9jnk99r2UFOmP ILi6bqrjQUfIPEnyDmgcUDz8NB5xJ3IbnU2aaHSIEoOs+ZjyZaLmSRW0io40Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677175858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rm27lNQO/g5OOGio4wnux33U8JWLioRe0lSLGQ7FUd4=; b=MgzDRh1OUhr+KehtPRimbI3bS9j5ZQIwGHFBTwXyDFEpygpYZRdhmRjZmiV7THE1a0u5T4 NTiou652mOkxp3oEdyV0gWaizE3tMo7t4YmJzBTtIRfmLDVBloBiLZGCCo7bGyCDPDmng0 IPUL98ZdndKqW6kfWwZctlDW67eD3vqMeWU3B1ntua4/E6z9tx/vTYLnhdybUx8NMj5hcb RSvOl01DPRAvCK2or/Ot775GtVjeLRx8FXRCYXBVsy1WzSkMbJM67OG/ech8BsG2TNV59K nWFcqS1CQuSgmJ+TORnWItZH3CqcGYv1PbhN7DHtfbvKC81BySUL92kvupFJ3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677175858; a=rsa-sha256; cv=none; b=MXYBP1WcgmXkwPMnKMJDfTG+xIFJLzGy3cFgFl0H/TkzwxMEuwzch++LOXM3cy06CWXSzC CaFtcxWMGbvyMM30CHMaslzaCs5NsuIz0LzqmZFXyQj6YU7cmosbPYFpBNU20UGs1N8+eS jZK/245gvpUmHYENldqwxzU6PdJznMAwDQKOUPgg9ItzGSJVGC0dRi62yocjJ8lx3lwi4Z XPo6l8lUJscrE9f1WdKfFJZQeKeH5EeiX6QTRXZKcceZ2cruC4KtlqJltfyQQinGKGvY2Y f3S5eyJemi/4LUomDn5HXriWZMk7rmgUqAAIHeyllHKEUvfqcOQYBEM4suzFWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN1Kt4zkXzsRs; Thu, 23 Feb 2023 18:10: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 31NIAwsM005181; Thu, 23 Feb 2023 18:10:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NIAw5H005180; Thu, 23 Feb 2023 18:10:58 GMT (envelope-from git) Date: Thu, 23 Feb 2023 18:10:58 GMT Message-Id: <202302231810.31NIAw5H005180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: ac25a113775a - releng/13.2 - loader: always install help files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: ac25a113775ad527a0fc4040738bfc9e43c7db4e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ac25a113775ad527a0fc4040738bfc9e43c7db4e commit ac25a113775ad527a0fc4040738bfc9e43c7db4e Author: Mitchell Horne AuthorDate: 2021-02-11 14:29:00 +0000 Commit: Mitchell Horne CommitDate: 2023-02-23 18:10:19 +0000 loader: always install help files Address two issues with current help file logic: The existing condition prevents the common help file from being installed when there are no additional help files defined. This results in no loader.help on EFI platforms, for example. Second, due to the fact that we build and install multiple loader types, each successive install will clobber the previous loader.help. The result is that we could lose type-specific commands, or possibly list them in loaders that do not have such commands. Instead, give each loader type a uniquely named help file. The EFI loader will look for /boot/loader.help.efi, userboot will look for /boot/loader.help.userboot, etc. The interpreter variant has no effect on which help file is loaded. This leaves the old /boot/loader.help unused. Some credit for the final approach goes to Mathieu for their version of the fix in https://reviews.freebsd.org/D22951. Approved by: re (cperciva) PR: 267134 Reported by: Daniel O'Connor Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28591 (cherry picked from commit 8859960436f5727f163a7b3468e08710c5e6d874) (cherry picked from commit a2b4abce0e30e014b2c08c0bdc34b368aa9c7a6f) --- ObsoleteFiles.inc | 3 +++ stand/common/commands.c | 4 ++-- stand/efi/loader/Makefile | 1 + stand/i386/loader/Makefile | 1 + stand/kboot/Makefile | 2 ++ stand/loader.mk | 15 ++++++++++----- stand/powerpc/ofw/Makefile | 1 + stand/uboot/Makefile | 3 ++- stand/userboot/userboot/Makefile | 2 ++ 9 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index fd0c71b4814a..64214e29e93f 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -52,6 +52,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20230203: loader help files renamed +OLD_FILES+=boot/loader.help + # 20230201: timeout moved from /usr/bin to /bin OLD_FILES+=usr/tests/usr.bin/timeout/Kyuafile OLD_FILES+=usr/tests/usr.bin/timeout/timeout_test diff --git a/stand/common/commands.c b/stand/common/commands.c index d109a2a8dbcf..d195bf723b37 100644 --- a/stand/common/commands.c +++ b/stand/common/commands.c @@ -123,7 +123,6 @@ help_emitsummary(char *topic, char *subtopic, char *desc) return (pager_output("\n")); } - static int command_help(int argc, char *argv[]) { @@ -132,7 +131,8 @@ command_help(int argc, char *argv[]) char *topic, *subtopic, *t, *s, *d; /* page the help text from our load path */ - snprintf(buf, sizeof(buf), "%s/boot/loader.help", getenv("loaddev")); + snprintf(buf, sizeof(buf), "%s/boot/%s", getenv("loaddev"), + HELP_FILENAME); if ((hfd = open(buf, O_RDONLY)) < 0) { printf("Verbose help not available, " "use '?' to list commands\n"); diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index 2aaba4fbb377..4c94f67cf4e0 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -83,6 +83,7 @@ CFLAGS+= -DEFI_SECUREBOOT NEWVERSWHAT= "EFI loader" ${MACHINE} VERSION_FILE= ${.CURDIR}/../loader/version +HELP_FILENAME= loader.help.efi # Always add MI sources .include "${BOOTSRC}/loader.mk" diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index 3195cb00c6be..2d3fcba4383c 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -67,6 +67,7 @@ CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs .if exists(${.CURDIR}/help.i386) HELP_FILES= ${.CURDIR}/help.i386 .endif +HELP_FILENAME= loader.help.bios # Always add MI sources .include "${BOOTSRC}/loader.mk" diff --git a/stand/kboot/Makefile b/stand/kboot/Makefile index 35d71cb064fc..6a238aad93b0 100644 --- a/stand/kboot/Makefile +++ b/stand/kboot/Makefile @@ -42,6 +42,8 @@ CFLAGS+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs HAVE_ZFS=yes .endif +HELP_FILENAME= loader.help.kboot + .include "${BOOTSRC}/fdt.mk" # Note: Since we're producing a userland binary, we key off of MACHINE_ARCH diff --git a/stand/loader.mk b/stand/loader.mk index 262de84c3107..b3569c1080c9 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -168,12 +168,17 @@ vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE} CFLAGS+= -DELF_VERBOSE .endif -.if !empty(HELP_FILES) +# Each loader variant defines their own help filename. Optional or +# build-specific commands are included by augmenting HELP_FILES. +.if !defined(HELP_FILENAME) +.error Define HELP_FILENAME before including loader.mk +.endif + HELP_FILES+= ${LDRSRC}/help.common -CLEANFILES+= loader.help -FILES+= loader.help +CFLAGS+= -DHELP_FILENAME=\"${HELP_FILENAME}\" +CLEANFILES+= ${HELP_FILENAME} +FILES+= ${HELP_FILENAME} -loader.help: ${HELP_FILES} +${HELP_FILENAME}: ${HELP_FILES} cat ${HELP_FILES} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} -.endif diff --git a/stand/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile index 28eb8ee91fad..5912ceae93d5 100644 --- a/stand/powerpc/ofw/Makefile +++ b/stand/powerpc/ofw/Makefile @@ -37,6 +37,7 @@ SRCS+= trampolineLE.S .endif HELP_FILES= ${FDTSRC}/help.fdt +HELP_FILENAME= loader.help.ofw # Always add MI sources .include "${BOOTSRC}/loader.mk" diff --git a/stand/uboot/Makefile b/stand/uboot/Makefile index ed2253cdae6f..5b8275a0131b 100644 --- a/stand/uboot/Makefile +++ b/stand/uboot/Makefile @@ -35,7 +35,8 @@ WARNS?= 1 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt +HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt +HELP_FILENAME= loader.help.uboot # Always add MI sources .include "${BOOTSRC}/loader.mk" diff --git a/stand/userboot/userboot/Makefile b/stand/userboot/userboot/Makefile index c5e2e6fe7c7c..43011b9577c9 100644 --- a/stand/userboot/userboot/Makefile +++ b/stand/userboot/userboot/Makefile @@ -54,6 +54,8 @@ CFLAGS+= -DUSERBOOT_ZFS_SUPPORT HAVE_ZFS=yes .endif +HELP_FILENAME= loader.help.userboot + # Always add MI sources .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. From nobody Thu Feb 23 19:13:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN2kH104Tz3sdLQ; Thu, 23 Feb 2023 19:13: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 4PN2kH0TYDz434y; Thu, 23 Feb 2023 19:13:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677179623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tJL7qP3kZPlTc1qX9K9FrGCUDKyUYzZBy9KUn2fGin0=; b=iDyHHtv/sLoYjkpcz1k8s1K54g6YgqpMTKfbHwiwQUO0XbbzwBHMr5CQqRztGERht1EVX9 6TDZuvB3OtCMaJJMnCeqh5cZLriDQM2S1mCh5n6yrfUluBUleexIsV7gCKpLFBeDLbtlBz ngh9jLe9r5N9FmK9pSOM7xGxrZ7zTOliteFioWlwfgt/IuphDjLvj7UQeBt/kK9AVIxvYY ZWfDMLJ4CXUwFLBAhs7OJzgTq7mLVEh6DOvtHXkspKS7eaoIUKhhoWdKPPMS3vLvM2NNal Z194tpCcm5h2LZDaCiJcQpmXFTb1yWljeTZVrLJuBpH3lQ4N3p90Jp7+Nm3utQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677179623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tJL7qP3kZPlTc1qX9K9FrGCUDKyUYzZBy9KUn2fGin0=; b=MDUyA0jbPokpc5WBZPg7g7EIYgglpWcA+nqb6WrcRUhj+4JGuZ29zsqUKBog4Iy4QLLwdG lVe8SjgVwsbuCdbx5CrD5uCfDJwc4kssJaYcJtWbgt0+/jHtfMysOfpUKuYgpxJHM8wF5o ZO/ADQ4rfqEkdXDvvpgymmh+aDAc3ah5YrenWuk6mAb14o6a1RlqiM+OxJli4kA8OyvM0N wuDswWlD+aVx/sl+j2jVAEVdiTrhLKgxZ+UbkiyPReRnDcg7qhJkesSNXW6bpt3UZDa6HD eZw4CyUeFMAu5OVQ6AJQbHm3GOFkxctCbNFKSyJvf4Dh4zyp+cFpeBHyhqraYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677179623; a=rsa-sha256; cv=none; b=HHcFHG2KyCfsz1xAcWLvNKDKFgAPAe/NPl9x8rRZID7FHcnil0/nTN7jgtjq8tGRuYnz6J cK5SD5j1+dfPMhLBeWU/w97HLjNZ8cLbcFYEgf+f/zpq8WYTa2gewpxAh2S6Z0aVA8H9qi FQDpR1Y0I3hXilGpGIUhssmE58otVeVcwY+FJ355JOD/r3cWVplIRNzSeIHFWIvNGbNQxH JhxTZEO63vu69xnONRdenDrRSjxt5V8b9WLZahcdiwuwL3tvcfu7tmMUThk8HKByVAK4is bdRooPSZsjrMOnChqfNclbunuHPksMwmq7gwWh0Ra33lLln+U5iHj8KaFW8rkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN2kG6c68ztnM; Thu, 23 Feb 2023 19:13: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 31NJDgnc091105; Thu, 23 Feb 2023 19:13:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJDgTR091104; Thu, 23 Feb 2023 19:13:42 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:13:42 GMT Message-Id: <202302231913.31NJDgTR091104@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: 17a5a290032e - main - efibootmgr: add missing break for 'u' case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17a5a290032ef75ed4aa8a2aa68b3a7e08935c1c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=17a5a290032ef75ed4aa8a2aa68b3a7e08935c1c commit 17a5a290032ef75ed4aa8a2aa68b3a7e08935c1c Author: Ed Maste AuthorDate: 2023-02-23 14:52:14 +0000 Commit: Ed Maste CommitDate: 2023-02-23 19:13:18 +0000 efibootmgr: add missing break for 'u' case Reviewed by: imp, zlei Reported by: Coverity CID: 1505695 Fixes: 9a7915299484 ("efibootmgr: Add --efidev (-u) to dis...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38747 --- usr.sbin/efibootmgr/efibootmgr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index 58d83d28d6e5..8d521f86ed04 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -290,6 +290,7 @@ parse_args(int argc, char *argv[]) case 'u': opts.find_dev = true; opts.dev = strdup(optarg); + break; case 'v': opts.verbose = true; break; From nobody Thu Feb 23 19:34:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3B60rY9z3sfNJ; Thu, 23 Feb 2023 19:34: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 4PN3B60KWFz44Qj; Thu, 23 Feb 2023 19:34:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7+FbXyrvUC4TdvTecr0VHGsHiJqcHqHMuHdIY69J9/w=; b=vsB+J95rm+4ouQxb3FeuefGRlq6yXlaZxap13fOwpw7lJh6h3JR2ORvBrXFp+oyll1xr4p SFng8z6R5Csql0AS1c0DESrSE9JxYfCjikwh9WX7eQTaf6/RvOf6QOiSJE81RLf0ZtY9NU 1Dj1BLnP64a1Sa5ENPAre+XZgsJqDToQxq8z3OIMHUU8yf2JGxepMJG/aDIj9W4ljOISUl 0vXTpNli77gUOOljbsMqwx4zhDANW6+Z8UTEY/ntAuQTEG7XJ31wl+PVNWJJLbcPD7qT05 nbqaHPLd494dERgfCy+ONbNsNTp9vUN4a+/gQSp0lnjB+YSsgd3ousXjQv6B1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7+FbXyrvUC4TdvTecr0VHGsHiJqcHqHMuHdIY69J9/w=; b=XZW7hf7q64e7hXkp1fNl4embugajgsgAk5nvd/4bRUw3wA69LOJI3xDlls5L+haOGngXKC Hk/eN5Ch3ZC8vrHdcecyfvymWL+WaCqq4HOr4v9jqMzEy1nhKt3G9Cf5IbTBn0UnIZKCky LP6xqzUnSnX17RLE3RqGgwv4fg8eLq64r87rUVottRd4j1cPkhQIMHtiaWtExwtoEiBcYL ySWWqoGUE27JQGlL4x4GzkrwMpH/qMw0P478xuqGQzSV9chZOthGgjnkGrxOgz9FEGJbp7 j167eDELYLY7n6Byt8y8O0M52yv20Sa0EU501iJ+/aHr9IMI+eNdEur2fXLMrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180862; a=rsa-sha256; cv=none; b=PnhobFquax39V4irnmZ6BIvfMuiktvmx9ueEFZ3GiI/9cZsaTw6VU5npxV+nzYavZ0yDcn 7OvRtzzsaO0Q08YMLVd/qkt9GGdn6x1ZdLmqX6OnTrgurA0rP4Z3Ae3W9YU5EoN40/YqRe j0uv8s7NB45GAmcor8yMpVNQwKmtxxYk84nbL0R2imvmv0C4Iwsw3xki5UVeh4YjxK+8k+ RUx8l3khrD/bmMsxTF78rJXaWz6PoEG5LrZwYSfnmRrdcL2QCQlInCmEveyz2ywsW8DQWq 0k5+wtPH7MxFYJHy4RhhDPeKe1WumzHCcy0zw2xZbw1AaFngCrt7M2My6Bbkng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3B56Vw8zts5; Thu, 23 Feb 2023 19:34: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 31NJYLsC020090; Thu, 23 Feb 2023 19:34:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYLfU020089; Thu, 23 Feb 2023 19:34:21 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:21 GMT Message-Id: <202302231934.31NJYLfU020089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0da06968d3e8 - releng/13.2 - LinuxKPI: linux_pci.c: fix whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0da06968d3e84c45b6b39b1baedec9a940ed85a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0da06968d3e84c45b6b39b1baedec9a940ed85a6 commit 0da06968d3e84c45b6b39b1baedec9a940ed85a6 Author: Bjoern A. Zeeb AuthorDate: 2023-01-27 15:18:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:30:35 +0000 LinuxKPI: linux_pci.c: fix whitespace Properly indent a line. No functional change. Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) (cherry picked from commit 68b1d162505149b8629f7e22cecf298cea2ff1f9) (cherry picked from commit 069f504a8c4f9873ca32637cf0df1b0390b69b6a) --- sys/compat/linuxkpi/common/src/linux_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 54780adfda14..15c5030a33b9 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1184,7 +1184,7 @@ linuxkpi_dmam_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_ha struct lkpi_devres_dmam_coherent *dr; dr = lkpi_devres_alloc(lkpi_dmam_free_coherent, - sizeof(*dr), GFP_KERNEL | __GFP_ZERO); + sizeof(*dr), GFP_KERNEL | __GFP_ZERO); if (dr == NULL) return (NULL); From nobody Thu Feb 23 19:34:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3B71nNnz3sfFc; Thu, 23 Feb 2023 19:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PN3B71CYrz44m0; Thu, 23 Feb 2023 19:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h+F0v/cWLUX/itfAu3OJMqOVjr+8o46NTzOCuVG8418=; b=piow+Y3HAz7avPt7n11954VFdRqrFl0O9zQW+rpWugjfp++ZHikQ2h1sYqTTBOjXJgERwS N3Ma/yC28C1im2jUUY/r4NyP/5akYx96pUeGR7FHUsNLX6pamYp6oWfC5pdFVQTTJH/JKw 6gn/GcsMJaz0gFeFK9lzaXd2VY/mozNA2BPUYOAh/4i0bbF0SEI3onrLFDx7bYhKId5EPs P0zjpomZlloPfBf7mxy7xisGIEQx6k5eD2F8w4ZjjML6irtQZLhdmyA+Pjbe/esv45YTKW LIUxsXVchvMhf/Wqt3lofBjCbCLBv5baSxH22uRbCW2EgGYYu5324Coi08Ttwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h+F0v/cWLUX/itfAu3OJMqOVjr+8o46NTzOCuVG8418=; b=SkRhwIEhfp1+f9Ff/kJ7zKJtX9ZlwnXzYAQlAjVPNdTAJLtdp/rQHPvQ1ZNZulsb3RfIz0 NFCCeKScdMvjyiwq13gIBKtBg/VNL6zEFNQr1BLI0MjNJOpBtYPsrl89jyOBMqqoGKc4zk GrXk1cxDBEcT/EAMcU07LYMMVx/+Q4dZp5NKnv07NeASLoUcntcXvHs9nMzHdyfl+geXte 8VINY22dx9PoeMcw+6BcHnIueA81nc7ZCYB3kQyh7XV8sq0pr5yjMlWW4+e6PX+7ZB26Nm pd9IjW/zunRysGZlaKU8+6w2ejVcoqAi6Q82oK+wnMV8L7jjvhcUGov3SQm6lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180863; a=rsa-sha256; cv=none; b=Fw4CHxohaaE76Pm7+TBbugtmuwELf664DwUhSMkncSFLXT9+I/yDMCxu7cShBNWEm9JIu9 Ek1xB2B/1TQ7Fi+MzDP63ISQvv5sQTCDOvaA6kJVwIM3drAuVo2O/YBI2UxR9eFLMmL7a5 jtCyVwTuRs5G4IVbkMkLOkCkQYMiMdLu0Vn6gyxH3FOCU0JuA9eK5qRxHw8JPQaVi5wBrm TGYjAYKql0AYe0acHq+b/XF/iEPxAQgrR3b4BkCuyU7Pw1X+0H0sDkjq+UFhdrk/kcsv0w dxEoVoghT+TgBeh6rKwFBmNOsjr8JWNbgTDM2RDMJhv5csdi+/EmRB4dTMfn5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3B70J0RzvLY; Thu, 23 Feb 2023 19:34: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 31NJYMRq020117; Thu, 23 Feb 2023 19:34:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYMXv020116; Thu, 23 Feb 2023 19:34:22 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:22 GMT Message-Id: <202302231934.31NJYMXv020116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: da2538a136f4 - releng/13.2 - LinuxKPI: interrupt.h: add disable_irq_nosync(), irq_set_status_flags() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: da2538a136f4ca1f103ef7f9f7485a339e0ae833 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=da2538a136f4ca1f103ef7f9f7485a339e0ae833 commit da2538a136f4ca1f103ef7f9f7485a339e0ae833 Author: Bjoern A. Zeeb AuthorDate: 2023-01-28 16:11:59 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:31:29 +0000 LinuxKPI: interrupt.h: add disable_irq_nosync(), irq_set_status_flags() Add a dummy irq_set_status_flags() along with #defines passed by the driver. Add disable_irq_nosync() as another wrapper to lkpi_disable_irq(). Those are used by wireless drivers. Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38241 (cherry picked from commit bc81a2b788f5644ece58defa30880b69c9894981) (cherry picked from commit 75727a02155af29167a6d460de5ce6a9d52e26d8) --- .../linuxkpi/common/include/linux/interrupt.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h index 57d7ac58ec5e..cb2b1bef4667 100644 --- a/sys/compat/linuxkpi/common/include/linux/interrupt.h +++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h @@ -43,6 +43,9 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); #define IRQF_SHARED RF_SHAREABLE +#define IRQF_NOBALANCING 0 + +#define IRQ_DISABLE_UNLAZY 0 struct irq_ent; @@ -105,6 +108,12 @@ disable_irq(unsigned int irq) lkpi_disable_irq(irq); } +static inline void +disable_irq_nosync(unsigned int irq) +{ + lkpi_disable_irq(irq); +} + static inline int bind_irq_to_cpu(unsigned int irq, int cpu_id) { @@ -136,6 +145,18 @@ irq_set_affinity_hint(int vector, cpumask_t *mask) return (-error); } +static inline struct msi_desc * +irq_get_msi_desc(unsigned int irq) +{ + + return (lkpi_pci_msi_desc_alloc(irq)); +} + +static inline void +irq_set_status_flags(unsigned int irq __unused, unsigned long flags __unused) +{ +} + /* * LinuxKPI tasklet support */ From nobody Thu Feb 23 19:34:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3B82yH5z3sfFg; Thu, 23 Feb 2023 19:34: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 4PN3B82Dmjz44gv; Thu, 23 Feb 2023 19:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WvXkQ3pGBQyi0iz+mqsbHCMnCxhSXr0E8UenEW+Y6mc=; b=GPppRrG1AuWJJN9Em9+GJz6poNeT0KvVwcHymdoN7HqD7QSo8PU42iz7D8FQDa26sbogxP qDfc2OPEM6ob6zm1OTAQrPCkd/fbKWVVcRVSMFmz/xFpCpzD84vtPhy+cUAaEtUTG7R9Xr nfXhzNr2Jw8lZX8UUVAFQ9us6QO6h089rJs481gPW6ioV2OXjm7Gfjr9IzYZrPT/1TRmW9 YCRV1ZXyIQ0AxVidUJJKruG3owsZBZ/V5gTelhlzCclS7yX0LqW8L6xnImvAnaNiyBCkwu wSwf1rkQT4pqFuoTUDsjfZkNFmGIHM91bAq2rhq2caTnf5ChwWSHYmwJHom0KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WvXkQ3pGBQyi0iz+mqsbHCMnCxhSXr0E8UenEW+Y6mc=; b=TDc/Yz0Vmrk7KkO+812JXp8j7D3YWjwKk+mCPlLVzDjdBp6Hklq/k7/ShTBIwHNM+mDqnG S05RTQbh6zQHp7MvWwIrNlY1u2bX6Nq0OU0EdmNbhi73ySpmloGZr6znKYYRAcYrWFS6Ei 6CxCfXapDU4FUnyK1YK7mzeHiq2BnwNTysAZPIUdgDd9QMkAGhFK1won1j+58SB5yRA8WN DpqB6V06BdvoJ/7jTfY3mkeYrM5TG+RHA2Ar/53A7WeyY1zIZNArMLNX0A2oRglvyJm8V4 7fI/dtvOmWG+qRapamGrAZn15a88xAauJtbmrRhzBqndOV5+zYEyHFJ2lqgi2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180864; a=rsa-sha256; cv=none; b=uIxAXVk663CK3Ji6Md/iGzEHrgS0pTuekgCuZH6uIC8UGN29r58ipxThiNjo74dY//mtvC sLEcfqVCZduDJ/CjLTtESlXCcrAXLCivCPOOOVWp2afImANxL7KxZG2uSzm78dwFbwvhif aJVAUVbPIWey2IOor52XUH1ekNPxCmVaiDPIK7imud1TUXRaRf6YxQ6+dTCRlcY6GF1SA6 EZ7TnDzMsp6Itumqpd446xhw2Uge1eDV+v+VPaXo5uja7NQSkdQHYOhllL313v5en4EetD 7A5F3F7LAdBWNtBWgx+wn2oqeH3QRxLbh40gMxj8XOSllrrww6PqFON0IkLW1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3B81BhLzvTK; Thu, 23 Feb 2023 19:34: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 31NJYOHK020137; Thu, 23 Feb 2023 19:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYOUX020136; Thu, 23 Feb 2023 19:34:24 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:24 GMT Message-Id: <202302231934.31NJYOUX020136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 82f8db9d3fdd - releng/13.2 - LinuxKPI: mm.h: implement virt_to_head_page() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 82f8db9d3fddea4eb71e87febe51d808bd9bd219 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=82f8db9d3fddea4eb71e87febe51d808bd9bd219 commit 82f8db9d3fddea4eb71e87febe51d808bd9bd219 Author: Bjoern A. Zeeb AuthorDate: 2023-01-28 16:00:55 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:31:37 +0000 LinuxKPI: mm.h: implement virt_to_head_page() Implement virt_to_head_page(). Sponsored by: The FreeBSD Foundation Reviewed by: markj Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38240 (cherry picked from commit 70b97048a051958be37b650b8a67c89203fd6b70) (cherry picked from commit 1984e6e4f1583ad1a44b6913e8722121fabe8967) --- sys/compat/linuxkpi/common/include/linux/mm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 4afc1a953f8e..572bdd8e9ddc 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -149,6 +150,13 @@ struct sysinfo { uint32_t mem_unit; }; +static inline struct page * +virt_to_head_page(const void *p) +{ + + return (virt_to_page(p)); +} + /* * Compute log2 of the power of two rounded up count of pages * needed for size bytes. From nobody Thu Feb 23 19:34:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3B92yb5z3sfQ4; Thu, 23 Feb 2023 19:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PN3B92XKxz450N; Thu, 23 Feb 2023 19:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180865; h=from:from:reply-to:subject:subject: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/hwraFlyBtNSPnRRfTa9FsY2RkyRi9b0QKTyPtCNOE=; b=lwaPFFSatWCqlD5iygItQHqv3WxgGW24XriGVltjPZUzBfFf3sjrWpTUFaquA0y6z0eq12 Ul2BBmW5oRpJHW37U4q2dIZEKcvP9ukbCWps5s6l+LLelvgrr8HMU7lR96sg+Yqigl56w3 VG/xU7NF2UMA8vvfW4tA5a8bcLe+IjWC926GcjbFJ2FNqqqHUSvrsLVTdrMoT8s7JkIsD+ BdfBA92V0UX4xkdHrezGlvdS706lGTHG7zCExrf0ZVgEoL1O7De4dFuOlaRIhbCUPokuqa 44SQZtPOdBsdLxXeuIYCSFFrw6VVHBbFVoE2Zr57ClOqSC+RiA7EL+In7rkpWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180865; h=from:from:reply-to:subject:subject: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/hwraFlyBtNSPnRRfTa9FsY2RkyRi9b0QKTyPtCNOE=; b=xpb1pFgzONGLHqVJegf6QqK4SOH+inVM8AY46Qqog0nLF3xgTwDwTKpaBLy5EbKdXYs5dR yXLk3W3STyVmXLmKiI+A3X2WHHkhftCe4YTggUIbA768aWu8rq82fsINpDsf1wKXvuUFtf Xsjm9KNqFDfzw3S3jOudcf/RPaKgy6Un/G4z1PNaqSQs6gqkXqAlYRHYjpNLrpf0e7Jj4J J//fFEAiO9xBRwO/h7thigDv+ji3HC9xUVCPQDNMVub2M8wXmWYVAPspZa5GzepG39tb8S XxlH90raIXvL35fZ8x1+YBKkzkdjLxI3KycZ3oy4V+pFyd18PZ/GgbMiUuiURg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180865; a=rsa-sha256; cv=none; b=WocvcoJjGYMgX0lqC8090k7ydCnQEEwqrNYJVduYQKqg1OrsOBMJ4edi1+E/dTlXdCV1gl SB0Z7up1YXFVMW4JFJpqRJR8IrIr+g7V7toRVq3c32bI7wL/t07aFnxHhj5Af/RbknN8Tq SaWdLovTrkRUI/B73jBW0yfC1qn/5PYjHthVMXO8CYIH/wlOVPeVOCvfRjaOItfQ4K4zPZ RqeEfyF8r+iM1eGqEePbToiqj4RpHaIZxEV7ye6jsjfJ6VJ9Zndng1m+PXGWiRfEr04ycm /OptouRxr0gQampwHcYbvLJHLMTlPfW0HjK0pLlNUYcIoGpu0B6aPCMUtZ4OjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3B91fQLzvBY; Thu, 23 Feb 2023 19:34: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 31NJYP04020156; Thu, 23 Feb 2023 19:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYPnb020155; Thu, 23 Feb 2023 19:34:25 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:25 GMT Message-Id: <202302231934.31NJYPnb020155@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a6f89b2b5f7e - releng/13.2 - LinuxKPI: const argument to irq_set_affinity_hint() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: a6f89b2b5f7e94be6dd14139ff0633526eed9968 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a6f89b2b5f7e94be6dd14139ff0633526eed9968 commit a6f89b2b5f7e94be6dd14139ff0633526eed9968 Author: Bjoern A. Zeeb AuthorDate: 2023-01-28 16:15:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:31:45 +0000 LinuxKPI: const argument to irq_set_affinity_hint() irq_set_affinity_hint() takes a const mask argument and some drivers pass it in as such where earlier implementations were more lenient. Deal with it and __DECONST() the argument when passed to intr_setaffinity(). Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38242 (cherry picked from commit 4c72d075a57e9a3215639aede16df4df29e1c1da) (cherry picked from commit 4724e1867e81ab5de2c6b5a6819998b660f3e96d) --- sys/compat/linuxkpi/common/include/linux/interrupt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h index cb2b1bef4667..1e7a1042d237 100644 --- a/sys/compat/linuxkpi/common/include/linux/interrupt.h +++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h @@ -133,12 +133,12 @@ devm_free_irq(struct device *xdev, unsigned int irq, void *p) } static inline int -irq_set_affinity_hint(int vector, cpumask_t *mask) +irq_set_affinity_hint(int vector, const cpumask_t *mask) { int error; if (mask != NULL) - error = intr_setaffinity(vector, CPU_WHICH_IRQ, mask); + error = intr_setaffinity(vector, CPU_WHICH_IRQ, __DECONST(cpumask_t *, mask)); else error = intr_setaffinity(vector, CPU_WHICH_IRQ, cpuset_root); From nobody Thu Feb 23 19:34:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BB3ffGz3sf7h; Thu, 23 Feb 2023 19:34: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 4PN3BB3DCvz44sR; Thu, 23 Feb 2023 19:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w+KtWQkLlOXmCbpbnqZv1w6iPblSW9bhl+FNzTasNJE=; b=T6Q9wC1qRvC/TPsz7NQw+zVqhg0fcUIDSVjci/+ZKP4jK4vHLLU1bRCtZVf9xe+smB9XpT Y/PKLGuvgtBJMuJIDHyS55Ph1w269C3Rwv3bTxG7dK2KmwmdUs59JJW25aqHqTZSq74AgY IHnHTQg5QGH0k5KYzo+5c25liphNs4gvJF/n4q5Xl/GLcs11uJErLuJemilYDC7iR6KJzn /nJjJE9LTxgoYkS0ixxQ7fUR6fRwjEbPfrra2xGhCQlq5MSwO8H9WgpNFhsJVDk3qYc6FU +r/9WY1XFSpAisAX1RkITN0fwIYkeGGqspQOICBnVCWQxHrnUjhzVzCWqfy0CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w+KtWQkLlOXmCbpbnqZv1w6iPblSW9bhl+FNzTasNJE=; b=hUUiz+q+fR2JAp345eLy2WfqpBqwULzU+mKGXkQYzEM6Zv98QFMntvXEi7iJgvMtVA/W78 YXBjIeqBDKxr8ZnT7QHkl+RL+UXiGPpcku/v8ven+gLDC81LjQW31sMCjzjQcNg9t+R28l 82Sik/536V2e4rEXImGE2Vac4SaVWSTUOpo2vnxckAuxRFPc6Y053ohxjGKz/eY8SxdDYs 9SstL6eZPAWMFjsrItrXGY1narpa2y++VUwvbs1DXkugURRuZPWBTqouVsNw1B3OKH7xNU +R4/OsTRtyJZnhK8UbmN9jWwtHifpXHGGLTr+dOJZMRnHlzXg4tM4N+ExNocHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180866; a=rsa-sha256; cv=none; b=DH2yfMeU7MtZ/Kt1MIpOOv2ogiOX4M7MVZjWO3KuNjhIczL578P5Wip+loovMAHhXMRnFO RLmowdZzFeJ9HmoLQFXSPp2e8XOovMDnDkQkJAUmC7NCljjYTDF7ZSY3K8khDY9wFhRV5r b9P9sJACv9pCo43QQS6C92clUxOu7ZVsME5EaoJC7t3c+G4kXgQEgAiyMAPj/FY7axdalr 5hmAkf4qtKlDHlnC+PZAhbIYE/qvaEILvbTKv4Dtc4o3ayohq/4CN+6sleo6Y5J7rbQ4Og CvM20+YFOCoWLWKE8Drcfzal6zqwKUOkIsmZjS948ezEFbHr7DgO1RVuvT2UDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BB2Klyzts6; Thu, 23 Feb 2023 19:34: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 31NJYQXL020175; Thu, 23 Feb 2023 19:34:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYQ88020174; Thu, 23 Feb 2023 19:34:26 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:26 GMT Message-Id: <202302231934.31NJYQ88020174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c30972f3d0e4 - releng/13.2 - LinuxKPI: device: add device_set_wakeup_enable() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: c30972f3d0e4abd83f1eb8e3087dc7acd588a7d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c30972f3d0e4abd83f1eb8e3087dc7acd588a7d7 commit c30972f3d0e4abd83f1eb8e3087dc7acd588a7d7 Author: Bjoern A. Zeeb AuthorDate: 2023-01-28 15:18:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:31:52 +0000 LinuxKPI: device: add device_set_wakeup_enable() Add a dummy device_set_wakeup_enable() which is used for WoWLAN which we do not (yet) support and device_wakeup_enable() which is a wrapper to the former with the enable argument being true. Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38238 (cherry picked from commit ffdf10fb9cf13464801f2d78d3e1470201394812) (cherry picked from commit b45e9a172d3830bed00018325eaa73c04a0b3a13) --- sys/compat/linuxkpi/common/include/linux/device.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 70015fb7d81f..ced13faffcf0 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -536,6 +536,24 @@ device_reprobe(struct device *dev) return (-error); } +static inline void +device_set_wakeup_enable(struct device *dev __unused, bool enable __unused) +{ + + /* + * XXX-BZ TODO This is used by wireless drivers supporting WoWLAN which + * we currently do not support. + */ +} + +static inline int +device_wakeup_enable(struct device *dev) +{ + + device_set_wakeup_enable(dev, true); + return (0); +} + #define dev_pm_set_driver_flags(dev, flags) do { \ } while (0) From nobody Thu Feb 23 19:34:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BD0FJQz3sfNX; Thu, 23 Feb 2023 19:34: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 4PN3BC494Fz453c; Thu, 23 Feb 2023 19:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5kJZjyD0N2bhr+bIe1Rma/OirDmoZM/uxovddLvMQNI=; b=ccY9ZgZ55YlPa/lA+2J5AltJSmt/XX1alSN2vmT49P+r9YUzvDqzAyqT5Jplj32SeXYHuw MZHEG+0Smo1IqJjf00I2noCtReieRrWP+kTuyY7R0EAewnIncKyF298nj17XJmlKhLsGBJ 0GqjmtiFlt45vNI8wcE0LMa3FIi1l+TxhjL2Jd2AIwpUBAzog+Y5i5PkEmD1nmSOWfx22J 8JjE5cB7ctW83ya6LljQkMPU19vzyTjiID5ShaRKPCJSwQx3Vf0HAYIyUOMCEvmYlNOyL3 KVLXPx0RT7OFm1O6lbdZ54JH13DlpyquBkS+XY9mGJP4OOmgBX99US8iVqF0Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5kJZjyD0N2bhr+bIe1Rma/OirDmoZM/uxovddLvMQNI=; b=u9N0HnGCPRkOrsjtfgrrOXl/WiwWVTrJeLKWYHqH0BHQHlA6iLTxLmyFDg1Ircva+tqbRg SUvuQPKim9XJ1GnvpYwM+kwifM7BbwEL07y679ebJQiE8yojcUZH9RRGZtWY7VsQRrJ0yp 2nj5HZFhROza2utU11h0AeaXBqW0a7K9vTBgX4T+OT+ygwPFLFxZQR/A00wYjCn0SrG7Dm JAEEbLZSDHpRt6DNvZyIEcP8I6kSVmhHttpPQqr89+wJlpe4UbC+q6jVtaXPsonDvUNGgq IaB8VIBujE1ids5aZNjl8TF7TwiEWVyMXYhbvv03gxKXMupxio2iNFG/HaFsaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180867; a=rsa-sha256; cv=none; b=NQ+sKw3kxEXaG2+cdCxdkFvPhuZq/hVg8vZi44gnQc8JDgm4qH5/g4YT2/hmF3UuLjQI6/ 8O3gTWWi0fQoPMHYaouxjYlLaTwrWYfdnQQPXbeLTPHi9j5BMrKWCU2kfFtPVYXbMVk3ym g+8u4dv9nBB2sG9ru/zmrrD/BSRgHwFS7CWoZsL0KcoPje8LwqCyC6DP39qGF/xCykgTsL ykvv/5rB1kmSt4UDu9PEPqoFYdwa+IjFd0q54KSMxidelemYQ5eaDJsjrAEPBZnPOvqusF 9KT+8EScfa9I5p82IwPIshBkzo9dEsDhw7dvNPj7dcaz7Ib6d4X7jheOhIFOuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BC3GS0zv9J; Thu, 23 Feb 2023 19:34: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 31NJYRnE020208; Thu, 23 Feb 2023 19:34:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYRVd020207; Thu, 23 Feb 2023 19:34:27 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:27 GMT Message-Id: <202302231934.31NJYRVd020207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e89029eacaee - releng/13.2 - LinuxKPI: pm.h: add dummy pm_wakeup_event() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: e89029eacaee78b55706ca0a80ba80b1733d7bc5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e89029eacaee78b55706ca0a80ba80b1733d7bc5 commit e89029eacaee78b55706ca0a80ba80b1733d7bc5 Author: Bjoern A. Zeeb AuthorDate: 2023-01-28 15:53:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:31:59 +0000 LinuxKPI: pm.h: add dummy pm_wakeup_event() Add a dummy implementation of pm_wakeup_event() which is used to notify the power management system about a wakeup (which we currently do not implement yet). Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38239 (cherry picked from commit 934cb7a3316609380fdea8da73233759f6dfff43) (cherry picked from commit fbc5dea2a3af8edf1f22603605f78fe9f9b71494) --- sys/compat/linuxkpi/common/include/linux/pm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pm.h b/sys/compat/linuxkpi/common/include/linux/pm.h index eb3316088787..74f0d330f505 100644 --- a/sys/compat/linuxkpi/common/include/linux/pm.h +++ b/sys/compat/linuxkpi/common/include/linux/pm.h @@ -33,10 +33,15 @@ #ifndef _LINUXKPI_LINUX_PM_H #define _LINUXKPI_LINUX_PM_H +#include /* pr_debug */ +#include + /* Needed but breaks linux_usb.c */ /* #include */ /* #include */ +struct device; + typedef struct pm_message { int event; } pm_message_t; @@ -79,4 +84,11 @@ const struct dev_pm_ops _name = { \ } #endif +static inline void +pm_wakeup_event(struct device *dev __unused, unsigned int x __unused) +{ + + pr_debug("%s: TODO\n", __func__); +} + #endif /* _LINUXKPI_LINUX_PM_H */ From nobody Thu Feb 23 19:34:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BD6VNrz3sfBL; Thu, 23 Feb 2023 19:34: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 4PN3BD5Xjyz45Dh; Thu, 23 Feb 2023 19:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ol2L9YtThjQajO7wNQaU/1rfH8bjSUficp01U7nQzs=; b=WtcH6MLcu1WgKGSsb5kl8UKi/mOwBygRq8jPKunVCzfr6qX2uOymM80ofZNPsW0ImeGNi+ pwHQgDxcUOnziJHsXOI4Mw+BnlGgO1cuXTMYZfJz226HqfvVNrvNH9/QPBfh/QODRGavMz +VansJwCnlURvFHuXtv4g8o4w4MH7nZtfhMTBOuk9ARvKsti9s40gdF0My0dP3coPtZ0mN Xt+gAF6JfHQnkrDVbnLggtWa233Fxj85M0CDzrPQQKcmEcg/1Kj4PYEOMivBugfS3nNlEE lj6E1WQz36XEH2zJkFGWClmt9ziYuFFOWJvk9I+R+aLDS9bZIiwM0fP6VG5U2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ol2L9YtThjQajO7wNQaU/1rfH8bjSUficp01U7nQzs=; b=NiOveGLtk45tgWP4R2b43m6bU3MKIc/NCnsIiUfZGtZfkzcUU2sEPWqvJciYBKJPuUhdbJ h29mQj1mwkGId3ez2WGD03zO+yqLlWb7uXO4575QWYdcSwT6+vMDTp59CfQI1jTS90GWJH /k045NPhAsO1s9pp5AcZD/UG0t++CtedoPwssADtmJAE21Mr054LvD0i9MUm++yaB8lDXv 83mwmZPGNzEyKn4+y3Rj6NGPc6GQ0BVZdEVLCx4Uwc7kYS3JfvVcors55KX4jL30WNip5u m+lMFS8D1oWLWpRCkRIrU5Q8FytFu+3XiQi0gKHY1H1gJVpna3ylaIfqQNrgBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180868; a=rsa-sha256; cv=none; b=VZ7P1Kf4YIOtEZ1w78AilphedWZfLBAmcuMQelUE692I67Tty6D0Sm6CWe8fi4lumDp2lH PVqYyE9x2SI/E2PsZWMWui84/Yq0YTMe4nblNF0qfyM5Q3aJxXX5lXWcfGUv5yIhjbKe7H PN0nJjsOJfe3LcKrX/q/ejSOCCWOKFOO+Gpso2C19b4nVcfNRTDK87DenangMU5jVIaxgt RFCco3EclfiKxz0jA5Z6j2s5w61pqEWtxWeIyPA+9zlCMBGjARlHRM2Zj8AFv4RRdLc0A/ VSx38hYORNa/jrZTtnOtoI/D9duS9YmMT3gOGwe1Djp6uCbj3ztBcMuKbTpoJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BD4QMHzvTL; Thu, 23 Feb 2023 19:34: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 31NJYSXk020233; Thu, 23 Feb 2023 19:34:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYS6o020232; Thu, 23 Feb 2023 19:34:28 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:28 GMT Message-Id: <202302231934.31NJYS6o020232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b03bf921b5b6 - releng/13.2 - LinuxKPI: add more dummy header files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: b03bf921b5b67f2179c58cba49f42a67690ea401 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b03bf921b5b67f2179c58cba49f42a67690ea401 commit b03bf921b5b67f2179c58cba49f42a67690ea401 Author: Bjoern A. Zeeb AuthorDate: 2023-01-29 18:16:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:32:06 +0000 LinuxKPI: add more dummy header files Add more empty header files wireless drivers try to include but we do not (yet) need for any implementation. Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38271 (cherry picked from commit 52c28b99034bd32c86e6c058f68cfbf11c8f76c3) (cherry picked from commit 8a091335fc63c86b80704abf58055f53c0621740) --- sys/compat/linuxkpi/dummy/include/linux/const.h | 0 sys/compat/linuxkpi/dummy/include/linux/elf.h | 0 sys/compat/linuxkpi/dummy/include/linux/if.h | 0 sys/compat/linuxkpi/dummy/include/linux/mmc/card.h | 0 sys/compat/linuxkpi/dummy/include/linux/mmc/core.h | 0 sys/compat/linuxkpi/dummy/include/linux/mmc/host.h | 0 sys/compat/linuxkpi/dummy/include/linux/mmc/mmc.h | 0 sys/compat/linuxkpi/dummy/include/linux/mmc/sd.h | 0 sys/compat/linuxkpi/dummy/include/linux/mmc/sdio.h | 0 sys/compat/linuxkpi/dummy/include/linux/mmc/sdio_func.h | 0 sys/compat/linuxkpi/dummy/include/linux/mmc/sdio_ids.h | 0 sys/compat/linuxkpi/dummy/include/linux/msi.h | 0 sys/compat/linuxkpi/dummy/include/linux/nvmem-consumer.h | 0 sys/compat/linuxkpi/dummy/include/linux/of_address.h | 0 sys/compat/linuxkpi/dummy/include/linux/property.h | 0 sys/compat/linuxkpi/dummy/include/linux/remoteproc.h | 0 sys/compat/linuxkpi/dummy/include/linux/rtnetlink.h | 0 sys/compat/linuxkpi/dummy/include/net/rtnetlink.h | 0 sys/compat/linuxkpi/dummy/include/uapi/linux/if_arp.h | 0 19 files changed, 0 insertions(+), 0 deletions(-) diff --git a/sys/compat/linuxkpi/dummy/include/linux/const.h b/sys/compat/linuxkpi/dummy/include/linux/const.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/elf.h b/sys/compat/linuxkpi/dummy/include/linux/elf.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/if.h b/sys/compat/linuxkpi/dummy/include/linux/if.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/mmc/card.h b/sys/compat/linuxkpi/dummy/include/linux/mmc/card.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/mmc/core.h b/sys/compat/linuxkpi/dummy/include/linux/mmc/core.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/mmc/host.h b/sys/compat/linuxkpi/dummy/include/linux/mmc/host.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/mmc/mmc.h b/sys/compat/linuxkpi/dummy/include/linux/mmc/mmc.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/mmc/sd.h b/sys/compat/linuxkpi/dummy/include/linux/mmc/sd.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/mmc/sdio.h b/sys/compat/linuxkpi/dummy/include/linux/mmc/sdio.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/mmc/sdio_func.h b/sys/compat/linuxkpi/dummy/include/linux/mmc/sdio_func.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/mmc/sdio_ids.h b/sys/compat/linuxkpi/dummy/include/linux/mmc/sdio_ids.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/msi.h b/sys/compat/linuxkpi/dummy/include/linux/msi.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/nvmem-consumer.h b/sys/compat/linuxkpi/dummy/include/linux/nvmem-consumer.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/of_address.h b/sys/compat/linuxkpi/dummy/include/linux/of_address.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/property.h b/sys/compat/linuxkpi/dummy/include/linux/property.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/remoteproc.h b/sys/compat/linuxkpi/dummy/include/linux/remoteproc.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/rtnetlink.h b/sys/compat/linuxkpi/dummy/include/linux/rtnetlink.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/net/rtnetlink.h b/sys/compat/linuxkpi/dummy/include/net/rtnetlink.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/uapi/linux/if_arp.h b/sys/compat/linuxkpi/dummy/include/uapi/linux/if_arp.h new file mode 100644 index 000000000000..e69de29bb2d1 From nobody Thu Feb 23 19:34:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BG28qrz3sfFx; Thu, 23 Feb 2023 19:34: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 4PN3BF6CDkz45FK; Thu, 23 Feb 2023 19:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e2/lknigu4c7T9pJFURHKh2MfjbTMTPRt2a9Z1EqIMc=; b=rL2ewRWMW6VaCLqMvGTguLFyCIj9YN3dV9WELS7sCxXDwWbcljwAgD19TGT8tXgsAXfdeQ wpu81yW7bjuKsvkje+l2CG1ADbCXUZC+UuvkGSnmgxdxsUd2ZQAuEybm5GCfp2gGEYTrWD zwP6t5H35csNAc865Ioc/Hw4lnkIF8LGuYI2V3L6b/byfXYTsbigNX8Fma+X24uJXaD0L8 w+SELV1eIZgndn1fB//HZfy5kNf/C2ckKlXN+REtIKwxjpFsinnl9npZu1ebCGq4SgJyhr wuXumqBUrBXAorCUe721uMrp0u+WExFXZPhh/K5CLVRRo5+2pjDQNemaEAygog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e2/lknigu4c7T9pJFURHKh2MfjbTMTPRt2a9Z1EqIMc=; b=RESe8hMk89V5+yXamJn8Wh1phhY6urVpyKx6DofE/R3KRy/U7cbLkMO4SJ+Slri39aIYrA 1t5BzCK3DKPj972/azJBX8Y/ePy9zwUl2BMOY0Im1aMYHh7mtFvaf4f5j0ToDuLqB1SVuX FyNKQagH58OrQ7zv5tDBe83NgX29wjQJZalnox25YmZVWDkYyygbXVqqCdBTFuXqqwvo8N 0FKWu8LI/0nzvJ2NyabffBezFekOrlaanwcf1TMEZxVVTHc/XRn74OQYhpW7YH+4mWBCH3 +C32Z4H7KtwtfDAQ4sQe6ZR1ZXZdMV2DqZLNSE4TnSo8F5H+MYyRwPBmuor11w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180869; a=rsa-sha256; cv=none; b=yc352QhXYqH0AZaST9+v2yvS2WUA9UyXC8n1BRxrVll2D7nngFOEmxczEmA/bkDPDAv+Wb 9/4E7+9wmfDadJQni4vzXZcklW2yB8vGrjkqP4o+ZJmn+yYi/eDfLLPqgkZh73PHkQ0+SQ yUIT3RHD4UXWn5Vwsv08vwcaJqiedCPeCP/0y1mxaakbE5BXBQZ6qMNdWzl28xoQDmjAYs osYFyDZVxAPDzbXGqp5zEMox7e2CFRkqTagD9LwPJtg6Siqq5FS7CT7ZYhv+OUdFRnGKkz Vgxt7kyrVJdHpOIXvh8BU3njbp0tZO3Tun3QmXuzn9BlkxYAjgJgjLeDfbKLog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BF5Jt1zvWV; Thu, 23 Feb 2023 19:34: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 31NJYTUN020252; Thu, 23 Feb 2023 19:34:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYT4A020251; Thu, 23 Feb 2023 19:34:29 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:29 GMT Message-Id: <202302231934.31NJYT4A020251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 792038fdb234 - releng/13.2 - LinuxKPI: skbuff: implement skb_free_frag() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 792038fdb234f608ba6301aaae364d02bd3ad9be Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=792038fdb234f608ba6301aaae364d02bd3ad9be commit 792038fdb234f608ba6301aaae364d02bd3ad9be Author: Bjoern A. Zeeb AuthorDate: 2023-01-28 15:33:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:32:13 +0000 LinuxKPI: skbuff: implement skb_free_frag() Using the work from 55038a6306a570c9f2df89f5ad076de0f7d98152 implement skb_free_frag() calling page_frag_free(). Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) (cherry picked from commit dbbf46ebba78770c2c3a1d7983e92e79ca67abc0) (cherry picked from commit 8a6a4122e6dd91489e48de50a3080f82d00e8715) --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 35d5a1fd9b80..12a6be42e743 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -791,7 +791,7 @@ static inline void skb_free_frag(void *frag) { - SKB_TODO(); + page_frag_free(frag); } static inline struct sk_buff * From nobody Thu Feb 23 19:34:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BH2Hlvz3sfKV; Thu, 23 Feb 2023 19:34: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 4PN3BG6swtz459f; Thu, 23 Feb 2023 19:34:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q7zVS4hHCaDBn+QLhmNOIrlGn14goDR9V3sRmISIGiE=; b=LtFr/g9PZ6g4vCt58qzrg+ZHjmkrVUemeNO9xqR8BgfMXIoaXCri3C+vbY8im/btQJnXVN X9uJj7yzG0xxacu30FdX5JIEmFYyHX2wwVa+GWn78MEl2ZzE3cEyNY9Rqi/0uooBw5d5AO B1a0HsrRzUEcrPlBqsX+0Lz93qG6iSreJ8S7E5lPb+M7uQdMHNHlFTWxtddSsNcn30WJvZ Ljdz24MCmgWByQIC/hbrBUmEwY1jSsZmiyuxmTbvtoE5heozhNAFgULdZBM+WlMLKKSefU JJlGfkfLsxh6bBQzVbjV9mee4S8QqjDKAFUBJJqLEKmQsDn3oyDWCu2q3qjS3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q7zVS4hHCaDBn+QLhmNOIrlGn14goDR9V3sRmISIGiE=; b=MHn4dYuYJ0J/fhZ3g7rhCvJzkt/ihnaZ8jP6r2SWmcuahJp4WAlfbBD/mzp0C28uaR8Qc9 LTILJoxIuLUVagebUnI4CnLBZuwBBqwWCbKAv0zBlOP/upg1kMzlt66t0rh/B1kKtYvpFu 10fWlslhqx1WxWU+cdVTZNlQ2EcueJYC6Z96YPJ9DT5UEoQjnwL9+tmoVIw0vzZEhK0y3/ pRlHyRZ5QbG4ZyL9H/f6LtI90FNuGd81ElRUfq5S9It9g2dmyfaR8WfkUoa2pFrttUUc+P VweT5otmI9JFmGy0OoKftuUCvQmYCeOeFuyRwlM2KXAdyvF0BKHp+9JqaVyJfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180871; a=rsa-sha256; cv=none; b=aByx8E5L0H/1/LehGhHg2YdtJB4PFtJgb2EqNaJzqJlsQYWhr2WEhkrOxA/3hVicpWGf5s IX0Kkwm8R04wThv6uCpfkuFmmAs4PCKnmTKA+eSh0d8bzhgw9gFZZokILAvISBAtk3NP2L HKHhyLbC9x4kstHvwxyc+r4b9ocpEgwadGsHmtdQg38rmIREIr/nYBPoQqZYot5107V6ks I3GqTupNurr7zDpOykoQtYSLZF2rIU4zZTlie39TaJdLvZ60o+IoG/zDhDBBHUB7vmJYSn UBIB3nrAUKzQDodVYN37FOPXzQb1UJPGs+X+B2Bhivcj/oMrhgsuRpVefmV49w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BG5zdhzvNG; Thu, 23 Feb 2023 19:34: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 31NJYU4U020273; Thu, 23 Feb 2023 19:34:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYUtf020272; Thu, 23 Feb 2023 19:34:30 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:30 GMT Message-Id: <202302231934.31NJYUtf020272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3473f9920c89 - releng/13.2 - LinuxKPI: 802.11: fix types and whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 3473f9920c8988cf24490b34c5c4d8448cef7df4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3473f9920c8988cf24490b34c5c4d8448cef7df4 commit 3473f9920c8988cf24490b34c5c4d8448cef7df4 Author: Bjoern A. Zeeb AuthorDate: 2023-01-31 13:39:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:32:21 +0000 LinuxKPI: 802.11: fix types and whitespace Correct struct member types, fix whitespace, and remove superfluous return statements in void functions. No functional changes. Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) (cherry picked from commit a3baca22d0b7789a040a60f389e3c132b6e1755b) (cherry picked from commit d282e777d7c9721614f110a1de66c7d88d0a6ea8) --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 11 ++++++----- sys/compat/linuxkpi/common/include/net/mac80211.h | 6 ------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 55a74227a338..8b73dc1abe3f 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2021 The FreeBSD Foundation + * Copyright (c) 2020-2023 The FreeBSD Foundation * Copyright (c) 2021-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -265,9 +265,8 @@ struct cfg80211_roam_info { }; struct cfg80211_bss_ies { - /* XXX TODO, type is best guess. Fix if more info. */ uint8_t *data; - int len; + size_t len; }; struct cfg80211_bss { @@ -937,6 +936,7 @@ struct iface_combination_params { struct regulatory_request { /* XXX TODO */ uint8_t alpha2[2]; + enum environment_cap country_ie_env; int initiator, dfs_region; int user_reg_hint_type; }; @@ -1029,8 +1029,9 @@ struct wiphy { uint32_t rts_threshold; uint32_t frag_threshold; struct tid_config_support tid_config_support; + uint8_t available_antennas_rx; + uint8_t available_antennas_tx; - int available_antennas_rx, available_antennas_tx; int features, hw_version; int interface_modes, max_match_sets, max_remain_on_channel_duration, max_scan_ssids, max_sched_scan_ie_len, max_sched_scan_plan_interval, max_sched_scan_plan_iterations, max_sched_scan_plans, max_sched_scan_reqs, max_sched_scan_ssids; int num_iftype_ext_capab; @@ -1200,7 +1201,7 @@ cfg80211_get_bss(struct wiphy *wiphy, struct linuxkpi_ieee80211_channel *chan, { return (linuxkpi_cfg80211_get_bss(wiphy, chan, bssid, ssid, ssid_len, - bss_type, privacy)); + bss_type, privacy)); } static inline void diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index d548b9bb956f..caf9be89281e 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -2394,7 +2394,6 @@ static __inline void ieee80211_resume_disconnect(struct ieee80211_vif *vif) { TODO(); - return; } static __inline int @@ -2410,7 +2409,6 @@ ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *key, uint32_t iv32, uint16_t *p1k) { TODO(); - return; } static __inline struct ieee80211_key_conf * @@ -2426,14 +2424,12 @@ ieee80211_gtk_rekey_notify(struct ieee80211_vif *vif, const uint8_t *bssid, const uint8_t *replay_ctr, gfp_t gfp) { TODO(); - return; } static __inline void ieee80211_remove_key(struct ieee80211_key_conf *key) { TODO(); - return; } static __inline void @@ -2441,7 +2437,6 @@ ieee80211_set_key_rx_seq(struct ieee80211_key_conf *key, int tid, struct ieee80211_key_seq *seq) { TODO(); - return; } static __inline void @@ -2449,7 +2444,6 @@ ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif, struct cfg80211_wowlan_wakeup *wakeup, gfp_t gfp) { TODO(); - return; } static __inline void From nobody Thu Feb 23 19:34:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BJ20Ybz3sff6; Thu, 23 Feb 2023 19:34: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 4PN3BJ1F84z454q; Thu, 23 Feb 2023 19:34:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bz3jyovAiEUuxFLchuwiMoUJBToIR4ZMIaGqpdtoba4=; b=gYBdY/okhg3T/k1dQh6w+vxvPWBtXXVnRA88LHR5nXm+RQZ+Tys3X3TiMwhcLA1NiEdOo4 3zrMEJe/DD9g7mZAG2ims+Aj6nnYhgwX1U/bJPrLgSQOakCgEuI44Quar9sTZYQRq9HF6q Cq1oYBYFjmgZyQ+z5eNW/X1pmv2oT2I9ev/vIQwqmWhC5llqJmlu96yZHXqOkmBbMD1UPh yIs5YFOq7Q5adTQEdRKNmO+oluN3eAnsRda+Bi+83AxUITLQazE7oSbsH9VyjVEV5pOPeS JFIAXR1pua1Nl2YublNIulhYkCveNu87cC+1zpUTAaJE8QgE93pTm7rtrD8SbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bz3jyovAiEUuxFLchuwiMoUJBToIR4ZMIaGqpdtoba4=; b=g7NU4zAstsHiLRVhn8GQpQBItsuxUOPqpU5Rw020eXQ0SU+Fvts9Q38Q+QejV+qYCasG96 a1z9LDaZPhj2/HKjf8/OGOJ8nKGYJQYDdRg/4h6zAi9Esmbm5q+FzWR1UvE+yDsBtEwpMr mwHF+kbw1XJDPncQ9g5Ppq4oqxa6e4PdguFqK6TKdJQusfhplF45ay2HIH8ls06STaZRDB pmdeFYBaKKYiNWe7IswHOV5G+H+U+YEwdMyNURlocUv0djN3wpXkLmyzWRTkADRNCgoJV1 BwhtsrxZMvr6IcNDM0qXPoXMpHCLxNG5OsURGjVsmyqc9E7tkg5QnYnDzELaug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180872; a=rsa-sha256; cv=none; b=rhXnLeEmXmsstMJwaTy8Re3JM6BijYq/BnZpJsaoUDeKWvwIXzpHUUwbUfHETPnmdsMu7A nd0pws9m2GLDy/d37viJD/qX8v+VuQn0hTQbYTSpMMV+k9FV9zW0M2UekJ9sMaTKCJmoZP foJ0oLYudw88XQSq4sm46bwyFJYsi6bgS0XFAGX9vdrQkrcXLBSASegxU2fWrzpO6wUCRU 5BMFBkhf3BaugvOg6DvrR4ue4R+PspwCMEYI8JxgUq5rKRuK6SEDFZ1KIURWn/jM3Lw33X W9Hmjnm6CMvqQ+Cx+PwlVF6vf/Jm4OAFA5gF7UF+cSLbZfN7RPzFR0ShVVJNZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BH6w86zvNH; Thu, 23 Feb 2023 19:34: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 31NJYVhH020292; Thu, 23 Feb 2023 19:34:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYVGD020291; Thu, 23 Feb 2023 19:34:31 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:31 GMT Message-Id: <202302231934.31NJYVGD020291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 422d97dd1be3 - releng/13.2 - LinuxKPI: 802.11: extend linuxkpi_ieee80211_rx() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 422d97dd1be339e9c7cdd48cff0b625e5b8f4013 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=422d97dd1be339e9c7cdd48cff0b625e5b8f4013 commit 422d97dd1be339e9c7cdd48cff0b625e5b8f4013 Author: Bjoern A. Zeeb AuthorDate: 2023-01-31 15:05:30 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:32:28 +0000 LinuxKPI: 802.11: extend linuxkpi_ieee80211_rx() Extend linuxkpi_ieee80211_rx() by another argument for the ieee80211_rx_list() implementation (even though the argument is currently ignored). Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) (cherry picked from commit e30e05d3ab3979a148068235298e1a6f73b675f0) (cherry picked from commit e420c65378a04c5b9cde34013cab78188bc5a4c2) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 25 ++++++++++++----------- sys/compat/linuxkpi/common/src/linux_80211.c | 15 +++++++++++++- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index caf9be89281e..fee8b88d8feb 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1001,7 +1001,7 @@ void linuxkpi_ieee80211_iterate_stations_atomic(struct ieee80211_hw *, void linuxkpi_ieee80211_scan_completed(struct ieee80211_hw *, struct cfg80211_scan_info *); void linuxkpi_ieee80211_rx(struct ieee80211_hw *, struct sk_buff *, - struct ieee80211_sta *, struct napi_struct *); + struct ieee80211_sta *, struct napi_struct *, struct list_head *); uint8_t linuxkpi_ieee80211_get_tid(struct ieee80211_hdr *, bool); struct ieee80211_sta *linuxkpi_ieee80211_find_sta(struct ieee80211_vif *, const u8 *); @@ -1468,28 +1468,36 @@ ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct sk_buff *skb, struct napi_struct *napi) { - linuxkpi_ieee80211_rx(hw, skb, sta, napi); + linuxkpi_ieee80211_rx(hw, skb, sta, napi, NULL); +} + +static __inline void +ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta, + struct sk_buff *skb, struct list_head *list) +{ + + linuxkpi_ieee80211_rx(hw, skb, sta, NULL, list); } static __inline void ieee80211_rx_ni(struct ieee80211_hw *hw, struct sk_buff *skb) { - linuxkpi_ieee80211_rx(hw, skb, NULL, NULL); + linuxkpi_ieee80211_rx(hw, skb, NULL, NULL, NULL); } static __inline void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb) { - linuxkpi_ieee80211_rx(hw, skb, NULL, NULL); + linuxkpi_ieee80211_rx(hw, skb, NULL, NULL, NULL); } static __inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb) { - linuxkpi_ieee80211_rx(hw, skb, NULL, NULL); + linuxkpi_ieee80211_rx(hw, skb, NULL, NULL, NULL); } /* -------------------------------------------------------------------------- */ @@ -2347,13 +2355,6 @@ ieee80211_get_tx_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, TODO(); } -static __inline void -ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta, - struct sk_buff *skb, struct list_head *list) -{ - TODO(); -} - static __inline void ieee80211_tx_status_ext(struct ieee80211_hw *hw, struct ieee80211_tx_status *txstat) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index ee4b58e60f4d..e0457e0e5fa0 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3840,9 +3840,11 @@ linuxkpi_ieee80211_scan_completed(struct ieee80211_hw *hw, return; } +/* For %list see comment towards the end of the function. */ void linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, - struct ieee80211_sta *sta, struct napi_struct *napi __unused) + struct ieee80211_sta *sta, struct napi_struct *napi __unused, + struct list_head *list __unused) { struct epoch_tracker et; struct lkpi_hw *lhw; @@ -4050,6 +4052,17 @@ skip_device_ts: if (ieee80211_hw_check(hw, RX_INCLUDES_FCS)) m_adj(m, -IEEE80211_CRC_LEN); +#if 0 + if (list != NULL) { + /* + * Normally this would be queued up and delivered by + * netif_receive_skb_list(), napi_gro_receive(), or the like. + * See mt76::mac80211.c as only current possible consumer. + */ + IMPROVE("we simply pass the packet to net80211 to deal with."); + } +#endif + NET_EPOCH_ENTER(et); if (ni != NULL) { ok = ieee80211_input_mimo(ni, m); From nobody Thu Feb 23 19:34:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BK1qGwz3sfBT; Thu, 23 Feb 2023 19:34: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 4PN3BK17qJz45Lc; Thu, 23 Feb 2023 19:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5b+hLgDWdPoT2GzhojTVGVLZX6rI7n053yfjUtfK0LA=; b=i1gtEUAddSP35MUKv2mGd6uStjhJOQONlSDztDw74byLtXPRH2RXc7NqMLg6fWt1cbspsb 7FIvfpZCisc1qqdjhYJP8Uk0QMtWpENDbZhiRSbERi4QDulLiPLddolSLLT6PYHthyu5QS emu9zmsw2/spud0HUz5uTCIpyhsV2zC0xkXxDtfLXOt5uBL5u06CKNkpaS/diD53VKu2w2 LdbH+z5iFiTi+UZDWIc6s4GztWfdz3C4nOa5/QJSpHbq3fp+eFNIL/ZImzyvu1IZPPKdOg LgpBG37iZ3eRkeq9oJPF5YIIq+x6LGvAhLAmUk2trA2TL35tcwejsC9bOzdOgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5b+hLgDWdPoT2GzhojTVGVLZX6rI7n053yfjUtfK0LA=; b=NjJYzqsBuUpRF9ic0lsDouAYwJbCG7BCY2QiA1td7z1BQBky8JTtQVs7J6CBfBCE7JzLSH 1zDkR+5xX3C0kSaMrzdxOd1OZObW3J6c9yLUkbkbPBPROW8dYi9ooGG5hmAL0aEz4iT3b+ eWFN5QK+s/oLgQVEvWmVjzo5iiUAmdGdeFLNv0zN3EonkkC17Six3+SA2XRUP74GAPR+wY TC1kuoNMZKsUJQjh3pJ7T+1yC1kJRKLiseNWA2zVo5UQPRCnyV4q3FMVf+oBJRZTHVyRO+ YpOkOVvN24avXKmOxH5jRAWj+B29Wll/Bho25tKyA+3WgcyZn4hlurqUz8IQ8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180873; a=rsa-sha256; cv=none; b=ljlvma8zLjtVm1/bNuvaulUY1+l8YX2kqEegfZxZFSGbcE+c18ehotbRV0CdXIhNfua35q +MnQU/lj3d90vtwMi3h12zrW4n/YoCXBpwSQJVeHTyXqw+x3bYqXn+ImvQ864oJjL1H7sX OajHSbRGIQ2Lw1DndRIfMOcBO9EocP2bob3atxDGwRuFtAbWe3RpzeHiXqedQeDgW89i0T 640Mvva/8NfHOS47q6FpReF4wdvxG6NY+14wj871L+Z88ojySIQAXPrLshcLfLy4aZ/OEP 43JeivMXBYfC7oloGW/IobD1bHA1FR5xjzlWrQOfptYkqXjLxYAyPAfshYCtwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BK06GLzts7; Thu, 23 Feb 2023 19:34: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 31NJYWKe020311; Thu, 23 Feb 2023 19:34:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYW3r020310; Thu, 23 Feb 2023 19:34:32 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:32 GMT Message-Id: <202302231934.31NJYW3r020310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 47ff90e57ef3 - releng/13.2 - LinuxKPI: 802.11: implement ieee80211_tx_status_ext() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 47ff90e57ef3a2e9ad39133d558064ef490e42c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=47ff90e57ef3a2e9ad39133d558064ef490e42c0 commit 47ff90e57ef3a2e9ad39133d558064ef490e42c0 Author: Bjoern A. Zeeb AuthorDate: 2023-01-31 15:35:59 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:32:34 +0000 LinuxKPI: 802.11: implement ieee80211_tx_status_ext() Add an implementation of ieee80211_tx_status_ext() extending the internal linuxkpi_ieee80211_tx_status() implementation. Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) (cherry picked from commit a839757109891573123d8777b539fafa2d2198bb) (cherry picked from commit df109ed24233e367ef7060a25ab1b55e2afcddc8) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 31 +++++++++-------- sys/compat/linuxkpi/common/src/linux_80211.c | 41 +++++++++++++++++++---- 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index fee8b88d8feb..2b3f6b8e3ab1 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1028,6 +1028,8 @@ void linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *); struct sk_buff *linuxkpi_ieee80211_probereq_get(struct ieee80211_hw *, uint8_t *, uint8_t *, size_t, size_t); void linuxkpi_ieee80211_tx_status(struct ieee80211_hw *, struct sk_buff *); +void linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *, + struct ieee80211_tx_status *); /* -------------------------------------------------------------------------- */ @@ -1988,13 +1990,6 @@ ieee80211_sta_set_buffered(struct ieee80211_sta *sta, uint8_t tid, bool t) TODO(); } -static __inline void -ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) -{ - - linuxkpi_ieee80211_tx_status(hw, skb); -} - static __inline void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, uint8_t tid, struct ieee80211_key_seq *seq) @@ -2130,6 +2125,13 @@ ieee80211_wake_queue(struct ieee80211_hw *hw, uint16_t q) TODO(); } +static __inline void +ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) +{ + + linuxkpi_ieee80211_tx_status(hw, skb); +} + static __inline void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb) { @@ -2144,6 +2146,14 @@ ieee80211_tx_status_ni(struct ieee80211_hw *hw, struct sk_buff *skb) ieee80211_tx_status(hw, skb); } +static __inline void +ieee80211_tx_status_ext(struct ieee80211_hw *hw, + struct ieee80211_tx_status *txstat) +{ + + linuxkpi_ieee80211_tx_status_ext(hw, txstat); +} + static __inline void ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) { @@ -2355,13 +2365,6 @@ ieee80211_get_tx_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, TODO(); } -static __inline void -ieee80211_tx_status_ext(struct ieee80211_hw *hw, - struct ieee80211_tx_status *txstat) -{ - TODO(); -} - static __inline void ieee80211_color_change_finish(struct ieee80211_vif *vif) { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index e0457e0e5fa0..57dd174b62a1 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4280,8 +4280,8 @@ linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *txq, * passed back from the driver. rawx_mit() saves the ni on the m and the * m on the skb for us to be able to give feedback to net80211. */ -void -linuxkpi_ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb, +static void +_lkpi_ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb, int status) { struct ieee80211_node *ni; @@ -4296,20 +4296,28 @@ linuxkpi_ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb, ieee80211_tx_complete(ni, m, status); /* ni & mbuf were consumed. */ } +} +void +linuxkpi_ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb, + int status) +{ + + _lkpi_ieee80211_free_txskb(hw, skb, status); kfree_skb(skb); } void -linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) +linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw, + struct ieee80211_tx_status *txstat) { + struct sk_buff *skb; struct ieee80211_tx_info *info; struct ieee80211_ratectl_tx_status txs; struct ieee80211_node *ni; int status; - info = IEEE80211_SKB_CB(skb); - + skb = txstat->skb; if (skb->m != NULL) { struct mbuf *m; @@ -4320,6 +4328,7 @@ linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) ni = NULL; } + info = txstat->info; if (info->flags & IEEE80211_TX_STAT_ACK) { status = 0; /* No error. */ txs.status = IEEE80211_RATECTL_TX_SUCCESS; @@ -4342,7 +4351,7 @@ linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) txs.flags |= IEEE80211_RATECTL_STATUS_LONG_RETRY; } #if 0 /* Unused in net80211 currently. */ - /* XXX-BZ conver;t check .flags for MCS/VHT/.. */ + /* XXX-BZ convert check .flags for MCS/VHT/.. */ txs.final_rate = info->status.rates[0].idx; txs.flags |= IEEE80211_RATECTL_STATUS_FINAL_RATE; #endif @@ -4390,7 +4399,25 @@ linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) info->status.status_driver_data[1]); #endif - linuxkpi_ieee80211_free_txskb(hw, skb, status); + if (txstat->free_list) { + _lkpi_ieee80211_free_txskb(hw, skb, status); + list_add_tail(&skb->list, txstat->free_list); + } else { + linuxkpi_ieee80211_free_txskb(hw, skb, status); + } +} + +void +linuxkpi_ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) +{ + struct ieee80211_tx_status status; + + memset(&status, 0, sizeof(status)); + status.info = IEEE80211_SKB_CB(skb); + status.skb = skb; + /* sta, n_rates, rates, free_list? */ + + ieee80211_tx_status_ext(hw, &status); } /* From nobody Thu Feb 23 19:34:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BL5BvDz3sfQS; Thu, 23 Feb 2023 19: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 4PN3BL2d5dz45Zv; Thu, 23 Feb 2023 19: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=1677180874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mtrRnnLcEH/W08BuW/KZ2micN1gIDbPwQL7SRfArUis=; b=wIhEFmoqPyBpkpmzuCI+cSFaI49VzH3V/W1bHZy3zuBABaCZg3Vk2ovuKN4PL7PY922fds HuD8PwfIAg6SqH+stSPSFIMo2BUb0u3akj0jXyQ8f1Ai0cF866mfr73jIEi2kFM+xkIs/b a3qPUWH+scDUzY79f0NCSfHimJ7U9uhuwiFsZ/hXRdVENNgHIgFip0jg+bHE8n5MCVwihj ugwxLLcG7Sh3oErsJXanPocFogr5Zm59kA2tpN98iGfpGya49fFMwIiP0xTuA4xAwRQcje Bzsxi2e3Z9PqRWBu4xdjBY5sbE0lMNMQA8lFostNRHVhsMUPizpEPXZMZ5Wcow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mtrRnnLcEH/W08BuW/KZ2micN1gIDbPwQL7SRfArUis=; b=VTpfKTDpw9VMEaYKJY46Nw/d4I3Gr+8gd3IYsqoz/dWc1PSMhEVcrq/5WK8rxUDWODyUwP VDq5fnFMrnypGP2LBR28LNDbr+Wo+e/xq8o68H1mscgmkHUUtLxNiXaCdmUIEPhGvXDw19 66uLeed3QFtOhauXz1kVZjwf3A+1TFTk+4cqiI9Q3rwuYjmUdNu6DzUhGHExr5YaueW8NX rWmgd3yxkwIWpfD437Ey5yJKKUGqB+pmIGxSqvwCfAiCAjCQYSjd/8uscpOU++361RqR7y Pg9hbriHkRv2hUvPF03qxPucQ5gaDm4/bVAHnaro7g4YMe/nvwE6lglY2xrwiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180874; a=rsa-sha256; cv=none; b=mVTKzt/2wk1bAEdCE9E5KjtRpeQIo9OxVDmu6yHLj7cPBOHllVeAgLVi3SrajUhempK/xV +ag3BdNCsRrZrtTlRPf1sCypmMbObFL32usvjHKogpC+cio5RlfZl0Tu4joFZL2pjeLS/K DoyzYeK2Xke98hSqbrjXpR257uevuI1FUR0JdEQlrOvGx3VrXh1K63gwgqdnNNZCv7P5U4 QuvZAtJzV+yc6zlDBwhsbrbiaUG3tC/rSSUcSSV0HKL1tz87+OIyaDQqRNj2aHaZnvSEoj WerXBuH9Kh7zZDEp3qJn2Kr7rpR9qyZzJ0PSFmX8NPJ+3xckVO39ECghNfPT4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BL1MGXzvLZ; Thu, 23 Feb 2023 19: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 31NJYYqL020336; Thu, 23 Feb 2023 19: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 31NJYYV7020335; Thu, 23 Feb 2023 19:34:34 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:34 GMT Message-Id: <202302231934.31NJYYV7020335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 811e79336e96 - releng/13.2 - LinuxKPI: 802.11: implement ieee80211_is_pspoll() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 811e79336e963ada4db550e40def2d77b6753f8a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=811e79336e963ada4db550e40def2d77b6753f8a commit 811e79336e963ada4db550e40def2d77b6753f8a Author: Bjoern A. Zeeb AuthorDate: 2023-01-31 16:36:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:32:41 +0000 LinuxKPI: 802.11: implement ieee80211_is_pspoll() Implement ieee80211_is_pspoll() and move it up to the set of implemented ieee80211_is_*() functions. There are no further changes (git diff just looks weird). Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) (cherry picked from commit ff76cbc81d57ffc4bbc9bc20fd22325b2a8c2028) (cherry picked from commit 2336248a8ba9763ad38074db40f32e117edd86f5) (cherry picked from commit 16dc23caf17f8ffa21e365a1f2fe1a72d7fecbe8) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 2b3f6b8e3ab1..b7c6c2d37b90 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1342,29 +1342,33 @@ ieee80211_is_any_nullfunc(__le16 fc) return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); } -static __inline bool -ieee80211_vif_is_mesh(struct ieee80211_vif *vif) +static inline bool +ieee80211_is_pspoll(__le16 fc) { - TODO(); - return (false); + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_PS_POLL | IEEE80211_FC0_TYPE_CTL); + + return (fc == v); } static __inline bool -ieee80211_is_frag(struct ieee80211_hdr *hdr) +ieee80211_vif_is_mesh(struct ieee80211_vif *vif) { TODO(); return (false); } static __inline bool -ieee80211_is_first_frag(__le16 fc) +ieee80211_is_frag(struct ieee80211_hdr *hdr) { TODO(); return (false); } static __inline bool -ieee80211_is_pspoll(__le16 fc) +ieee80211_is_first_frag(__le16 fc) { TODO(); return (false); From nobody Thu Feb 23 19:34:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BM4PVMz3sf80; Thu, 23 Feb 2023 19:34: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 4PN3BM2xRpz45H9; Thu, 23 Feb 2023 19:34:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZjqncX0nr62SdF59DSIoz8P6oaiP6NReMcQrJV8h4tY=; b=ldTNAaWwBQiA8FITnY8sa4JSwxy8h8gqziZVB2zVyP+lvIRaU7Kvz7i0eAOlliVQbp3nzP jBKazLoND2Xn2U+EN5JmT5hKt9CHIscwZuqQKRvDcYvbt0gXvs0sNHywCQymRIe0ypu3To ZfG8ABmKcZHoJL1ruvYyOgfLXiPxUnUDvFYgWGUoW9Gf38xHsEWyXj6Nqasonud/Kha5Ty sU19PtvbW52mO1mUqcuSfBDuVOV5QOVP7h+/J/0MUIslT7wsKgCCr/xk4zv7BmhipIIHrm dV5aS1WYKByVz3Ps0FYjjur97x2AI7zpVtvv0zPjpEA+Z69Fly6ujh7ZFBLMHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZjqncX0nr62SdF59DSIoz8P6oaiP6NReMcQrJV8h4tY=; b=jugW8WJnzdmKHuS4OCBETT6XpzReBInHq0QgYquYBQ3yx8WaE75+MQMJa8jrBet4HJqOjy OokxmE2ZIDYvgvIfku0wrSFfZaYHl5/YPcCCSb5GvsCOOEr4ngDLAZngjU3KpDjaiGQNtz N1mtyUdUeBmiuIDZcpUopUtq8FL2FVgj1HQGj47QKaAC5jAkNiAk7LAywENL3GdM7mPTxt sRmHJAiLVkVrUX5jzAi2a84FE5b+lIDYeTQIU+LgJA+FAgwAA1o0FxJVywcZOiUIiOs81Z wmCwg5r2ikQJ/dnEF8cHR6F0ZBT4OQ2NlX+ERnMPDOpaOqPIcMgjbTpSCFkN9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180875; a=rsa-sha256; cv=none; b=epeoyp2iSSosUJ2GT7BHy7uBsUzG3tzvz2B640u+oPkcKvSnQdehD6ee39GEexaCWTD8Jv o2uUhMq/XX+WYD+rT+lfj4qmIx4hqbzb5RTcez3ZZBtKQ0nO4lqFLn/2Rb7iiBLrVCmmK/ 8S4fWzsPCyUx6gl6b3dgB7e6jJ0frT8hYezd5fdMYdNv/joGfYJPqk4wDdXlD+/lhyNmIq J5MkNcnyogeoD4IKQVh7HRFltxmlwsj4LsExUWuUc8WFH15RcXDPoycWNkVi5Xa5GT7HRe wKrXGIIj+wpZ5FJAIGrZarMGgGi0/0Wq+mU0J6a13JK1ILP1jG7UH0XeSsGzxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BM22gCzts8; Thu, 23 Feb 2023 19:34: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 31NJYZn3020360; Thu, 23 Feb 2023 19:34:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYZj9020359; Thu, 23 Feb 2023 19:34:35 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:35 GMT Message-Id: <202302231934.31NJYZj9020359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 377fdea48222 - releng/13.2 - LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 377fdea48222d2422d18c93d4d2dada1f553e2bb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=377fdea48222d2422d18c93d4d2dada1f553e2bb commit 377fdea48222d2422d18c93d4d2dada1f553e2bb Author: Bjoern A. Zeeb AuthorDate: 2023-01-31 23:00:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:32:48 +0000 LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT Add code (currently disabled by #ifdef) for HT and VHT to lkpi_scan_ies_add(). Switch to a local variable for ic given the new code also needs the value. Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) (cherry picked from commit 3dd980267f4e53df259eb6d322e7332a8bc5bb0a) (cherry picked from commit 28fbc0caa49b0fb119cc34a704d5437d63f479a3) --- sys/compat/linuxkpi/common/src/linux_80211.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 57dd174b62a1..b2969aeb5db2 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2478,11 +2478,13 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies, { struct ieee80211_supported_band *supband; struct linuxkpi_ieee80211_channel *channels; + struct ieee80211com *ic; const struct ieee80211_channel *chan; const struct ieee80211_rateset *rs; uint8_t *pb; int band, i; + ic = vap->iv_ic; for (band = 0; band < NUM_NL80211_BANDS; band++) { if ((band_mask & (1 << band)) == 0) continue; @@ -2503,7 +2505,7 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies, if (channels[i].flags & IEEE80211_CHAN_DISABLED) continue; - chan = ieee80211_find_channel(vap->iv_ic, + chan = ieee80211_find_channel(ic, channels[i].center_freq, 0); if (chan != NULL) break; @@ -2514,10 +2516,31 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies, continue; pb = p; - rs = ieee80211_get_suprates(vap->iv_ic, chan); /* calls chan2mode */ + rs = ieee80211_get_suprates(ic, chan); /* calls chan2mode */ p = ieee80211_add_rates(p, rs); p = ieee80211_add_xrates(p, rs); +#if defined(LKPI_80211_HT) + if ((vap->iv_flags_ht & IEEE80211_FHT_HT) != 0) { + struct ieee80211_channel *c; + + c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan, + vap->iv_flags_ht); + p = ieee80211_add_htcap_ch(p, vap, c); + } +#endif +#if defined(LKPI_80211_VHT) + if ((vap->iv_vht_flags & IEEE80211_FVHT_VHT) != 0) { + struct ieee80211_channel *c; + + c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan, + vap->iv_flags_ht); + c = ieee80211_vht_adjust_channel(ic, c, + vap->iv_vht_flags); + p = ieee80211_add_vhtcap_ch(p, vap, c); + } +#endif + scan_ies->ies[band] = pb; scan_ies->len[band] = p - pb; } From nobody Thu Feb 23 19:34:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BN4nRdz3sfJC; Thu, 23 Feb 2023 19:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PN3BN43s1z45mN; Thu, 23 Feb 2023 19:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=znotsN6JnaUuq5vxwbH9QGMwURRfQnl457Kdl0jUcrY=; b=dMnf78MpVxHpOKcRMLCtx0PVpEOz/LTmEegTP4Tws6RgSsr2AoDOZ42ONrS9W6sD1GIR2m NhzTKgwx0flZVYcxaPKVc3xqCy97rMc6/zYOTgSlSOCDojDqXsRansMieDEkXtZlSKKmlx ytU1GJE5GX9lWLNo7bvSPscfb6eyn3y3EnY2mib/RqGVNIy1X6tKU8Kl3PU6prW35m5Tvl CTaE41V6Ns7bOuEKaWcOcYjUNnWDrqkyrtI34ApQ0dDFZIG5cm2mjYcxfRN975Ctr/vB1G 3RTNlfYPRK6yXNoI8FalUs3KDMcqiFm6YmSrr02smqwhitHsQBlXMZq1+I3yJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=znotsN6JnaUuq5vxwbH9QGMwURRfQnl457Kdl0jUcrY=; b=Fey3kRPTkSp8L203VIIsMaM8RKB5ouBDrO9RCq/Ns3PHFwGoF6fTMtM1uP3g1Jfcrrl04M FsQzPLiPml0Diw0G4ZQzeRMLN1dSOj9KUzcrqSNYMpBF3uM2xYue3eofBGXedLsSGpGlpO lblx5IbIdHQaoxOkteplmVwm/MSInuW3NLKnnDJzIyQivaUCVz9gOgwjNq0NX7IKaa4yG/ eA/ee98OyVODv6yxD/oNazr3rtPIHvcrRWC8suTSRbN17plttWqy2+cq4rE7di9W+40AVt jaw7Tb0YPtxgAPHvdIYFuZ/577ai3p4ka5VVWURIrZqHWtyJsTZ8gsiANIZxlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180876; a=rsa-sha256; cv=none; b=Dllw0wgYFgD++zL/K3pzxYqfqxbU7Ofs/AfrQDpqjIqhFgItdDl42Gj10HkXQR7uZE0N60 BFrd+8eY0zIJxDuK+gPLMF4Vixxkr09i6/JCWz9xdOkEy8PiLm2EcgzjJH9Ro6DKxBF640 XIOGH91nUTzCSfjWEMLRn327KGy1VDykhqi5FgDyk0CDv4vYyHooIPYWy6ruuolPQU6ePr h/dt21t3/bd3hDjQ+cG7woJxSj8XvX/vs1b+vnb/qCec9HdYwIztET9QTf1t5VYvJasiMc dhgiQBCwjpSUcKChGFX/z9rJGzMMIWiOOLfY+i/i+R3PEAqqKoOpSG0g5wUsMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BN32nYzvNJ; Thu, 23 Feb 2023 19:34: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 31NJYa0s020379; Thu, 23 Feb 2023 19:34:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYaL0020378; Thu, 23 Feb 2023 19:34:36 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:36 GMT Message-Id: <202302231934.31NJYaL0020378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8e45120aceeb - releng/13.2 - LinuxKPI: 802.11: fix indent in lkpi_wake_tx_queues() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 8e45120aceeb5a1457b9406c9b1543e5a1d1d314 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8e45120aceeb5a1457b9406c9b1543e5a1d1d314 commit 8e45120aceeb5a1457b9406c9b1543e5a1d1d314 Author: Bjoern A. Zeeb AuthorDate: 2023-01-31 23:12:30 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:32:55 +0000 LinuxKPI: 802.11: fix indent in lkpi_wake_tx_queues() Fix indentation in lkpi_wake_tx_queues(). No functional changes. Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) (cherry picked from commit b0ddb44fd427d44b8153781ce9c461e393771aff) (cherry picked from commit 9e782bfab9042aed12c36746534b1e4e4ec6d597) --- sys/compat/linuxkpi/common/src/linux_80211.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b2969aeb5db2..bcd8ea9d4c6e 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -861,24 +861,24 @@ lkpi_wake_tx_queues(struct ieee80211_hw *hw, struct ieee80211_sta *sta, /* Wake up all queues to know they are allocated in the driver. */ for (tid = 0; tid < nitems(sta->txq); tid++) { - if (tid == IEEE80211_NUM_TIDS) { - IMPROVE("station specific?"); - if (!ieee80211_hw_check(hw, STA_MMPDU_TXQ)) - continue; - } else if (tid >= hw->queues) + if (tid == IEEE80211_NUM_TIDS) { + IMPROVE("station specific?"); + if (!ieee80211_hw_check(hw, STA_MMPDU_TXQ)) continue; + } else if (tid >= hw->queues) + continue; - if (sta->txq[tid] == NULL) - continue; + if (sta->txq[tid] == NULL) + continue; - ltxq = TXQ_TO_LTXQ(sta->txq[tid]); - if (dequeue_seen && !ltxq->seen_dequeue) - continue; + ltxq = TXQ_TO_LTXQ(sta->txq[tid]); + if (dequeue_seen && !ltxq->seen_dequeue) + continue; - if (no_emptyq && skb_queue_empty(<xq->skbq)) - continue; + if (no_emptyq && skb_queue_empty(<xq->skbq)) + continue; - lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); + lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); } } From nobody Thu Feb 23 19:34:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BP6wrJz3sfP5; Thu, 23 Feb 2023 19:34: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 4PN3BP4hkSz45c6; Thu, 23 Feb 2023 19:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lnhmBJUWfxoaNY1yvqzeEgRBp6mGqpWvbEkDJoccdZY=; b=MMLblRfLhVzlyhsJGUR2HnnttIzqj8dNeW4CUxHQFdwkz8ZHoL5W1awa1H9a0KifVlQiiV GtUPxXyMrD2ckx5EI66QpmzDot139r8JvWP0vmR0fplh7EeTM1qRyevws/Byuet98qxqYk zs0NEucDbYWmzVpRMq4uDaWBcL4lkeHGdVXwEd0GufdibxhaQ4S8KajGOBR1zn2h1bxM+e 1vABYbcao2j+iFKhJ+yAenSlxF8dfdMfJQnGSeo5mZ5UI5CL5AMZtjVtk0sL8IpR0wpvBT V1DTB33UFEs/VL5NmriNE+9hUgBzWrLqrXE+Y/i3gQbInrBkvxCj/YpfNyeUng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lnhmBJUWfxoaNY1yvqzeEgRBp6mGqpWvbEkDJoccdZY=; b=nazQ0udRGCD0zViezjH4X2CQhWXOaUO3e/ij49KoU2a+myOmgrAoLoFnkW1Ymc15OhiCfF GItZ/LeIeJVpqDNvBrMbn+VYkEh97YNxCP4K2rZuXOebz/9CcXMkO5gyQlBXjNevBYjl4L r2wOC52zFZtie9I2QhHyWSRf1HLLyFzvLYgJTm7wg9I2udN+1IZK3xqJkXqnvlyklX6oSX K68MZ4Q7T240SAGC6wbT/n6T8XqHAS+pC9GVVAGS61a2A5hs2UdEcuXFpAR7EUKi4M9ayC 0L5CeKk5cxvKjbYyF56JkzxqpI2oavPWpzvSku3pJ21SaikdHECFH3cGIoqwgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180877; a=rsa-sha256; cv=none; b=n3kpCZmcZnmx0L5IoY/HppfQPcvysmRKDe7Fvbo59Sq+bC8xkzLHKvgkjYX5Y7TZK3sRQc nJP/Ek/ltBxtvG5NEbpU7jYfltViDVJ6fu5D2gQNL07YKFiX6yZX6jSSdlhK9KuyHTcGed 2KXNoqOlYtJpA3GUgcg92l4g8PLWd1gQV4r2V3dxtB5QJIKf9tMVM7DpgpovSeoIGEl8na YpwsHgddEXY/ksMSzFBOW6QReZFayClfU1ncrIGL28msOtM6dvkuWu4VraXcONiRyQkb3c Bw68I777XYdrCoJKdCxlWyWwTtCtb6CZ8DA8HQ/L41Uqy0Uq4X4nQzbKOOu+sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BP3mCvzvBZ; Thu, 23 Feb 2023 19:34: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 31NJYbOS020398; Thu, 23 Feb 2023 19:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYbYG020397; Thu, 23 Feb 2023 19:34:37 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:37 GMT Message-Id: <202302231934.31NJYbYG020397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0b165b1fce84 - releng/13.2 - LinuxKPI: 802.11: basic implementation of *queue(s)/*txq* LinuxKPI: 802.11: deal with stopped queues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0b165b1fce848c6c636548d54064eec5a9d82c55 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0b165b1fce848c6c636548d54064eec5a9d82c55 commit 0b165b1fce848c6c636548d54064eec5a9d82c55 Author: Bjoern A. Zeeb AuthorDate: 2023-01-31 16:17:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:33:01 +0000 LinuxKPI: 802.11: basic implementation of *queue(s)/*txq* LinuxKPI: 802.11: deal with stopped queues Very basic implementations of ieee80211_{wake,stop}_queue[s], as well as ieee80211_txq_schedule_start(), ieee80211_next_txq(), and ieee80211_schedule_txq(). Various combinations of these are used by different wireless drivers, incl. iwlwifi. Following 5a9a0d7803382321b5f9fff1deae5fb08463cf1a initialize the queue values explicitly and deal with a stopped queue in ieee80211_tx_dequeue(). Sponsored by: The FreeBSD Foundation (parts of this work) Approved by: re (cperciva) (cherry picked from commit 5a9a0d7803382321b5f9fff1deae5fb08463cf1a) (cherry picked from commit 0cbcfa1964de89cd346ee6f79437c6ab83a3b716) (cherry picked from commit 9f9d047405778b2d2aca829a2037532b8ae8ed5d) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 124 +++++------ sys/compat/linuxkpi/common/src/linux_80211.c | 237 ++++++++++++++++++++++ sys/compat/linuxkpi/common/src/linux_80211.h | 14 ++ 3 files changed, 316 insertions(+), 59 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index b7c6c2d37b90..36e6600f237b 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1030,6 +1030,14 @@ struct sk_buff *linuxkpi_ieee80211_probereq_get(struct ieee80211_hw *, void linuxkpi_ieee80211_tx_status(struct ieee80211_hw *, struct sk_buff *); void linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *, struct ieee80211_tx_status *); +void linuxkpi_ieee80211_stop_queues(struct ieee80211_hw *); +void linuxkpi_ieee80211_wake_queues(struct ieee80211_hw *); +void linuxkpi_ieee80211_stop_queue(struct ieee80211_hw *, int); +void linuxkpi_ieee80211_wake_queue(struct ieee80211_hw *, int); +void linuxkpi_ieee80211_txq_schedule_start(struct ieee80211_hw *, uint8_t); +struct ieee80211_txq *linuxkpi_ieee80211_next_txq(struct ieee80211_hw *, uint8_t); +void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *, + struct ieee80211_txq *, bool); /* -------------------------------------------------------------------------- */ @@ -1508,6 +1516,63 @@ ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb) /* -------------------------------------------------------------------------- */ +static inline void +ieee80211_stop_queues(struct ieee80211_hw *hw) +{ + linuxkpi_ieee80211_stop_queues(hw); +} + +static inline void +ieee80211_wake_queues(struct ieee80211_hw *hw) +{ + linuxkpi_ieee80211_wake_queues(hw); +} + +static inline void +ieee80211_stop_queue(struct ieee80211_hw *hw, int qnum) +{ + linuxkpi_ieee80211_stop_queue(hw, qnum); +} + +static inline void +ieee80211_wake_queue(struct ieee80211_hw *hw, int qnum) +{ + linuxkpi_ieee80211_wake_queue(hw, qnum); +} + +static inline void +ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq) +{ + linuxkpi_ieee80211_schedule_txq(hw, txq, true); +} + +static inline void +ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq, + bool withoutpkts) +{ + linuxkpi_ieee80211_schedule_txq(hw, txq, true); +} + +static inline void +ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint8_t ac) +{ + linuxkpi_ieee80211_txq_schedule_start(hw, ac); +} + +static inline void +ieee80211_txq_schedule_end(struct ieee80211_hw *hw, uint8_t ac) +{ + /* DO_NADA; */ +} + +static inline struct ieee80211_txq * +ieee80211_next_txq(struct ieee80211_hw *hw, uint8_t ac) +{ + return (linuxkpi_ieee80211_next_txq(hw, ac)); +} + +/* -------------------------------------------------------------------------- */ + static __inline uint8_t ieee80211_get_tid(struct ieee80211_hdr *hdr) { @@ -1819,18 +1884,6 @@ ieee80211_tdls_oper_request(struct ieee80211_vif *vif, uint8_t *addr, TODO(); } -static __inline void -ieee80211_stop_queues(struct ieee80211_hw *hw) -{ - TODO(); -} - -static __inline void -ieee80211_wake_queues(struct ieee80211_hw *hw) -{ - TODO(); -} - static __inline void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool state) { @@ -2117,18 +2170,6 @@ ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *w) linuxkpi_ieee80211_queue_work(hw, w); } -static __inline void -ieee80211_stop_queue(struct ieee80211_hw *hw, uint16_t q) -{ - TODO(); -} - -static __inline void -ieee80211_wake_queue(struct ieee80211_hw *hw, uint16_t q) -{ - TODO(); -} - static __inline void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) { @@ -2259,41 +2300,6 @@ ieee80211_sta_register_airtime(struct ieee80211_sta *sta, TODO(); } - -static __inline void -ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint8_t ac) -{ - TODO(); -} - -static __inline void -ieee80211_txq_schedule_end(struct ieee80211_hw *hw, uint8_t ac) -{ - /* DO_NADA; */ -} - -static __inline struct ieee80211_txq * -ieee80211_next_txq(struct ieee80211_hw *hw, uint8_t ac) -{ - - TODO(); - return (NULL); -} - -static __inline void -ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq) -{ - TODO(); -} - -static __inline void -ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq, - bool withoutpkts) -{ - TODO(); -} - - static __inline void ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter) { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index bcd8ea9d4c6e..d0a3b4b8586a 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -76,6 +76,12 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_LKPI80211, "lkpi80211", "LinuxKPI 80211 compat"); +/* XXX-BZ really want this and others in queue.h */ +#define TAILQ_ELEM_INIT(elm, field) do { \ + (elm)->field.tqe_next = NULL; \ + (elm)->field.tqe_prev = NULL; \ +} while (0) + /* -------------------------------------------------------------------------- */ /* Keep public for as long as header files are using it too. */ @@ -238,9 +244,11 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], ltxq->txq.ac = tid_to_mac80211_ac[tid & 7]; } ltxq->seen_dequeue = false; + ltxq->stopped = false; ltxq->txq.vif = vif; ltxq->txq.tid = tid; ltxq->txq.sta = sta; + TAILQ_ELEM_INIT(ltxq, txq_entry); skb_queue_head_init(<xq->skbq); sta->txq[tid] = <xq->txq; } @@ -2270,6 +2278,9 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], vif->hw_queue[i] = i; else vif->hw_queue[i] = 0; + + /* Initialize the queue to running. Stopped? */ + lvif->hw_queue_stopped[i] = false; } vif->cab_queue = IEEE80211_INVAL_HW_QUEUE; @@ -4262,13 +4273,25 @@ linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) { struct lkpi_txq *ltxq; + struct lkpi_vif *lvif; struct sk_buff *skb; + skb = NULL; ltxq = TXQ_TO_LTXQ(txq); ltxq->seen_dequeue = true; + if (ltxq->stopped) + goto stopped; + + lvif = VIF_TO_LVIF(ltxq->txq.vif); + if (lvif->hw_queue_stopped[ltxq->txq.ac]) { + ltxq->stopped = true; + goto stopped; + } + skb = skb_dequeue(<xq->skbq); +stopped: return (skb); } @@ -4643,6 +4666,220 @@ linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *vif) /* -------------------------------------------------------------------------- */ +void +linuxkpi_ieee80211_stop_queue(struct ieee80211_hw *hw, int qnum) +{ + struct lkpi_hw *lhw; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + int ac_count, ac; + + KASSERT(qnum < hw->queues, ("%s: qnum %d >= hw->queues %d, hw %p\n", + __func__, qnum, hw->queues, hw)); + + lhw = wiphy_priv(hw->wiphy); + + /* See lkpi_ic_vap_create(). */ + if (hw->queues >= IEEE80211_NUM_ACS) + ac_count = IEEE80211_NUM_ACS; + else + ac_count = 1; + + LKPI_80211_LHW_LVIF_LOCK(lhw); + TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) { + + vif = LVIF_TO_VIF(lvif); + for (ac = 0; ac < ac_count; ac++) { + IMPROVE_TXQ("LOCKING"); + if (qnum == vif->hw_queue[ac]) { + /* + * For now log this to better understand + * how this is supposed to work. + */ + if (lvif->hw_queue_stopped[ac]) + ic_printf(lhw->ic, "%s:%d: lhw %p hw %p " + "lvif %p vif %p ac %d qnum %d already " + "stopped\n", __func__, __LINE__, + lhw, hw, lvif, vif, ac, qnum); + lvif->hw_queue_stopped[ac] = true; + } + } + } + LKPI_80211_LHW_LVIF_UNLOCK(lhw); +} + +void +linuxkpi_ieee80211_stop_queues(struct ieee80211_hw *hw) +{ + int i; + + IMPROVE_TXQ("Locking; do we need further info?"); + for (i = 0; i < hw->queues; i++) + linuxkpi_ieee80211_stop_queue(hw, i); +} + + +static void +lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) +{ + struct lkpi_hw *lhw; + struct lkpi_vif *lvif; + struct lkpi_sta *lsta; + int ac_count, ac, tid; + + /* See lkpi_ic_vap_create(). */ + if (hw->queues >= IEEE80211_NUM_ACS) + ac_count = IEEE80211_NUM_ACS; + else + ac_count = 1; + + lhw = wiphy_priv(hw->wiphy); + + IMPROVE_TXQ("Locking"); + LKPI_80211_LHW_LVIF_LOCK(lhw); + TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) { + struct ieee80211_vif *vif; + + vif = LVIF_TO_VIF(lvif); + for (ac = 0; ac < ac_count; ac++) { + + if (hwq == vif->hw_queue[ac]) { + + /* XXX-BZ what about software scan? */ + + /* + * For now log this to better understand + * how this is supposed to work. + */ + if (!lvif->hw_queue_stopped[ac]) + ic_printf(lhw->ic, "%s:%d: lhw %p hw %p " + "lvif %p vif %p ac %d hw_q not stopped\n", + __func__, __LINE__, + lhw, hw, lvif, vif, ac); + lvif->hw_queue_stopped[ac] = false; + + LKPI_80211_LVIF_LOCK(lvif); + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + struct ieee80211_sta *sta; + + sta = LSTA_TO_STA(lsta); + for (tid = 0; tid < nitems(sta->txq); tid++) { + struct lkpi_txq *ltxq; + + if (sta->txq[tid] == NULL) + continue; + + if (sta->txq[tid]->ac != ac) + continue; + + ltxq = TXQ_TO_LTXQ(sta->txq[tid]); + if (!ltxq->stopped) + continue; + + ltxq->stopped = false; + + /* XXX-BZ see when this explodes with all the locking. taskq? */ + lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); + } + } + LKPI_80211_LVIF_UNLOCK(lvif); + } + } + } + LKPI_80211_LHW_LVIF_UNLOCK(lhw); +} + +void +linuxkpi_ieee80211_wake_queues(struct ieee80211_hw *hw) +{ + int i; + + IMPROVE_TXQ("Is this all/enough here?"); + for (i = 0; i < hw->queues; i++) + lkpi_ieee80211_wake_queues(hw, i); +} + +void +linuxkpi_ieee80211_wake_queue(struct ieee80211_hw *hw, int qnum) +{ + + KASSERT(qnum < hw->queues, ("%s: qnum %d >= hw->queues %d, hw %p\n", + __func__, qnum, hw->queues, hw)); + + lkpi_ieee80211_wake_queues(hw, qnum); +} + +/* This is just hardware queues. */ +void +linuxkpi_ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint8_t ac) +{ + struct lkpi_hw *lhw; + + lhw = HW_TO_LHW(hw); + + IMPROVE_TXQ("Are there reasons why we wouldn't schedule?"); + IMPROVE_TXQ("LOCKING"); + if (++lhw->txq_generation[ac] == 0) + lhw->txq_generation[ac]++; +} + +struct ieee80211_txq * +linuxkpi_ieee80211_next_txq(struct ieee80211_hw *hw, uint8_t ac) +{ + struct lkpi_hw *lhw; + struct ieee80211_txq *txq; + struct lkpi_txq *ltxq; + + lhw = HW_TO_LHW(hw); + txq = NULL; + + IMPROVE_TXQ("LOCKING"); + + /* Check that we are scheduled. */ + if (lhw->txq_generation[ac] == 0) + goto out; + + ltxq = TAILQ_FIRST(&lhw->scheduled_txqs[ac]); + if (ltxq == NULL) + goto out; + if (ltxq->txq_generation == lhw->txq_generation[ac]) + goto out; + + ltxq->txq_generation = lhw->txq_generation[ac]; + TAILQ_REMOVE(&lhw->scheduled_txqs[ac], ltxq, txq_entry); + txq = <xq->txq; + TAILQ_ELEM_INIT(ltxq, txq_entry); + +out: + return (txq); +} + +void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *hw, + struct ieee80211_txq *txq, bool withoutpkts) +{ + struct lkpi_hw *lhw; + struct lkpi_txq *ltxq; + + ltxq = TXQ_TO_LTXQ(txq); + + IMPROVE_TXQ("LOCKING"); + + /* Only schedule if work to do or asked to anyway. */ + if (!withoutpkts && skb_queue_empty(<xq->skbq)) + goto out; + + /* Make sure we do not double-schedule. */ + if (ltxq->txq_entry.tqe_next != NULL) + goto out; + + lhw = HW_TO_LHW(hw); + TAILQ_INSERT_TAIL(&lhw->scheduled_txqs[txq->ac], ltxq, txq_entry); +out: + return; +} + +/* -------------------------------------------------------------------------- */ + struct lkpi_cfg80211_bss { u_int refcnt; struct cfg80211_bss bss; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index d9f2ce68f4f1..4d44ca07948e 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -50,6 +50,7 @@ #ifndef D80211_IMPROVE #define D80211_IMPROVE 0x2 #endif +#define D80211_IMPROVE_TXQ 0x4 #define D80211_TRACE 0x10 #define D80211_TRACEOK 0x20 #define D80211_TRACE_TX 0x100 @@ -62,6 +63,10 @@ #define D80211_TRACE_STA 0x10000 #define D80211_TRACE_MO 0x100000 +#define IMPROVE_TXQ(...) \ + if (linuxkpi_debug_80211 & D80211_IMPROVE_TXQ) \ + printf("%s:%d: XXX LKPI80211 IMPROVE_TXQ\n", __func__, __LINE__) + struct lkpi_radiotap_tx_hdr { struct ieee80211_radiotap_header wt_ihdr; uint8_t wt_flags; @@ -93,7 +98,11 @@ struct lkpi_radiotap_rx_hdr { (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE)) struct lkpi_txq { + TAILQ_ENTRY(lkpi_txq) txq_entry; + bool seen_dequeue; + bool stopped; + uint32_t txq_generation; struct sk_buff_head skbq; /* Must be last! */ @@ -139,6 +148,8 @@ struct lkpi_vif { TAILQ_HEAD(, lkpi_sta) lsta_head; bool added_to_drv; /* Driver knows; i.e. we called add_interface(). */ + bool hw_queue_stopped[IEEE80211_NUM_ACS]; + /* Must be last! */ struct ieee80211_vif vif __aligned(CACHE_LINE_SIZE); }; @@ -164,6 +175,9 @@ struct lkpi_hw { /* name it mac80211_sc? */ struct mtx mtx; + uint32_t txq_generation[IEEE80211_NUM_ACS]; + TAILQ_HEAD(, lkpi_txq) scheduled_txqs[IEEE80211_NUM_ACS]; + /* Scan functions we overload to handle depending on scan mode. */ void (*ic_scan_curchan)(struct ieee80211_scan_state *, unsigned long); From nobody Thu Feb 23 19:34:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BR1p37z3sfQh; Thu, 23 Feb 2023 19:34: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 4PN3BQ5s6kz45T5; Thu, 23 Feb 2023 19:34:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzzF/jyAlz25ZqeN29AHYQS818Pr4Va0UGyXP4Hz3oo=; b=CSpFylkUdi6IEOX1XqBmnNglFwG5p6rchwQ8ZIaQS4xd9CTy0y85rX5+GGMzgL9CmULI4v V+7cC9RbACnk3/+oEVFxKlxderyLX53kJpITdHGf8XykbEDOVVPnl1Rc1ECMlMvrWiBVrU qgFb4FLfIb/9uqFh3WQhDkqPyu8iMqPIoDBoxNgftViB/BlsxyPCHk9sclLjcaHF7o/aWy YHSsGyBhlNPZ39XaykrF5oruC5G67AMexwGSUJQuTO0XU1ewqSDxzxOrOdd4RKkeZvxPJq VOtQrBtufVA+JSSiEubpIMlFBn9DaG2hgtDlbyzmfyhR0bxBzG6Z+1NNE2CSbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YzzF/jyAlz25ZqeN29AHYQS818Pr4Va0UGyXP4Hz3oo=; b=j2Rit4SvnHIvwVyWXX8Poi5RH73VjIodMHc+G4M/xLrDO0eRJkby+mf7eJjRdo9N1aZONN BSpy1BFlH7o8ol0f5o2qe3R9LS7lQJ8Ol73ZHpn/gwKgiIPOswoEhzcG6XkWJXOSGe/wP7 xLb3YOLW6QGs+gwy7ewG6zfv4RyZGzXZNcLAN17avRT9QVTB2UWq/jahCBYUiUgEgZNrd1 y5E93ArIGxmBhTlycleNU9e/e40qOSQizMmDzPcrivkAmO1zApZUTEQ97Az8g1ohYz+NqV 9u258LGRQFzXcaJDXzxa0nCHdEbIFvJQHiYPTU9g1bWVOwZnHnGLiHDY37LY7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180878; a=rsa-sha256; cv=none; b=KZwzSzoy/7NvaKg2EjjDYfaepno5aDcRppwqfLR95+kAjdO9gF6rH0xk0afuN5uZfZcyVC sSnImYt1SwK4miRtnoQIylAa/3fTdIvpMaO7EcFKiMhmpfGaW37SWA10PfQY0TngZK1nlI d5sPN/8FMxSNtUcRxVysF7yk10bFnTs6A3t5LSxSeOthDZ1fzDSflrIAAAq7ZZr2eRNCgP BlkFZUiJkrpDMj//xuydkc3VFY10LtoX5daV1YmDpaksyLpS+qF3Gu1kVEN6eoksH3TD63 THvxaInAZ2zGWe2oy7Lfib/yALubEeco3qNeQ3oT6DUttHfh6PmuqTzwyGsXyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BQ4xykzvTM; Thu, 23 Feb 2023 19:34: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 31NJYckk020417; Thu, 23 Feb 2023 19:34:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYcJ3020416; Thu, 23 Feb 2023 19:34:38 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:38 GMT Message-Id: <202302231934.31NJYcJ3020416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4876c939ce63 - releng/13.2 - LinuxKPI: implement irq_get_msi_desc() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 4876c939ce63c86fe918e469881cc92ec40cfbee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4876c939ce63c86fe918e469881cc92ec40cfbee commit 4876c939ce63c86fe918e469881cc92ec40cfbee Author: Bjoern A. Zeeb AuthorDate: 2022-11-28 18:27:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:33:09 +0000 LinuxKPI: implement irq_get_msi_desc() Add irq_get_msi_desc() as a wrapper around a PCI function which will allocate a single cached value (see comment on struct) for the msi_desc requested if it doesn't exist yet and handle freeing it when the PCI device goes away. We take the values from the ivars of the native (FreeBSD) device. While changing struct pci_dev also add the msi_cap field requested by a wireless driver. Reviewed by: hselasky (earlier version) Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D37523 (cherry picked from commit 4b56afaf7bf4fa37bae5b26fd93ee1ff5969c1bb) (cherry picked from commit 7d23664b35a2611dc4fea56f7cfd2b99f91626a0) --- sys/compat/linuxkpi/common/include/linux/pci.h | 14 ++++++++++++ sys/compat/linuxkpi/common/src/linux_pci.c | 31 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 8d41e33b0da8..1475a159e0b5 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -303,6 +303,17 @@ _pci_exit(void) \ module_init(_pci_init); \ module_exit(_pci_exit) +struct msi_msg { + uint32_t data; +}; + +struct msi_desc { + struct msi_msg msg; + struct { + bool is_64; + } msi_attrib; +}; + /* * If we find drivers accessing this from multiple KPIs we may have to * refcount objects of this structure. @@ -338,6 +349,8 @@ struct pci_dev { bool managed; /* devres "pcim_*(). */ bool want_iomap_res; bool msix_enabled; + uint8_t msi_cap; + struct msi_desc *msi_desc; }; /* XXX add kassert here on the mmio offset */ @@ -366,6 +379,7 @@ struct resource *_lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size); struct pcim_iomap_devres *lkpi_pcim_iomap_devres_find(struct pci_dev *pdev); void lkpi_pcim_iomap_table_release(struct device *, void *); struct pci_dev *lkpi_pci_get_device(uint16_t, uint16_t, struct pci_dev *); +struct msi_desc *lkpi_pci_msi_desc_alloc(int); static inline bool dev_is_pci(struct device *dev) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 15c5030a33b9..e31ff18b675d 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -341,6 +341,8 @@ lkpinew_pci_dev_release(struct device *dev) if (pdev->bus->self != pdev) pci_dev_put(pdev->bus->self); free(pdev->bus, M_DEVBUF); + if (pdev->msi_desc != NULL) + free(pdev->msi_desc, M_DEVBUF); free(pdev, M_DEVBUF); } @@ -962,6 +964,35 @@ out: return (-EINVAL); } +struct msi_desc * +lkpi_pci_msi_desc_alloc(int irq) +{ + struct device *dev; + struct pci_dev *pdev; + struct msi_desc *desc; + struct pci_devinfo *dinfo; + struct pcicfg_msi *msi; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return (NULL); + + pdev = to_pci_dev(dev); + if (pdev->msi_desc != NULL) + return (pdev->msi_desc); + + dinfo = device_get_ivars(dev->bsddev); + msi = &dinfo->cfg.msi; + + desc = malloc(sizeof(*desc), M_DEVBUF, M_WAITOK | M_ZERO); + + desc->msi_attrib.is_64 = + (msi->msi_ctrl & PCIM_MSICTRL_64BIT) ? true : false; + desc->msg.data = msi->msi_data; + + return (desc); +} + CTASSERT(sizeof(dma_addr_t) <= sizeof(uint64_t)); struct linux_dma_obj { From nobody Thu Feb 23 19:34:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BS0bskz3sfcf; Thu, 23 Feb 2023 19:34: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 4PN3BR6vPQz45w7; Thu, 23 Feb 2023 19:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s+EJAgKtQrvVcK78Sk2Q/GwH9xdGl/muwUq5h4hHPII=; b=rHsY1fpW1umPLoVg0LhosjnwZkG8EJIdiXqSrUlo5mVv8MvZHZY7S5B4PARcT/9Bdjj7Y/ Mz5w74BWT6T+i5+Geo/8ADgfHL/fIiBonScpNxeT7eyjHI1pIQPD9Oxp6u4qnJSwosw2bQ F1gLvOonG5kSWKL8iiIEWR1bA2/b7pFTjOfdsQlxTzVr4FK1lxWXhh3xT/iBSqV3OcBJdH F/gQ4XdYlkzpxqy14bTbX9slK1TA+U4aXmJmJXveJ/Y6DjjrA/pScqtu0pFAWK8AkmEap0 fpCliwwxBtwWtVKfPhR/MRy5Rx/Oy6Z8sEP6fIBYbW1Ng7I9eVWCGUlS814ljg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s+EJAgKtQrvVcK78Sk2Q/GwH9xdGl/muwUq5h4hHPII=; b=pt4BemVCGnf+PtWWxCzJKfEtbnm010wO+HWHPn6t/jgFR4Z8lg+JyfqB1XMqJaWJEhOnDp uxO2FqXfMAUsyK2MYIikx6SHtPW/zbZBOCX4IZdtTsJCnmPUaIawpOWPwKa4RMfRxIzXwc C0kijAMrwx99DdMqv0OJrCfmRZXyqC3/pDlAmErDAzPePI5FN133FWbEF88BevQu1HKzvI aBR2cRm0jO7KXMziyl+iJ9M2u2MWSL9TFteOJ1Z1BLjiy3bvK7q2nuxaymId58DNrXGNHr UeKw4PB4qWOT2eMJQekiAcPC6fPAN/pwndPb6fUxx0HIWygmXMF0ANFOPejBfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180880; a=rsa-sha256; cv=none; b=mFTN2Wk6Z7up5tAc1xXVO82Be+qx13v37pVKbaxBCRgODtNZDINf3kt3NAjazSVkjtMAQ3 1HCWGPj3HuE1+nL8bN6YtNsAYyaJDWHZm3x6O/dmOKJd4lKb3cd3TX2RgmZtxLnjoF4vw/ Hsrqb7K16zjwVAyhoBEYqS1GOzSRoXQ4ZbdKV/G5ZB1pSK02jiiEjbvv/prznjs/ywRujc +Zes67tQu3AJQDsY4jjw6oLNBie++d/hil+pVNm+r3uV9vx1ucA0s/RX7AwIwqBDYOsRfD ahlSGi6Nlif15XFALx0Up9ScUWOpPK5PkugrRXfrDS6oyG2Od7dWMs4qrwkcmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BR605nzvTN; Thu, 23 Feb 2023 19:34: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 31NJYdJi020441; Thu, 23 Feb 2023 19:34:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYd7S020440; Thu, 23 Feb 2023 19:34:39 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:39 GMT Message-Id: <202302231934.31NJYd7S020440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0de7dba20435 - releng/13.2 - LinuxKPI: PCI: implement support for more than 1 MSI vector List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0de7dba20435c0361067b451886b8185d53b0951 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0de7dba20435c0361067b451886b8185d53b0951 commit 0de7dba20435c0361067b451886b8185d53b0951 Author: Bjoern A. Zeeb AuthorDate: 2023-01-27 15:34:42 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:33:16 +0000 LinuxKPI: PCI: implement support for more than 1 MSI vector Following e9715b1c4474333ff119aba3a9a74bff91f72372 and 4b56afaf7bf4fa37bae5b26fd93ee1ff5969c1bb, implement support for up-to 32 MSI vectors. This is used by wireless drivers. This also switches msi_desc to an array in order to store per-vector information. Sponsored by: The FreeBSD Foundation Discussed with: grehan (in Dec) Reviewed by: jhb Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38222 (cherry picked from commit b15491b4773af99ce2470144ef6bcd9146cc9a98) (cherry picked from commit 03a85378b81fcaffae5f8efdd75e2b8e10094e6a) --- sys/compat/linuxkpi/common/include/linux/pci.h | 36 +++++++++++++++++++------- sys/compat/linuxkpi/common/src/linux_pci.c | 32 ++++++++++++++++++----- 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 1475a159e0b5..5e028774f079 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -350,7 +350,7 @@ struct pci_dev { bool want_iomap_res; bool msix_enabled; uint8_t msi_cap; - struct msi_desc *msi_desc; + struct msi_desc **msi_desc; }; /* XXX add kassert here on the mmio offset */ @@ -901,28 +901,44 @@ pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, linux_pci_enable_msi(pdev) static inline int -pci_enable_msi(struct pci_dev *pdev) +_lkpi_pci_enable_msi_range(struct pci_dev *pdev, int minvec, int maxvec) { struct resource_list_entry *rle; int error; - int avail; + int nvec; - avail = pci_msi_count(pdev->dev.bsddev); - if (avail < 1) - return -EINVAL; + if (maxvec < minvec) + return (-EINVAL); + + nvec = pci_msi_count(pdev->dev.bsddev); + if (nvec < 1 || nvec < minvec) + return (-ENOSPC); - avail = 1; /* this function only enable one MSI IRQ */ - if ((error = -pci_alloc_msi(pdev->dev.bsddev, &avail)) != 0) + nvec = min(nvec, maxvec); + if ((error = -pci_alloc_msi(pdev->dev.bsddev, &nvec)) != 0) return error; + /* Native PCI might only ever ask for 32 vectors. */ + if (nvec < minvec) { + pci_release_msi(pdev->dev.bsddev); + return (-ENOSPC); + } + rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 1, false); pdev->dev.irq_start = rle->start; - pdev->dev.irq_end = rle->start + avail; + pdev->dev.irq_end = rle->start + nvec; pdev->irq = rle->start; pdev->msi_enabled = true; return (0); } +static inline int +pci_enable_msi(struct pci_dev *pdev) +{ + + return (_lkpi_pci_enable_msi_range(pdev, 1, 1)); +} + static inline int pci_channel_offline(struct pci_dev *pdev) { @@ -1623,7 +1639,7 @@ err: /* * We cannot simply re-define pci_get_device() as we would normally do * and then hide it in linux_pci.c as too many semi-native drivers still - * inlucde linux/pci.h and run into the conflict with native PCI. Linux drivers + * include linux/pci.h and run into the conflict with native PCI. Linux drivers * using pci_get_device() need to be changed to call linuxkpi_pci_get_device(). */ static inline struct pci_dev * diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index e31ff18b675d..a66627612778 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -322,6 +322,11 @@ lkpifill_pci_dev(device_t dev, struct pci_dev *pdev) pdev->dev.parent = &linux_root_device; pdev->dev.release = lkpi_pci_dev_release; INIT_LIST_HEAD(&pdev->dev.irqents); + + if (pci_msi_count(dev) > 0) + pdev->msi_desc = malloc(pci_msi_count(dev) * + sizeof(*pdev->msi_desc), M_DEVBUF, M_WAITOK | M_ZERO); + kobject_init(&pdev->dev.kobj, &linux_dev_ktype); kobject_set_name(&pdev->dev.kobj, device_get_nameunit(dev)); kobject_add(&pdev->dev.kobj, &linux_root_device.kobj, @@ -334,6 +339,7 @@ static void lkpinew_pci_dev_release(struct device *dev) { struct pci_dev *pdev; + int i; pdev = to_pci_dev(dev); if (pdev->root != NULL) @@ -341,8 +347,11 @@ lkpinew_pci_dev_release(struct device *dev) if (pdev->bus->self != pdev) pci_dev_put(pdev->bus->self); free(pdev->bus, M_DEVBUF); - if (pdev->msi_desc != NULL) + if (pdev->msi_desc != NULL) { + for (i = pci_msi_count(pdev->dev.bsddev) - 1; i >= 0; i--) + free(pdev->msi_desc[i], M_DEVBUF); free(pdev->msi_desc, M_DEVBUF); + } free(pdev, M_DEVBUF); } @@ -949,10 +958,7 @@ out: if (flags & PCI_IRQ_MSI) { if (pci_msi_count(pdev->dev.bsddev) < minv) return (-ENOSPC); - /* We only support 1 vector in pci_enable_msi() */ - if (minv != 1) - return (-ENOSPC); - error = pci_enable_msi(pdev); + error = _lkpi_pci_enable_msi_range(pdev, minv, maxv); if (error == 0 && pdev->msi_enabled) return (pdev->dev.irq_end - pdev->dev.irq_start); } @@ -972,14 +978,24 @@ lkpi_pci_msi_desc_alloc(int irq) struct msi_desc *desc; struct pci_devinfo *dinfo; struct pcicfg_msi *msi; + int vec; dev = linux_pci_find_irq_dev(irq); if (dev == NULL) return (NULL); pdev = to_pci_dev(dev); - if (pdev->msi_desc != NULL) - return (pdev->msi_desc); + + if (pdev->msi_desc == NULL) + return (NULL); + + if (irq < pdev->dev.irq_start || irq >= pdev->dev.irq_end) + return (NULL); + + vec = pdev->dev.irq_start - irq; + + if (pdev->msi_desc[vec] != NULL) + return (pdev->msi_desc[vec]); dinfo = device_get_ivars(dev->bsddev); msi = &dinfo->cfg.msi; @@ -990,6 +1006,8 @@ lkpi_pci_msi_desc_alloc(int irq) (msi->msi_ctrl & PCIM_MSICTRL_64BIT) ? true : false; desc->msg.data = msi->msi_data; + pdev->msi_desc[vec] = desc; + return (desc); } From nobody Thu Feb 23 19:34:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BT1Ffjz3sfch; Thu, 23 Feb 2023 19:34: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 4PN3BT0Ybqz45tB; Thu, 23 Feb 2023 19:34:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GDlIK+Exq989JXxh7ZcQzIhIV416cRq46I6t+9Gwoc4=; b=jLZ5MtAfZfp1Goq9JJyRJ1EFPf1PHN5xI6Hm3E42d3rqBCskkRGhrU5Pjbfa7E2UYe5zbJ OdRBxemhs8R0bW4RROeAgDHlE6V6XhRufZfDa2D1F6E8Ki8R2HCN67DkaQK+/FyQn2zKS4 4OrovIY89nik/2QrbmoujjqruurANuZ6g8RZCHoA3sboG22rct1327idIzwn/1f+tiX7jV kDvSwoPiHIXe798Fl+exzkaWPTIrGJ/6Woy4vnHHphso6YmqcjviEzNxMS/R8Ug5lj5Ggp PLVWpFjLM6FRvNMlFPSOPhGYepSvscjVXB6xLAUX3AEfSz8mfbP4Nc5speyZFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GDlIK+Exq989JXxh7ZcQzIhIV416cRq46I6t+9Gwoc4=; b=mLDPPd4XqHrF8EdT3EpDoZ6JO1qDmcInaz0k95eSendG/59wn5EMqShYutQRXUvoGH4XP/ Ydwgr10yqT6EbH4iFBbeRHt6o4XE9if4ECWRZ2/hLAsAKyAKOIwOFTAJ2Ln9ApbmgbFtE6 oW6wWIoKtMVHPHLzbpvqmFun3IrvbU0n09LYil4vIUyGn4CAvyCtPwNRZAxZJA1iwavN6i 0OaqGtq8E18PJs3Xob8t9cIpV3u/VzwGtTgzWfxh7lzIbLsS9diQWovMMPI805HGvJYUqr maV8nCfU6w6CWo6puy36t+F5x83oDym1OJ0edp7ggk53f3ql1epFQJargSsXYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180881; a=rsa-sha256; cv=none; b=OOziYuo2zeo5UbpM4AOKnhZAKIJ+DcuI6M/fWaqhkkClCIcAffr3EmMxcKjC1/S37JpJCD oSipTz+wh5XyngEXmFnkA5xGNeFD25YoHQlzUdzewAhoHva37WNA26V7HBVzWuC0LsLqwk hWB6/ndBnx7pEqjUcDVaeEn82M31d+gxJh0r+sIsMNa1ET+4C9CZdn6KR2mRWnkL5xkA/j H38Bldvon27L2f8Rayr8T7Qmxj+42SV+Mx0uVZIXZflYA/muVyDXHh5eHTgiQ9IHFDb76p jkwwraLXPCXgzBberYmjWj9ZGOP4lYQWTxKrSbYMfo+1xc9fW138Vmrt6DnqRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BS6dHxzv9K; Thu, 23 Feb 2023 19:34: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 31NJYe2c020463; Thu, 23 Feb 2023 19:34:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYe1T020462; Thu, 23 Feb 2023 19:34:40 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:40 GMT Message-Id: <202302231934.31NJYe1T020462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4fa10614c773 - releng/13.2 - LinuxKPI: pci: add more functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 4fa10614c77369ae4edd09a065a70fd20e526d43 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4fa10614c77369ae4edd09a065a70fd20e526d43 commit 4fa10614c77369ae4edd09a065a70fd20e526d43 Author: Bjoern A. Zeeb AuthorDate: 2023-01-28 15:02:51 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:33:24 +0000 LinuxKPI: pci: add more functions Add a dummy pci_assign_resource() and an implementation of pci_irq_vector() returning the irq for MSI-X, MSI, and legacy interrupt. Both are needed by wirless drivers. Sponsored by: The FreeBSD Foundation Reviewed by: jhb Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D38237 (cherry picked from commit fd1a2f3dfc0e8fb20d0d397d586000bb918aab47) (cherry picked from commit 7b65e6f377ca0005a986c59f1e31a0421d92660f) --- sys/compat/linuxkpi/common/include/linux/pci.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 5e028774f079..3d43595df047 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -1694,4 +1694,30 @@ pci_is_enabled(struct pci_dev *pdev) PCIM_CMD_BUSMASTEREN) != 0); } +static inline int +pci_assign_resource(struct pci_dev *pdev, int bar) +{ + + return (0); +} + +static inline int +pci_irq_vector(struct pci_dev *pdev, unsigned int vector) +{ + + if (!pdev->msix_enabled && !pdev->msi_enabled) { + if (vector != 0) + return (-EINVAL); + return (pdev->irq); + } + + if (pdev->msix_enabled || pdev->msi_enabled) { + if ((pdev->dev.irq_start + vector) >= pdev->dev.irq_end) + return (-EINVAL); + return (pdev->dev.irq_start + vector); + } + + return (-ENXIO); +} + #endif /* _LINUXKPI_LINUX_PCI_H_ */ From nobody Thu Feb 23 19:34:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN3BV44YHz3sfBl; Thu, 23 Feb 2023 19:34: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 4PN3BV1g86z45rM; Thu, 23 Feb 2023 19:34:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Brml1X7LjoZ3rjEni+HcHwJvKlruZcLzmhEvBeJDBfQ=; b=VJzd+0ZLLu66KVY0H9eGb5peinZdG7Z3XzbqoNSdmVvIaDB3TrhfPfJb3Yw8Fq1VyoczjO fQExE5BXPU5dh3UzkFEUppEi1sVHx52DtcIvTyJzEyr1oNH/YN2nW8Zf79MmxHzFgJovFX WMB/XcewwG4n9fH8Ta2HuZVKOIQ058MQtX5gKbMIVPMvSZOSPPB8nJTKi3n06X1FEvtBge UWGbo0AMUTVqVFJ73K4wnfJA7Rw3BWmy1l1k/sMpZgSO7ByYvTWPx4WnQMUFtyRMxOkDyB GL3TiNsW0ktvuP/rBJbadjL3oDWH6Kc9Q1XZihzAQD2+otpik+yg/wpLk/Dliw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677180882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Brml1X7LjoZ3rjEni+HcHwJvKlruZcLzmhEvBeJDBfQ=; b=XpPqKR3rkmQHQpHHI8zI4DUdNp6xl/aVqLGvwKvCu7Ca/gUcOiYnZQqZWKnJ0AYI3JaJQ/ LYlq3N/N33kc4olSFyJU29KNvRwlFJ+9tnAuP9J7s6Vgq2M3Y63PGLAde6UW82cYVjamW7 BrX2yC4TtKCqzEOAKTB9EigF3scoHw5pq+Ix4A9qCvLT88HNYjCr7fKYdVIznumFwJd2P0 jVC8QRYvyd41VKSCSKlC5UL1Kf22QA3VsAZU6PeWsW72QJ5BLdQvSdxHRWIPWqvV2f9IQ3 mGt6kkTseiBbAokNVHKIn7s8/aQZvaN6qEIZP0/tDEg/HfCk+gU124ENDUc0VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677180882; a=rsa-sha256; cv=none; b=wo8WaMgfsfoOKVJM55DS0UYWjWp7uJrvD5AfKAiMxNdAjZyIkjO2Yvow4HHG11SmZaMa2S LjyNtHnDExPTN8ll0xEIn8UZiYn0ybuY15/4O7SovU7eGgxg4jMpEpYnd8JpykMJbqI+xC GLZsC54CdIbMm3hByaaAlIIrrtXE5gKeslS6AxVI/iOFacwUlA+Y5t/8C4CopmVTnLd56j i1OfwDXRHn+3bq5itxul9sMa4SNdWiU+h6szUDK2doIuNCsAkgpkY2RT8XhYASMmOnP6PY QIl2P/twNk6nWkx0ACFiJ/FCyHS5TOqO4yk/JU+GMtnR01jjEAnKvmY3E43y6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN3BV0V6ZzvTP; Thu, 23 Feb 2023 19:34: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 31NJYfOb020484; Thu, 23 Feb 2023 19:34:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NJYf4W020483; Thu, 23 Feb 2023 19:34:41 GMT (envelope-from git) Date: Thu, 23 Feb 2023 19:34:41 GMT Message-Id: <202302231934.31NJYf4W020483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 368a398b9c3e - releng/13.2 - LinuxKPI: return an address string in pci_name() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 368a398b9c3e01359d9997aaa3ccff6415129f74 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=368a398b9c3e01359d9997aaa3ccff6415129f74 commit 368a398b9c3e01359d9997aaa3ccff6415129f74 Author: Val Packett AuthorDate: 2023-02-06 21:50:13 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 19:33:31 +0000 LinuxKPI: return an address string in pci_name() amdgpu's virtual display feature uses pci_name() to match a module parameter string, and the documentation shows an example of `0000:26:00.0` for the name. In our case the name was just `drmn`, which is not actually unique across devices. The other consumers are wireless drivers, which will benefit from this change. Generate the expected string for pci_name() to return. Related to: https://github.com/freebsd/drm-kmod/issues/134 Sponsored by: https://www.patreon.com/valpackett Reviewed by: bz, hselasky, manu (earlier) Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D34248 (cherry picked from commit 393b0ba25f1a54dcc3f94244933c665f1c471d1a) (cherry picked from commit 30960c51e646c51134fcb72e0adc881f36a41c38) --- sys/compat/linuxkpi/common/include/linux/pci.h | 4 ++-- sys/compat/linuxkpi/common/src/linux_pci.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 3d43595df047..e050cb5021cf 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -351,6 +351,7 @@ struct pci_dev { bool msix_enabled; uint8_t msi_cap; struct msi_desc **msi_desc; + char *path_name; }; /* XXX add kassert here on the mmio offset */ @@ -470,8 +471,7 @@ pci_resource_flags(struct pci_dev *pdev, int bar) static inline const char * pci_name(struct pci_dev *d) { - - return device_get_desc(d->dev.bsddev); + return d->path_name; } static inline void * diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index a66627612778..3dbcf5cfbce0 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -309,6 +309,9 @@ lkpifill_pci_dev(device_t dev, struct pci_dev *pdev) pdev->subsystem_device = pci_get_subdevice(dev); pdev->class = pci_get_class(dev); pdev->revision = pci_get_revid(dev); + pdev->path_name = kasprintf(GFP_KERNEL, "%04d:%02d:%02d.%d", + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev)); pdev->bus = malloc(sizeof(*pdev->bus), M_DEVBUF, M_WAITOK | M_ZERO); /* * This should be the upstream bridge; pci_upstream_bridge() @@ -352,6 +355,7 @@ lkpinew_pci_dev_release(struct device *dev) free(pdev->msi_desc[i], M_DEVBUF); free(pdev->msi_desc, M_DEVBUF); } + kfree(pdev->path_name); free(pdev, M_DEVBUF); } From nobody Thu Feb 23 21:14:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN5PD10TYz3smW4; Thu, 23 Feb 2023 21:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PN5PD0XPZz3J1R; Thu, 23 Feb 2023 21:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677186848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OEP+8WyaaBgOLdOJJVZDRG23P7bksrtCfOB7ffOzIdk=; b=cIW11DaPngDw3Ont8oASMQUK0Os3+R2DZ9JYhds+2ThMsXw8e51j4SEQAkdLaBEfqJ8dru GA3D6LCy2B55qeqzzAs79/eI/b+tNDChY4NydTGYCCrX09/UykS01aTW4sWXdgbNX0M8Pl 3hi/JIblLK5hE0T1hzrW5CqyZ/jvY5ORlGpUoZ7nP2wLbaPBhdiT6xFsbJCHBB2GGgOaxE oTBWu9ZUbP3sOWA9F0uFj5A2Tw1JuBaYN+WfCc3W0IN+q/aOtQGLFV8+QdlnceEI3WXQ8K BV0cgSNfITDwtspAfwWV5gdBYqo3ScFQDneN8Rri4oJ+hm9Zi052DDBmCrppQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677186848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OEP+8WyaaBgOLdOJJVZDRG23P7bksrtCfOB7ffOzIdk=; b=DrJy73rUdGt/K/QOBj6AK4wGVXLqmSOs32UdMTA+dT8qwyyuQVngNyU5/McQ6iihibIO2f vvygUZ5ZGEjVkX0/s26ufNEWdHXIQypPKN9e1wrGQxyqFwTaouWFDkHXljcRlidDEaOemP 5HLbW6qMxxAol8qiUZxtuiK41ZJIhyvANHXsPBdvrwzImL+5124M/Nz2Xz63rHXoH6XgaH +nY+BGtBePUnfMrBi9Q69dPfuoONFN/meivMpOCxc2rZbdTcTQRQu7zNMYFKBHKw/ZaUlV rOPF+Y0lm4LUk1FdSgIrg+HjbMQkbVB+iFR4Dzc91jFYpqWX4MSql5fo9bpyZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677186848; a=rsa-sha256; cv=none; b=Atk8oD56tkqswx9dftpuOb08u2qR8EPzQF2A2z8GeEq8dIaLIC0wvXNWLG7e8W+FIpe+qU IZZgFpO53vabYSEruv4W/UW2HunzYfmvnD9IrSwRVCADqz45UbXOfMxDbn3m5HtzndNzkd evtIk3SDSquH8rsOJ2tgOziRl7wNl8ALC15nqCD+6/6J9MpnbcQVceppvp6mOwS43MQygB bhlglE29Tllu6Aao/jwpD9yFmodUevT8wMWnOdR6lcf/EU6Howf1o0LoYEWzL+dJiT3pZp BZA9wCsQeO0O4A8/6v6Z1dlhyt7sb8mVY0qA2YqZsmCf4Iob7a53EpfwlzqEAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN5PC6hrszxfC; Thu, 23 Feb 2023 21:14: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 31NLE7WC063598; Thu, 23 Feb 2023 21:14:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NLE7Vp063597; Thu, 23 Feb 2023 21:14:07 GMT (envelope-from git) Date: Thu, 23 Feb 2023 21:14:07 GMT Message-Id: <202302232114.31NLE7Vp063597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c9ba91435a01 - main - net80211: ieee80211_swscan_bg_scan() track return variable under lock List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9ba91435a01a80632a5b68144d75b38241fc8be Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c9ba91435a01a80632a5b68144d75b38241fc8be commit c9ba91435a01a80632a5b68144d75b38241fc8be Author: Bjoern A. Zeeb AuthorDate: 2023-02-18 01:15:21 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 21:12:23 +0000 net80211: ieee80211_swscan_bg_scan() track return variable under lock As the comment says it probably does not matter but use a local variable to track state under lock so we can return the last known good state of what we thought we were operating under after unlocking. Likely no functional changes. Sponsored by: The FreeBSD Foundation MFC atfer: 3 days Reviewed by: enweiwu, adrian Differential Revision: https://reviews.freebsd.org/D38660 --- sys/net80211/ieee80211_scan_sw.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_scan_sw.c b/sys/net80211/ieee80211_scan_sw.c index 1456fafd60a1..51e1189824e3 100644 --- a/sys/net80211/ieee80211_scan_sw.c +++ b/sys/net80211/ieee80211_scan_sw.c @@ -336,12 +336,14 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan, { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_scan_state *ss = ic->ic_scan; + bool scanning; /* XXX assert unlocked? */ // IEEE80211_UNLOCK_ASSERT(ic); IEEE80211_LOCK(ic); - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { + scanning = ic->ic_flags & IEEE80211_F_SCAN; + if (!scanning) { u_int duration; /* * Go off-channel for a fixed interval that is large @@ -405,6 +407,7 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan, ic->ic_flags_ext |= IEEE80211_FEXT_BGSCAN; ieee80211_runtask(ic, &SCAN_PRIVATE(ss)->ss_scan_start); + scanning = true; } else { /* XXX msg+stat */ } @@ -415,8 +418,7 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan, } IEEE80211_UNLOCK(ic); - /* NB: racey, does it matter? */ - return (ic->ic_flags & IEEE80211_F_SCAN); + return (scanning); } /* From nobody Thu Feb 23 21:18:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN5VB5scmz3smXZ; Thu, 23 Feb 2023 21:18: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 4PN5VB5JM0z3JkM; Thu, 23 Feb 2023 21:18:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677187106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=soklxhyQiBc753JLS7VnfExOXtWG2AgAfxHBs94yDpY=; b=H/aUjPI57gi3+if9X2l/BtbR5tyIFMPLEoniGSZbm8pIJSAqEtLkSXZZ1CKy1XPTzGc0BN QDkWgNVYtpoNq6Dcl2t0YJDmdINpdLJi+XRA/uZMlRTbS+6daLvjPEzVp5qdJUNO+77IL+ tNV3tsTf+ZRJUxKhy0VUaTKqyvzyuHmc/gLhomy4z3t5V/fxgGc5pYwxgmJCM5+gVJS7UN f3cBj1Lu+tas5klKZlS4v0Tq9BZTVsKdtGurar4NIG+AbZDWHVOix3unx5DvIsPxhB2yy3 39ni1gBiJUoBk61YfY8pSkqGb1yekOqSXET2Uib8iKhjwtHo/DMzaAUDklFRsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677187106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=soklxhyQiBc753JLS7VnfExOXtWG2AgAfxHBs94yDpY=; b=ylS6497sb3wxDYkrN478Roth9UavCfUeXu5AqnReU6+acI488MW1f7fy9x2dZoyuS+O4HP E/qFYBTzaraQbdJVPSviRH0I8CmhbouMiDRot+1mPkfZbWWVWCtaEbL28deF+BvEl+1E9W 6T7GvFLRNESeRHHUDR1yu8e17zxm8heMoNH0AR280QqGFEnA99p+TX8Ov+HB+i8fo+Gmvz YvcJaofBplkL+d5l990mIiOvyhxmlPTyIW9zsFKMGnA/7DfQ5GqFZ3xstqjRO9G/fhwCYe 9hZ2jvHglutU/YoEVXslZCP9PCi1C5bHd1quWosLAHOyBk6z3OaGzuL2E8jiVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677187106; a=rsa-sha256; cv=none; b=eSbKgNooSAX3SWmTIps5qutH3f4im8o+mitpmR5ERup0DPTrd9o/5sGawUiKJ1qpINqy9m pp6/Sv2IojLYkiAu7vYhnCEH67ixiRw0azWgR4TgEt2nepDCVePnDQOeExLeilWZ5aNO3e cWp9GLMs1SRXalYVFbiOf/kCZradHhPhRcQYy/qhlf41vO3yhMQwOsI11kl3Ye514bad00 yEYlEwmffNgEGksi4GK0hBEt4xqS0glMTsff1GSCqUbt4l6y5uzlggKroiMXu+RfC4ft5G pLozhvZKfjChCisOhn5PmzmMj/KHYw8PPHMICJ9QF3elMbq/EXtpyW/TVGLDfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN5VB4KR8zxqp; Thu, 23 Feb 2023 21:18: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 31NLIQ2Z064380; Thu, 23 Feb 2023 21:18:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NLIQpI064379; Thu, 23 Feb 2023 21:18:26 GMT (envelope-from git) Date: Thu, 23 Feb 2023 21:18:26 GMT Message-Id: <202302232118.31NLIQpI064379@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: 0455b90beedd - main - tools/git: fix typos in documentation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0455b90beeddb636b0644c5d47ef80ffb3e4b4c7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0455b90beeddb636b0644c5d47ef80ffb3e4b4c7 commit 0455b90beeddb636b0644c5d47ef80ffb3e4b4c7 Author: Mina Galić AuthorDate: 2023-02-23 21:05:33 +0000 Commit: Ed Maste CommitDate: 2023-02-23 21:15:19 +0000 tools/git: fix typos in documentation and change mention of svn to git. Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/659 --- tools/tools/git/HOWTO | 6 +++--- tools/tools/git/arcgit | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/tools/git/HOWTO b/tools/tools/git/HOWTO index 160696c4d236..9e0501c91896 100644 --- a/tools/tools/git/HOWTO +++ b/tools/tools/git/HOWTO @@ -28,7 +28,7 @@ commits. The intended workflow is: Differential, so try to give each commit a meaningful commit message that gives your reviewers the necessary context to understand your change. -2. Create your reviews bu running this command in your git repo: +2. Create your reviews by running this command in your git repo: $ arcgit -r C1~..C2 -R reviewer -T testplan C1 should be the first commit that you want reviewed, and C2 should be the @@ -36,7 +36,7 @@ commits. The intended workflow is: specifying the -R option multiple times. You can CC (AKA subscribe) people to a review with the -C option. Note that if you subscribe a mailing list to a review, the mailing list will be emailed for every comment or change - made to each review. Please be judicious when subscibing mailing lists to + made to each review. Please be judicious when subscribing mailing lists to reviews. It may be better to instead send a single email to the appropriate list announcing all of the reviews and giving a short summary of the change as a whole, along with a link to the individual reviews. @@ -75,7 +75,7 @@ commits. The intended workflow is: 4. Once the reviews have been approved, you need to prepare your patch series to be committed. This involves squashing the fixes made in code review back into the original commit that they applied to. This gives you a clean - series of commits that are ready to be commited back to svn. + series of commits that are ready to be pushed to git. First, merge each of your review branches back into your main development branch. For example: diff --git a/tools/tools/git/arcgit b/tools/tools/git/arcgit index 60d9abe58595..283856ae128f 100755 --- a/tools/tools/git/arcgit +++ b/tools/tools/git/arcgit @@ -35,8 +35,8 @@ # # When your reviews are complete, merge all of the review_DXXXX branches # together, and then do a git rebase -ik to meld the code review fixes into the -# commit that they fixed. Now you have a clean series of patches to commit to -# svn. +# commit that they fixed. Now you have a clean series of patches to push to +# git. usage() { From nobody Thu Feb 23 21:23:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN5bm4KyYz3smgl; Thu, 23 Feb 2023 21: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 4PN5bm3qTdz3MJw; Thu, 23 Feb 2023 21: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=1677187396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+xTNljBRLhhNwUpV4ovWKK4KXpD/fnhAFDrkS+tceVc=; b=IzdGWUEbL2HjD0tVJWPVfOKPj03hI+mvMfdi0CpDZbw9aV1PtDz2IIckIVZnPE0HmjRCXZ gGZNoXVl9lHdBam680GxFGSA80bQzOD08LIVZxBx0FbL0DyYOH91eSHX7oZ10Dqlw5YevJ bxW3gZ23OMuiCn3RbCT25FZjASAe3sF5mtxTLbKFRAL1ytOHuTv+if6w0BGoWtusWSC0Yn JTU0AMq7kcMZMZlCYg05MgYOkkXcIuQ27G6Cx487CjX+c0x+Bkj5mnb9o48ufZJvwN+kng o/GXg/nKXz7UUOJ1rt02bOclOsw54opN9MLMDlFR4AzPdHttIZ/FuMboHDZX1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677187396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+xTNljBRLhhNwUpV4ovWKK4KXpD/fnhAFDrkS+tceVc=; b=k7//HkWZ2f/7xQs5I3NXGQcgYhMZg/p8ZVcp/tfKzCzsIjQNJDWp5dY8JscNSVtiH6TgZL yTAShcQB+/kZZCLVpWhbmPOfXwdccuvv0weNbyOqdFr4Ie58Ckjb1alIun50mSjvY4Coo3 qy82EA+4PBo4+r16/zMmOvbhDdT8znbE0cKsKCcZg15p4FXOLkW7UN2izjIAnbLwO7xxTc mJInVd5sBhPXfyvNqcxDLhrGte/wrhGjUfaU+EdLpmPzUr8XNI3aVNqWkwluPnVKbukZJF ztmmRRg2MC0ALSuLOL2qSB95IdBbLxFfykM+yeeq2XV/0aqlyB9ki08hVwy0tA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677187396; a=rsa-sha256; cv=none; b=u9LE03Il94UKQ1BiqkrC1EPzcTR3Ioq17C9KVZFAMIZtLyg1mzsu3fSf9BB/QQJQRUD7u8 ZbgsbAPtvH9mtT1sM8sldlhkoDxSb7XXyJ9BWa2ONlHNJjWvQwCmvzXK72hLA+OZM8sRuw KyW3bytyFhTyiteLn7Zr4wesmcC+aKrNhGfENFrT4rrxPbD+kU9jKaFR2mclbNC0mnyEZM i0BMv3ASOKX+4BUxJMStwimSmFFf3b2b9ajkC0fP50JY4/Q33tiX1iKipeLiQ5JxvvaIr/ 29LcH8LXFWXvuAIiUJD3AacWpvT0PpRU2Ub9R7G5mU6NKxbQCpOdADOiZOzaCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN5bm2rCSzxrH; Thu, 23 Feb 2023 21: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 31NLNGmi078013; Thu, 23 Feb 2023 21: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 31NLNGi6078012; Thu, 23 Feb 2023 21:23:16 GMT (envelope-from git) Date: Thu, 23 Feb 2023 21:23:16 GMT Message-Id: <202302232123.31NLNGi6078012@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: 4e696aff6909 - main - iconvlist(3): fix count argument type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e696aff69090da046817a6339d01f4675728b95 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4e696aff69090da046817a6339d01f4675728b95 commit 4e696aff69090da046817a6339d01f4675728b95 Author: Kyle Evans AuthorDate: 2023-02-23 21:22:12 +0000 Commit: Kyle Evans CommitDate: 2023-02-23 21:22:12 +0000 iconvlist(3): fix count argument type count is just an unsigned int, not a pointer. Sponsored by: Klara, Inc. --- lib/libc/iconv/iconvlist.3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/iconv/iconvlist.3 b/lib/libc/iconv/iconvlist.3 index b1a6e0564341..2e9f585534c6 100644 --- a/lib/libc/iconv/iconvlist.3 +++ b/lib/libc/iconv/iconvlist.3 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2009 +.Dd February 23, 2023 .Dt ICONVLIST 3 .Os .Sh NAME @@ -47,7 +47,7 @@ .In iconv.h .Ft void .Fo iconvlist -.Fa "int \*[lp]*do_one\*[rp]\*[lp]unsigned int *count, const char * const *names, void *arg\*[rp]" +.Fa "int \*[lp]*do_one\*[rp]\*[lp]unsigned int count, const char * const *names, void *arg\*[rp]" .Fa "void *arg" .Fc .Sh DESCRIPTION From nobody Fri Feb 24 02:53:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNDwy0pWpz3t7RM; Fri, 24 Feb 2023 02:53: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 4PNDwy0GYCz4HG4; Fri, 24 Feb 2023 02:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677207218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RljYNks9jAFmTP4lpX/9AQbDDlQSLUKaCBNG7crrZIY=; b=ckjXWIZzeh5JjQc8WLNSsjHUYhwbgN2Mpl4ELYt2Dvq1Ecx1YlbFSSNnBco1xVK4y2/iD5 Nb7GEx68k2sgra9ct6uBAQ9gZk+6g7A7ltgAzzaIWlddAoL5d2LiWzSc5XEgl8h+BV1w3i iiiAE508C//V9w+ocdL3ZW/HdV58RPPSGf79uK2pd/6eQcVZ79XSzvt6DLs1WzcCUA1ogB jodbQzqhH1UUeGH8ObaF/AzCfEwVf4AzFT3s0UrbNDEEgoYd3ofieWyii6491F9nyZduVD UT2u9G/6VnZhOp7p+pgTcgd7bGDaYnIkyu5wPzxcfRRamXYK6CEotaVZoLqTzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677207218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RljYNks9jAFmTP4lpX/9AQbDDlQSLUKaCBNG7crrZIY=; b=O8ZwPjhN6/U1kFG+s/H11/cPGCEA6C9j/JevaHA/Xe6U2iQm70j92AmANywmEhvC0AZRyb 0k/93t6quzZQkzKzavtjn9CF0ajhnI3rpRwDSfe5SOYEzQJDa3u0mbVGndNZumUzF+pnCF bWYUZ8/M7aWpGYvgPwRKugw9f4geNyGDCXQ+T36zOhApSm/cK4JwYmSohk2x63E84iTTYy yY/N6yUKCnNjTsTsFR/C2KKVH1AcB+UQzB3e7503YkiOlKiLIWAr3Ol37dC/dxsGiGF3xQ fhd+wGrzJhaRl5S7P2Kb8Il6h+TEoE+SacLBKUa+6T/YVPUnLWyUKTXNlpX7kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677207218; a=rsa-sha256; cv=none; b=ywRgcl1Q/ttPIUaAI0EqXcSzdRFZr+JLdKpBrNub3+QieCJJUk2odVD2IHHIpsTVOoXBmK gWRC2xc6AXBAmgh+HtqfV10T4dYrRHX6l3dF6b8/y6fERw+H4PA/d4XudM1u+dWuFLv18E VgJGeRTijqqrtKBjjm2+OJertZ1dSBMo+OCRQrC+VSOhop0+YalVjV7tvfErDZkxP7Foj2 h+AAW84wn5eMtVFvZomuM8lcNNziJehymDfiE5c+H80f63WlcJ3wA59fJoEgLmXqR7zUFc 8YG/G3hPrhCTwqW3T8SQqqxg5bDQ5bqqqGMCfdeMRvsY2LzhQGFy18jmdZ187w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNDwx6QmMz16pC; Fri, 24 Feb 2023 02:53: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 31O2rbsY046986; Fri, 24 Feb 2023 02:53:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31O2rbJx046985; Fri, 24 Feb 2023 02:53:37 GMT (envelope-from git) Date: Fri, 24 Feb 2023 02:53:37 GMT Message-Id: <202302240253.31O2rbJx046985@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: 8c8574acb851 - main - config: Include errno.h in mkmakefile.cc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c8574acb85169447168bdf08d5718ba7cf2be85 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8c8574acb85169447168bdf08d5718ba7cf2be85 commit 8c8574acb85169447168bdf08d5718ba7cf2be85 Author: Mark Johnston AuthorDate: 2023-02-24 02:45:01 +0000 Commit: Mark Johnston CommitDate: 2023-02-24 02:53:06 +0000 config: Include errno.h in mkmakefile.cc Commit da8884202940 ("config: error out on malformed env/hint lines") added a reference to EINVAL. In some configurations the bootstrap tools build fails for lack of errno definitions. Fixes: da8884202940 ("config: error out on malformed env/hint lines") Reported by: syzbot+b1a5d112a737d9a2be9b@syzkaller.appspotmail.com --- usr.sbin/config/mkmakefile.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/config/mkmakefile.cc b/usr.sbin/config/mkmakefile.cc index 2aaed82ce3ee..232933711ce5 100644 --- a/usr.sbin/config/mkmakefile.cc +++ b/usr.sbin/config/mkmakefile.cc @@ -44,6 +44,7 @@ static const char rcsid[] = */ #include +#include #include #include #include From nobody Fri Feb 24 03:08:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNFGD19nKz3t7pP; Fri, 24 Feb 2023 03:08: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 4PNFGD0lFgz4Jqk; Fri, 24 Feb 2023 03:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677208116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0TJLdy1vRQqcCPbLHJx9RCpM2qIVjCL1fBKMD2rtT8I=; b=Ucniczimf1RZYvKbGf672QuZN6eAH11Uvflti0VjbLLobnu2KFynVgmFgqzNfKle6UJ1dE iYEppuPrmQPPPQKbIQgpuTR8Q7Ya8QvR6PasiJF292hEgHT7I9/tGFxxj1mDhonfEy8CJF 8wH7hTAMZ3q0UxlmEgKPC3QfTosMq23hR0mcSPFct006p7Bh/f/Tn/tmlCB8an6D10ZXr/ LXVxt6pV6qjTVXyaVY0/O8EVNS4m5/8OaAN0iD7GNnX68Y8XDPLL8mWb+kRZxDYgdKsPGH OhKI55O4/RoYFAJHkmhbgRsCnorZ9fdXxRCykoVsW49UUXHnM6GC8OBI4eEHuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677208116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0TJLdy1vRQqcCPbLHJx9RCpM2qIVjCL1fBKMD2rtT8I=; b=hxkPh6uNxuUQoaZm/FhDXeY4NC+Vqgc2AaMdynP6XvbOzDRdrLM3PowgFcu0UXZO0Ia3Wv +jElzaTDHYk1KAYE+W475nWKo7JZXING3ij/zTgb8LHhkeOBKzcBwe+sIFsQk+LL1weA/a UwPYpXT/ruYMxjWjb27yWOH73Qojr4eefzxd70W3fyrCC1G0oruOjZX/ABGcc9FAFSgrXi WA3SJd007jxX6eM4kfVF2kbBFK5zU2pMktTtuptpuy3gvRMZxlrZw8kPVIQBqn+Tt9CFfB 3rKS618zmpBJoe7yPKceEbRbBDDGBUX5mF/0Xduc4JQgZu22N0GjbmSVCQdM5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677208116; a=rsa-sha256; cv=none; b=BzPocRuvVuy1hS57wQFdABOnNsyhji2EwPyWYktj/LQEgLlbGJm/BcXJrf5XykUUxysb1b P+IGnEIuTl0iX+MQdFucewdYDCNVq35OB18cP24P6RJpZ0EsImGE5GOQZ2rRjzWKvjVUUM jXZPn9/1xKX6a4ywewcAreijtuZ/U55h6EEduxnfE9saJSTOU0UDycaqLM+0ywq4b1nTyk zjpTyKBm/E/UPPSaQGcbLcg8xr/IbyXcI5SajWXIi2X+1zF7ZU769K9M56IpN15dtGSz+O VaLKFv8ndC8u1rMS3mBKvrldjesrmVcAwSE9yNMTZRhhTVcH5evMkA//DJ1YZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNFGC6vK8z16Zv; Fri, 24 Feb 2023 03:08: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 31O38ZCr063570; Fri, 24 Feb 2023 03:08:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31O38Zba063569; Fri, 24 Feb 2023 03:08:35 GMT (envelope-from git) Date: Fri, 24 Feb 2023 03:08:35 GMT Message-Id: <202302240308.31O38Zba063569@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: 9d7cc536e261 - main - buf: Make bufspace_daemon_shutdown() a no-op after a panic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d7cc536e261a7d207476115dac6058c38f469bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9d7cc536e261a7d207476115dac6058c38f469bd commit 9d7cc536e261a7d207476115dac6058c38f469bd Author: Mark Johnston AuthorDate: 2023-02-24 02:56:36 +0000 Commit: Mark Johnston CommitDate: 2023-02-24 02:56:36 +0000 buf: Make bufspace_daemon_shutdown() a no-op after a panic This function doesn't need to do anything in that context, and calling wakeup() can lead to recursive panics. Discussed with: mhorne MFC after: 1 week --- sys/kern/vfs_bio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index abc3eea9be4e..b40ee382c42a 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -766,6 +766,9 @@ bufspace_daemon_shutdown(void *arg, int howto __unused) struct bufdomain *bd = arg; int error; + if (KERNEL_PANICKED()) + return; + BD_RUN_LOCK(bd); bd->bd_shutdown = true; wakeup(&bd->bd_running); From nobody Fri Feb 24 03:08:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNFGF1FrJz3t76r; Fri, 24 Feb 2023 03:08:37 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4PNFGD21X2z4Jvs; Fri, 24 Feb 2023 03:08:36 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 162.251.186.162 is neither permitted nor denied by domain of glebius@freebsd.org) smtp.mailfrom=glebius@freebsd.org; dmarc=none Received: by glebi.us (Postfix, from userid 1000) id 4CC1B51206; Thu, 23 Feb 2023 19:08:30 -0800 (PST) Date: Thu, 23 Feb 2023 19:08:30 -0800 From: Gleb Smirnoff To: Rick Macklem Cc: Rick Macklem , bz@freebsd.org, jamie@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup Message-ID: References: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [0.64 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.86)[-0.860]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_TO(0.00)[gmail.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[glebius]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TAGGED_RCPT(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4PNFGD21X2z4Jvs X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N Rick, On Thu, Feb 23, 2023 at 05:56:06AM -0800, Rick Macklem wrote: R> > This one actually doesn't look correct to me. What happens here is that the sysctls R> > will affect only the default VNET. R> > R> Yes, but the sysctls are mostly useless anyhow. I don't know how to make them R> work in a prison. (I know how to use SYSCTL_FLAG_VNET, but that does not R> work in this case.) Doesn't they work as intended in my patch D38742? R> > I think the VNET-itezation of this file went a bit wrong. You don't need to convert R> > static structures to malloced when you VNET-ize a module. The infrastructure should R> > take care of memory management. R> > R> Not if you want to keep the vnet footprint small. This was necessary R> so that nfsd.ko R> (and friends) will load dynamically. Without the conversion to R> mallocs, it would complain R> the vnet was out of memory when nfsd.ko tried to load. R> (I'm sure I didn't need to do all of them, but it made sense to keep R> the vnet footprint R> as small as possible.) R> > The dynamic sysctl context seems to be unneeded from the very beginning. It was R> > always attached to the static softc. Suggested patch: R> > R> > https://reviews.freebsd.org/D38742 R> > R> I'll look at it, but if it stops malloc'ng softc, then I will be R> worried w.r.t. vnet footprint and R> dynamic loading. (Note that the structure has an array of hash list R> pointers in it, so it R> is rather large. Replying to you and Bjoern's email too here. Well, if we want a fully blown virtualized network stack, and this is what VIMAGE is, then, well, we need a full chunk of memory to keep a network stack data. So, if there is a limit there, (Bjoern mentioned 8k) then this limit needs to be increased as more and more subsystems are virtualized. I also don't see how we actually save any memory using malloc(9) instead of using memory provided by VIMAGE? The kmem use would be roughly the same if not worse. What exactly are we saving here? R> Another reason (along with dynamic loading of the modules) for keeping R> the foot print R> small is to try and keep the jails that do not use nfsd(8) and friends R> lightweight. R> When I originally coded it, I put it under a kernel option called R> VNET_NFSD (still in R> kern_jail.c at this time), but others felt that a new kernel option R> wasn't desirable, R> (There is a lot of discussion under D37519. The downside of discussions that R> happen in phabricator is that not as many people see them. I started an email R> thread on freebsd-current@, but it quickly migrated to D37519. Just R> the way things R> currently happen.) I briefly looked into D37519 and didn't find any discussion over memory footprint and savings. I agree that a kernel option of VNET_NFSD is undesirable. The global option VIMAGE shall control that and nothing else. R> > For example nfsstatsv1, which is now malloced for non-default vnets and static for R> > the default. Lots of modules still incorrectly update the global one. R> > R> Nope. "struct nfsstatsv1" is a structure that is shared with the NFS R> client, which is R> not vnet'd. As such, a static "struct nfsstatsv1" needs to exist for prison0. R> R> My original solution was to create a separate structure for the server R> side stuff R> (vnet it), but then the result was a messy copying exercise for the system call, R> which returns the entire structure (with client and server info). R> R> Once the client side is vnet'd (I've already had a couple of emails asking me R> to do it, so I plan on starting to work on it) then, yes, the R> structure can become R> a malloc'd vnet'd one and the IS_DEFAULT_VNET can go away. I see the problem. So, we got several things that need to be done to nfsstatsv1: virtualize, separate server and client, possibly make them use counter(9) to avoid races and performance issues. And I'm afraid there is API/ABI that needs to be preserved? Depending on order of doing changes to nfsstatsv1 the amount of work is going to be different. So, if we start with my D38743 the only problem observed is that the client code will use virtual version of the stats. So if somebody decides to run a client from a vnet jail, it will fill this jail stats instead of global. Is it a big deal if the future plan is actually to make client virtualized too? R> I am not sure why you think IS_DEFAULT_VNET() is such a big deal in R> the initialization code? It work. I can see an argument for using both R> SYSINIT() and VNET_SYSINIT() for cases where you have both non-vnet;d R> and vnet'd data to initialize. However, I don't see any problem with using R> IS_DEFAULT_VNET() when needed. My main concern is complexity and its unforseen consequences. The original design of VIMAGE is simple - just wrap every global variable into VNET() macro and you are done. Don't make non-default vnet in any sense different to the default one! It actually works pretty good if the recipe is being followed. Sometimes this leads to pretty large mechanical changes, and people try to avoid that. For example in pf(4) we had quite a long story with getting it stable with VIMAGE, and I think that was because we just didn't do it right from the beginning. So with NFS we started to create complexity and we already got problems. The memory definitely is used after free, see: https://ci.freebsd.org/job/FreeBSD-main-amd64-test/23034/console -- Gleb Smirnoff From nobody Fri Feb 24 07:51:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNMXs2KHDz3tg0Z; Fri, 24 Feb 2023 07:51: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 4PNMXs1tRQz3H8r; Fri, 24 Feb 2023 07:51:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677225101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dyr6mK0YXTZmlebs2lpWw+fEq3Smw3Xx5T6leNT2tR0=; b=ERlbgECkgH3WZn/yOYEcOHPYS6d969AFfCvaG/JNP0s6T2/x6Ue8kF8LCW/3i5K7Ic/KI4 FOSGgtbL5pWqN39QnkmyWUB6l73gGWyYEXoOiHAHTG2+XeQ9zyrsfWKskxwwECP4OtwYba gXv0HnePRmk/eJBLFJFvE1VLsFSfhUFf2+BCYKrNbIipPp2ANsY9+WkSAtet26U+Ivm5SC SDldudtDEvGved9RdvY1okf+pFwH0RzZ0QGPmskHTP0liEWdpIKQdh852FfTUkRNPgEeEz 0EzgCPWIf9QS/Tqd/DZDeqlMnJYZAl4/Kex2ApILf5G3VDNvBYlCGnWyw3F9NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677225101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dyr6mK0YXTZmlebs2lpWw+fEq3Smw3Xx5T6leNT2tR0=; b=N2ZwgNg2l0twZsAZKOIpDv8atLGth/0Ec/wpAX/eAd9h6pTA/IFvbUaNI9Bg4o8zdoGeMo A9Xfhxrk0EH05Tr7RpWfrD/EUyhIm0C6H95GyvpScDmZOP/bQw/Te/azERTH6ksFyHgK2A 4tMOpAQdk53JIS7CuX0FutmomTZJz6UOmZLK43oqzb1vDhnUF5gtCk52TALg1i9W5Ckd4D lVgZV0+uIMQ003H3wNd/r42OASgwwMEFLhEq5+ivet9MLkkSBcDSlyjWKjcjUgC3GLQiz0 upsN3ed1HFewsVi04vANtHjvlJwo4HMbXm+Z6UGvZsStcDGdFMbl3DuTtRDBIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677225101; a=rsa-sha256; cv=none; b=WQYmJvyBkkzc4sBdqvegnaLjSpvJpRR5i0B2YYSXMPxhfglXntWuo3qk+MIGiTrEHpMLxK KkUGCkjCandNeUq+Od1w6DIBwvLVkq4/Vp77+EMCegnmDHSPAy16rgyLDdu3OM3ewSlc3l MSw5j+/DzHbQxmIZoPnlLaG4ahFEeiNj+ZV01XAwQQwcBe8ankSjdVYUWAU+sa7d941Wwt QeP1zMj1PDMpv24Fv1mTvpLgb5WUaJBMJZuUWeVCG5sBnP+PgraGK3ule46PiBQeIvAeLY mBTaBPphYglr3EOs+54Iia6aV7d9UurO2Gj4SW3uXBg3oTcALxOvdwqdR+/HFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNMXs0yBxzFnd; Fri, 24 Feb 2023 07:51: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 31O7pfLY073984; Fri, 24 Feb 2023 07:51:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31O7pfcm073983; Fri, 24 Feb 2023 07:51:41 GMT (envelope-from git) Date: Fri, 24 Feb 2023 07:51:41 GMT Message-Id: <202302240751.31O7pfcm073983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: d0e8ce556627 - releng/13.2 - 13.2: update to BETA3 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: d0e8ce556627662153fd5d207fc86d7917a95065 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=d0e8ce556627662153fd5d207fc86d7917a95065 commit d0e8ce556627662153fd5d207fc86d7917a95065 Author: Colin Percival AuthorDate: 2023-02-24 07:50:45 +0000 Commit: Colin Percival CommitDate: 2023-02-24 07:50:45 +0000 13.2: update to BETA3 Approved by: re (implicit) Sponsored by: https://www.patreon.com/cperciva --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 92aab7aafc2e..f49a96657cdd 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.2" -BRANCH="BETA2" +BRANCH="BETA3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Fri Feb 24 10:21:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNQsW3jffz3tny6; Fri, 24 Feb 2023 10:21: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 4PNQsW2t2Gz3kkq; Fri, 24 Feb 2023 10:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677234079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8yiVtR0HmTX3UhrGoBeyhPaXZ3Sap5gVj7F02No4T8I=; b=t27Txqc2XLhJ22TGfH1aGgPa+PaB8QdneqdVX/DjxvQjIhxRT6bwf+UyDNDS1yKWc+ZfF9 6EAMQJBtBCSUPZ3ot4LX31bwkOZT8+Bz3ugAFXoI3bZ8W4jmsDeCwbDZM6WRYxx4pxTHDN z3gIf/P4GgJSWFwOHFiGMhHJDnxraV6YHCIpDOaqeWvS9EPoOBePLSuPjF4tViH2lVDnFi 07tldZl1/bMPfQGg/lxf52DZLJ70J3qaMAhrsNaO/CTRcsg22q2TDpQx2Dt9PUpZMEsOwp kQO0j8bgAT43u4+E2MIkVAsIUMChnoWg66hvfMgBsnRkV1rX2vMgwxi9OU4J6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677234079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8yiVtR0HmTX3UhrGoBeyhPaXZ3Sap5gVj7F02No4T8I=; b=WsOsmTkgLFlt4NlNhwbLmIDQ1rpnel3ZMzjX8cMGLQeDqyM7aZt1hfEALh6q3uk92FOr+t JImMexGYxY8yzOJS2TL1NKP+ESXkEkGKsoKYxmPFM20JJ9Y3IixOSPX/q8qrUgC8tTCbxf mvHA2WHN3CNH7yTgegK/qUcyNEajhPUZQniIBIIn9ZHkE6rxJO9GwC+tfR/zyKxT87dU8W ozUwCb5TIBZSQR/U1XmjVjTFi7hCMZ3sLLiEZgkCEPkywuCUmprGsno3HFpc5KZUn0n5HE dh1uKx6RwIzAWxussHjT5qkoYj4NalfNBraGbbXRK0A2m4yhYXwqcMz4MkgnTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677234079; a=rsa-sha256; cv=none; b=IZqxXQHwwqa6+hW4fCtcazGjpI6iGGzoVsiMVNLMih0zt5yRFp+5dclh1DOdVHXZIi7LaQ D+dk/EkO5u0UnpedzSV6ib/BzDdKNzwKcLZrzl6ApJOQM78Okn57RHkLuCpQkTYRJFUnz4 30eh/N9f6saSgN9OnwgprXEBeMfkoKt6Amq7RvxyVBVffzWBXUQ0pvI5Lp3lp4R1sm1lnC QfI7Tdvy0vGMlCbZBpqo00P7xZ9+nm54uEYMMI2q/ffc06XVTuZZGOwJbHIw87f2/ierwM StMXQM6u9kBSFMEIn667Bnvy8qLwTxuXcB5RMfw+lTB2qHZzdGTfUXFGmZkb6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNQsW1xX0zKlf; Fri, 24 Feb 2023 10:21: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 31OALJhg086125; Fri, 24 Feb 2023 10:21:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OALJBA086124; Fri, 24 Feb 2023 10:21:19 GMT (envelope-from git) Date: Fri, 24 Feb 2023 10:21:19 GMT Message-Id: <202302241021.31OALJBA086124@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: efeb80031170 - main - netlink: fix NOINET6 build. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efeb8003117073d29bf82c8a69e036b8dbd78352 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=efeb8003117073d29bf82c8a69e036b8dbd78352 commit efeb8003117073d29bf82c8a69e036b8dbd78352 Author: Alexander V. Chernikov AuthorDate: 2023-02-24 10:19:12 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-24 10:21:06 +0000 netlink: fix NOINET6 build. Reported by: Michael Paepcke PR: 269787 MFC after: 3 days --- sys/net/route/nhop_ctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 73c34f675a04..d99b78351952 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -836,16 +836,20 @@ nhop_set_blackhole(struct nhop_object *nh, int blackhole_rt_flag) bzero(&nh->gw_sa, sizeof(nh->gw_sa)); switch (nh->nh_priv->nh_upper_family) { +#ifdef INET case AF_INET: nh->gw4_sa.sin_family = AF_INET; nh->gw4_sa.sin_len = sizeof(struct sockaddr_in); nh->gw4_sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); break; +#endif +#ifdef INET6 case AF_INET6: nh->gw6_sa.sin6_family = AF_INET6; nh->gw6_sa.sin6_len = sizeof(struct sockaddr_in6); nh->gw6_sa.sin6_addr = in6addr_loopback; break; +#endif } } From nobody Fri Feb 24 10:34:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNR9G5BNhz3tpPn; Fri, 24 Feb 2023 10:34: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 4PNR9G4hdMz3mcv; Fri, 24 Feb 2023 10:34:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677234898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=84ovkklmzy+QSrq67pft9MzHJwOnbKnVuqvMWN8GrNY=; b=LcdknxV5Z2oxNcrJr46fieDC4rdHz5yRmj+9VWQiQq+fHSJrSDbigsChz2BjjHGht6RmjK 8f/cxF5AfrbHV2rUt+1tjIsAllsdvf1IDtT7BNlbFJajRABM1YkdAGX9MeIHV3ajb1j3qN J9FeqL15GpNVbsEEgI9E+9vQ6vq/iyK/dz43Awg4uDTGVlz2xEwxFUcRbBi5qfgGbDf4OJ NjafmNe1AJS9SmBJS1vfk/B8IHrKQfozdVG0sUdb7yWEClZnIU09yPnf8h1xVzBUqYoost TISk7XwMEGRrQSOMsaQKfVqAoD6f3vsPl43CmOoy8UASgRraqQBBcwyO+AZc0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677234898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=84ovkklmzy+QSrq67pft9MzHJwOnbKnVuqvMWN8GrNY=; b=Yh2aS1MmpzvYkmj/uDygoGP8lNlP/Zti2hOo9R+0uJHtk+FpAkZlQOHR4YheVIvXQ3lgIE adLi8EUQBli8cP7QK8aJ6pvTE7slL4Tohym4kND5e4tu3LpXc6y6I5vxuZxI6579qsZfpG GkkXQCAaabWogI5Zq2zgR4ptMV8VRpEFS8kbsm4cHeX1MOmFtCF7xd3skH0xeFa0KTlo6n E5stjO9LCJS8zLYcDjhG8J93jQ5dWTJfRemC3NyWapZbmtm1nGdU3EejVGmsrg+CV5vmHc K7TYlTqQMehfhGtx6Y58g+BxpAmYw3q0Itj+bVmn5G6zKWuiIBFnP6lhQ+J0cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677234898; a=rsa-sha256; cv=none; b=XdsclmXHz7SL17l+LyCiw7ukTSxaOlOXo56Y150m2aTmTs/g2AbRMy138XWHKtmvJJvb0C QvIFO5xznQc0ky2q2RuYiEzsioSK9s43qfzuXifC6tRw4miepNSKUX6BLAadYKI9xXcG+K vcQGclHi9/3+HW2GhioPU9yvxyXCSmDqN/Ue3sGKgFrPix66W/FXXpDZ/zDGn0UZmm006G lrw7a5Mh6kxQlCtzbHxMS80HEYosTd8ZKS4/DbN7TqUMTXchEnK+sG07QBhDiklUj5S5Do sKNO+EwbtKM7e1s9xtuk+ObzUnlHsmDoM/BMiWbw2HR4ak1SKT62HgqFT/sNAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNR9G3lC5zL1F; Fri, 24 Feb 2023 10:34: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 31OAYwuH005760; Fri, 24 Feb 2023 10:34:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OAYw6M005759; Fri, 24 Feb 2023 10:34:58 GMT (envelope-from git) Date: Fri, 24 Feb 2023 10:34:58 GMT Message-Id: <202302241034.31OAYw6M005759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: c90cd0a9cf15 - stable/13 - netlink: Fix "version introduced" documentation. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c90cd0a9cf157a30824145cc114716f880df8480 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c90cd0a9cf157a30824145cc114716f880df8480 commit c90cd0a9cf157a30824145cc114716f880df8480 Author: Tom Hukins AuthorDate: 2023-02-24 10:25:35 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-24 10:32:11 +0000 netlink: Fix "version introduced" documentation. netlink(4) and associated features will exist in FreeBSD 14.0 but they will also exist in 13.2, an older version, from commits such as 02b958b and b309249. Pull Request: #651 MFC after: 1 day --- share/man/man3/snl.3 | 2 +- share/man/man4/genetlink.4 | 2 +- share/man/man4/netlink.4 | 2 +- share/man/man4/rtnetlink.4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man3/snl.3 b/share/man/man3/snl.3 index 9fdeeaf56178..78a6b67e88a9 100644 --- a/share/man/man3/snl.3 +++ b/share/man/man3/snl.3 @@ -297,7 +297,7 @@ and The .Dv SNL library appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS This library was implemented by .An Alexander Chernikov Aq Mt melifaro@FreeBSD.org . diff --git a/share/man/man4/genetlink.4 b/share/man/man4/genetlink.4 index 2c5b9b99f994..a21963b5e3bd 100644 --- a/share/man/man4/genetlink.4 +++ b/share/man/man4/genetlink.4 @@ -138,7 +138,7 @@ The following groups are defined: The .Dv NETLINK_GENERIC protocol family appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS The netlink was implementated by .An -nosplit diff --git a/share/man/man4/netlink.4 b/share/man/man4/netlink.4 index fdcc823b01a6..a5cde2852158 100644 --- a/share/man/man4/netlink.4 +++ b/share/man/man4/netlink.4 @@ -344,7 +344,7 @@ or .Re .Sh HISTORY The netlink protocol appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS The netlink was implemented by .An -nosplit diff --git a/share/man/man4/rtnetlink.4 b/share/man/man4/rtnetlink.4 index 2c601251f7b0..56c124e4f854 100644 --- a/share/man/man4/rtnetlink.4 +++ b/share/man/man4/rtnetlink.4 @@ -532,7 +532,7 @@ RTNLGRP_NEIGH Notifies on ARP/NDP neighbor arrival/removal/change The .Dv NETLINK_ROUTE protocol family appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS The netlink was implementated by .An -nosplit From nobody Fri Feb 24 10:39:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNRG22z57z3t5DW; Fri, 24 Feb 2023 10:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PNRG22V2hz3nPD; Fri, 24 Feb 2023 10:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SgZOY+Wna5oWXyqKYKUrjFIJjCyXrAP/mExP5ZcouMM=; b=HTkj3+SvP/6ac0CSTZikREvc0Bd57C8S8Q/gmYrksw2I1bm088GJkQh0QUjhj5kwbmbnEa f6popbd8nneiJqsahMsQtzYE+GQI5cuUL7vb3JAKw61FI0CNOa1jZhoXUuOuY1uIqA+FPk 2OXjjqqAP3Ka29Jt62n5p7XCTq42SnV+Vl5Cg1roQ7Fuu+Nj5Rl7EQgPoBD/qJFUgiULEJ K6RXTSNncoKrLzTKmilRDiGdJ542NyeUD/CE5lfJYjH8fRarS7uOKFaeERTUYA5anSDz8x 1H4WrgR08//Ti9p0c59BvDAK4cog5fLnDrc3GPXCMOFakpVkHsYgHolA9wxqKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SgZOY+Wna5oWXyqKYKUrjFIJjCyXrAP/mExP5ZcouMM=; b=r0Y+5pbR4SGwWqzyCQ8Ajf+TdJIH+z8DwXW/3G3pEIFvZdtXRm3tbPokirV23D7dpSwx4t d/6CHUk5GxJ2RPDdOosAmUDkhOLceprzXn5rioOPxsWzb81s7gCtp+B8+9pSBuT4L4icgd A4nPHxAXpad9wpH1q1CcLKxEl64wDdKZrFs5t/pdbcz9YV5F532VDsF9y8So1lsT1ZPaaK Xaq31x74qk7heffjEX4esn68OTnNNNxG+s3fX/3bhgftLp4pPVOYH4znb9cUU0yoLyD4wP RbIZaERv9hKuHdQ02T3hF/rU8EVlWJUFkIgODv/lF8EFV/Q5x+z+ynBZh8epeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677235146; a=rsa-sha256; cv=none; b=GkccCTWvT52oyZT+uAWSXRo38+AX0UJnryB5xak5mp4PrWJysrevxJuPley8wywVne1Du4 9gj4l+Mw+lWgOGPJAYO7lrT9KZBkQaOeczSm47QsvQNz5PjlzQPfdQRg5zeBl2W4mMaA6I 8xO4zlbbpzd2uaA9YFMaCCVTd1SeaOIdDKCjL2VulHX+6Ld1BbWgXbPaWlistqWP/IbrqB ld2Ks42/EcZGYQEXnDRoW79ZIImUQwUWOeCg/ftBsKdruMagaXut2brBPz5Zxjz32Tz7kZ dMqgicEfh2tmXf5rFj2wkwg97M4Ys4gnkYAIZThedEGKGcdcusq4LMpacopDEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNRG21Y42zKd8; Fri, 24 Feb 2023 10:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31OAd6A8006339; Fri, 24 Feb 2023 10:39:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OAd6LJ006338; Fri, 24 Feb 2023 10:39:06 GMT (envelope-from git) Date: Fri, 24 Feb 2023 10:39:06 GMT Message-Id: <202302241039.31OAd6LJ006338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: f9f0d2f475e0 - stable/13 - netlink: fix style(9) after c3d3f3594fdf. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f9f0d2f475e05ad88120ef1c0a645d2aa6dc3e94 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f9f0d2f475e05ad88120ef1c0a645d2aa6dc3e94 commit f9f0d2f475e05ad88120ef1c0a645d2aa6dc3e94 Author: Alexander V. Chernikov AuthorDate: 2023-02-24 10:37:51 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-24 10:38:41 +0000 netlink: fix style(9) after c3d3f3594fdf. No functional changes. Reported by: karels --- sys/kern/uipc_sockbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 277965412779..aa8c2345c21f 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -693,7 +693,7 @@ sbsetopt(struct socket *so, int cmd, u_long cc) if (*lowat > *hiwat) *lowat = *hiwat; } else { - u_long limit = sogetmaxbuf(so); + u_long limit = sogetmaxbuf(so); if (!sbreserve_locked_limit(sb, cc, so, limit, curthread)) error = ENOBUFS; } From nobody Fri Feb 24 10:40:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNRJ55qstz3tphb; Fri, 24 Feb 2023 10:40:53 +0000 (UTC) (envelope-from melifaro@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 4PNRJ55NRVz3p06; Fri, 24 Feb 2023 10:40:53 +0000 (UTC) (envelope-from melifaro@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235253; 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=ls1+5o/x4zXkjkq1L5u9a792AqbAhC9V57TAM1XHLwA=; b=V9+QK7InVcGjeYPn4aje0Tai6W4qQyk8Z6MMwEXbvB7nQLnw2Lgp7Olk8hlKXKVENUxuQB 4WP6w2WI1s5+jrnq+dezAwAnUn8zRq3CpFMCMNpSLTb/tGW798XRfK87gbgVVhSE/K0j9i h1kls+d7mski1XOj2X4wOiR7Kk+jElpHBt8tXbhilFclbxMm+T1txVjr5oVwN8EnydB7ST bSyAblbE+VqYifN1Y1DG4yeg+lnNr2ku6l70kPmxMi98+XQtswTh0QfPmsY/dJQD+gZjoE cMbKA5EtkPwM6dg606IUzJcEXeXaIOCqXIpCK6QGdXc2ZaGbNpVo79hkYf74/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235253; 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=ls1+5o/x4zXkjkq1L5u9a792AqbAhC9V57TAM1XHLwA=; b=Zp8sZqde0j3atEZXQi+/hrBRidfczwISIYIa6BDLB5E7Tf1Oa1Pw7UiOHUK47k+/LxYMQq LOf3q6UiT03rmdGTki6IaFGdoHS1PT6VlW0dYFXnyg5XezfTtIOno/9vyhvcaVjnGWvDV/ CTvxdNHrEi8czkSonRzw+3BivOBmVFbX+j2mOp9dZenQqg3UPl2tsBvrhUAdBZayvkNCoH 8zTjoYZTOpsRTjy+YRLvon9O/LtAj2wqm6YFRKE88jKLd22oNhaMdnP3txs//iLClsC+aR gngwyhtw8m+fycH03Lqj6556GHD9hAa37Oj7Ug4aouJ1h/383yGz8KqKIOFLOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677235253; a=rsa-sha256; cv=none; b=cloFxotdSKWhJnWO/PWib3GcoH/eaQCUygzZttwEWhRBit/cTZVP430ukk2/DwC/kWXrrp B1jf35NMumFUA/EgXbDTeC153c+2R+zKFCF+34ce1U8MuvsbnHviE0tS6ZfBLpEkc/AcRy dYIUUVwsz/MnzJlkY85zBRcicLNo6ndnJZmCV9UIa08FWsuKeeavU+78VMfcpfrY7D0e1+ +dT37M8FygwlT8hpkdk86/yibQqLvUI698Bw5pqTtKSQl6HmKYS3iPGmbAyspvq5o8oWtV zRaSc0Q5gQCsh1fmDNcHQhn/CprZp7LTVgMie8suxebV3mpMMX7mT54/hZOWvA== Received: from smtpclient.apple (unknown [IPv6:2a02:8084:d6bb:510:8470:49be:b746:8dbc]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: melifaro/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PNRJ50tFSzt2q; Fri, 24 Feb 2023 10:40:53 +0000 (UTC) (envelope-from melifaro@freebsd.org) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: git: c3d3f3594fdf - stable/13 - netlink: allow to override sb_max for netlink sockets. From: Alexander Chernikov In-Reply-To: <721D2CDA-6740-482D-BDC9-C5EFE56F7AE0@karels.net> Date: Fri, 24 Feb 2023 10:40:40 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <2F9CFF0F-F14C-401F-97D6-E83B3842A599@FreeBSD.org> References: <202302101619.31AGJESZ073291@gitrepo.freebsd.org> <721D2CDA-6740-482D-BDC9-C5EFE56F7AE0@karels.net> To: Mike Karels X-Mailer: Apple Mail (2.3731.400.51.1.1) X-ThisMailContainsUnwantedMimeParts: N > On 10 Feb 2023, at 17:00, Mike Karels wrote: >=20 > On 10 Feb 2023, at 10:19, Alexander V. Chernikov wrote: >=20 >> The branch stable/13 has been updated by melifaro: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc3d3f3594fdf653392936594b75ec330= af12d7fa >>=20 >> commit c3d3f3594fdf653392936594b75ec330af12d7fa >> Author: Alexander V. Chernikov >> AuthorDate: 2023-02-10 16:07:17 +0000 >> Commit: Alexander V. Chernikov >> CommitDate: 2023-02-10 16:07:22 +0000 >>=20 >> netlink: allow to override sb_max for netlink sockets. >>=20 >> Netlink sockets sometimes require larger buffers than other = sockets. >> For example, full-view IPv4 dump sent via netlink may consume 50+ = megabytes. >> The desired buffer may be bigger than the system maximum `sb_max`. >> FreeBSD HEAD has a mechanism for overriding protocol `setsockopt()` = handler, >> which netlink uses to permit buffer reservations beyond `sb_max`. >> This behaviour is handy as it doesn't require system administrator = to lift >> the limits for other sockets. >> Stable/13 lack such muchanism, so a different approach has to be = used. >> This diff is a direct commit to stable/13 and it simply copies the = logic from >> Netlink in -HEAD for checking if the larger buffer size should be = permitted. >>=20 >> Differential Revision: https://reviews.freebsd.org/D38472 >> --- >> sys/kern/uipc_sockbuf.c | 3 ++- >> sys/kern/uipc_socket.c | 10 ++++++++++ >> sys/sys/sockopt.h | 1 + >> 3 files changed, 13 insertions(+), 1 deletion(-) >>=20 >> diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c >> index cbfcc0e5fe95..277965412779 100644 >> --- a/sys/kern/uipc_sockbuf.c >> +++ b/sys/kern/uipc_sockbuf.c >> @@ -693,7 +693,8 @@ sbsetopt(struct socket *so, int cmd, u_long cc) >> if (*lowat > *hiwat) >> *lowat =3D *hiwat; >> } else { >> - if (!sbreserve_locked(sb, cc, so, curthread)) >> + u_long limit =3D sogetmaxbuf(so); >=20 > Spaces instead of tabs. >=20 > Mike Ups. Haven=E2=80=99t noticed that one. Fixed in f9f0d2f475e05ad88120ef1c0a645d2aa6dc3e94. Thank you! >=20 >> + if (!sbreserve_locked_limit(sb, cc, so, limit, curthread)) >> error =3D ENOBUFS; >> } >> if (error =3D=3D 0) >> diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c >> index f8931b653a4d..fdf718de2483 100644 >> --- a/sys/kern/uipc_socket.c >> +++ b/sys/kern/uipc_socket.c >> @@ -128,6 +128,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -2975,6 +2976,15 @@ sooptcopyin(struct sockopt *sopt, void *buf, = size_t len, size_t minlen) >> return (0); >> } >>=20 >> +u_long >> +sogetmaxbuf(struct socket *so) >> +{ >> + if (so->so_proto->pr_domain->dom_family !=3D PF_NETLINK) >> + return (sb_max); >> + u_long nl_maxsockbuf =3D 512 * 1024 * 1024; /* 512M, XXX: init = based on physmem */ >> + return ((priv_check(curthread, PRIV_NET_ROUTE) =3D=3D 0) ? = nl_maxsockbuf : sb_max); >> +} >> + >> /* >> * Kernel version of setsockopt(2). >> * >> diff --git a/sys/sys/sockopt.h b/sys/sys/sockopt.h >> index cb7fc3ffca27..d01d62f21680 100644 >> --- a/sys/sys/sockopt.h >> +++ b/sys/sys/sockopt.h >> @@ -68,5 +68,6 @@ int accept_filt_getopt(struct socket *, struct = sockopt *); >> int accept_filt_setopt(struct socket *, struct sockopt *); >> int so_setsockopt(struct socket *so, int level, int optname, >> void *optval, size_t optlen); >> +u_long sogetmaxbuf(struct socket *so); >>=20 >> #endif /* _SYS_SOCKOPT_H_ */ From nobody Fri Feb 24 10:44:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNRNT0bt1z3t5Fb; Fri, 24 Feb 2023 10:44: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 4PNRNS678kz3pmD; Fri, 24 Feb 2023 10:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A19YPah/hQ2t22d46iXGYB2pTATdf2T76pn3EaecZCU=; b=vfaq1garIVdrdsA8phpnxIME+9Wz719OkWRbVvCFu944YkO7/Qrgcil/vQ1eJ2/ln+CnZX H9oEFk9xGKJj4GMcRzE+LRsBZkUUBjUTXeX7hfznlXYrO0cR3060L0G0BV9xIQ5xmBGk7Q 9E2E3gMhCHypwxt6KM3CupfgCEvrSZgXB8EPn8T5XUlV7yjzQ3TLh5j/FzyaLfjbVQ4iS2 JFxuiZu9kkdQLDa/ya+fxi7gp+5HBzE75C4O+aoVkB0WmgfQwztfumx3GY+OqBaVDVnRpr 5P5kFdiaDOqLKucZNzrMWYik9FQabGoanYDsHnE+dcUfX190hESDo5Sh4uuyaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A19YPah/hQ2t22d46iXGYB2pTATdf2T76pn3EaecZCU=; b=GlDG33FmRvOrltlAZvTcYQy+xKChyFZ//v6OSzsDTtFo0YJN+XGAOPWsVSGZrhxHWw/Pip GGHPiug6mwEo7zXeIRi2dSwxHJd86K+JMtTfufIK4ZYoKf71O2MfeNDvaSeUg/7D4RgOpz 9feJ7EUFrALtbEjdgjPqYj5gYgMOpM9IRQvK2w2ZyPOYf0l7S3uKKXjoG1eedvoI9n5XMp Euum3k1WLC2fRhNXU+NA8HzkagMTr+cP27VfW7koe5zeJYMfmUs1XPofXXcLCkSM8eYRks SzxWLtgOv8azCc5uBrCs648qngw8sBmN6d+8Ov6blFwlAl/jQprEgCwwSEfdiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677235480; a=rsa-sha256; cv=none; b=Ap8LXm1KSn8M1fYLz3XPOHnHh2F1I/Z4XtRKLu4hP/bvwkwXSOeTcREbW5puJ91KqmIRoD 5XkqJPf1ryAhm1SnrtNExO9++h1b7vNysPZm5juG14Cm8o9YEslMw4wG053DXVcxph26sx Af1fJJgj8h9+sw9SXzqIXV6e8uTD+4OXsV3xSg69j4MwYo3afpXryA98vbU1hrP+IHza7v 4iidXt2iRahdX4C89uw27hsnqFtI6ugWM45XZc+Hzmenc//kZLYdliEdO5qirQWVXl3e9b 3+KwW/Wv69Els3RJ+x1RlHoH0By5lB3yNQ8Z62jLkgtKawItHfIGfTPkw03uJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNRNS5DL1zLG9; Fri, 24 Feb 2023 10:44: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 31OAieiq019890; Fri, 24 Feb 2023 10:44:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OAieAa019889; Fri, 24 Feb 2023 10:44:40 GMT (envelope-from git) Date: Fri, 24 Feb 2023 10:44:40 GMT Message-Id: <202302241044.31OAieAa019889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 07595bd3c55a - stable/13 - testing: handling non-root users with VNETs in pytest-based tests. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 07595bd3c55a1c63ca49d7e250346a90910c206d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=07595bd3c55a1c63ca49d7e250346a90910c206d commit 07595bd3c55a1c63ca49d7e250346a90910c206d Author: Alexander V. Chernikov AuthorDate: 2023-02-09 14:31:34 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-24 10:43:30 +0000 testing: handling non-root users with VNETs in pytest-based tests. Currently isolation and resource requirements are handled directly by the kyua runner, based on the requirements specified by the test. It works well for simple tests, but may cause discrepancy with tests doing complex pre-setups. For example, all tests that perform VNET setups require root access to properly function. This change adds additional handling of the "require_user" property within the python testing framework. Specifically, it requests root access if the test class signals its root requirements and drops privileges to the desired user after performing the pre-setup. Differential Revision: https://reviews.freebsd.org/D37923 MFC after: 2 weeks (cherry picked from commit 6332ef8941999b0c074d1ece0e1e108447c70b98) --- tests/atf_python/atf_pytest.py | 54 ++++++++++++++++++++++++++++++++++++---- tests/atf_python/sys/net/vnet.py | 3 +++ tests/atf_python/utils.py | 23 ++++++++++++++++- tests/conftest.py | 26 +++++++++++++------ 4 files changed, 92 insertions(+), 14 deletions(-) diff --git a/tests/atf_python/atf_pytest.py b/tests/atf_python/atf_pytest.py index d530c7b4515c..db7244d3234b 100644 --- a/tests/atf_python/atf_pytest.py +++ b/tests/atf_python/atf_pytest.py @@ -3,6 +3,7 @@ from typing import Any from typing import Dict from typing import List from typing import NamedTuple +from typing import Optional from typing import Tuple import pytest @@ -51,10 +52,32 @@ class ATFTestObj(object): return line return obj.name + @staticmethod + def _convert_user_mark(mark, obj, ret: Dict): + username = mark.args[0] + if username == "unprivileged": + # Special unprivileged user requested. + # First, require the unprivileged-user config option presence + key = "require.config" + if key not in ret: + ret[key] = "unprivileged_user" + else: + ret[key] = "{} {}".format(ret[key], "unprivileged_user") + # Check if the framework requires root + test_cls = ATFHandler.get_test_class(obj) + if test_cls and getattr(test_cls, "NEED_ROOT", False): + # Yes, so we ask kyua to run us under root instead + # It is up to the implementation to switch back to the desired + # user + ret["require.user"] = "root" + else: + ret["require.user"] = username + + def _convert_marks(self, obj) -> Dict[str, Any]: wj_func = lambda x: " ".join(x) # noqa: E731 _map: Dict[str, Dict] = { - "require_user": {"name": "require.user"}, + "require_user": {"handler": self._convert_user_mark}, "require_arch": {"name": "require.arch", "fmt": wj_func}, "require_diskspace": {"name": "require.diskspace"}, "require_files": {"name": "require.files", "fmt": wj_func}, @@ -66,6 +89,9 @@ class ATFTestObj(object): ret = {} for mark in obj.iter_markers(): if mark.name in _map: + if "handler" in _map[mark.name]: + _map[mark.name]["handler"](mark, obj, ret) + continue name = _map[mark.name].get("name", mark.name) if "fmt" in _map[mark.name]: val = _map[mark.name]["fmt"](mark.args[0]) @@ -91,8 +117,24 @@ class ATFHandler(object): state: str reason: str - def __init__(self): + def __init__(self, report_file_name: Optional[str]): self._tests_state_map: Dict[str, ReportStatus] = {} + self._report_file_name = report_file_name + self._report_file_handle = None + + def setup_configure(self): + fname = self._report_file_name + if fname: + self._report_file_handle = open(fname, mode="w") + + def setup_method_pre(self, item): + """Called before actually running the test setup_method""" + # Check if we need to manually drop the privileges + for mark in item.iter_markers(): + if mark.name == "require_user": + cls = self.get_test_class(item) + cls.TARGET_USER = mark.args[0] + break def override_runtest(self, obj): # Override basic runtest command @@ -220,7 +262,9 @@ class ATFHandler(object): # global failure self.set_report_state(test_name, state, reason) - def write_report(self, path): + def write_report(self): + if self._report_file_handle is None: + return if self._tests_state_map: # If we're executing in ATF mode, there has to be just one test # Anyway, deterministically pick the first one @@ -230,8 +274,8 @@ class ATFHandler(object): line = test.state else: line = "{}: {}".format(test.state, test.reason) - with open(path, mode="w") as f: - print(line, file=f) + print(line, file=self._report_file_handle) + self._report_file_handle.close() @staticmethod def get_atf_vars() -> Dict[str, str]: diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py index 1f61269ffe6c..c0e0a24f6687 100644 --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -329,6 +329,7 @@ class ObjectsMap(NamedTuple): class VnetTestTemplate(BaseTest): + NEED_ROOT: bool = True TOPOLOGY = {} def _get_vnet_handler(self, vnet_alias: str): @@ -374,6 +375,7 @@ class VnetTestTemplate(BaseTest): # Do unbuffered stdout for children # so the logs are present if the child hangs sys.stdout.reconfigure(line_buffering=True) + self.drop_privileges() handler(vnet) def setup_topology(self, topo: Dict, topology_id: str): @@ -465,6 +467,7 @@ class VnetTestTemplate(BaseTest): # Save state for the main handler self.iface_map = obj_map.iface_map self.vnet_map = obj_map.vnet_map + self.drop_privileges() def cleanup(self, test_id: str): # pytest test id: file::class::test_name diff --git a/tests/atf_python/utils.py b/tests/atf_python/utils.py index fddfadac9a56..c8146b943ce9 100644 --- a/tests/atf_python/utils.py +++ b/tests/atf_python/utils.py @@ -1,8 +1,10 @@ #!/usr/bin/env python3 import os +import pwd from ctypes import CDLL from ctypes import get_errno from ctypes.util import find_library +from typing import Dict from typing import List from typing import Optional @@ -31,6 +33,8 @@ libc = LibCWrapper() class BaseTest(object): + NEED_ROOT: bool = False # True if the class needs root privileges for the setup + TARGET_USER = None # Set to the target user by the framework REQUIRED_MODULES: List[str] = [] def _check_modules(self): @@ -41,9 +45,26 @@ class BaseTest(object): pytest.skip( "kernel module '{}' not available: {}".format(mod_name, err_str) ) + @property + def atf_vars(self) -> Dict[str, str]: + px = "_ATF_VAR_" + return {k[len(px):]: v for k, v in os.environ.items() if k.startswith(px)} + + def drop_privileges_user(self, user: str): + uid = pwd.getpwnam(user)[2] + print("Dropping privs to {}/{}".format(user, uid)) + os.setuid(uid) + + def drop_privileges(self): + if self.TARGET_USER: + if self.TARGET_USER == "unprivileged": + user = self.atf_vars["unprivileged-user"] + else: + user = self.TARGET_USER + self.drop_privileges_user(user) @property - def test_id(self): + def test_id(self) -> str: # 'test_ip6_output.py::TestIP6Output::test_output6_pktinfo[ipandif] (setup)' return os.environ.get("PYTEST_CURRENT_TEST").split(" ")[0] diff --git a/tests/conftest.py b/tests/conftest.py index b5ce5ae2286b..687f6bde375e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,10 +7,14 @@ PLUGIN_ENABLED = False DEFAULT_HANDLER = None +def set_handler(config): + global DEFAULT_HANDLER, PLUGIN_ENABLED + DEFAULT_HANDLER = ATFHandler(report_file_name=config.option.atf_file) + PLUGIN_ENABLED = True + return DEFAULT_HANDLER + + def get_handler(): - global DEFAULT_HANDLER - if DEFAULT_HANDLER is None: - DEFAULT_HANDLER = ATFHandler() return DEFAULT_HANDLER @@ -81,11 +85,9 @@ def pytest_configure(config): "markers", "timeout(dur): int/float with max duration in sec" ) - global PLUGIN_ENABLED - PLUGIN_ENABLED = config.option.atf - if not PLUGIN_ENABLED: + if not config.option.atf: return - get_handler() + handler = set_handler(config) if config.option.collectonly: # Need to output list of tests to stdout, hence override @@ -93,6 +95,8 @@ def pytest_configure(config): reporter = config.pluginmanager.getplugin("terminalreporter") if reporter: config.pluginmanager.unregister(reporter) + else: + handler.setup_configure() def pytest_collection_modifyitems(session, config, items): @@ -114,6 +118,12 @@ def pytest_collection_finish(session): handler.list_tests(session.items) +def pytest_runtest_setup(item): + if PLUGIN_ENABLED: + handler = get_handler() + handler.setup_method_pre(item) + + def pytest_runtest_logreport(report): if PLUGIN_ENABLED: handler = get_handler() @@ -123,4 +133,4 @@ def pytest_runtest_logreport(report): def pytest_unconfigure(config): if PLUGIN_ENABLED and config.option.atf_file: handler = get_handler() - handler.write_report(config.option.atf_file) + handler.write_report() From nobody Fri Feb 24 10:44:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNRNV1kfcz3t5Hj; Fri, 24 Feb 2023 10:44: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 4PNRNV0G2kz3pgg; Fri, 24 Feb 2023 10:44:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UPrIl6a5yDvu0+xiSSxtIDz8nqSev7ViBz2VLCxpJKo=; b=U/c3WMCbApvZPsbI4KPbCz8iFucZAFdz8I9Te5F+yUKb3E4gq+UC8lWW1N9GOnBDyg7jZw 4w7STPMwbgnaWd7V8jyr0nfzJNdoh5EMdLEBgwX4G3D6IY6S4/p+0yL5i47n9/tbsygWzY N2SI19MJmDeX1H+ntgGbHyAFA0Cth2XY3UuunmWbEbx9ry9CVGzDuqIhseHn1hJ68cMFqI AG0wzi0I8UMuygm803JwRzyLdBcqXLerSYqVuIyHjzjabIbf+ld+ONTU9i93U+uBAistVZ BxVeXo0NP2y4dIddguXnVTMdQYemXslEyCYsFmZ9NnkB34NnKcbqxUQnw2Xu2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UPrIl6a5yDvu0+xiSSxtIDz8nqSev7ViBz2VLCxpJKo=; b=LGHy+YS1C+bXoZZwt0Mgk6DfIRAjEp4Us94i46tGbj8/MUHxMcJSYQxmo4ma7y5Te/Ic5n CrLkwy4Ig/wGC/Cg5d1vCYnX0OHGRWQITNmSP7FZA51r+6ek7CXKAj8uiow/g+SnOgMfL5 YfCChXS/2Hhv1B2u2xogPc//HCNdcTWXFRleF4Lyfnkskr4AuwCme4J0ybxINgBmSxiYQp DLr8Ayd87ybO6kB5NOu0XKAgg5YbEv14G3uLsmAQ/qucXEBO6xYLc5l9+aS0G+0DtrtFxb IVumnamG5tf+hmspFuQ0pyuyy6colYbh+b5kob7HlE92fQnm5SByW997JPZ1fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677235482; a=rsa-sha256; cv=none; b=dS5wg6ewdps37+OMb9c2K6zkHRG7wrd6xjrQh5ZDHwSzuJpn00vhtztcIcpBGuE1jRXTce uRKEbAuog3O/dFotY+NJDhgTlwvCJVmm4lmyDXQL3uMb1wpHxkMTbZ2MqJ5/uQNstzO+eS uzFKmVliVDdIYD96suROKwo6IpvxI+vBn9ZKcOADhADc7MAl4m79QBN9uXqImNlha722PC edX+SIUJ1I60uuk/SxDEpqgd8vq1HYFT9ODgv71nOJqoCo4e8HqpQu0Am56HahpP1pMC+K 29fjZGhLYJXfUT8SjuCssvF379EHFAbGCFXKS/jQGIuL3eIQ0LtZR6mgqLANqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNRNT5sN3zKdZ; Fri, 24 Feb 2023 10:44: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 31OAifEN019912; Fri, 24 Feb 2023 10:44:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OAifiO019911; Fri, 24 Feb 2023 10:44:41 GMT (envelope-from git) Date: Fri, 24 Feb 2023 10:44:41 GMT Message-Id: <202302241044.31OAifiO019911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 240ee0183fa1 - stable/13 - netlink: fix IPv6 route addition with link-local gateway List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 240ee0183fa190502a5e1f163c49f336f8f10cd4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=240ee0183fa190502a5e1f163c49f336f8f10cd4 commit 240ee0183fa190502a5e1f163c49f336f8f10cd4 Author: Alexander V. Chernikov AuthorDate: 2023-02-20 14:24:01 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-24 10:43:50 +0000 netlink: fix IPv6 route addition with link-local gateway Currently kernel assumes that IPv6 gateway address is in "embedded" form - that is, for the link-local IPv6 addresses, interface index is embedded in bytes 2 and 3 of the address. Fix address embedding in netlink by wrapping nhop_set_gw() in the netlink-specific nl_set_nexthop_gw(), which does such embedding automatically. Reported by: Marek Zarychta MFC after: 3 days (cherry picked from commit c7c348162101a70b1f99299578dabe1d3b100e48) --- sys/netlink/route/nexthop.c | 42 ++++++++++++++++++++++++++++++++++++------ sys/netlink/route/route_var.h | 2 ++ sys/netlink/route/rt.c | 15 ++++++++++++--- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/sys/netlink/route/nexthop.c b/sys/netlink/route/nexthop.c index e9f008842644..63e491687249 100644 --- a/sys/netlink/route/nexthop.c +++ b/sys/netlink/route/nexthop.c @@ -741,8 +741,34 @@ newnhg(struct unhop_ctl *ctl, struct nl_parsed_nhop *attrs, struct user_nhop *un return (0); } +/* + * Sets nexthop @nh gateway specified by @gw. + * If gateway is IPv6 link-local, alters @gw to include scopeid equal to + * @ifp ifindex. + * Returns 0 on success or errno. + */ +int +nl_set_nexthop_gw(struct nhop_object *nh, struct sockaddr *gw, struct ifnet *ifp, + struct nl_pstate *npt) +{ +#ifdef INET6 + if (gw->sa_family == AF_INET6) { + struct sockaddr_in6 *gw6 = (struct sockaddr_in6 *)gw; + if (IN6_IS_ADDR_LINKLOCAL(&gw6->sin6_addr)) { + if (ifp == NULL) { + NLMSG_REPORT_ERR_MSG(npt, "interface not set"); + return (EINVAL); + } + in6_set_unicast_scopeid(&gw6->sin6_addr, ifp->if_index); + } + } +#endif + nhop_set_gw(nh, gw, true); + return (0); +} + static int -newnhop(struct nl_parsed_nhop *attrs, struct user_nhop *unhop) +newnhop(struct nl_parsed_nhop *attrs, struct user_nhop *unhop, struct nl_pstate *npt) { struct ifaddr *ifa = NULL; struct nhop_object *nh; @@ -750,17 +776,17 @@ newnhop(struct nl_parsed_nhop *attrs, struct user_nhop *unhop) if (!attrs->nha_blackhole) { if (attrs->nha_gw == NULL) { - NL_LOG(LOG_DEBUG, "missing NHA_GATEWAY"); + NLMSG_REPORT_ERR_MSG(npt, "missing NHA_GATEWAY"); return (EINVAL); } if (attrs->nha_oif == NULL) { - NL_LOG(LOG_DEBUG, "missing NHA_OIF"); + NLMSG_REPORT_ERR_MSG(npt, "missing NHA_OIF"); return (EINVAL); } if (ifa == NULL) ifa = ifaof_ifpforaddr(attrs->nha_gw, attrs->nha_oif); if (ifa == NULL) { - NL_LOG(LOG_DEBUG, "Unable to determine default source IP"); + NLMSG_REPORT_ERR_MSG(npt, "Unable to determine default source IP"); return (EINVAL); } } @@ -777,7 +803,11 @@ newnhop(struct nl_parsed_nhop *attrs, struct user_nhop *unhop) if (attrs->nha_blackhole) nhop_set_blackhole(nh, NHF_BLACKHOLE); else { - nhop_set_gw(nh, attrs->nha_gw, true); + error = nl_set_nexthop_gw(nh, attrs->nha_gw, attrs->nha_oif, npt); + if (error != 0) { + nhop_free(nh); + return (error); + } nhop_set_transmit_ifp(nh, attrs->nha_oif); nhop_set_src(nh, ifa); } @@ -839,7 +869,7 @@ rtnl_handle_newnhop(struct nlmsghdr *hdr, struct nlpcb *nlp, if (attrs.nha_group) error = newnhg(ctl, &attrs, unhop); else - error = newnhop(&attrs, unhop); + error = newnhop(&attrs, unhop, npt); if (error != 0) { free(unhop, M_NETLINK); diff --git a/sys/netlink/route/route_var.h b/sys/netlink/route/route_var.h index f1e522c7ae05..f3b1d7d929a5 100644 --- a/sys/netlink/route/route_var.h +++ b/sys/netlink/route/route_var.h @@ -104,6 +104,8 @@ void rtnl_iface_drivers_register(void); void rtnl_nexthops_init(void); struct nhop_object *nl_find_nhop(uint32_t fibnum, int family, uint32_t uidx, int nh_flags, int *perror); +int nl_set_nexthop_gw(struct nhop_object *nh, struct sockaddr *gw, + struct ifnet *ifp, struct nl_pstate *npt); #endif diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index aca69e75fea8..534186447b4d 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -736,7 +736,11 @@ create_nexthop_one(struct nl_parsed_route *attrs, struct rta_mpath_nh *mpnh, if (nh == NULL) return (ENOMEM); - nhop_set_gw(nh, mpnh->gw, true); + error = nl_set_nexthop_gw(nh, mpnh->gw, mpnh->ifp, npt); + if (error != 0) { + nhop_free(nh); + return (error); + } if (mpnh->ifp != NULL) nhop_set_transmit_ifp(nh, mpnh->ifp); nhop_set_rtflags(nh, attrs->rta_rtflags); @@ -800,8 +804,13 @@ create_nexthop_from_attrs(struct nl_parsed_route *attrs, *perror = ENOMEM; return (NULL); } - if (attrs->rta_gw != NULL) - nhop_set_gw(nh, attrs->rta_gw, true); + if (attrs->rta_gw != NULL) { + *perror = nl_set_nexthop_gw(nh, attrs->rta_gw, attrs->rta_oif, npt); + if (*perror != 0) { + nhop_free(nh); + return (NULL); + } + } if (attrs->rta_oif != NULL) nhop_set_transmit_ifp(nh, attrs->rta_oif); if (attrs->rtax_mtu != 0) From nobody Fri Feb 24 10:44:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNRNW1ssQz3t5QG; Fri, 24 Feb 2023 10:44: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 4PNRNW0wHYz3pkF; Fri, 24 Feb 2023 10:44:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1GNK0Yf0jkm0TyRmi2ekk/7tCQqc5wDxxZzQy+idO8w=; b=psi3HgRRjcJ9Q1rXHzmjZGZPvH4vDRckxzFHn+rc8aBoshwCwbqieolLUrXBGLrHcBvru3 rqyPZc0wFBjCwQfICrSOtL7O3ULo//QFEijiE9iMii1wAqzbTQPpd/vnB59NuYHib47hza MtmR3myl9hFC6qj2asgvdbhyO8NsPOtPgw3vUZvmUwcW8fkkQqiiTd/4e3+4nxKZTrYZuM 7eY2Qo6eqX2P66nVg73vqrdtZlk945KYzB0R60sfA3JOlU642rDgwcZLULPJN5NHF5UXin vIBkf7dXWCEe9sESSEwabKFK7Fr8FWgYGUEbyLxiFdaMkGvfOG6z0Y69KoAl+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677235483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1GNK0Yf0jkm0TyRmi2ekk/7tCQqc5wDxxZzQy+idO8w=; b=v15N2BjDvV2DZoRxs5YlCHvY3jcmt0rSGZiztezuiQzANpSgT7JJoTrnPhsBHKPn84JTf9 wvWy5sXO03xU3N8XbRAkZ2C/qADZ6/1o0H0vMveUXIx8KUyiWRUeasFJtK00yY5G0w8r4s uUW4oZXLfczO12abzsiyNYzSsLgMi+vFdaoa/rti3jUVmYHQamv987I0RyWZcGUuomLTgh fsRS5aUkdZmRzj4Q7xiUOaYS7Z777oHfGyUG15p/wa1ebaLPf8hqsolOAX47+M+F8pNanR 4iLcYoJVniMtt/kz4yqeHOWLJhxz2h7/LmIg0E09btaFjjeuiWLDzCMB587MCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677235483; a=rsa-sha256; cv=none; b=JqUOROSUN2BrcEVsEI4GuIfc2pCioOkAp/hUYhhmFapiHRl70gb2F85hI1Cz+pk8cURTcr bGV9YSCa3SMslMu5X+gL+1PwkrIRhEl14k6tdka3rbcJv/HMqdONtf+lCXioKEkBeyNZPh tmsa7zHp66e5VoYxWj/Pn7FGZHrgFqQ/LIPP5P+m5JbBAJk59cKGWDWEwUFCGFrz7VVGoV xvnJE/0R4YIg1UbehunHjyfKyl2IJ5LtHhQE/ovnv69lDJjTQy1WKAV29Od/FBClUViVsk A7FRt7HVZ3cAp9/BWlJrfp+Dz4randkbJHUS9gghY2c689L4DbzgC/DpqZuxXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNRNV70STzLRL; Fri, 24 Feb 2023 10:44: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 31OAigJw019938; Fri, 24 Feb 2023 10:44:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OAigeV019937; Fri, 24 Feb 2023 10:44:42 GMT (envelope-from git) Date: Fri, 24 Feb 2023 10:44:42 GMT Message-Id: <202302241044.31OAigeV019937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: d101991d8dcc - stable/13 - netlink: clear IPv6 embedded scope when dumping route gateways. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d101991d8dcc1e056d1c06ca83b88826f4d65ae5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=d101991d8dcc1e056d1c06ca83b88826f4d65ae5 commit d101991d8dcc1e056d1c06ca83b88826f4d65ae5 Author: Alexander V. Chernikov AuthorDate: 2023-02-21 12:25:58 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-24 10:44:02 +0000 netlink: clear IPv6 embedded scope when dumping route gateways. Reported by: zarychtam@plan-b.pwste.edu.pl MFC after: 3 days (cherry picked from commit b9b2184322da85e1f4d52e3b0a6322dd214210ec) --- sys/netlink/route/rt.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 534186447b4d..dabdaea3e03b 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -123,7 +124,9 @@ rc_get_nhop(const struct rib_cmd_info *rc) static void dump_rc_nhop_gw(struct nl_writer *nw, const struct nhop_object *nh) { +#ifdef INET6 int upper_family; +#endif switch (nhop_get_neigh_family(nh)) { case AF_LINK: @@ -132,19 +135,27 @@ dump_rc_nhop_gw(struct nl_writer *nw, const struct nhop_object *nh) case AF_INET: nlattr_add(nw, NL_RTA_GATEWAY, 4, &nh->gw4_sa.sin_addr); break; +#ifdef INET6 case AF_INET6: upper_family = nhop_get_upper_family(nh); if (upper_family == AF_INET6) { - nlattr_add(nw, NL_RTA_GATEWAY, 16, &nh->gw6_sa.sin6_addr); + struct in6_addr gw6 = nh->gw6_sa.sin6_addr; + in6_clearscope(&gw6); + + nlattr_add(nw, NL_RTA_GATEWAY, 16, &gw6); } else if (upper_family == AF_INET) { /* IPv4 over IPv6 */ + struct in6_addr gw6 = nh->gw6_sa.sin6_addr; + in6_clearscope(&gw6); + char buf[20]; struct rtvia *via = (struct rtvia *)&buf[0]; via->rtvia_family = AF_INET6; - memcpy(via->rtvia_addr, &nh->gw6_sa.sin6_addr, 16); + memcpy(via->rtvia_addr, &gw6, 16); nlattr_add(nw, NL_RTA_VIA, 17, via); } break; +#endif } } From nobody Fri Feb 24 12:20:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNTVx472Zz3tB9y; Fri, 24 Feb 2023 12:20: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 4PNTVx3Ss2z3wrM; Fri, 24 Feb 2023 12:20:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677241225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3L1Z2dYjVKkKWzzWAlIQDAAwN6YX3EaPeKswQraTQY=; b=oR+9kr7Y/47RqOU3ux2iDv3Ckfl7KA7A6A2KZ5rr5HxeLuxtW1KO/CcfnslZerbYJXp3CG +qMf8ajCViYBMEXA1q7Z5gr4K3/Ww+Xi+z+4B4AlB7rLTXxpuhNMPGFEjUVBNGjbrOaX2/ RCGXT59aLmUSpfSwrrmOF+Xcem0EQ3KuOsZ/J9CWzzokmhoyoHmmJrgxoxNoPvGcTHgEub xOI5sfgEtQll9is2e0noFWQwwM/wafHv8wpqoRwSeeW9OEj9npGYMzEQHVG/MN+pT3G1tX RFNADYi55dRB896d/cv6Z6lX7H0MgLTK/4b9vwJxQCl4vV+tsAnGTQqrl/LKQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677241225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3L1Z2dYjVKkKWzzWAlIQDAAwN6YX3EaPeKswQraTQY=; b=eQL0Q14f4zotLuazVbA6uIUqTEqhHduYd060kQn9WaEmIqxWcUZYkC8M5HXq/3lA7NAjec 9uGpKz+0mO2VaybXCyeDHEtepinyBWk7+l8fKHfuX3bMne+V1ImkyhoAmUJHOf6Y/h8a3h +jUz8uhHDhBsOx5C7WvlzyU3KziCS9LLmYhQQik2Wn2NuJAOj0XZ6k2P5tbVPCCSpgKxyv 8b8LJKqJ0iV7dmJbs2owdxrSqeY2La47xa1M/ZU273rFAPZkMdaiLbCnolLd8h+SLOCOgL Ny0Kx/GJ3o8ojqAvCU2rep8/u2SkvpOFnhNrX0MHzoHAnccVqY9Jp+2vVYAceA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677241225; a=rsa-sha256; cv=none; b=l6/8vmdRImBWTqvbdL+pxpUpdo5hw8pZPRSU/2RKHMUiGQhrm/ExsYUtzvR5dajOAhXGAo XYHU5t3ZkgvC8wFYkfqK5E+B+OWeB1ogldJGce3aq9IEVwrh6OwNSojeLlic9jYUCIMIjH RZfUEfOfu+n2903K4K896gr8bA+7v9xfUSQHVQ0t5uTn46CSSBKHZknq2RVC68KUHSD8hh Oy/AbbCcp9PP/6BomAf7LPgerpqUlIJecr6R+PcVbT6E1BZYzXuu1j363NNAFPsahrvgHx Ye2lTot7WRLnXoiVQ9/kwl4HEv6RjxXTwqc7Blzu8xoTKb0A4M1YTmcpXBuCSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNTVx2L7vzNLM; Fri, 24 Feb 2023 12:20: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 31OCKPwS058299; Fri, 24 Feb 2023 12:20:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OCKPPO058298; Fri, 24 Feb 2023 12:20:25 GMT (envelope-from git) Date: Fri, 24 Feb 2023 12:20:25 GMT Message-Id: <202302241220.31OCKPPO058298@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: df2fbbfa71b8 - main - Update leap-seconds to latest leap-seconds.3676924800 (expires 2023-12-28) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df2fbbfa71b8ecc9e9e75ce85a635aade9c691cb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=df2fbbfa71b8ecc9e9e75ce85a635aade9c691cb commit df2fbbfa71b8ecc9e9e75ce85a635aade9c691cb Author: Dimitry Andric AuthorDate: 2023-02-24 12:17:16 +0000 Commit: Dimitry Andric CommitDate: 2023-02-24 12:18:05 +0000 Update leap-seconds to latest leap-seconds.3676924800 (expires 2023-12-28) Obtained from: ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800 MFC after: 3 days --- usr.sbin/ntp/ntpd/leap-seconds | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ntp/ntpd/leap-seconds b/usr.sbin/ntp/ntpd/leap-seconds index 0f43115c8e53..17e3a100f943 100644 --- a/usr.sbin/ntp/ntpd/leap-seconds +++ b/usr.sbin/ntp/ntpd/leap-seconds @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C63 -# File expires on: 28 December 2022 +# Updated through IERS Bulletin C65 +# File expires on: 28 December 2023 # -#@ 3881174400 +#@ 3912710400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 732b2044 5863a938 b7e43179 1339c710 ded63837 +#h e76a99dc 65f15cc7 e613e040 f5078b5e b23834fe From nobody Fri Feb 24 12:21:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNTWy6blRz3tB7x; Fri, 24 Feb 2023 12:21: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 4PNTWy64ZQz3xFV; Fri, 24 Feb 2023 12:21:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677241278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9K0FtcRn7cYGbLYCP8CEUzxSvqGoYty44z87/TnxXg=; b=ab6LoaAV5n9a+TAQxTTPMkdE9Sg4oyf5SjUtB7jtNrMN69kovoZUNspZV7YUhUvboGxSqk B0/dcJrVlicyahM3HrgY2n3WbBAGxOlFCqcM7Mx/3i9kWqCaLh56PHq22yKiH4tkpZFLPl 6+iUHUSoUtvsrK5qYEtShwMnlNkHHjVP7DkEjrd6Rt44+uWxdgyWAvv4VGaJApQSFuy+Fj AjdSe8IrBSSzbIKJuCgzah2xWTf263CF+fgNcrk5OKQ7OHvmDd7Shy3S+syyEZsPW75+xo U4A2WnlgmNaC8FXTGbQcpJ9RJ/N8rIYXJe/ZMUdYwOKF/tfQFHec1BmmXK2n3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677241278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9K0FtcRn7cYGbLYCP8CEUzxSvqGoYty44z87/TnxXg=; b=PxeJaf9WNGIcL38p2U3V/PxeWbcVdG5bdBTqE9R+QmJ5NeJ23rxFjR7wYWkPs4q0/wWnu5 UjjwsfN6iCGWGwHQudiL9U2PyYiBHm902APTsaT+VZxIVJHtd8U12evdKlKra+YSL0ygQW 4J2j5WYVxzvnW3rTjgY20iVqwTvWpCaIAXvXq3SVoiYc4u2IIz+DOcNPV/GKfRvcDkgd3S Iey5jU2/ZI680bul32qdYEgZXbl1nQhCAOXmXGkEMbcXfZamrZge+GxFwKINHXOjSKTWuJ z2L7UK7eY1Tyn8eC5VgLf+lYxUlluErSOFj0epiSvNvVa3XCiXjOxy3WOz+PxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677241278; a=rsa-sha256; cv=none; b=jgqgzVtTI9atPBhu3ZelkrkdI+8Pw/qA3JP2xi1CpzKfe0BV/KHCRV8gF93oPI/UasbaBl Tst1WpyiIb0q9KECri6ySlmAK8x88jgyk+eM28LTBCjiAcO8deOMTFjfjtYe66JiVBUsun QdCWxdWInUEF3+BtkolfKLFoJIdVFVz/RDWspqeHwaNJGG5LquFdXHzO91BqLoXQkHtDx+ QJgOGAcOLN501Dx51/yjzuzN31j/AopYDzvlS8Jm9OA9eVnPwN3EVgWvaTDpgFhwS2ftNX /VotH3ctywAZRv1EP9sPVTrcqAbl3rwXXDWTJzxXcw1FbYN4DdtILFgO36OIZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNTWy57qlzNW9; Fri, 24 Feb 2023 12:21: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 31OCLIeA059325; Fri, 24 Feb 2023 12:21:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OCLIqO059324; Fri, 24 Feb 2023 12:21:18 GMT (envelope-from git) Date: Fri, 24 Feb 2023 12:21:18 GMT Message-Id: <202302241221.31OCLIqO059324@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 44a6088278ea - stable/13 - kern/sysv_ipc.c: use ANSI C function definition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 44a6088278ea3ae6e98b04d9863d7fdf033f26a3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=44a6088278ea3ae6e98b04d9863d7fdf033f26a3 commit 44a6088278ea3ae6e98b04d9863d7fdf033f26a3 Author: Konstantin Belousov AuthorDate: 2023-02-21 14:00:22 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-24 12:20:50 +0000 kern/sysv_ipc.c: use ANSI C function definition (cherry picked from commit 836e4b371b6eacc8a7e14cdf30fbced59c343455) --- sys/kern/sysv_ipc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c index 884ea9a7111f..46ec6b159ea5 100644 --- a/sys/kern/sysv_ipc.c +++ b/sys/kern/sysv_ipc.c @@ -56,23 +56,18 @@ void (*shmexit_hook)(struct vmspace *) = NULL; /* called from kern_fork.c */ void -shmfork(p1, p2) - struct proc *p1, *p2; +shmfork(struct proc *p1, struct proc *p2) { - if (shmfork_hook != NULL) shmfork_hook(p1, p2); - return; } /* called from kern_exit.c */ void shmexit(struct vmspace *vm) { - if (shmexit_hook != NULL) shmexit_hook(vm); - return; } #endif From nobody Fri Feb 24 14:37:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNXXm3vD4z3tK4T; Fri, 24 Feb 2023 14:37: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 4PNXXm3Kzkz47b1; Fri, 24 Feb 2023 14:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1n/N4sR6Ok65g2429/CZjMmU0Jwq5m+9Lsi3ykn6aUE=; b=la+pwyH1QvX/6F/MQu+XlJudfcA+/08vMNmZCsJzsKoE+XXZK5OJptdbe7btKZaZzjUes2 HYL2DCGvZh/ftPLZQDXjNDh4XExAwZbZgXWTRli3H7DCdjXStdUtI6CvAAdMlU2kI+a3TL uUW4pkHhMPvvn8f5+vCKJlugy8GBhZNx0+JeeLpNmE4iuxNCmBFouUnxy63HsaJ3VzADvE XAlZ/1ebtOBxIA6Ek1qx3K5GouG9Ha1XY7pf2pFBLyLhsrPYo1XIqv4nAEZR1eahzRdphr zas22WpqK4xdAsNEq11qqr3l74lgUFM1JkPBPKATpuSbRDIVT9tsIwtSQPoMIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1n/N4sR6Ok65g2429/CZjMmU0Jwq5m+9Lsi3ykn6aUE=; b=sHfBXSb5ayEVIEskfo9TgSoDuQRHuwFPPYTjpXqRFpgwXIgaWdt0Cp4vNo9ndZR4xvvvYU cvaWjmrGLE2O6l1BT1CbV/ez6KHC90lX8iL92AMYx4ADL9Bh8vXcX6+yfrKR1s6YDe9wmg OkH6qqyGekma/8/j6cgGAA3ag+ba8+KiZSpPZKwDtarh1e3FV6fm5UfsokcvmLllAJV/8i yMa4QWoD0C8AXKM2hF6h4QRhiw7xCS0HjmwTleCsO8vTwvYAaUuhELw8EHdpTJSjWS9YMC J6kWr3zOHlOv26CaAAYqZkxsxiOtizzmmGrkLeIOFQMADxdHCGp1Zitg9FQ77A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677249432; a=rsa-sha256; cv=none; b=KXhFrwDSTCrZJf/XwTVIvS/cowEm/MRcl1XzrJ5JvtP79H6kJ+hG8n/ZJ8u5EVVixd9DZ0 uPj27tCjhqTK4rwMHnEYripm2suLjXsdU/MMvDWTV4rv01Vr6sXvB3nivI6OYJooNxkNoL 2AlIMMBkvqooAvO8Cz8/D+0B9VPDvCfDzQ/yLwXGd9YJaf6vZbGg3gVWRNJkykmUa+y5tS fZ56+AXadI9ds1vRJqMWFCzUZ8cRArPBApzc8X1F66CDchlnMDsPJeiKVsvq3YZiz+WavT pP1mRPeO1uw1yooAkNnYdkGPrjlJqfl5yKChxQbSzBBhD9bMQ5pFuv6FxdPtLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNXXm2G8PzRpS; Fri, 24 Feb 2023 14:37: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 31OEbC4Q049458; Fri, 24 Feb 2023 14:37:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OEbCvt049457; Fri, 24 Feb 2023 14:37:12 GMT (envelope-from git) Date: Fri, 24 Feb 2023 14:37:12 GMT Message-Id: <202302241437.31OEbCvt049457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: dd6f6030cc29 - main - amd64 kernel config: clean up whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd6f6030cc2981ce860b664e54bf17cf9fc80668 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=dd6f6030cc2981ce860b664e54bf17cf9fc80668 commit dd6f6030cc2981ce860b664e54bf17cf9fc80668 Author: Mike Karels AuthorDate: 2023-02-23 17:09:39 +0000 Commit: Mike Karels CommitDate: 2023-02-24 14:36:28 +0000 amd64 kernel config: clean up whitespace Most options in kernel config files use "optionsOPTION". This allows the option to be commented out without shifting columns. A few options had two tabs, and some had spaces. Make them consistent. --- sys/amd64/conf/FIRECRACKER | 12 ++++++------ sys/amd64/conf/GENERIC | 12 ++++++------ sys/amd64/conf/GENERIC-MMCCAM | 8 ++++---- sys/amd64/conf/NOTES | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sys/amd64/conf/FIRECRACKER b/sys/amd64/conf/FIRECRACKER index 0ee5c93fe458..4a9946f25991 100644 --- a/sys/amd64/conf/FIRECRACKER +++ b/sys/amd64/conf/FIRECRACKER @@ -29,14 +29,14 @@ options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 -options ROUTE_MPATH # Multipath routing support -options FIB_ALGO # Modular fib lookups +options ROUTE_MPATH # Multipath routing support +options FIB_ALGO # Modular fib lookups options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging options TCP_HHOOK # hhook(9) framework for TCP -options TCP_RFC7413 # TCP Fast Open +options TCP_RFC7413 # TCP Fast Open options SCTP_SUPPORT # Allow kldload of SCTP -options KERN_TLS # TLS transmit & receive offload +options KERN_TLS # TLS transmit & receive offload options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists @@ -175,11 +175,11 @@ envvar machdep.disable_tsc_calibration="1" # Provide bug-for-bug compatiblity with Linux in MP Table searching # and parsing. Firecracker relies on these bugs. -options MPTABLE_LINUX_BUG_COMPAT +options MPTABLE_LINUX_BUG_COMPAT # Disable the automatic registration of a PCI bridge; we do in fact # not have one. -options NO_LEGACY_PCIB +options NO_LEGACY_PCIB # Bus support. # Note that Firecracker provides neither ACPI nor PCI; but removing these diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 56b881d80a52..46c901300371 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -31,15 +31,15 @@ options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 -options NETLINK # netlink(4) support -options ROUTE_MPATH # Multipath routing support -options FIB_ALGO # Modular fib lookups +options NETLINK # netlink(4) support +options ROUTE_MPATH # Multipath routing support +options FIB_ALGO # Modular fib lookups options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging options TCP_HHOOK # hhook(9) framework for TCP -options TCP_RFC7413 # TCP Fast Open +options TCP_RFC7413 # TCP Fast Open options SCTP_SUPPORT # Allow kldload of SCTP -options KERN_TLS # TLS transmit & receive offload +options KERN_TLS # TLS transmit & receive offload options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists @@ -136,7 +136,7 @@ device smbios options IOMMU device pci options PCI_HP # PCI-Express native HotPlug -options PCI_IOV # PCI SR-IOV support +options PCI_IOV # PCI SR-IOV support options COMPAT_LINUXKPI diff --git a/sys/amd64/conf/GENERIC-MMCCAM b/sys/amd64/conf/GENERIC-MMCCAM index 0aa7a7da1072..afb0d128dca4 100644 --- a/sys/amd64/conf/GENERIC-MMCCAM +++ b/sys/amd64/conf/GENERIC-MMCCAM @@ -9,7 +9,7 @@ include MINIMAL ident GENERIC-MMCCAM # Access GPT-formatted and labeled root volume -options GEOM_LABEL +options GEOM_LABEL # UART -- for bhyve console device uart @@ -27,8 +27,8 @@ device pass device scbus device da -options MMCCAM +options MMCCAM # Add CAMDEBUG stuff -options CAMDEBUG -options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) +options CAMDEBUG +options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index 4b107b19ac42..e568842f2830 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -630,7 +630,7 @@ options COMPAT_AOUT # ZFS support # NB: This depends on crypto, cryptodev and ZSTDIO -options ZFS +options ZFS ##################################################################### # VM OPTIONS @@ -664,5 +664,5 @@ options VM_KMEM_SIZE_SCALE # GCOV (code coverage) support -options LINDEBUGFS -options GCOV +options LINDEBUGFS +options GCOV From nobody Fri Feb 24 14:37:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNXXn3ZNxz3tJH2; Fri, 24 Feb 2023 14:37: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 4PNXXn35gnz47l8; Fri, 24 Feb 2023 14:37:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yi52T+rDW1DSEszd21l+h5Q+08hOrNDMaaLyqpFobKc=; b=k+gOzzWbyHRjUP81rCafVo9raxqJ6IAB+/7G2PHwEHAbj6WSIYmmckoI43rQyp8QxTzShO PUco/vnnmKFbGeL81El3oXnpfWAy6Lkdx9mGUDtd5cSVWQnA1BKoDqzsWkq2UgswFhwP7N vmmzQO2l0n51shdg3eveuHIxuVoTXW8bCWbGkLWAVmhIsOVrF23tFLGxAz3zNZQsG86i9y s6XNdv4L3SrZWs/nY2Jc3EUOZ+XsBuyIDUkTUjx2WoYPGQF4KTIInV8qQxo0wI33+g+vyG 4SpXsklTf4oUoPML+hZf8X3ynGcXZvNVLKf2VXQlHdNtPCcHGXZO0blR2AOSsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yi52T+rDW1DSEszd21l+h5Q+08hOrNDMaaLyqpFobKc=; b=GBqe0XK2ldSEDyWbjeq4Vo71rHZv3d41dghSraLotGKhaXtsjW+32Gm/HZDJppIn4H25h5 K60hkCzENI+xu+2wGmrCHpWiHGtr40zaUCFxwlFNPesoMVv9D6hB+xDkHRkUhY8gqNwPOS CpGrjHozC6XODOApC6rhzHHhB0MpqEYT+fTREdz//DLSyCTCRiLbGyURi09DmJu9UGSPMi dA3b5jzUndQr2qjH0XiN1COZ4UTizQTomWh4waJMIIMHxRvnN/ZGgIA7x2vFX/c7YCwhkt sCcM4OhtNQ5Ae7B5vIHyJtnzMmA3YKA6xjOqEa4E/xiM5us++d6xIm+ZIApMew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677249433; a=rsa-sha256; cv=none; b=N5CZp8F9R2s9TuIAN7GyN7ihu/tN9B5m9CYt8BilJAGSf3v1NGSSozARAmBcUWcXdzr831 D4HYBr8jW0nO54vfNRF2RI52CKS2XD3vTezCw1bx3QeTM8SzvBjHrDxS9o2WcIkJf2XJwv y5zmk2KSDNCeW+MRP+6zGq0k0dLmtrLhsOdecBZ8JNgqJqKVDfNTNNdN1fL471E9nV2Tty KjPq/5UESg8afzOQZ7x3/oCspZsbgTWdXXUw343L6b95oPuiifVos2alEYcmg2jpiVbb3F a8kWCuOIU+AI5HDj3ySyACf105tbeZjh2SPHej6AG08/GtAoqRyjbGbE9B8B5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNXXn261gzRRK; Fri, 24 Feb 2023 14:37: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 31OEbDs5049481; Fri, 24 Feb 2023 14:37:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OEbDS4049480; Fri, 24 Feb 2023 14:37:13 GMT (envelope-from git) Date: Fri, 24 Feb 2023 14:37:13 GMT Message-Id: <202302241437.31OEbDS4049480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 91646fe5750c - main - arm kernel config: clean up whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91646fe5750c3cb22783a1b41e4f370b66176659 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=91646fe5750c3cb22783a1b41e4f370b66176659 commit 91646fe5750c3cb22783a1b41e4f370b66176659 Author: Mike Karels AuthorDate: 2023-02-23 17:38:26 +0000 Commit: Mike Karels CommitDate: 2023-02-24 14:36:28 +0000 arm kernel config: clean up whitespace Most options in kernel config files use "optionsOPTION". This allows the option to be commented out without shifting columns. A few options had two tabs, and some had spaces. Make them consistent. --- sys/arm/conf/ARMADA38X | 6 +++--- sys/arm/conf/GENERIC | 6 +++--- sys/arm/conf/GENERIC-MMCCAM | 2 +- sys/arm/conf/SOCDK | 4 ++-- sys/arm/conf/std.armv7 | 2 +- sys/arm/conf/std.qca | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/arm/conf/ARMADA38X b/sys/arm/conf/ARMADA38X index 238d8189f37e..17ba80095531 100644 --- a/sys/arm/conf/ARMADA38X +++ b/sys/arm/conf/ARMADA38X @@ -21,7 +21,7 @@ options ROOTDEVNAME=\"/dev/da0s1a\" options SCHED_ULE # ULE scheduler options SMP -options VM_KMEM_SIZE_MAX=0x9CCD000 +options VM_KMEM_SIZE_MAX=0x9CCD000 # pseudo devices device clk @@ -92,7 +92,7 @@ device ath # Atheros NIC's device ath_pci # Atheros pci/cardbus glue device ath_hal device ath_rate_sample -options ATH_ENABLE_11N +options ATH_ENABLE_11N # CESA device cesa @@ -102,7 +102,7 @@ device cryptodev # L2 Cache device pl310 -options PLATFORM +options PLATFORM # FDT options FDT diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 83dd919de3ac..84f81a2f142c 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -61,8 +61,8 @@ options SOC_BCM2836 options SOC_BRCM_BCM2837 options SOC_MV_ARMADA38X options SOC_MV_ARMADAXP -options SOC_TI_AM335X -options SOC_OMAP4 +options SOC_TI_AM335X +options SOC_OMAP4 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores @@ -164,7 +164,7 @@ device gpioregulator # EVDEV support device evdev # input event device support -options EVDEV_SUPPORT # evdev support in legacy drivers +options EVDEV_SUPPORT # evdev support in legacy drivers device uinput # install /dev/uinput cdev device aw_cir diff --git a/sys/arm/conf/GENERIC-MMCCAM b/sys/arm/conf/GENERIC-MMCCAM index 0e36756d2241..c5ae6d4560c5 100644 --- a/sys/arm/conf/GENERIC-MMCCAM +++ b/sys/arm/conf/GENERIC-MMCCAM @@ -11,7 +11,7 @@ include GENERIC ident GENERIC-MMCCAM -options MMCCAM +options MMCCAM # Add CAMDEBUG stuff options CAMDEBUG diff --git a/sys/arm/conf/SOCDK b/sys/arm/conf/SOCDK index 59f93d480a86..b5561b9b7ff2 100644 --- a/sys/arm/conf/SOCDK +++ b/sys/arm/conf/SOCDK @@ -23,8 +23,8 @@ include "SOCFPGA" ident SOCDK -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s4\" +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s4\" # Flattened Device Tree -options FDT_DTB_STATIC +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=socfpga_arria10_socdk_sdmmc.dts diff --git a/sys/arm/conf/std.armv7 b/sys/arm/conf/std.armv7 index 03cc0ae5a2b8..8db32751732b 100644 --- a/sys/arm/conf/std.armv7 +++ b/sys/arm/conf/std.armv7 @@ -11,7 +11,7 @@ options CC_CUBIC # include CUBIC congestion control options TCP_HHOOK # hhook(9) framework for TCP device crypto # core crypto support options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 -options NETLINK # netlink(4) support +options NETLINK # netlink(4) support options SCTP_SUPPORT # Allow kldload of SCTP options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support diff --git a/sys/arm/conf/std.qca b/sys/arm/conf/std.qca index 7fbb99300e84..24e6601f0939 100644 --- a/sys/arm/conf/std.qca +++ b/sys/arm/conf/std.qca @@ -70,7 +70,7 @@ device usb device xhci device dwc3 device qcom_dwc3 -options USB_HOST_ALIGN=64 +options USB_HOST_ALIGN=64 # Ethernet support device mdio From nobody Fri Feb 24 14:37:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNXXp65nkz3tJlP; Fri, 24 Feb 2023 14:37: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 4PNXXp3vRkz47ns; Fri, 24 Feb 2023 14:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7vEkXmAq+4tlBPNHxIZELv3kp8J1ApP399/PuV7M6JM=; b=bvD0BqiWSxWiKBVllryIpZTF/JJDXPjOOEN29Sd3W/j5ZBFaoAHtHk/888Lon8KXYFKCwm EBCw4afrYf5ibIy28v1wcEQu2Pr/x+uQgGliUicvWB1oiu8vftU4DORnAEzQIzTEWEkNbL 2iZUt1LJnLa2VWWiy81AeI4oZnUYrEbWSss1b9KWLLi+jJpCyL36DwyuyhkrmXGDGNTq33 Fjm94uL58fhxs2plnPhKYp0Y2q+JXS0uO6NC2Q4uz3wUhqxqFuwu++XpTba1ygrt8dN2jA 1kBT68rnx+vytZZWNxPhJkVgD10ujNmBxZJLkbzxoPziGRtfyT1TGGMk37UFxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7vEkXmAq+4tlBPNHxIZELv3kp8J1ApP399/PuV7M6JM=; b=tnPHhxvhrqi6M2VoGsJx3FtdMuKE8H9ErsEUX43e219xvl0ttq0EqOcN340p3vpOrddlrr QB2GwQMb0T2nCHSNKrtPQOXfMX5zx1oDNpdRh45QnxC5pxaqhFRyW88qVhtVGMG5HZQlPO huJ7Bc+pizdl9ZhIKFsvijFVd4imj5THrXn+KcQH203f5lUggYIeJkJmKnIBX948N1gx09 ph63jmlLBCbdmpjblr2xrwK8Iz13iyu/HbmcnZlhHkxO9OjjE3s/4tsXlpVDYAE8lRQR5D w13//mrPCB9QdWKQsO/XlIZA4pNwvUVIz3Sx/V1E2SDc+BvXHyXpv4eyacf/mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677249434; a=rsa-sha256; cv=none; b=wlgE+Z0P7t4D9/ojHNha44AW4WK0PEIpnXNLh8evdZ4VmpcsgT2fsF2pnOIZTOGwhO+Ht2 V+xaaB1HCs0dmDbpo51j0dltMdx5KoATd0kSDmZYaMB+yz2sQeMm/1QYdba9sqZcYY8clK mfIa9eY3qRk604eE+vQWINVSLcbN97dCFeYDvpe2hP28EYNK0d5uzKaeLWkpFXv1eWrD1F 8er3zKJvc5YD0RHKQQnjkcu9F+XAXhNBUhVHKaacBpBLl9sc7eHoZ6K4HhrRXJOT7/u7di y5az7+1kDVnxOY6GDdHff9TEmp55S2zrWVOLZetqgHA0PCvcsZMjh4yeMGnhug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNXXp30qczRPB; Fri, 24 Feb 2023 14:37: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 31OEbEmH049503; Fri, 24 Feb 2023 14:37:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OEbE3U049502; Fri, 24 Feb 2023 14:37:14 GMT (envelope-from git) Date: Fri, 24 Feb 2023 14:37:14 GMT Message-Id: <202302241437.31OEbE3U049502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: f12907d01a6b - main - arm64 kernel config: clean up whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f12907d01a6b6a5c3bde687a1bc674963ea17f93 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=f12907d01a6b6a5c3bde687a1bc674963ea17f93 commit f12907d01a6b6a5c3bde687a1bc674963ea17f93 Author: Mike Karels AuthorDate: 2023-02-23 17:41:31 +0000 Commit: Mike Karels CommitDate: 2023-02-24 14:36:29 +0000 arm64 kernel config: clean up whitespace Most options in kernel config files use "optionsOPTION". This allows the option to be commented out without shifting columns. A few options had two tabs, and some had spaces. Make them consistent. --- sys/arm64/conf/GENERIC-MMCCAM | 2 +- sys/arm64/conf/NOTES | 6 +++--- sys/arm64/conf/std.arm64 | 2 +- sys/arm64/conf/std.dev | 2 +- sys/arm64/conf/std.nxp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/arm64/conf/GENERIC-MMCCAM b/sys/arm64/conf/GENERIC-MMCCAM index ab45fcb8168d..ded8d750b1e8 100644 --- a/sys/arm64/conf/GENERIC-MMCCAM +++ b/sys/arm64/conf/GENERIC-MMCCAM @@ -17,7 +17,7 @@ options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) # pass(4) device device pass -options MMCCAM +options MMCCAM nodevice mmc nodevice mmcsd diff --git a/sys/arm64/conf/NOTES b/sys/arm64/conf/NOTES index 2bd7395a51ba..e77a5cf087aa 100644 --- a/sys/arm64/conf/NOTES +++ b/sys/arm64/conf/NOTES @@ -185,7 +185,7 @@ device aw_pwm device vt_efifb # EVDEV support -options EVDEV_SUPPORT # evdev support in legacy drivers +options EVDEV_SUPPORT # evdev support in legacy drivers device aw_cir # Pseudo devices. @@ -219,7 +219,7 @@ options CAMDEBUG options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) # bring in camified MMC too -options MMCCAM +options MMCCAM # arm64 doesn't support inb/outb, so disable chipset probing which needs it nooptions PPC_PROBE_CHIPSET @@ -245,7 +245,7 @@ options COMPAT_FREEBSD32 # Compatible with FreeBSD/arm ##################################################################### # ZFS support -options ZFS +options ZFS # # HID-over-I2C support diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64 index 1e664a3ba90c..ff2acef22a4d 100644 --- a/sys/arm64/conf/std.arm64 +++ b/sys/arm64/conf/std.arm64 @@ -13,7 +13,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options CC_CUBIC # include CUBIC congestion control options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 -options NETLINK # netlink(4) support +options NETLINK # netlink(4) support options ROUTE_MPATH # Multipath routing support options FIB_ALGO # Modular fib lookups options TCP_OFFLOAD # TCP offload diff --git a/sys/arm64/conf/std.dev b/sys/arm64/conf/std.dev index 1725cec626e4..0a0e1da8cf8b 100644 --- a/sys/arm64/conf/std.dev +++ b/sys/arm64/conf/std.dev @@ -68,7 +68,7 @@ device syscon # EVDEV support device evdev # input event device support -options EVDEV_SUPPORT # evdev support in legacy drivers +options EVDEV_SUPPORT # evdev support in legacy drivers device uinput # install /dev/uinput cdev # PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure diff --git a/sys/arm64/conf/std.nxp b/sys/arm64/conf/std.nxp index 574893aebb68..5b2e2b52d4e6 100644 --- a/sys/arm64/conf/std.nxp +++ b/sys/arm64/conf/std.nxp @@ -3,7 +3,7 @@ # # SoC support -options SOC_NXP_LS +options SOC_NXP_LS # I2C device pca954x # NPX I2C bus multiplexer / switches From nobody Fri Feb 24 14:37:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNXXr0ZSNz3tK6p; Fri, 24 Feb 2023 14:37: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 4PNXXq53NDz47tl; Fri, 24 Feb 2023 14:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J2rkijaAImuy7flcg/+ND55w4JFB7CyXTd7T4ZzuG40=; b=A3/Yn15Tmysq91STZ7hm4PjpPceSJBk54V8B/fV+mfGb10V8oTOGT8RuJHFYSFzeu8SttM TMFSSbIdcKm4MHtumFpjEbPVRm1dfwX2gmfn3tCel0qSieWxNIgRKSxinmG3lb+qsvl5nO w71bNebbk5aMU7ApIzT+5lmve4RnSr9s0wJgF8LyiR6rs0tzw/xLTLxaOFVW26Cpe8XE5u yRlq94g8IQFYR/losZUFT7XwLErO7j1PvUM+bzGSnleh+jzeXwPLYkO+L6TOBxsST+RGJ5 ujAlIa4Qjxv1/5H9enBnbwIzoWpW5Hz9Qt4TXrzLt9SRxcLGGiNDQVR6m3Xx/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J2rkijaAImuy7flcg/+ND55w4JFB7CyXTd7T4ZzuG40=; b=tYjjftWqpYNvHOUGxXwrEPOm4i6rW87J5w+WqUQdroYAuSsDaeQBG+mSN6Fz2B5cN4EXIi S3Ij4iz78KT9Li4UWPNk4FKSb+nRIgCdi33URwS495vh26nXxEezAPfamP9x7/0kFS/azV 1qOou3lo+at3+m0/j3iU8+iy5CENMyFSYWW74ZxFIdZ68YYFxjrUKgETwGHV+NC/2J666D y/7zx0miAyeBzBlpiL3X8PuirSc0OYDZxSNDFkAdjreIMh8Fg0G09fCjYqGDxEM0pkCkds Nx92PutFbIJ1wPODTNiuxP4J2U7RiMJ4VIfEoUhDl9Oiht/3bsGDwH7Lbie3Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677249435; a=rsa-sha256; cv=none; b=J2a4M7mcKPHoK1sCeW6KJIarzBx7kRhllMZ20yi0OupWzZC/I5IBmv/ehvmv1/6Xm5h2Dk 5Eerw/+zE0Np4uCaT8/Yy4+p+Op9iRy6/r5630/6aZmeB4ahBRLPe7iIqAmIQsbgbLVJq9 JVAVtUsYBzezpY7s5xiHhmXbyv7w8ikAeGWUTNfOu9IreGGGnea4/ipndGwkj08wG6zeCk KA39UmHqDyrFLKwpxULLNxz0jP6NPNZJGEhByAxu7sd7dfTEVx6zw9cCS1r+UaSMw0w5r0 1rIbWOHUIP5Q6xnJb0C3mTj1oVlkhZk40keUxF7QIvsfv3WtYIAPmoz533a6cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNXXq46rJzRPC; Fri, 24 Feb 2023 14:37: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 31OEbFrc049522; Fri, 24 Feb 2023 14:37:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OEbF5O049521; Fri, 24 Feb 2023 14:37:15 GMT (envelope-from git) Date: Fri, 24 Feb 2023 14:37:15 GMT Message-Id: <202302241437.31OEbF5O049521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: d44acf5d8d23 - main - i386 kernel config: clean up whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d44acf5d8d2329e14547d97be7e3afbd5355a26e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=d44acf5d8d2329e14547d97be7e3afbd5355a26e commit d44acf5d8d2329e14547d97be7e3afbd5355a26e Author: Mike Karels AuthorDate: 2023-02-23 17:42:59 +0000 Commit: Mike Karels CommitDate: 2023-02-24 14:36:29 +0000 i386 kernel config: clean up whitespace Most options in kernel config files use "optionsOPTION". This allows the option to be commented out without shifting columns. A few options had two tabs, and some had spaces. Make them consistent. --- sys/i386/conf/GENERIC | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 5d30f2877c1c..8e688bd6581b 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -32,8 +32,8 @@ options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 -options NETLINK # netlink(4) support -options ROUTE_MPATH # Multipath routing support +options NETLINK # netlink(4) support +options ROUTE_MPATH # Multipath routing support options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload options SCTP_SUPPORT # Allow kldload of SCTP @@ -120,7 +120,7 @@ device acpi device smbios device pci options PCI_HP # PCI-Express native HotPlug -options PCI_IOV # PCI SR-IOV support +options PCI_IOV # PCI SR-IOV support # Floppy drives device fdc From nobody Fri Feb 24 14:37:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNXXr6v0nz3tJZ0; Fri, 24 Feb 2023 14:37: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 4PNXXr64XVz47mj; Fri, 24 Feb 2023 14:37:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M2sLgjRClB9vknRmWXHNerlatHI0+EkDDOxQEPL6JWc=; b=kOk+SCPc8IzrHV623EU0YheFwS3UKyna5KzqWcqKeRl8Q9mvu1fJPLZFaapGuTmJHmz0zq Kc+mI5QcTdovjafXcWU/byIdPhNPVsqPcMfz2+6HLxfoAlU4/VdHv8DYScAAyuV8g/xzpX njBXewt9C81f1AM0GnbhR9Lf3s+3p5z2npt+sQq/U8fZQVS6HEzqyiNlQ+sDhgCuqWUDgv 2DctYt5ihv8K3GDVtli2+VWR91UP7oos9F3cePpuEV0iwnumJK7V250SkNd95/qAMhvIVo WT6TjNxiC6XdP8tb/UHQbPFXAHl1xl8JlYOLmbIcNEaQCSf4IoGJVSbtoi04iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M2sLgjRClB9vknRmWXHNerlatHI0+EkDDOxQEPL6JWc=; b=Xwyy3PWcfoyDan23TeOSKsj9riBe2dulqNYJWsfmmFQtfvxdyBHU2FHa8ZbJjOe9vVoLy3 iUDP4e5kw9cuxCc+Pj8iV7UZii7eNTSPlYEzYxOzXISMUzj9vGZEnzXPYqV7sa5lQAzXCo 8OPzT60+50wmRf70hM25Qox8G21dMOtTpjSWM7JrOruAGNyyAk60c+sZWGXgYnFdIMq6kB EsUTAQqoyrsMnBO5nhmN1B/+ckXkx4elZRp1C+J6/oGFJKzPzQXYBuEi2cDbLglGuioiia DUUaivP7QlzJcpGgdnOdv0ZnXTKEH5K9yO52MMFHsvj8OpAiiPnAajDCCSt7Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677249436; a=rsa-sha256; cv=none; b=fXrZEdS8R0M9hwCBgVsnc9AAtiqj9c5kml1rukjKvKmgxOwz+Y5YSaMaC+ctPrhODMm49e mOFFs+9ZCCGCyT9Am3u/+9WURt+RToTVZukFPewhc6FXW0gZQ0AM9kHDQZpTvt8D71ct6k V/fY+IlPFuS4tOGs7oOCctVrSsHtkpAxiRVn7QHWhq6AOEW9nAiZOBUYrllvayK9TNkMr7 kg97CkAWn3X6sy3el/I8mNeeouCV+n6tapSnXGDvT3t1eke3IlNCcEBaiYSLkaXMH/XEpt fUEMuPZJTSpG+RZosXUmcXkuzM2Weyf04+lNmBDTrq/50OP2/6pcQ/456+I/oQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNXXr51bxzRyS; Fri, 24 Feb 2023 14:37: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 31OEbGJu049541; Fri, 24 Feb 2023 14:37:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OEbGap049540; Fri, 24 Feb 2023 14:37:16 GMT (envelope-from git) Date: Fri, 24 Feb 2023 14:37:16 GMT Message-Id: <202302241437.31OEbGap049540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 8995b96f344d - main - powerpc kernel config: clean up whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8995b96f344d7d01f6ed87b189831b8fee52f45c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=8995b96f344d7d01f6ed87b189831b8fee52f45c commit 8995b96f344d7d01f6ed87b189831b8fee52f45c Author: Mike Karels AuthorDate: 2023-02-23 17:44:18 +0000 Commit: Mike Karels CommitDate: 2023-02-24 14:36:29 +0000 powerpc kernel config: clean up whitespace Most options in kernel config files use "optionsOPTION". This allows the option to be commented out without shifting columns. A few options had two tabs, and some had spaces. Make them consistent. --- sys/powerpc/conf/GENERIC | 2 +- sys/powerpc/conf/GENERIC64 | 20 ++++++++++---------- sys/powerpc/conf/GENERIC64LE | 16 ++++++++-------- sys/powerpc/conf/MPC85XXSPE | 12 ++++++------ sys/powerpc/conf/NOTES | 4 ++-- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC index b269893b01bd..52961b1d102e 100644 --- a/sys/powerpc/conf/GENERIC +++ b/sys/powerpc/conf/GENERIC @@ -32,7 +32,7 @@ options PSIM # GDB PSIM ppc simulator options MAMBO # IBM Mambo Full System Simulator options PSERIES # PAPR-compliant systems -options FDT +options FDT options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 37a78446f07a..ab36e2032203 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -30,11 +30,11 @@ makeoptions WITH_CTF=1 options POWERMAC # NewWorld Apple PowerMacs options PS3 # Sony Playstation 3 options MAMBO # IBM Mambo Full System Simulator -options QEMU # QEMU processor emulator +options QEMU # QEMU processor emulator options PSERIES # PAPR-compliant systems (e.g. IBM p) options POWERNV # Non-virtualized OpenPOWER systems -options FDT # Flattened Device Tree +options FDT # Flattened Device Tree options SCHED_ULE # ULE scheduler options NUMA # Non-Uniform Memory Architecture support options PREEMPTION # Enable kernel thread preemption @@ -42,8 +42,8 @@ options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 -options NETLINK # netlink(4) support -options ROUTE_MPATH # Multipath routing support +options NETLINK # netlink(4) support +options ROUTE_MPATH # Multipath routing support options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging options TCP_HHOOK # hhook(9) framework for TCP @@ -84,7 +84,7 @@ options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode @@ -136,7 +136,7 @@ device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # NVM Express (NVMe) support device nvme # base NVMe driver -options NVME_USE_NVD=0 # prefer the cam(4) based nda(4) driver +options NVME_USE_NVD=0 # prefer the cam(4) based nda(4) driver device nvd # expose NVMe namespaces as disks, depends on nvme # SCSI Controllers @@ -226,8 +226,8 @@ device kue # Kawasaki LSI USB Ethernet # Wireless NIC cards device wlan # 802.11 support -options IEEE80211_SUPPORT_MESH # enable 802.11s draft support -options IEEE80211_DEBUG # enable debug msgs +options IEEE80211_SUPPORT_MESH # enable 802.11s draft support +options IEEE80211_DEBUG # enable debug msgs device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support @@ -235,8 +235,8 @@ device wlan_amrr # AMRR transmit rate control algorithm device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support -options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later +options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation +options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath # FireWire support diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 5e6d26c4a775..ffb43628d2b1 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -28,12 +28,12 @@ makeoptions WITH_CTF=1 # Platform support options MAMBO # IBM Mambo Full System Simulator -options QEMU # QEMU processor emulator +options QEMU # QEMU processor emulator options PSERIES # PAPR-compliant systems (e.g. IBM p) options POWERNV # Non-virtualized OpenPOWER systems options ISA_206_ATOMICS # PowerISA v2.06 optimized subword atomics -options FDT # Flattened Device Tree +options FDT # Flattened Device Tree options SCHED_ULE # ULE scheduler options NUMA # Non-Uniform Memory Architecture support options PREEMPTION # Enable kernel thread preemption @@ -79,7 +79,7 @@ options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode @@ -131,7 +131,7 @@ device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # NVM Express (NVMe) support device nvme # base NVMe driver -options NVME_USE_NVD=0 # prefer the cam(4) based nda(4) driver +options NVME_USE_NVD=0 # prefer the cam(4) based nda(4) driver device nvd # expose NVMe namespaces as disks, depends on nvme # SCSI Controllers @@ -221,8 +221,8 @@ device kue # Kawasaki LSI USB Ethernet # Wireless NIC cards device wlan # 802.11 support -options IEEE80211_SUPPORT_MESH # enable 802.11s draft support -options IEEE80211_DEBUG # enable debug msgs +options IEEE80211_SUPPORT_MESH # enable 802.11s draft support +options IEEE80211_DEBUG # enable debug msgs device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support @@ -230,8 +230,8 @@ device wlan_amrr # AMRR transmit rate control algorithm device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support -options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later +options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation +options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath # FireWire support diff --git a/sys/powerpc/conf/MPC85XXSPE b/sys/powerpc/conf/MPC85XXSPE index 45c8d09f5cfb..1d7ef9ac9742 100644 --- a/sys/powerpc/conf/MPC85XXSPE +++ b/sys/powerpc/conf/MPC85XXSPE @@ -34,7 +34,7 @@ options FDT options FFS options GDB options GEOM_PART_GPT -options GEOM_LABEL # Provides labelization +options GEOM_LABEL # Provides labelization options INET options INET6 options TCP_HHOOK # hhook(9) framework for TCP @@ -63,11 +63,11 @@ options WITNESS_SKIPSPIN # The powerpcspe target arch can run non Altivec/VMX powerpc binaries # Keep COMPAT options in sync with powerpc target arch. -options COMPAT_FREEBSD6 # Compatible with FreeBSD6 -options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options COMPAT_FREEBSD9 # Compatible with FreeBSD9 -options COMPAT_FREEBSD10 # Compatible with FreeBSD10 -options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options COMPAT_FREEBSD9 # Compatible with FreeBSD9 +options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options COMPAT_FREEBSD13 # Compatible with FreeBSD13 diff --git a/sys/powerpc/conf/NOTES b/sys/powerpc/conf/NOTES index 78d990331ead..b7c7921f6a68 100644 --- a/sys/powerpc/conf/NOTES +++ b/sys/powerpc/conf/NOTES @@ -41,10 +41,10 @@ options FPU_EMU #options MPC85XX options POWERMAC #NewWorld Apple PowerMacs -#options PS3 #Sony Playstation 3 +#options PS3 #Sony Playstation 3 options PSIM #GDB PSIM ppc simulator options MAMBO #IBM Mambo Full System Simulator -options QEMU #QEMU processor emulator +options QEMU #QEMU processor emulator # The cpufreq(4) driver provides support for CPU frequency control device cpufreq From nobody Fri Feb 24 14:37:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNXXt0LVmz3tK1k; Fri, 24 Feb 2023 14:37: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 4PNXXs6hjLz483b; Fri, 24 Feb 2023 14:37:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oX9bsxgK7gvFAiVnGoIb34FYv9dIRoA56aNAk/M5BdA=; b=vR0FskaE5DdSLDGkNuzjtcN4fRKEo2Rp95T857plV+VIbqX9jd5oWwl51G1OuA8yHqRzmk Qp8mWESDVv6bS1ONSU9upUTEyHaG2xW/QsZwiSQmAB0g36Yp9g8TwglmK/OA1tMjtlCND/ gWLHPl7ZZPM8HbKMEzrtAxPPr3puAiClGMKK96cJye/LUMYPdIk0kJQx+oAUd0SaWTsCx5 dre8e07HUFEpZkL4DLNhoLetnh1GAOcUbvbfMi0XWg4qe+BmLLVPhHny2ysxExbs8J8a0B 6cErdrpA8mNV+d7XLerZfF4uIgZqSyFoAFmy5UBfaxbK3tSJusK7XjSHadyMXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677249438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oX9bsxgK7gvFAiVnGoIb34FYv9dIRoA56aNAk/M5BdA=; b=hN4ZymD6M9l2REs7rLv0Ov1ijEIP3XsMg+3E9dTf/v6akivtxBo8dk/u9MlMZO/IDQxqix 5zavSPmuM65do1Gv1eM/mE633hNMWWcdw+gBjvDYWDdhVBXBqs3pgeX+DJCxL+QSzaT9v/ WApRw81jgEuYXxaV/HXr0tGsUjtLFgqFMViv5BGOkX5+apykx2Hy2PJ1a2BMohQN0Vfnmj oCGwTuaeSMVgJ6on0ybUtO7Yvl5xcWAani/wT/MeLH+EUj2VTBWiV05pxI4JFuly+ae5By MAJWByEQJR5yGhJc1n2Mr71WFPpb9zb/4o0O8YEJ/a5LQFzU5nVgf8sLsc/vDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677249438; a=rsa-sha256; cv=none; b=K/2vc7Ei1PG1B4GV1tJtHyGyZB6WsvVwgB5M41Xczw7grJvccA/HXQbC/DZee3ULxIpqiJ ciG4MKyY3b8akCBMFRg2MkhRpD6AZfXgZ4d4igfTW9J7evfqXazt7Q/skaOq8E5jaV366q P9g2mEIJT1MZJgR6ph9o6JnHgCAmbVqC0+RAI3SqI/Y6aOoT6EuGyQWrAJX2luC3a0l81z 380VNo7P8Em+FkznGqgKFeOmXlEpB1O9XxrCLDKSDz8zBQeK+ujOmNgx0b519/PlGWlaog TUdJssrerNpum5w3Ran5CJesk3XiX08J7EgMmOmt5IDz8jCWb6/Xv8FoXISUUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNXXs5pMgzRC7; Fri, 24 Feb 2023 14:37: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 31OEbH41049560; Fri, 24 Feb 2023 14:37:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OEbHeH049559; Fri, 24 Feb 2023 14:37:17 GMT (envelope-from git) Date: Fri, 24 Feb 2023 14:37:17 GMT Message-Id: <202302241437.31OEbHeH049559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: ae4387d724e2 - main - riscv kernel config: clean up whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae4387d724e2661e5e4ee7743954ffaa9ac01275 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=ae4387d724e2661e5e4ee7743954ffaa9ac01275 commit ae4387d724e2661e5e4ee7743954ffaa9ac01275 Author: Mike Karels AuthorDate: 2023-02-23 17:45:08 +0000 Commit: Mike Karels CommitDate: 2023-02-24 14:36:29 +0000 riscv kernel config: clean up whitespace Most options in kernel config files use "optionsOPTION". This allows the option to be commented out without shifting columns. A few options had two tabs, and some had spaces. Make them consistent. --- sys/riscv/conf/GENERIC | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 69c36511da80..df7d680ff3ff 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -31,8 +31,8 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 -options NETLINK # netlink(4) support -options ROUTE_MPATH # Multipath routing support +options NETLINK # netlink(4) support +options ROUTE_MPATH # Multipath routing support options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging options TCP_RFC7413 # TCP Fast Open @@ -189,7 +189,7 @@ options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default # Kernel dump features. -options ZSTDIO # zstd-compressed kernel and user dumps +options ZSTDIO # zstd-compressed kernel and user dumps # Pseudo devices. device crypto # core crypto support From nobody Fri Feb 24 14:42:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNXfm6fTwz3tK64; Fri, 24 Feb 2023 14:42:24 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) (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 4PNXfm4VHfz4DdP; Fri, 24 Feb 2023 14:42:24 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x42e.google.com with SMTP id y10so1301681pfi.8; Fri, 24 Feb 2023 06:42: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:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uCI4mFOTlukp5VDzQ0osYNN+wtWNCzQMKoijn00LsJc=; b=W9oHsoS5QQO3JY7M7nz7Y4ph/Xy4lMs79jQqWvAGnEvuIfEm67Hea2bCWD0esztS75 NGMwVztEwO8tB5GD/lJxOX3Zhbky29bU25Zlxu8sDlX51EafJXWCnxMitDYhMGHU0zKk nuX5adwETcvyqcTFgR+CE7Y3fKh0Ccs+vKorU0AsHvLIksPT1nT1eqTiNV8TLhTbO/Zn +M06/i4MtexiKKsWJG9h2BIkrpNliBJEuWeycunNjsh5oCgb6b9DylKxzGUw1ei/HNqG VaPNlIjEO9xq7KZ+cXmZ2IEG+DCp7y8yho1by9yZVcZT52sPZsGoT7eeF2BDRFbNjifd DPhw== 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=uCI4mFOTlukp5VDzQ0osYNN+wtWNCzQMKoijn00LsJc=; b=IfArjqY5kHswMT2UJrGpt8mbPExVbWneaPXy3MPaI80f2CnzbjwiJpuxHvM4lUllFm v/kHaDQNrDcR1ecqeUBv89hCX+A9Erwm5djfjpVBn8tiAsLgkBFKaWEC9L1z7dc13Q7w ezVjyNVNEiBdxrBsVzPexmfKDuJAMAYRfz08vG0Q5Hk+pgmjv9YaMgjwzibtDCsG1Qc0 vX3ECVPwfLQgVGx+UoXPtUZz+wYtnK1Wwk5QH4dzI7hffTeJjkOxw7tEUf/zslx344Ph n1/Fhk1lPGRdOPXAc4QGZIgb2QAgfRTwgkxIBjgsYvFGhGHtKTstWvDd3xn30mYpMYQH 9jHA== X-Gm-Message-State: AO0yUKU1xv0J5p264lo0x1zgDWmAFYg1kl3VDy8EMYjEnoq+OW4QqXJc 8DwVMp6pgVBjtYZ/EfjcqcWO3FD7qRrrEDKTzP8hR+WUQvPg X-Google-Smtp-Source: AK7set/aJbXPr6hLXMP4s1ZDTCfXpPJA6MqeVYc6vt41rw9Hw3zTca+7YYWqRFrVFNSeLedLiS6h3/ylBd7OcJXh/SI= X-Received: by 2002:a63:7902:0:b0:502:fd12:83ce with SMTP id u2-20020a637902000000b00502fd1283cemr1596958pgc.5.1677249742973; Fri, 24 Feb 2023 06:42:22 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302202112.31KLCfQB080359@gitrepo.freebsd.org> In-Reply-To: From: Rick Macklem Date: Fri, 24 Feb 2023 06:42:05 -0800 Message-ID: Subject: Re: git: ef6fcc5e2b07 - main - nfsd: Add VNET_SYSUNINIT() macros for vnet cleanup To: Gleb Smirnoff Cc: Rick Macklem , bz@freebsd.org, jamie@freebsd.org, 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: 4PNXfm4VHfz4DdP 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: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 Thu, Feb 23, 2023 at 7:08 PM Gleb Smirnoff wrote: > > Rick, > > On Thu, Feb 23, 2023 at 05:56:06AM -0800, Rick Macklem wrote: > R> > This one actually doesn't look correct to me. What happens here is that the sysctls > R> > will affect only the default VNET. > R> > > R> Yes, but the sysctls are mostly useless anyhow. I don't know how to make them > R> work in a prison. (I know how to use SYSCTL_FLAG_VNET, but that does not > R> work in this case.) > > Doesn't they work as intended in my patch D38742? Yes, and my pretty trivial D38748 does as well. What I was trying to say above was "I don't know how to vnet sysctls done under a SYSCTL_ADD_NODE()".. One of those also exists in the krpc. > > R> > I think the VNET-itezation of this file went a bit wrong. You don't need to convert > R> > static structures to malloced when you VNET-ize a module. The infrastructure should > R> > take care of memory management. > R> > > R> Not if you want to keep the vnet footprint small. This was necessary > R> so that nfsd.ko > R> (and friends) will load dynamically. Without the conversion to > R> mallocs, it would complain > R> the vnet was out of memory when nfsd.ko tried to load. > R> (I'm sure I didn't need to do all of them, but it made sense to keep > R> the vnet footprint > R> as small as possible.) > R> > The dynamic sysctl context seems to be unneeded from the very beginning. It was > R> > always attached to the static softc. Suggested patch: > R> > > R> > https://reviews.freebsd.org/D38742 > R> > > R> I'll look at it, but if it stops malloc'ng softc, then I will be > R> worried w.r.t. vnet footprint and > R> dynamic loading. (Note that the structure has an array of hash list > R> pointers in it, so it > R> is rather large. > > Replying to you and Bjoern's email too here. Well, if we want a fully blown > virtualized network stack, and this is what VIMAGE is, then, well, we need a > full chunk of memory to keep a network stack data. So, if there is a limit > there, (Bjoern mentioned 8k) then this limit needs to be increased as more > and more subsystems are virtualized. I also don't see how we actually save > any memory using malloc(9) instead of using memory provided by VIMAGE? The > kmem use would be roughly the same if not worse. What exactly are we saving > here? > I know nothing about the internals of VIMAGE, so I'll leave that to others to discuss. I will point out that I do not see any disadvantage to using malloc(). > R> Another reason (along with dynamic loading of the modules) for keeping > R> the foot print > R> small is to try and keep the jails that do not use nfsd(8) and friends > R> lightweight. > R> When I originally coded it, I put it under a kernel option called > R> VNET_NFSD (still in > R> kern_jail.c at this time), but others felt that a new kernel option > R> wasn't desirable, > R> (There is a lot of discussion under D37519. The downside of discussions that > R> happen in phabricator is that not as many people see them. I started an email > R> thread on freebsd-current@, but it quickly migrated to D37519. Just > R> the way things > R> currently happen.) > > I briefly looked into D37519 and didn't find any discussion over memory > footprint and savings. I agree that a kernel option of VNET_NFSD is undesirable. > The global option VIMAGE shall control that and nothing else. > Well, there was a discussion of how to gte nfsd.ko to load dynamically (after I found out it would not) somewhere. The answer was basically "malloc arrays and big data structures", which worked and I am fine with. > R> > For example nfsstatsv1, which is now malloced for non-default vnets and static for > R> > the default. Lots of modules still incorrectly update the global one. > R> > > R> Nope. "struct nfsstatsv1" is a structure that is shared with the NFS > R> client, which is > R> not vnet'd. As such, a static "struct nfsstatsv1" needs to exist for prison0. > R> > R> My original solution was to create a separate structure for the server > R> side stuff > R> (vnet it), but then the result was a messy copying exercise for the system call, > R> which returns the entire structure (with client and server info). > R> > R> Once the client side is vnet'd (I've already had a couple of emails asking me > R> to do it, so I plan on starting to work on it) then, yes, the > R> structure can become > R> a malloc'd vnet'd one and the IS_DEFAULT_VNET can go away. > > I see the problem. So, we got several things that need to be done to > nfsstatsv1: virtualize, separate server and client, possibly make them use > counter(9) to avoid races and performance issues. And I'm afraid there is > API/ABI that needs to be preserved? Depending on order of doing changes to > nfsstatsv1 the amount of work is going to be different. > > So, if we start with my D38743 the only problem observed is that the client > code will use virtual version of the stats. So if somebody decides to run > a client from a vnet jail, it will fill this jail stats instead of global. > Is it a big deal if the future plan is actually to make client virtualized > too? Your patch is fine. It just requires the rest of the work of vnet'ng the client to be done and I have not done that yet. Until then, your patch would just break client mounts. I'm pretty sure they would crash almost instantly, although I have not tried it. In the meantime, the code needs to stay in a working form. (I also won't guarantee I'll get the client vnet'ng done in time for FreeBSD14, although I think it will happen.) > > R> I am not sure why you think IS_DEFAULT_VNET() is such a big deal in > R> the initialization code? It work. I can see an argument for using both > R> SYSINIT() and VNET_SYSINIT() for cases where you have both non-vnet;d > R> and vnet'd data to initialize. However, I don't see any problem with using > R> IS_DEFAULT_VNET() when needed. > > My main concern is complexity and its unforseen consequences. The original design > of VIMAGE is simple - just wrap every global variable into VNET() macro and you > are done. Don't make non-default vnet in any sense different to the default one! > It actually works pretty good if the recipe is being followed. Sometimes this leads > to pretty large mechanical changes, and people try to avoid that. For example in > pf(4) we had quite a long story with getting it stable with VIMAGE, and I think > that was because we just didn't do it right from the beginning. > Yea, as you noted, the NFS code can get complex and the nfsstatsv1 part is a bit messy (mostly maintaining backwards compatibility for old versions of the structure). This simple use of IS_DEFAULT_VNET() fixes the problem until the client side is vnet'd. Then it can go away. > So with NFS we started to create complexity and we already got problems. The > memory definitely is used after free, see: > > https://ci.freebsd.org/job/FreeBSD-main-amd64-test/23034/console Yes, I think D38750 fixes this. For my test setup (a main GENERIC kernel), VNET_SYSUNINIT() functions never get called. After "jail -r" they are stuck in dying state. This happens even for non-vnet jails. jamie@ has reproduced the problem on a setup he did. As such, I can't test the VNET_SYSUNINIT() stuff, so I only saw this problem when the KASAN testing found it. It would be interesting to know how the kernel used in the testing setup differs from GENERIC, because the kernel in the testing environment does appear to call the VNET_SYSUNINIT() functions? rick > > -- > Gleb Smirnoff From nobody Fri Feb 24 14:59:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNY2V1jl8z3tZqd; Fri, 24 Feb 2023 14:59: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 4PNY2V1BgFz4FbD; Fri, 24 Feb 2023 14:59:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677250770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KvT1eQopK29DIU0oYl6kXR+nFaLtTDLUnKEtCTaBDuY=; b=K8g+9mpXMBOi43qcTiOlIMpTXEQEBfb0x1Iuie9lFPDJDU9UEzpE0Tn+nxPpzAuwGgVHL+ W9f+ZWFHwThBjgY7edRDgdeLuwjllQCxqo+41WRwZ7WsfgVrd0RK6lrVfvQR9u8soPOuCO A6K1qf4t5YunHI9sBXmu5IdC3ziTbSrT36xBAF0FwElhLPNNFXl8hTAK8gc1mxkkMN81k5 +19yY6JL0omYEchWfceHPQFXTVMnmJTSTIqwKT9EV3OiFgjU0dwMKiVZOAqgNk4ZhY5Qu4 GzCO4mu3vRDTUYXxpz/RxqZHvjDMd6nOejGoiQ70/DrTGa2qgnH9wUQ+lFtOmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677250770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KvT1eQopK29DIU0oYl6kXR+nFaLtTDLUnKEtCTaBDuY=; b=xvNEMpkniDI29KMLeuUvDQY8a19+1y2tBW2P/Y4MnK6URb9GJFDv9K3ffIzVjGiXuaBgFK 38bjJV026NocyTrF8N0ncZO0AAAOXoYyToFJ0H0lL2bIHfA4uhYV6exfXZbRkvHPufe52p qME8lbMumC0aTWC5PCXJKLGW3PsulE4tMaJ6TIrQZ3t7rrfabm+1eOA+oVWp9+X9jyDEm3 k/uH7W/BSFfq5DslhTgURrKMJuuDfpnCo+MBMIra33XG6z4yCFT+nKJ4UzJObhtEjSBtjn Sx9K7fH7EEVgh4ack4J7uYSpLdtyxjAw6hilOcGcHeD2UdXs5oy+3sChGI8Csg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677250770; a=rsa-sha256; cv=none; b=G4Bv2pD/Rp0nKQhYHsxlsYq7WunyNAAgLLbXwJnpY35dd5cC6Q6Yjn46Rlf8UgNk5ckaJW 9hYHCc+h2AiJQz2rJdL+b9d83/h2Tlpf1PLeEAZTcvBzQfyd0kTHLZD7jL84js2dH3Tba2 xAV8v0HvVIzVAt7yEn11FpITVTZipYFlLm5q0TMvtJ4PyJRV3Jjf/Xuveg1/DQaSzwowJP JpUL70OZCTQR4eHppEa8KkbO1hcETu42+Jd7jtP3LLk1ZIO+se0nPVqs4QVQTlhpCVVWAf E2uEgbndPyt88evAbGXqquES9sev10Y8zQVQACvee6I+MmpAlJg6zsXFQuVcpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNY2V0GtBzSCw; Fri, 24 Feb 2023 14:59: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 31OExTU3077468; Fri, 24 Feb 2023 14:59:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OExTc7077467; Fri, 24 Feb 2023 14:59:29 GMT (envelope-from git) Date: Fri, 24 Feb 2023 14:59:29 GMT Message-Id: <202302241459.31OExTc7077467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 70960bb86a3b - main - ping: Fix unsigned integer underflow resuling in a ping -R segfault List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70960bb86a3ba5b6f5c4652e613e6313a7ed1ac1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=70960bb86a3ba5b6f5c4652e613e6313a7ed1ac1 commit 70960bb86a3ba5b6f5c4652e613e6313a7ed1ac1 Author: Cy Schubert AuthorDate: 2023-02-23 05:43:17 +0000 Commit: Cy Schubert CommitDate: 2023-02-24 14:50:53 +0000 ping: Fix unsigned integer underflow resuling in a ping -R segfault ping -R (F_RROUTE) will loop at ping.c:1381 until it segfaults or the unsigned int hlen happens to be less than the size of an IP header: slippy$ ping -R 192.168.0.101 PING 192.168.0.101 (192.168.0.101): 56 data bytes 64 bytes from 192.168.0.101: icmp_seq=0 ttl=63 time=1.081 ms RR: 192.168.0.1 192.168.0.101 192.168.0.101 10.1.1.254 10.1.1.91 unknown option bb unknown option 32 unknown option 6 ... unknown option 96 unknown option 2d Segmentation fault The reason for this is while looping through loose source routing (LSRR) and strict source routing (SSRR), hlen will become smaller than the IP header. It may even become negative. This should terminate the loop. However, when hlen is unsigned, an integer underflow occurs becoming a large number causing the loop to continue virtually forever until hlen is either by chance smaller than the lenghth of an IP header or it segfaults. Reviewed by: asomers Fixes: 46d7b45a267b MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38744 --- sbin/ping/ping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 6956b9a68ad2..2fc876e50776 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1150,7 +1150,7 @@ pr_pack(char *buf, ssize_t cc, struct sockaddr_in *from, struct timespec *tv) ssize_t icmp_data_raw_len; double triptime; int dupflag, i, j, recv_len; - uint8_t hlen; + int8_t hlen; uint16_t seq; static int old_rrlen; static char old_rr[MAX_IPOPTLEN]; @@ -1171,7 +1171,7 @@ pr_pack(char *buf, ssize_t cc, struct sockaddr_in *from, struct timespec *tv) hlen = (l & 0x0f) << 2; /* Reject IP packets with a short header */ - if (hlen < sizeof(struct ip)) { + if (hlen < (int8_t) sizeof(struct ip)) { if (options & F_VERBOSE) warn("IHL too short (%d bytes) from %s", hlen, inet_ntoa(from->sin_addr)); From nobody Fri Feb 24 15:37:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNYtN38lWz3tcVB; Fri, 24 Feb 2023 15:37: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 4PNYtN2jmSz4K3n; Fri, 24 Feb 2023 15:37:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677253052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=77a3VcrkbouA4RKJHag3f+IZ6Z5IqJa8GOqgvLDE6RA=; b=x4Uvgbtwf/xlHCxU4/WL7EK2tltmPXt12r4NcwUUYKdqz/8VVVFAyndg5XBV7vJ0dU+qis l/GatCOAE1SUOWjsVXrIfUtgsNJ4A8uvobz8LgU3nkx9TFEpk70A7kF0MnBUEGgxhZ3RXq B+uNyxKmeIZqKhFtObj4zUbalEeCEffiuEfu0EOGMyiDOCt1aATwmhQamSz7qQiY9pqgPm k6LCCE5hiUfcHL3F9p783cCEXQcI4K/6Z3lNzPmAsovRN53mCeg2YtAKVnaNO61YdBp/RY DEKivsQzQVkKfPlUcNI03M3VySDtFBUfpYgyKj0DSq//5D9q31fTGXxGJcbdrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677253052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=77a3VcrkbouA4RKJHag3f+IZ6Z5IqJa8GOqgvLDE6RA=; b=xQbIk5G/3joi/X10mBGMrk4M38Kduq9BKNPtRCp2N4QYp1E2Pvih208FC8pvNv9ZRsJiRi nrk9jNK+lqHbTAXJ9wHOF8A0/4PE7oof0Nc6qZiJAH4k2PboojJr9ITuYxZ1zE2fFKHleW 9g8JP15AslE+2Y2dB/Zk14j3uJ9tEpQJGbxn8djcd9ZASWjMFlZocpuOeJfKdRtADQSYKc fz9D8cJuFWqT9jhGS+nm193aPwPWEzq1VUNiLINwEH2cPgsSeVFLmY4BY3GX8mBJ5bzh6N rznHC/XpOMk4rlR8qVF8EG1+vxOfFu/F38JfWd0M+humCQytdWQWX/ksN5ol6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677253052; a=rsa-sha256; cv=none; b=SFCdmSnUBkLwk6RspstD/WS4YBY0vX/iUKN9wkbaFczegvgiX/mNpLDCw7L343MLz7qSmO 18iBw316KiL9l/G8wmyq95HLhiBdbgtVtkJ4PXpKRzg/fkDzjGtSQO6d7rDaZgG7oBiGCd PVY+/xjA9YO1hxksvZ1XSAhGE4sE+Azn2wDdE7LHT1igZyV8GhonGvUX6beNMV46ZWFc0t 6qvYT0YjC8W1PH+N2vSUutnQmcVPtMzA12CQP3GG1oOgGGrcarQ5BjMvbYfsDQAFaJBkBW vmgilsJ7mruhtFdgwP7kZeC02oEPEyGfZdH5hgt9YfrWpVLKQY5sco/Jatz6vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNYtN1mL7zSmg; Fri, 24 Feb 2023 15:37: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 31OFbWM4034842; Fri, 24 Feb 2023 15:37:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OFbWAo034841; Fri, 24 Feb 2023 15:37:32 GMT (envelope-from git) Date: Fri, 24 Feb 2023 15:37:32 GMT Message-Id: <202302241537.31OFbWAo034841@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: 4036fcb8053a - main - nfsd: Fix a use after free when vnet prisons are deleted List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4036fcb8053adf3ac54c8428eef0dd076dfc1718 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4036fcb8053adf3ac54c8428eef0dd076dfc1718 commit 4036fcb8053adf3ac54c8428eef0dd076dfc1718 Author: Rick Macklem AuthorDate: 2023-02-24 15:36:28 +0000 Commit: Rick Macklem CommitDate: 2023-02-24 15:36:28 +0000 nfsd: Fix a use after free when vnet prisons are deleted The Kasan tests show the nfsrvd_cleancache() results in a modify after free. I think this occurs because the nfsrv_cleanup() function gets executed after nfs_cleanup() which free's the nfsstatsv1_p. This patch makes them use the same subsystem and sets SI_ORDER_FIRST for nfs_cleanup(), so that it will be called after nfsrv_cleanup() via VNET_SYSUNINIT(). The patch also sets nfsstatsv1_p NULL after free'ng it, so that a crash will result if it is used after free'ng. Tested by: markj Reviewed by: markj MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D38750 --- sys/fs/nfs/nfs_commonport.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 212b498e6328..be5fc688b7eb 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -885,7 +885,7 @@ nfs_vnetinit(const void *unused __unused) mtx_init(&NFSD_VNET(nfsrv_nfsuserdsock).nr_mtx, "nfsuserd", NULL, MTX_DEF); } -VNET_SYSINIT(nfs_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_ANY, +VNET_SYSINIT(nfs_vnetinit, SI_SUB_VNET_DONE, SI_ORDER_FIRST, nfs_vnetinit, NULL); static void @@ -893,12 +893,14 @@ nfs_cleanup(void *unused __unused) { mtx_destroy(&NFSD_VNET(nfsrv_nfsuserdsock).nr_mtx); - if (!IS_DEFAULT_VNET(curvnet)) + if (!IS_DEFAULT_VNET(curvnet)) { free(NFSD_VNET(nfsstatsv1_p), M_TEMP); + NFSD_VNET(nfsstatsv1_p) = NULL; + } /* Clean out the name<-->id cache. */ nfsrv_cleanusergroup(); } -VNET_SYSUNINIT(nfs_cleanup, SI_SUB_VNET_DONE, SI_ORDER_ANY, +VNET_SYSUNINIT(nfs_cleanup, SI_SUB_VNET_DONE, SI_ORDER_FIRST, nfs_cleanup, NULL); extern int (*nfsd_call_nfscommon)(struct thread *, struct nfssvc_args *); From nobody Fri Feb 24 17:23:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNcDk2dK9z3tkBk; Fri, 24 Feb 2023 17: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 4PNcDk2D1Qz3FrL; Fri, 24 Feb 2023 17: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=1677259414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=22XpkrOMyfZSabHEeOZzrMvQc1ZhL3z815FCo0tFJ7A=; b=p1j3ApmbHbqQpMy+MLJmHOhnf8+iyU9CjhMZEulhpOKq1XrEyAzR3hak8CijRHD1czk0+f Rl+Xlu0sT/qeL3YV+xqplIxHwk1DRfP2+MwY/fKZ2wWGHCABhyv7npC25P7JeABsrCIDvM xejlouWUlNkFEesiTY7qRkcOKUu/f6VarBHkvpNvdOCGMSnb5PknMeh23rdDFxm7UpsIYZ yXsvVC47xb+UAFUT6pjl+e20Z39LHdX8E0hMqTbNDtFr+h5DB9gSPTCCgMpOGwPhvVLy6D UfytVIhJy1daxQDsFrJ1DsdyGZVb218WTS8xDZ6GbgWzBNp9D0F7g2TxQ3NPYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677259414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=22XpkrOMyfZSabHEeOZzrMvQc1ZhL3z815FCo0tFJ7A=; b=AtQhlfjAFWVd6fnwx6sPaWHRDvHPqIeosL/6zvTFeJhwvWn4XGgyRiK+Ob7DcuamdvA9mw Jkfc8+ntrLcMS90N7KUI3p5WzumUCRKqhftpNrfDgbNlDyFGoO4iqh01B+5laRoWmeBzQu LGlCXXX3/m48nHZG8nY2l3G2PUTRNzFo1Mek0VgvL+TzdZKZPkxFD7PU7omktcOfNS8GAB 1p3nN53D3zFFPYC9WYqK8Y01NZxQCWKQmvneHfZ+yjGZXRk8QuZplFDx+BrAH7kc4sUv6N 49Wuu1zsNGPWFgODPw2oSb7qyn1+ZHJxKCrQxpAuQspNcJKmhWRsdhW39eERlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677259414; a=rsa-sha256; cv=none; b=a3yuaA/Ba8P3E2r5AVAq/nE8FrA7N1nSbfYVhMOWb7DpKLWR1wm739h43sXKnEvVgHK22i q0BdyYCTHzh6CHOq9+kMTPd7nyMabCK6K5doTTDMoQL8LfFoKUWGQUcFpCr2MxlyZyu4fM /JQpnCNT2lwcD5f48+koZHrH0gbLXqh9jlvJhi2H8sOl+jomJxSyQzcKzP9FQngr1wgyWh 2x0iBpIzmPIs/MQcxzcnHtbfUosAOtxQt0051y3dvBH0Do/n0APlpzn6KzQkBc1iYHbA3z L9QdZ7Gw5Fw7r63JOPf1QjulgObOy1qy0Xh+pF99H0A8YRKr5hsglHgl4HJj3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNcDk1GCPzX8L; Fri, 24 Feb 2023 17: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 31OHNYef092658; Fri, 24 Feb 2023 17: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 31OHNY0m092657; Fri, 24 Feb 2023 17:23:34 GMT (envelope-from git) Date: Fri, 24 Feb 2023 17:23:34 GMT Message-Id: <202302241723.31OHNY0m092657@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: 9873b1716970 - main - bcm_dma: attach at an earlier bus pass List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9873b171697033f9f19608d98bcd1c16cacb92af Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9873b171697033f9f19608d98bcd1c16cacb92af commit 9873b171697033f9f19608d98bcd1c16cacb92af Author: Mark Millard AuthorDate: 2023-02-17 20:30:35 +0000 Commit: Mitchell Horne CommitDate: 2023-02-24 17:20:40 +0000 bcm_dma: attach at an earlier bus pass The sdhci_bcm driver attach routine relies on bcm_dma already being attached, in order to allocate a DMA channel. However, both drivers attached at the default pass so this is not guaranteed. Newer RPI firmware exposes this assumption, and the result is a NULL-dereference in bcm_dma_allocate(). To fix this, use BUS_PASS_SUPPORTDEV for bcm_dma. PR: 268835 Reviewed by: mhorne MFC after: 1 week --- sys/arm/broadcom/bcm2835/bcm2835_dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2835_dma.c b/sys/arm/broadcom/bcm2835/bcm2835_dma.c index 5f9ecb0b7981..49a3938282a2 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_dma.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_dma.c @@ -764,5 +764,6 @@ static driver_t bcm_dma_driver = { sizeof(struct bcm_dma_softc), }; -DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0); +EARLY_DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0, + BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(bcm_dma, 1); From nobody Fri Feb 24 17:23:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNcDl3tFnz3tkF7; Fri, 24 Feb 2023 17:23: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 4PNcDl3QhTz3G7W; Fri, 24 Feb 2023 17:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677259415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=euQPxlC+dey9MApnJ5Tig4RUk03itdsjZRzpOXWEKXM=; b=aMmMzK9s4idCovPWg1Un5Vhj/G4n+Lk6m62AQkSOeQw8gd9AVuc0rEuv5Ifk+/qbJV/l1m yOHYrKr/2du2S3WT04dH2hJkGtvHKnc0TllaEAY1xBGtVYTYAJIVMQdltys6oyZfj9nZOG lyvneZ7WTEIMm0HjQJwWTm7xpK3tE1ATtJHnKYXVGH6lv5nwoFcDybJvHLssxF0oaOUjj6 TAlN1DiTfGytYdXxAQV2WhvgCmcJ+pQFIVtA6xnrPaOdTKUY8iGZ6a4F6f0y5l5eb0kEyb gdVYNncu7pqRqpNXbctuB2lj75MPGL70F6jbnScAU2gMh9OqidC8PAxUi+9HXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677259415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=euQPxlC+dey9MApnJ5Tig4RUk03itdsjZRzpOXWEKXM=; b=XOlQhbk43U90uleODw9cfu1qjchdPV81ySompAtZGZiU1DigBZsrCBLE3ohkKhlG4zZlo+ IRUtq0krCcC4SD7ctxNx2F4E6Nk9AvT7eebf8O6krEyZq9eU8P/+Iw1kbWf/yKH7xuezH/ SNMlvruudoEKKnOuSOT6zLvEnuBa34qodDCgaQcPhFX/4RTi1C3R03LTS41wFvZSYWIPQp xciAQfhpqfmBClx7DVHWVcvdf6FWN7Le/EVoWCrMpb4pgU8LA3Qa+/7lVlL37p0YzxAZor 59W4RpAwU2u9CPqauaJJAlw3nYSnwOgKhTz1fOqm76CW8KTn8IZI/Ht+/gZfVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677259415; a=rsa-sha256; cv=none; b=ym9vl7tbSj44gINBZHbS8Y5UDqB91FDWSFLf1rpszYZ+eJU665m4//F5FlGLM4RPoCBUpN mEpPVXObh8KMCdyHREjioBli1PEz5YUK+YGGg7dj4PuRpn5QAkjju5fkPhb5jPd5VE1sf0 65U2CbXfjdyk2fgBi9Kxg3Q/R/McCyMugeMyWsJUxXm4PAvLEOrgqZz7OuiLL9Tr8IyjoA 3BldpXUjNqHq76Z9+A6q58YTCEzM64qKoENUzY7Z32ZCebrZK+xb7RgfcLleOtvrCakYBd 8LJYxTYSkCAmOLkb71gPvHHBEIDK1ArD72dPUVE8YWeVmSzdRgGaOcG8GODQUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNcDl2ThJzX8M; Fri, 24 Feb 2023 17:23: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 31OHNZWQ092677; Fri, 24 Feb 2023 17:23:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OHNZOA092676; Fri, 24 Feb 2023 17:23:35 GMT (envelope-from git) Date: Fri, 24 Feb 2023 17:23:35 GMT Message-Id: <202302241723.31OHNZOA092676@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: 07ccf71451d7 - main - bcm_dma: don't dereference NULL softc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07ccf71451d7377b1a6f3367f738ce7ddb1f2a24 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=07ccf71451d7377b1a6f3367f738ce7ddb1f2a24 commit 07ccf71451d7377b1a6f3367f738ce7ddb1f2a24 Author: Mitchell Horne AuthorDate: 2023-02-24 17:19:54 +0000 Commit: Mitchell Horne CommitDate: 2023-02-24 17:20:40 +0000 bcm_dma: don't dereference NULL softc This file defines a small API to be used by other drivers. If any of these functions are called before the bcm_dma device has attached we should handle the error gracefully. Fix a formatting quirk while here. Reviewed by: manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38756 --- sys/arm/broadcom/bcm2835/bcm2835_dma.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2835_dma.c b/sys/arm/broadcom/bcm2835/bcm2835_dma.c index 49a3938282a2..e9633674d9f6 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_dma.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_dma.c @@ -328,6 +328,9 @@ bcm_dma_allocate(int req_ch) int ch = BCM_DMA_CH_INVALID; int i; + if (sc == NULL) + return (BCM_DMA_CH_INVALID); + if (req_ch >= BCM_DMA_CH_MAX) return (BCM_DMA_CH_INVALID); @@ -343,13 +346,10 @@ bcm_dma_allocate(int req_ch) break; } } - } - else { - if (sc->sc_dma_ch[req_ch].flags & BCM_DMA_CH_FREE) { - ch = req_ch; - sc->sc_dma_ch[ch].flags &= ~BCM_DMA_CH_FREE; - sc->sc_dma_ch[ch].flags |= BCM_DMA_CH_USED; - } + } else if (sc->sc_dma_ch[req_ch].flags & BCM_DMA_CH_FREE) { + ch = req_ch; + sc->sc_dma_ch[ch].flags &= ~BCM_DMA_CH_FREE; + sc->sc_dma_ch[ch].flags |= BCM_DMA_CH_USED; } mtx_unlock(&sc->sc_mtx); @@ -364,6 +364,9 @@ bcm_dma_free(int ch) { struct bcm_dma_softc *sc = bcm_dma_sc; + if (sc == NULL) + return (-1); + if (ch < 0 || ch >= BCM_DMA_CH_MAX) return (-1); @@ -392,6 +395,9 @@ bcm_dma_setup_intr(int ch, void (*func)(int, void *), void *arg) struct bcm_dma_softc *sc = bcm_dma_sc; struct bcm_dma_cb *cb; + if (sc == NULL) + return (-1); + if (ch < 0 || ch >= BCM_DMA_CH_MAX) return (-1); @@ -531,6 +537,9 @@ bcm_dma_reg_dump(int ch) int i; uint32_t reg; + if (sc == NULL) + return; + if (ch < 0 || ch >= BCM_DMA_CH_MAX) return; @@ -558,6 +567,9 @@ bcm_dma_start(int ch, vm_paddr_t src, vm_paddr_t dst, int len) struct bcm_dma_softc *sc = bcm_dma_sc; struct bcm_dma_cb *cb; + if (sc == NULL) + return (-1); + if (ch < 0 || ch >= BCM_DMA_CH_MAX) return (-1); @@ -597,6 +609,9 @@ bcm_dma_length(int ch) struct bcm_dma_softc *sc = bcm_dma_sc; struct bcm_dma_cb *cb; + if (sc == NULL) + return (0); + if (ch < 0 || ch >= BCM_DMA_CH_MAX) return (0); From nobody Fri Feb 24 18:21:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNdW457qPz3tmrp; Fri, 24 Feb 2023 18:21: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 4PNdW44gtYz3MLX; Fri, 24 Feb 2023 18:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677262864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PD5inkcM5rBty+/96JgBNl93TTP1shT3XYO/nLDw8Ps=; b=Mewqp/Nu/p4pmC5Z/+GMXhgmXVT5LCDOE6Rtm/G8Wvw3Takzr9rnvqG0H/jgMN7mMPhocl j+YWTzedK5ULTprx8KzY3P41H/Jb7dPQT5EVtXTfq8LHGiL78uC6bs/itKrNZiNxkjZJFJ o0B3e26rBSYs1EdpmBNIZvacVgLn0Sy/smycBGQMg28Bq141HbXr+B6OEvaLB4fs6LrboQ Q+WsEVJXX8qXYWUcV7Ky2XIiOY2sGqi+tpDmBkh4/RgyqHGRXvJO0Bmv/DNDf9H9kckTpX IPYeuMUgAw/RDgDchnHQprUB4+pmPe5YEFMlT98R08ZAro6cuMdN40ZSS3AqPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677262864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PD5inkcM5rBty+/96JgBNl93TTP1shT3XYO/nLDw8Ps=; b=NeGN2QZSr0kADjrOb6YPMhOckSPYMGkw79JZOkYtaTECCC/zko6JtJG422onuVDhpYFzGg k0A9A3bGWJRW7U22bFmoE5UbmkuR2v1rrwYmMol1TkJ3X1+1JZohYiqsMSC39agt2d1lYD cy25PVe6RKkqrN426zaY4EEx+WwT8y4qjnMneeixWAPyREopqxmu9BIqftgTcHjVynxgZ5 GvEN26TfbMJI+eZQh/aBgCku3RNQsdxjRfztXX0W6ugo+OHZVDcqWFrND5yJEKPyhGnMIf ZbyxD4yFOgKCPWtJvr5GS+UYfibmwpqZC+uMG6ajok//mkelSdaldTH/x2c0MQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677262864; a=rsa-sha256; cv=none; b=r9Ot11ziRyrOKDEBPdT+nZPjho8jn05k0x2B3rAFoQyAsuvwTUsIVh/inmr4eRRJWfDDtT Ix39aXWCda+TmN0VSbm14ZNpcEDypSojsTQTv7jTmfIRWYskivBxU9j0P+IC8vTV4+cwKJ 66hC3if03iVPuYvMoFbNnxfYXG2qwzBhceTSDGJk8HXq6ImU3KMkaOr8+6Tdao5lOiAZfg ARMAhn/9rdjhKib/JgCTRAkca/7gfyp2gOBF3PvvWgS/ldXgQYxVVgTHNa2bX8MJ+brEf9 LXqylKIjbI4gVC5Hkuua49L+bSR4S4wHmA10IMjBhPcnxCSHfQquAWgwe89+xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNdW43l2lzYTS; Fri, 24 Feb 2023 18:21: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 31OIL4mh075894; Fri, 24 Feb 2023 18:21:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OIL4ux075893; Fri, 24 Feb 2023 18:21:04 GMT (envelope-from git) Date: Fri, 24 Feb 2023 18:21:04 GMT Message-Id: <202302241821.31OIL4ux075893@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: 2c709ee70ade - main - libc: handle zero alignment in memalign() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c709ee70ade9fd8f77b37917a4169d667dda41d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2c709ee70ade9fd8f77b37917a4169d667dda41d commit 2c709ee70ade9fd8f77b37917a4169d667dda41d Author: Paul Floyd AuthorDate: 2023-02-24 16:29:01 +0000 Commit: Ed Maste CommitDate: 2023-02-24 18:19:06 +0000 libc: handle zero alignment in memalign() For compatibility with glibc. The previous code would trigger a division by zero in roundup() and terminate. Instead, just pass through to malloc() for align == 0. PR: 269688 Reviewed by: imp, mjg MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/655 --- lib/libc/gen/memalign.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/memalign.c b/lib/libc/gen/memalign.c index 4f5ea2fd61fd..dc0ad34a117b 100644 --- a/lib/libc/gen/memalign.c +++ b/lib/libc/gen/memalign.c @@ -35,5 +35,12 @@ __FBSDID("$FreeBSD$"); void * memalign(size_t align, size_t size) { - return (aligned_alloc(align, roundup(size, align))); + /* + * glibc allows align == 0, but that is not valid for roundup. + * Just pass through to malloc in that case. + */ + if (align != 0) + return (aligned_alloc(align, roundup(size, align))); + else + return (malloc(size)); } From nobody Fri Feb 24 18:50:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNf8h1BsWz3tpWd; Fri, 24 Feb 2023 18:50: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 4PNf8h0hxTz3QWS; Fri, 24 Feb 2023 18:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677264612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5LTZd58XI1LA2MTARHItVyA5D17/77I1TEO5yw311xs=; b=yeyioIjOZTxyuTSdfYM5FEwOtOwWv+xKpCvQVuw0ZYRkXzi825nzGevdumjRYhV0Bx8su3 C1aONZnpWAeCjRJUmobQfWhVIfjNuJ0AtiVVy5/UsKhayh+tSSbqkiltSllrRNZWssZBX4 DfsfYPF5WJD5pn9BvgQ+o1Kg0ji53qfvcmuRao31BoAP2jhzWOEGMwoCv8NHpOHqxSkUbu 42YEYhjQzAoF4b1gFyIhV4gkcKB/tOQWIg54Qb9wS2pr4DgZSFTqGKfUCjXbbWO/SGgyVN RC4FR5mwFe0UETRms/jBOxyPYrjXt0mAcuVkaJLkZ1YbCHljoD8ai6hSvamL1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677264612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5LTZd58XI1LA2MTARHItVyA5D17/77I1TEO5yw311xs=; b=g5K3UHZ0WnLkg4CzseWTG2B+8mUaYMXy/k7WXXIF1UltCTChha0bmJ8XPDkHrcRoBeUSLX 91jYHrz1p/0oC7tNvIq+CyjyTgRQIfg/885UP981+J1S8Jj5X2sikbupnp6r/N8qFrnMUC xzBrYUred5lUvlnZteKPj51/WbwRy/dtV3NeaYR+yjPxKFbw/7ymt+IOOgBNApHjVcgeI+ Nf2/9+gnEuoy2znBJdrBRT9JgQ1ArQOW8UjxZaHobbfGb7SrICqGgcxmimsQuy8ZzsyUsN pwazq+xHj88Yjs25kVTiej2GK9CsT7Al50BgQ4EkNmd676gAw6RUJZnJQZ6/HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677264612; a=rsa-sha256; cv=none; b=pugavPR76mX6H1lFAnc8OofyYQgItJ5CXKDOsnl8DQCn+flEzhL9Y+YGiCZC5b2t7U0ai1 BP0PHgm+ZTv5DgVF8cHQpDDZufKDKcv4Xn00jAgS+3UxOOXwBpQhQZRzL9b1PbTfNoXZFS X1JAE/bx01OLYU0LtyN0iM3IzdTzu0YJYfxdOsntDrlz3+4NKOr/x2JqR0fFOgMlv5y0ch gDONh31Ky3UPd2ihQ4XkT+sAOf33PT687KqupEQUAUYRLqa5o9d7tu6OdlCoiDOfQ4X1GJ /B0U1vBM2w3ffePnhfNHUZqKYdM5cOQlCYVgmR15Nc8kpNZ8PpINP+QsYxMaxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNf8g6sMqzYwn; Fri, 24 Feb 2023 18:50: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 31OIoBqO012824; Fri, 24 Feb 2023 18:50:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OIoBJX012818; Fri, 24 Feb 2023 18:50:11 GMT (envelope-from git) Date: Fri, 24 Feb 2023 18:50:11 GMT Message-Id: <202302241850.31OIoBJX012818@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: 19a7cf0ce8ea - main - scmi: Suppress a couple of -Wunused-function warnings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19a7cf0ce8ea07d93108331aa2099dc7d8973745 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=19a7cf0ce8ea07d93108331aa2099dc7d8973745 commit 19a7cf0ce8ea07d93108331aa2099dc7d8973745 Author: Mark Johnston AuthorDate: 2023-02-24 18:40:58 +0000 Commit: Mark Johnston CommitDate: 2023-02-24 18:44:52 +0000 scmi: Suppress a couple of -Wunused-function warnings No functional change intended. Sponsored by: Klara, Inc. --- sys/dev/firmware/arm/scmi_clk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/firmware/arm/scmi_clk.c b/sys/dev/firmware/arm/scmi_clk.c index a42f0ed2c0ba..77110282f9d0 100644 --- a/sys/dev/firmware/arm/scmi_clk.c +++ b/sys/dev/firmware/arm/scmi_clk.c @@ -58,7 +58,7 @@ struct scmi_clknode_softc { int clock_id; }; -static int +static int __unused scmi_clk_get_rate(struct scmi_clk_softc *sc, int clk_id, uint64_t *rate) { struct scmi_clk_rate_get_out out; @@ -117,7 +117,7 @@ scmi_clk_set_rate(struct scmi_clk_softc *sc, int clk_id, uint64_t rate) return (0); } -static int +static int __unused scmi_clk_gate(struct scmi_clk_softc *sc, int clk_id, int enable) { struct scmi_clk_state_out out; From nobody Fri Feb 24 19:16:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNflK6BWHz3tqr3; Fri, 24 Feb 2023 19: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 4PNflK5cC8z3hjj; Fri, 24 Feb 2023 19: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=1677266205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VIVpt4g53GGTKVXsxlR/RAIU/8XwrrtbaPNqqxH6/TY=; b=oLafAjcbhHCvKG3iwzo29jlvSlv/nh6avGIidf88DDozJBLiZVFKfuXPAfL3kmhUG5sVEJ pvrYwITevNpZDNkGISCtfzuZPxul+AY5rNvFh/M/SkzwVe1GK+ZJt8GJ0xFP0kePlPDNqN Skyy8hjDdeOoA+z4Jmc28dXip/ENlbcdeBBGYU2QXYJNRHlpm62lPuRzt4L85WQWPlgP7E 03aLlcrcXqU6l4Lm0G8nh6Kip7MAdggi+PUCkDkGaqgIRMIqHUjyI+Nj/RqIr2lvj8M5Uc i127SCm5L8s5gTFFMqenwktTmghjzYcRX0BWcZ15w13CJoLVq/H4RFx/JjVmAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677266205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VIVpt4g53GGTKVXsxlR/RAIU/8XwrrtbaPNqqxH6/TY=; b=r2K9ORU2XLBpALyQ7VkmFdUrcfTQRm0zwISBYmVvgJId0T3VmEPFRpFve3tnZ3nziXjSaD +np8Od1uRWsIW3KnnlSQ8Fj9AkgiddRfLBlkjAViO3e/Dz0xR1f8KQFavYLOlCMbgnUIME fBTD6I6GHnCZqoY2TvpNN9QAOsvQR0gb/7+e6ava2P8TMjWlJSbj0ZVF4pBLzzMRPozjOW /plRBbUE5jKdcndKHdRaMoJ/RTQfRLsF9hDGRz+aKR8jr47C3QqMVk72vr51FJ+OmHfdPd sw7ueX3inR5NIu3I0mh18WAkGhHLd5utgBU0R/ekcZZQ/ZzNBt9GmSEu7+Sj9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677266205; a=rsa-sha256; cv=none; b=k75XP90d27BMbk8hbT9wBSY3CPuqYu8+XbHKNYuI3NOhOTdX5Ey5WdL7Hmy+X+WwtHFOay yPbPUdCksoyKUw5Zl+03dSqHX++DBQhXgs2xswi2ntfqR4sZzHNx9fZRT736ddcSIWL64T 7BiRAtHjshQjJimNobDy0wHfZX4DkY2GSMOWJjYemoiKLku4BNfTS5xlQ09l5fNZl81ohJ dCRJv70+onLUOezgSC/Os295BtvIJmrNe4SmNHvP8pXreB+GYaFyzhvKTBQNSivBzn1O+9 6/DlFUuLo66TbtHv8yrG61sY7+USyNiiyAKOtMlji8IJIVZ1aAqTwnkRKFAHnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNflK4ZZ6zZjk; Fri, 24 Feb 2023 19: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 31OJGjOF050884; Fri, 24 Feb 2023 19: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 31OJGjLM050883; Fri, 24 Feb 2023 19:16:45 GMT (envelope-from git) Date: Fri, 24 Feb 2023 19:16:45 GMT Message-Id: <202302241916.31OJGjLM050883@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: b9c8f4900ce7 - main - config: drop reference to removed System_spec List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9c8f4900ce7a18508517ce74a3e644a5ae3c1bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b9c8f4900ce7a18508517ce74a3e644a5ae3c1bd commit b9c8f4900ce7a18508517ce74a3e644a5ae3c1bd Author: Kyle Evans AuthorDate: 2023-02-24 19:14:50 +0000 Commit: Kyle Evans CommitDate: 2023-02-24 19:16:19 +0000 config: drop reference to removed System_spec Fixes the following warning: yacc: w - the symbol System_spec is undefined yacc: 3 rules never reduced Reported by: otis Fixes: 6a836ea741c7 ("config(8): Remove obsolete 'config' directive.") --- usr.sbin/config/config.y | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 0ffeb653d722..c4a3522ebbcf 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -188,8 +188,6 @@ Config_spec: | NOMAKEOPTION Save_id { rmopt_schedule(&mkopt, $2); } | IDENT ID { ident = $2; } | - System_spec - | MAXUSERS NUMBER { maxusers = $2; } | ENV ID { newenvvar($2, true); } | ENVVAR ENVLINE { newenvvar($2, false); } | From nobody Fri Feb 24 19:27:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNfzD39L5z3trLc; Fri, 24 Feb 2023 19:27: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 4PNfzD2W2fz3jvn; Fri, 24 Feb 2023 19:27:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677266824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zdyTZvmv9tLG06aoutqggXLePaqyZUN9PIVAYVAB1t0=; b=H9xl6O1DYbMYfqH3J+HTa0pLLEsk9/dYLcYe/J51HwBghlK25kSOUydkBFX5Eo1GYOF7vP JucN5ODxyVkMPW3VGEI+4imGJ/LdKy6QNl/NRt7HpeRgNy5u8YGJwMnNQQeYe1fDCo4zyK f0oHNvihXCymMBs4ZpytMzqZTPDn8ptmgmkdQV4+l+1t/1Nbs7b2dS0tOfAubHe4hkEbTE lbwpgl9n5Mpt+iHG5ZcqNsy1Lg4BNSbBrehBPKV9b8N3Kp67MptXndHnS4sFL5CknPApHF UCNMa7QMXZpKQxgTFml9jJEG9u4tBaVKS5SGAiGsDKsYHnSKJw9xAgFOSKrVWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677266824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zdyTZvmv9tLG06aoutqggXLePaqyZUN9PIVAYVAB1t0=; b=Sk+NQph/eydH5bx06jXoS5TKmKST+Mn+uP3NXgIGwPOl527upJtYG8h9vMKi1Lq91GQxea iNiSpfLiES9fP/NIAJua9VwUKA/xJXzMla9B7DnBS751QtD4Riy942OuM61aOuUq//Ahoy jCsZUNECmG7IGsyq/q3Wo+kE7SxPHhSmRmiudhxLdK2OLLCquYAgU4skR194QnsL0rrYzW t66Bew6cJu2U6oZjVWDNEe/TSDF1YWnB9bswyC6ui5baDTPkh17ig9RPeIuJktMFsxAzdU RLqgyySSK1o8u2+vy5DFZexeQHcx0EOtu0LMJ2gWsZ4eFb1jePnSHqFvgh/Fhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677266824; a=rsa-sha256; cv=none; b=XgLIsdNENACXr5dSv9w3HvZsSLfR0bwsheTyOxVUkC0fF2Vm58geZbg88uQKdU3I6LD1i3 3vZSg2hiPbsTysbyn8a1s43pBiYAFZ3N/qf/8jHiTspexXubQXm1C/OAXdFNgEocRDRDC1 dynEgGZ86s3f3gqnMUbc7JA2inx83f2096T5ZRturxCkTpynym/uM5P3/altEmNJnbvQ9h Hea5fd+8CdwfsaCBZrji0foK9NfBaaK+PES9v09v7b3Gj2n95/d1ZO6RH+sc2qX/aQZrxF xAVLwfy6CtYlgoqFOpW8ESJv4ple6DJ5oLZslaBkEprZkrZ0CDVe76mz3hut4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNfzD1XJmzbJT; Fri, 24 Feb 2023 19:27: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 31OJR4cM066943; Fri, 24 Feb 2023 19:27:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OJR4w1066942; Fri, 24 Feb 2023 19:27:04 GMT (envelope-from git) Date: Fri, 24 Feb 2023 19:27:04 GMT Message-Id: <202302241927.31OJR4w1066942@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: 83158c68934b - main - time: s/ppsratecheck/eventratecheck List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83158c68934b4fae6897bbe1694cf9a7f4b9c0b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=83158c68934b4fae6897bbe1694cf9a7f4b9c0b1 commit 83158c68934b4fae6897bbe1694cf9a7f4b9c0b1 Author: Mateusz Guzik AuthorDate: 2023-02-23 12:49:11 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-24 19:26:36 +0000 time: s/ppsratecheck/eventratecheck The routine is used as a general event-limiting routine in places which have nothing to do with packets. Provide a define to keep everything happy. Reviewed by: rew Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D38746 --- sys/kern/kern_time.c | 18 +++++++++--------- sys/sys/time.h | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 658f6df0b386..fd4e89d61b15 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1098,21 +1098,21 @@ ratecheck(struct timeval *lasttime, const struct timeval *mininterval) } /* - * ppsratecheck(): packets (or events) per second limitation. + * eventratecheck(): events per second limitation. * * Return 0 if the limit is to be enforced (e.g. the caller - * should drop a packet because of the rate limitation). + * should ignore the event because of the rate limitation). * - * maxpps of 0 always causes zero to be returned. maxpps of -1 + * maxeps of 0 always causes zero to be returned. maxeps of -1 * always causes 1 to be returned; this effectively defeats rate * limiting. * * Note that we maintain the struct timeval for compatibility * with other bsd systems. We reuse the storage and just monitor - * clock ticks for minimal overhead. + * clock ticks for minimal overhead. */ int -ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps) +eventratecheck(struct timeval *lasttime, int *cureps, int maxeps) { int now; @@ -1124,11 +1124,11 @@ ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps) now = ticks; if (lasttime->tv_sec == 0 || (u_int)(now - lasttime->tv_sec) >= hz) { lasttime->tv_sec = now; - *curpps = 1; - return (maxpps != 0); + *cureps = 1; + return (maxeps != 0); } else { - (*curpps)++; /* NB: ignore potential overflow */ - return (maxpps < 0 || *curpps <= maxpps); + (*cureps)++; /* NB: ignore potential overflow */ + return (maxeps < 0 || *cureps <= maxeps); } } diff --git a/sys/sys/time.h b/sys/sys/time.h index 20375b9a82af..673de65a688c 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -578,7 +578,8 @@ void getboottimebin(struct bintime *boottimebin); /* Other functions */ int itimerdecr(struct itimerval *itp, int usec); int itimerfix(struct timeval *tv); -int ppsratecheck(struct timeval *, int *, int); +int eventratecheck(struct timeval *, int *, int); +#define ppsratecheck(t, c, m) eventratecheck(t, c, m) int ratecheck(struct timeval *, const struct timeval *); void timevaladd(struct timeval *t1, const struct timeval *t2); void timevalsub(struct timeval *t1, const struct timeval *t2); From nobody Fri Feb 24 19:31:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNg4151nRz3trbG; Fri, 24 Feb 2023 19:31: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 4PNg414ZC6z3ktZ; Fri, 24 Feb 2023 19:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677267073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ariONyuE8G80QPHCgfkOra8t3W1CrbM5FgC3VJA/fM=; b=fTro6KPJ3XkGk4VvEr/qG2QDctg06We2NB1kTzOOfaKR0jyQficfeJ/bF4c2NugXE6TuGt M1rtHxbjQFZBa61/+QytSpyC3GUtxt24S3URsn2aIeuJYd7uw2Xebz1W9FDH/E+/3KfWy/ I4uyEpm9K704d2MG6/3+60JG5Q/wy9+dXT4YXNVZXloGIggSSH4JzyNpNY3bNsu93RIGmw 7pKHnjwEw34S9SdFqu3JNFoV/RuWIEV8LDmF1TrRhvK2mZ8j/1AwKAECkRwwNJvURSiBic jpnd3NRlnQK2ZhE80kM5HYFnTQxPS7HfORRyC85F47z5x1xRRdrQ62W757HzKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677267073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ariONyuE8G80QPHCgfkOra8t3W1CrbM5FgC3VJA/fM=; b=Kc0rvWbkcF7hh0429B2PIrSJorZkZSwPFFbOlxkvKgFA6sVFqCPBvvtMS/WD7rJFcqQhqL 2Hvt6B++j7ULXzYRJJ1I/dGkNIxvcREGpReUQd3PTJHw1+j+QdnNov3VNlBTfDZGLGf2NB 297tYsg3romBjrT0Hxi10+aqrPhNB6E/zy4NDpxNOeojBG7+BtLyzCzxnSx47FN6G1svof KyDAYhJH2OMW4f71KnKm5rJbXw8C4ESJKWf4WuQjsm0AcXo9rn2rYJjg0S582hH4OItpn2 1yHmWiEow9B9EvMfUz8IDV9MeREgDMpobczRhgma2KzmrA4Tr/4Ec7T1Ebs1Vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677267073; a=rsa-sha256; cv=none; b=EoMQv0TzL33JQ2r6iVMD8RTA6SYhCkopE5jP44gYblOLXYGAGZnk67cHeZqddlZMwbdsso pnDhv/ZPQks+7E30KD2mv/hQgo07BbOoPTczMMFNaKBjx8tYplwSX4Qs2zQDHSCQdfJFda Ps96CfEF8/oofLMUYcrIs7iDZshyrbFfjhT5/Lz8mUMgvEH8AdIKPHm4NMmO0g12pqDS8g 9OLrUw/ahE67n1hWrZcBqGYDMPSVQGjMFFKrExdVRYjiaYKMKk5kk/UeGhEBlmYg8AbNW3 bZjADewQQ9BZwbc2t0UfvUjZPXtOhHhN8pqQV5a41K4UyXpv3S5ySx02k5eR0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNg413dXgzbd2; Fri, 24 Feb 2023 19:31: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 31OJVDXl076992; Fri, 24 Feb 2023 19:31:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OJVDNW076991; Fri, 24 Feb 2023 19:31:13 GMT (envelope-from git) Date: Fri, 24 Feb 2023 19:31:13 GMT Message-Id: <202302241931.31OJVDNW076991@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: 1ebec3806eed - main - vfs: s/ppsratecheck/eventratecheck List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ebec3806eed27f2f1ddba1960c1fef905befeb0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1ebec3806eed27f2f1ddba1960c1fef905befeb0 commit 1ebec3806eed27f2f1ddba1960c1fef905befeb0 Author: Mateusz Guzik AuthorDate: 2023-02-24 19:30:49 +0000 Commit: Mateusz Guzik CommitDate: 2023-02-24 19:30:49 +0000 vfs: s/ppsratecheck/eventratecheck nfc --- sys/kern/vfs_mountroot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index 3c506378ad2f..79019c4bbc8e 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -987,7 +987,7 @@ vfs_mountroot_wait(void) curfail = 0; lastfail.tv_sec = 0; - ppsratecheck(&lastfail, &curfail, 1); + eventratecheck(&lastfail, &curfail, 1); td = curthread; while (1) { g_waitidle(td); @@ -996,7 +996,7 @@ vfs_mountroot_wait(void) mtx_unlock(&root_holds_mtx); break; } - if (ppsratecheck(&lastfail, &curfail, 1)) { + if (eventratecheck(&lastfail, &curfail, 1)) { printf("Root mount waiting for:"); TAILQ_FOREACH(h, &root_holds, list) printf(" %s", h->who); From nobody Fri Feb 24 20:20:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNh973XW6z3ttfM; Fri, 24 Feb 2023 20:20:43 +0000 (UTC) (envelope-from kevans@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 4PNh972tTFz3nSS; Fri, 24 Feb 2023 20:20:43 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677270043; 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=2tmN4I5p0bF1bD+U3AjTVX2mehcHMT8EPvOJFRBs9Fg=; b=AibLn8SsmbPWBJB4zyQv4IzxMnlY0F0yltk/124cmbAYF+x4cC7I48Iy/FTaXgvgMBow/U xGCmueqRN0f7FncuoDWOX9EoFWTq8gFXoDDycVDZxCa98QRQnJa/JWGqsSNGfsEKRWy1mb YrIXGN+QU42CPlnPkPwS5Oly21YB/RA3tCgy1BE2u4qvSn7XdH8GFkx6jWJVDjt3PKwXGO ttwfrWv7pRfjVMOtV4A0U63VG1grN4qCFFDPKTV+eZKiS8zNyTHJwZsdITBhPiwynham9x LYTZvf/NS8AilkCOw2mEowIzOG8x8ctpKPVyhI/ad0THiUOStpX2A5OUNB1izg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677270043; 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=2tmN4I5p0bF1bD+U3AjTVX2mehcHMT8EPvOJFRBs9Fg=; b=jhK8rBcntbBBhBYMTP3Ed6zZREy9PiMvt8Cniy0asdJOoYNpgcd+fjsc7qhg+Fe43nhMMV VclqGH41EE79HA0DaxHMaDXcxGufyJzNv7wmEOy8DVCZ6ZWuCWVLzxL/Q5d5mHuLjAl91O iBHkvrO6YZuvymFvy04PlkM7IMnfb2Puw/DcPax68ISEhCtDFTpaPudyks0ZW6hM1g0vWu torJ9scfQoT5Jv9nlsTdjOwTsWG4rPXqWJ4yE1FfVc62Yae4uoUbWjwBxVbVwiuK+/dk5w bLlF+mN/yaAEM6Sp+98Jlm+ZJJd3VeKvwjeXgT35lRijlIxNXDS1MpThctjWvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677270043; a=rsa-sha256; cv=none; b=ND56wHJ0lmcW6RSAMTKvGquoyYljSKnQQbLwx1UAW8MyzsAoHAVvl6JEmrvk0X2OvB4No8 0QOUSmsnpiGvZSs5sweXroctKllwxT8JrrWLG+Cf5PXPBVHFy7lVIQALlF8XgG+pUOVCx9 VylwkjZGEqEBYGVYh5p2KNf9S5+gSLV9V1TRhOkNbKMnsbZe1w8wWtCcFrSLLeP0dWLSEW qIn2Db6B0FkW03ZXWnaY2evAEODCNZnpom3CuXKV36mYId4Bgd79qmV7C5lVTg6ikCtD2k 8222xyZEKicTdAQulNwgCasJzLUNeJyu+PHwVjf68mFjw6WgFpQAT5YaM/40CA== Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PNh971mRKz1528; Fri, 24 Feb 2023 20:20:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f176.google.com with SMTP id z6so796652qtv.0; Fri, 24 Feb 2023 12:20:43 -0800 (PST) X-Gm-Message-State: AO0yUKWhxQp/9iXUCTPlqz84S3wI6LvSryBEj7KJ0kxCFqX8qPAVQWRQ d5j41kTZkB02tlL9Np8MpkOhI/T1E3YIiap6QR0= X-Google-Smtp-Source: AK7set9BPGi3XwTQWYKSN8T8i1C2AtcUAn39uB23HhFYhO0OHX5zo5LYCOYxniK9Ven8/RfdCdUpUlQ9fPSKRCh3tFA= X-Received: by 2002:ac8:4110:0:b0:3bf:bd88:777e with SMTP id q16-20020ac84110000000b003bfbd88777emr708604qtl.1.1677270042919; Fri, 24 Feb 2023 12:20:42 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302241927.31OJR4w1066942@gitrepo.freebsd.org> In-Reply-To: <202302241927.31OJR4w1066942@gitrepo.freebsd.org> From: Kyle Evans Date: Fri, 24 Feb 2023 14:20:36 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 83158c68934b - main - time: s/ppsratecheck/eventratecheck To: Mateusz Guzik 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-ThisMailContainsUnwantedMimeParts: N On Fri, Feb 24, 2023 at 1:27 PM Mateusz Guzik wrote: > > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=83158c68934b4fae6897bbe1694cf9a7f4b9c0b1 > > commit 83158c68934b4fae6897bbe1694cf9a7f4b9c0b1 > Author: Mateusz Guzik > AuthorDate: 2023-02-23 12:49:11 +0000 > Commit: Mateusz Guzik > CommitDate: 2023-02-24 19:26:36 +0000 > > time: s/ppsratecheck/eventratecheck > > The routine is used as a general event-limiting routine in places which > have nothing to do with packets. > > Provide a define to keep everything happy. > > Reviewed by: rew > Sponsored by: Rubicon Communications, LLC ("Netgate") > Differential Revision: https://reviews.freebsd.org/D38746 > --- This should probably also be added to share/man/man9/ratecheck.9. Thanks, Kyle Evans From nobody Fri Feb 24 21:43:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNk0t124wz3tyP8; Fri, 24 Feb 2023 21:43: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 4PNk0t0N5kz412c; Fri, 24 Feb 2023 21:43:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677275022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6iOoHqsQl+fBWlIZob1s284QjnEZHNoWLpRpW7z75no=; b=LF9TMOOnyxnLusz5YBtdmRF6PnzQrCtm1EfN8xAnVRM+ge+C4i0uRnt2XKtjhBsn2HDLmB ceLbEBvbKfOObBU5syTSG/ktwtXWKaoE8LWm18n/8WZrC8P7z+v9rMttBm1jxOc1xpseK5 tX8sRRB4A8Bwv1w9Ia7vqoUvDef+CEeeeOlUGgEhCAG8S6EradmoyDIWHFFItsKb9BCCaO wWBzFGt3K8V25vMDMcWUDKhXb/ajkFg/8Gr2DbWAkIEqqJiEVf3Ii/5YBhP7DTCQT0TucW auvQQEoCfft3DdidNQ/1ikAlsAsu2ApGJB8DvtFPkA5A+0kKIYRWcLuIGndTKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677275022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6iOoHqsQl+fBWlIZob1s284QjnEZHNoWLpRpW7z75no=; b=eFcN/TKeQyvajSFcsclVcLd5aOLtCd2ag57HEl5adEASQ0VcoYxuTTFwqXppO8Kh+kIoHe t6SEKz8PwSEb4ECQKxwIvQWGEtJ44tdOuo0dO0X8HZnK6gHFlJQ+YYAPV6a/E9OVP82PtY DwvtBdr6PxxcSTqEy7tV2nCyM+4C87VrIBCHGKM6Z/ZeuNQcg8aDOXAkzx71DID5QCnSzg aOi1GIFbnyWtkYKg/gfJexnJZ/x7yeFUBX1vlNS1pyTka8snR0ElLjwXkk8Cg8W9MYxxJ/ bxuMy6KQZycJVMzJfemqJhFp7qWhFp0upgdvQAFhjI3psUR+gVsMnvolhfLfwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677275022; a=rsa-sha256; cv=none; b=OD034mHaTvWYJ6VSG2QaxnBYqxp3SCY6E9hiWHgNXyoH+R/Oui6IAqSGB2MKQREujXCTTM /GBKbi4HXSJs2+Nw6A9iksbsG6Dv5CwPY6OMQV4L15YNbgg68XRAuWLZb3oSGEneN7mYlU thUOcNe8KJw/GETF9/7HIvglZEkmVdAcjX39kzAaTnl5AqAQXnYAypWurr2cO6Sy+gLL4c hpgt9Vd32C3Vs1zNgfmjnh6Z3IqQ/4cTlw55krXhtlsIXs9FvnUIOgJ+zs1CuLZsyrp9DH r409ZWvcXvGiTRERz4K1NiS+VJZDE1CL+wZ+kSUSHuThX6UjeE4WYfwbSb8mNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNk0s6ZQ6zfPZ; Fri, 24 Feb 2023 21:43: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 31OLhfKH087278; Fri, 24 Feb 2023 21:43:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OLhfO3087277; Fri, 24 Feb 2023 21:43:41 GMT (envelope-from git) Date: Fri, 24 Feb 2023 21:43:41 GMT Message-Id: <202302242143.31OLhfO3087277@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: 163dd260e3cb - main - Add gnn@ as my mentor. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkoshy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 163dd260e3cb62911968aaff761ddbc57117bc23 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jkoshy: URL: https://cgit.FreeBSD.org/src/commit/?id=163dd260e3cb62911968aaff761ddbc57117bc23 commit 163dd260e3cb62911968aaff761ddbc57117bc23 Author: Joseph Koshy AuthorDate: 2023-02-19 09:25:22 +0000 Commit: Joseph Koshy CommitDate: 2023-02-24 21:42:30 +0000 Add gnn@ as my mentor. Approved by: gnn (mentor) Differential Revision: https://reviews.freebsd.org/D38673 --- share/misc/committers-src.dot | 1 + 1 file changed, 1 insertion(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 2dce9a542a23..0afa32f65654 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -558,6 +558,7 @@ gnn -> davide gnn -> erj gnn -> ivoras gnn -> jinmei +gnn -> jkoshy gnn -> jtl gnn -> karels gnn -> kp From nobody Fri Feb 24 22:18:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNkmh4XDJz3v1BQ for ; Fri, 24 Feb 2023 22:18: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 4PNkmh3whMz45XV; Fri, 24 Feb 2023 22:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677277092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PcQJMLxRGiQJVIrBpOiplVg3viwRLj5FOOVqre6e3Bo=; b=TmTo8TZFtRlZ/dw2Am7+GBpmUTx/IeuHIWx1ykJj8hUap6WWjQ4hdqnE6dE1R2UOW6SA/L KofiSS3uGzCCwsP4hyrkR9uAB/E54wVjD2IQ6frN2qsK9I/TKjW/hSjAaKXoU08TogvNEr sR3OA1F92zx985X2nmwGkEYikl9/DNFJlAMQqn096wZJ7/mppuactY0kQ75LoFEscoMIyL Ek8j/3wqhD5pG58oH0QsoYR4riYrMNwflPRhjdd0A9W3LldOXAupQtufJmtuZ2+3sZkisB NtoH7A1o5hBxV8U43N0j2joisrs4mV7Zr9ZUJHMVkBb0bsRLpnFahNncs0gtPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677277092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PcQJMLxRGiQJVIrBpOiplVg3viwRLj5FOOVqre6e3Bo=; b=Djj8n8okp46LNoFyTsTPtp+p9ZO2GF71vwEs7G7lZHKlcOH/xpZS/Nh6CV2CATUH4DJqaZ 5u+VIll8Cmyj0TJqsCvQN/3F8ngiL8B39wpAVRlSb5N4dKwqIn/wovdkWYorUkS8lpBHn0 +fBG/ut8bqwK8N1Mo9+s/jtbqHd2Cv5PKkLcDMVVhQaNT7GbkIVHcoHJV3Vnjm83QsK5Ii weWKKnsFvU+gE9zGQmWSj9QNfdWwtlxh9huY5+utbbLv/cHcJy0AyI8dUenlX6D/833ArT xgXWfgP8bAUEQNCq71h9LP03yOY0P/LBbE0Ejcfb5uru/oGB86vTCVBx9Y+3hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677277092; a=rsa-sha256; cv=none; b=sUKnVVdnxTjEumb181yeBxg1l8bsWVqpc+SDG3J3jE83amjw+GozsYYckMWOwwD0zOuMC1 3QHyM78knQ1pdthkYk8jO9r+WTbvhWkedg0D+CRHwDAPEGoGzUW98WzSjoMwwRcPYTWusb dVG9i08VPwDLvBozcQh7uF10k9kxdSdZPTA3nOfB33RLRIF5FiGzZAV21Hwpx8iAuACRmW 8aUpthq597JSd51/71gMGeyCzj/MNbdEIUH8VlKcek3jKHM485+psIZHMMcEOEZq0vV9AQ w7nfZuniMqY9kNCHDxupXtM4oKhpkP+YqRqkazVpReuq1i/lisFg4qWKjyCbLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNkmh2hWkzgHp; Fri, 24 Feb 2023 22:18: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 31OMICP5036093; Fri, 24 Feb 2023 22:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OMICGS036091; Fri, 24 Feb 2023 22:18:12 GMT (envelope-from git) Date: Fri, 24 Feb 2023 22:18:12 GMT Message-Id: <202302242218.31OMICGS036091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: aaf1213c6f70..61e1a12bb6c3 - vendor/bc - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/vendor/bc X-Git-Reftype: branch X-Git-Commit: 61e1a12bb6c3bfdb0a4e499c88e8eaa2b548e427 X-Git-Oldrev: aaf1213c6f70af0b517f6aa13cd837d3468a7a0d X-Git-Newrev: 61e1a12bb6c3bfdb0a4e499c88e8eaa2b548e427 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch vendor/bc has been updated by se: URL: https://cgit.FreeBSD.org/src/log/?id=aaf1213c6f70..61e1a12bb6c3 61e1a12bb6c3 vendor/bc: import version 6.3.1 From nobody Fri Feb 24 22:18:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNkmh4xHjz3v0Vr for ; Fri, 24 Feb 2023 22:18: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 4PNkmh4QYwz45cs; Fri, 24 Feb 2023 22:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677277092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m7aPQuaybU1Dt2djeOE1RFi2WOLf62M8XLw95r33maA=; b=ZGl9l7LjWl3afrfc7Lsp+Goq5Q0qUmR4wWEVpVbE9BB9qlcrUoZCuq2+6rU56pB774VIHg dkW79pDqo4w4suuqamlP36770rmAjpeCIA3RCI8aAZQz2Akqr56KMR36uVyBrxzZ4XFdAl vsZsbiPgYNBsoef5D3gWZ6PmKyNDFqmT3SrIE7sANezQgaBtS+ZLBvqh9GolxrKrH6sw9U 8LDuuVMxvLQPH73LYNiYxSlSxFhpbTkPmbnFmgTEAHii9LxhyXwshmvPDPomBT1aY/cQi3 DO8sHa+hdfPci+RhtLnUllBjktNlocTVJ5USZM4CUgeZaHHRUa8ybUXBpwNG4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677277092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m7aPQuaybU1Dt2djeOE1RFi2WOLf62M8XLw95r33maA=; b=aLKMz4/sJVc0lR8Lhf/VzmmKOLApssSEMGPrXRx86ueLEOl5yGw1CE4/ayrZGgg1jA5LmE CvR2SGHyNJ4i3u4BgKJJzpyGwyWBHwfFoqKnV0tlIrKzuQzImb6kz8FiizEeG8O81O1/0W gUiD7BC0g9QqiZZqyD1ZKsY9dyBZOHAOYx58L3M3JR42lNOnsPmVZblWNDquBOFigHfmlt FoqGDn0FSHD+wYCfq7MsL7tYqN5fJIB77oFDzk+EV+so0j+B2gLm3perpn+7179iZ7RYRJ CnPYeyaK8dQgHnGJ2Y53Vc6FNfjZOFlkeCvHdbeofBK/dwRdSFKyNXPDFEYJGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677277092; a=rsa-sha256; cv=none; b=gMM2Y9ui7e8o9b/WRob+ouPSKbQBDP/2Hn3CD1BLEulW/aeE0terianSKgQRDVmfzy3Fw6 jt/+N4xlnGAt+eio0Xhxe0Fj4xFqyEASlHqJR7xW4zmKdtvUQd/KL8CFvzaskv8nBRLx9g o8Zm0GdPBXa+eQuLEJsY+KUvtSx2fyaNOUh6xQBEc02UsQ8ddlQFQP7DMOkNFlycUWrR7e rgboQOYQPrnXeQ5ldSDkVzZmduwBNWNGaXWjAtGSmQFfQdrb7T2UcDIzLcMIsRu/TuIjZc xmy1xdSw2ec6OId23eId5gG6OQWhRVnnZsVTS1qaDZXZxlkdzQUEt+fFCWClSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNkmh3NG0zgHq; Fri, 24 Feb 2023 22:18: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 31OMICAU036117; Fri, 24 Feb 2023 22:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OMICJa036116; Fri, 24 Feb 2023 22:18:12 GMT (envelope-from git) Date: Fri, 24 Feb 2023 22:18:12 GMT Message-Id: <202302242218.31OMICJa036116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 1e3e5b7914fd - Create tag vendor/bc/6.3.1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/tags/vendor/bc/6.3.1 X-Git-Reftype: annotated tag X-Git-Commit: 1e3e5b7914fd0707f6d69b2bc3858bbe1c5e6fc0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The annotated tag vendor/bc/6.3.1 has been created by se: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/bc/6.3.1 tag vendor/bc/6.3.1 Tagger: Stefan Eßer TaggerDate: 2023-02-24 22:16:45 +0000 Tag version 6.3.1 commit 61e1a12bb6c3bfdb0a4e499c88e8eaa2b548e427 Author: Stefan Eßer AuthorDate: 2023-02-24 22:14:58 +0000 Commit: Stefan Eßer CommitDate: 2023-02-24 22:14:58 +0000 vendor/bc: import version 6.3.1 This version adds a command to dc to query whether extended registers are enabled or not. From nobody Fri Feb 24 22:25:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNkxQ1qt4z3v1qy; Fri, 24 Feb 2023 22:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PNkxQ1GCdz46g8; Fri, 24 Feb 2023 22:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677277546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7+CRCeLxoEDhPMeuA/TTDD7h3GDTY0Arm6hyaSVsQfE=; b=HcBk3b2/SkJ+lyVNO2mPM1WoKXSncw/ABGJGCsPH7kW1QvrcfJ6cJOejzSsbjJahD+h8OG Bpub88eYlB/d9Z4tRR7RZvpkYVCz4tJqW6yCgZhXZ1Nx3poSuvl8gt4otiavkfMgLSyJBZ BWJxHfADrDZJfDJkfRSANzDSG2idKw0ghcdZl+KMA4BTkwu5bfEsZraA/2Ld2BfLiblieI TSi7J5QJ5UlO78E8qtR22mVtEhP7XEkpbukBUYwRjMGlc+rXhEmNlxS1jZCVkPPRgf3h1J Tyk1aTrHaUbD0nFOvdscGI9B61BhX71Jt8Sav3ErhOxfSMp/OZIjXYh3tx+Rlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677277546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7+CRCeLxoEDhPMeuA/TTDD7h3GDTY0Arm6hyaSVsQfE=; b=ISSDvPrGDPdPSktfqj4WZxBaSnL+177wrydu5NOXlxxNXtpmplTczO0JP+y8dozRaWrL9H XGUi40BuyWhNSyQbBGFznVyFrf6rr/y1KkygOi2wfOjRufAnjRk6jJkZk1cB1ALbgXiQFi Lt+fKOF+tBmPK4+sG2bdXFZQtQ/tAmez3lglJ4sKSoQzf56pm6b1AeNgJuUHxze3ojoHsa S8uJ+f0NlaIFew+tAu4JIiPBzrTR0GjFc9hrLFVMHdtaPvYYSFjtnZen20423lAE1L+arr 2sxK/TElsQ3HzywFp10Ht4+/bg92ZXn7s2j7R283cVsakl9ZfNDLMBPr3IH1kQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677277546; a=rsa-sha256; cv=none; b=grYay56T6rvGvKlxrgETlFx+U1jttENAO3OVMIKMSE+3Js+wa0bVpGWulz9Iy8U9SNFT0i ApL6I56/s4Rbrf1NOMOAlDIKBdcqsA6JJi0mbXBkw7xueuQuWUnXmHx+5ql4PZIiJJWNBd /XgGKrEjc2dc4avmOjwru9l5j6TZbf+xNnjo5k8mQl0qgAZVtw84limNrmjYycmyWOAIDt ZcE/cKSRI4/uqVFga/+A9kNuHYEwCLS+bxF42C+uR+gGZeMXXECs8kIoh/4PEG0Fn3iIVf nDbrf1Fet3XXfqaEmA46z1HMLc+1ebdD3SvK5qT5Nq5DZrcoV2dP8yx+TbGDLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNkxQ03vyzgS8; Fri, 24 Feb 2023 22:25: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 31OMPjwq051339; Fri, 24 Feb 2023 22:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31OMPjdE051338; Fri, 24 Feb 2023 22:25:45 GMT (envelope-from git) Date: Fri, 24 Feb 2023 22:25:45 GMT Message-Id: <202302242225.31OMPjdE051338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John-Mark Gurney Subject: git: eb81dd8404e5 - main - make cross build from arm64 work.. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jmg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb81dd8404e55c8e048acfb1cd4f4c3c021afaf4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jmg: URL: https://cgit.FreeBSD.org/src/commit/?id=eb81dd8404e55c8e048acfb1cd4f4c3c021afaf4 commit eb81dd8404e55c8e048acfb1cd4f4c3c021afaf4 Author: John-Mark Gurney AuthorDate: 2023-02-24 05:47:03 +0000 Commit: John-Mark Gurney CommitDate: 2023-02-24 22:24:19 +0000 make cross build from arm64 work.. Reviewed by: dim, imp, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D38762 --- lib/clang/libllvm/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index 01fe0705d954..a031f0fdd706 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -31,6 +31,9 @@ TARGET_ARCH?= ${MACHINE_ARCH} CFLAGS+= -DBLAKE3_NO_AVX512 -DBLAKE3_NO_AVX2 -DBLAKE3_NO_SSE41 \ -DBLAKE3_NO_SSE2 .endif +.if ${TARGET_ARCH} != "arm64" +CFLAGS+= -DBLAKE3_USE_NEON=0 +.endif SRCDIR= llvm/lib From nobody Fri Feb 24 22:55:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNlbC3MVhz3v2rp; Fri, 24 Feb 2023 22: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 4PNlbC01b1z4BHn; Fri, 24 Feb 2023 22: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=1677279303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xiZ8vqwgKRg8vyaH+fShHhGblMG/t1jrBsjnuKazhvg=; b=suU09QkV1H++e2UDHJ3mFOeKlU+Qexlfk6EORtMGU/fCqP1S2MrItDeTcdwIxXNSw8Qux2 WqRLqlFNcWV3GYmVseDK9KtNvGKcLN2JZAITmrz6X1+zoutluCKtqAbYkbJSZ/e6wBvWjt 6pEllxE4OfkEnwGSjcfWM1qJVccQqp3CjjE7zXGzz4qMDBvztPZdeDDyjOqWGN954tWPCY M/s895SdlJmSdVLngOIRwKlTTw/VgjlFj/CufPWChlpaDeS+7O1kbT7dJzx6+6y0C7XIFO m/hCKfVCht89crg35ryx63/ro2iloPL7c6KasDW2D3EcY+FSX0ZAxXuNyMev7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677279303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xiZ8vqwgKRg8vyaH+fShHhGblMG/t1jrBsjnuKazhvg=; b=AvlxnXrzs181UAVCYO3Z+TP7L95N9wz03GSJyRfwErc37B1WWWnXGFrpBRQGip0MnvPy5+ OqcrcPG63ChFJLPWtPfvHX7s6FksFDiSq4WMZeYm0dBgZ5N71X8HOqXXxcZAQHHCghjQG1 29YVvSNN9EqYXPXr8MiPyZzc3qKBQu/SGuWxRD8rEctTlZeM6ImtlQCmroWfXljKf9af8d vLhcUDzv+eMMzSopjIJiVrsg36SZYBncVlJe8tiS1Ki6Kpuqqp2gNpMdsrTGz9ldq8tR0o yJ8w99ZwQMp6v6Dbi3zsU6ahTqm+ocPo5vGvfwonWvpJzZf1SDvnCqGhUixLhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677279303; a=rsa-sha256; cv=none; b=Z4mxDP+5l02T6+5KQ+y+QXS5Rp+7fRfiBwPp2TdlNigmdKs4vWBbFUmqCq8pNBQ5nSeUb4 dRCIAJ8oRq3wKKFiaTFSXOKgeV56cgqTCwc1nMwYC/FKuIZ6IsWFLjV8bK1IvuAS2oG4b6 +ui6LFNQyuTBgJozizBsu4S4pIiiOy/ELa8FfYhlFmChU2/vasA+yOK969gZuV4a4aiMbN swuHyIF0ODVx+r+zeEV/tnK0LEIsgyXRBXdvwqzcbQAQQnEu9QOt9+/66PIngw26y7l5Dg UNTvVNQ9ocSMHoMzxBfPvlrFCOJ+73R2kDvMM7ICOFajg9eF5uOZ3TmFlOim2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNlbB6BSPzhCp; Fri, 24 Feb 2023 22: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 31OMt2eA098249; Fri, 24 Feb 2023 22: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 31OMt2RH098248; Fri, 24 Feb 2023 22:55:02 GMT (envelope-from git) Date: Fri, 24 Feb 2023 22:55:02 GMT Message-Id: <202302242255.31OMt2RH098248@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: 103d7cdfb743 - main - vendor/bc: import version 6.3.1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 103d7cdfb7435591049413e1bc39482cb316efb7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=103d7cdfb7435591049413e1bc39482cb316efb7 commit 103d7cdfb7435591049413e1bc39482cb316efb7 Author: Stefan Eßer AuthorDate: 2023-02-24 22:14:58 +0000 Commit: Stefan Eßer CommitDate: 2023-02-24 22:52:09 +0000 vendor/bc: import version 6.3.1 This version adds a command to dc to query whether extended registers are enabled or not. (cherry picked from commit 61e1a12bb6c3bfdb0a4e499c88e8eaa2b548e427) --- contrib/bc/MEMORY_BUGS.md | 5 ++ contrib/bc/Makefile.in | 10 +-- contrib/bc/NEWS.md | 25 ++++++++ contrib/bc/gen/lib2.bc | 4 +- contrib/bc/gen/strgen.c | 6 +- contrib/bc/gen/strgen.sh | 4 +- contrib/bc/include/bcl.h | 6 ++ contrib/bc/include/lang.h | 7 +- contrib/bc/include/lex.h | 17 +++-- contrib/bc/include/parse.h | 14 ++-- contrib/bc/include/program.h | 12 ++-- contrib/bc/include/rand.h | 6 +- contrib/bc/include/status.h | 24 +++---- contrib/bc/include/vector.h | 4 +- contrib/bc/include/version.h | 2 +- contrib/bc/include/vm.h | 6 +- contrib/bc/manuals/bc/A.1 | 6 +- contrib/bc/manuals/bc/A.1.md | 2 +- contrib/bc/manuals/bc/E.1 | 6 +- contrib/bc/manuals/bc/E.1.md | 2 +- contrib/bc/manuals/bc/EH.1 | 6 +- contrib/bc/manuals/bc/EH.1.md | 2 +- contrib/bc/manuals/bc/EHN.1 | 6 +- contrib/bc/manuals/bc/EHN.1.md | 2 +- contrib/bc/manuals/bc/EN.1 | 6 +- contrib/bc/manuals/bc/EN.1.md | 2 +- contrib/bc/manuals/bc/H.1 | 6 +- contrib/bc/manuals/bc/H.1.md | 2 +- contrib/bc/manuals/bc/HN.1 | 6 +- contrib/bc/manuals/bc/HN.1.md | 2 +- contrib/bc/manuals/bc/N.1 | 6 +- contrib/bc/manuals/bc/N.1.md | 2 +- contrib/bc/manuals/bcl.3 | 2 +- contrib/bc/manuals/dc/A.1 | 12 ++-- contrib/bc/manuals/dc/A.1.md | 10 +-- contrib/bc/manuals/dc/E.1 | 12 ++-- contrib/bc/manuals/dc/E.1.md | 10 +-- contrib/bc/manuals/dc/EH.1 | 12 ++-- contrib/bc/manuals/dc/EH.1.md | 10 +-- contrib/bc/manuals/dc/EHN.1 | 12 ++-- contrib/bc/manuals/dc/EHN.1.md | 10 +-- contrib/bc/manuals/dc/EN.1 | 12 ++-- contrib/bc/manuals/dc/EN.1.md | 10 +-- contrib/bc/manuals/dc/H.1 | 12 ++-- contrib/bc/manuals/dc/H.1.md | 10 +-- contrib/bc/manuals/dc/HN.1 | 12 ++-- contrib/bc/manuals/dc/HN.1.md | 10 +-- contrib/bc/manuals/dc/N.1 | 12 ++-- contrib/bc/manuals/dc/N.1.md | 10 +-- contrib/bc/scripts/exec-install.sh | 6 ++ contrib/bc/scripts/format.sh | 2 + contrib/bc/scripts/link.sh | 5 ++ contrib/bc/scripts/lint.sh | 5 +- contrib/bc/scripts/locale_install.sh | 3 +- contrib/bc/scripts/safe-install.sh | 12 ++-- contrib/bc/src/args.c | 4 +- contrib/bc/src/bc_parse.c | 6 +- contrib/bc/src/data.c | 16 ++--- contrib/bc/src/dc_lex.c | 1 + contrib/bc/src/dc_parse.c | 1 + contrib/bc/src/file.c | 4 +- contrib/bc/src/history.c | 4 +- contrib/bc/src/lang.c | 8 +-- contrib/bc/src/library.c | 4 +- contrib/bc/src/num.c | 12 ++-- contrib/bc/src/parse.c | 4 +- contrib/bc/src/program.c | 49 ++++++++------ contrib/bc/src/read.c | 4 +- contrib/bc/src/vm.c | 34 +++++----- contrib/bc/tests/all.sh | 3 +- contrib/bc/tests/error.sh | 8 +-- contrib/bc/tests/errors.sh | 8 +-- contrib/bc/tests/other.sh | 120 ++++++++++++++++++++++------------- contrib/bc/tests/script.sh | 6 +- contrib/bc/tests/scripts.sh | 5 +- contrib/bc/tests/test.sh | 6 +- contrib/bc/vs/bc.vcxproj | 2 +- 77 files changed, 442 insertions(+), 294 deletions(-) diff --git a/contrib/bc/MEMORY_BUGS.md b/contrib/bc/MEMORY_BUGS.md index d675b28b342a..12e0b854e9d8 100644 --- a/contrib/bc/MEMORY_BUGS.md +++ b/contrib/bc/MEMORY_BUGS.md @@ -51,3 +51,8 @@ existed in. had properly hooked Valgrind into my `bcl` tests, but I had not. The first version without this bug is `6.0.1`. + +* In version `6.0.0` until `6.2.4` (inclusive) of `bcl`, there is a possible + use-after-free if `bcl_init()` fails. + + The first version without this bug is `6.2.5`. diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 83417a333826..89ddb7589c47 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -239,25 +239,25 @@ $(GEN_EXEC): $(GEN_DIR) %%GEN_EXEC_TARGET%% $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) "" "" 1 $(BC_LIB_O): $(BC_LIB_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) "" "" 1 $(BC_LIB2_O): $(BC_LIB2_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) 0 $(BC_HELP_O): $(BC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) 0 $(DC_HELP_O): $(DC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< @@ -536,6 +536,7 @@ clean:%%CLEAN_PREREQS%% @$(RM) -f $(BC_HELP_C) $(BC_HELP_O) @$(RM) -f $(DC_HELP_C) $(DC_HELP_O) @$(RM) -fr vs/bin/ vs/lib/ + @$(RM) -f $(BCL_PC) clean_benchmarks: @printf 'Cleaning benchmarks...\n' @@ -548,6 +549,7 @@ clean_config: clean clean_benchmarks @$(RM) -f Makefile @$(RM) -f $(BC_MD) $(BC_MANPAGE) @$(RM) -f $(DC_MD) $(DC_MANPAGE) + @$(RM) -f compile_commands.json clean_coverage: @printf 'Cleaning coverage files...\n' diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 4601db456f86..ad118e401c32 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,30 @@ # News +## 6.3.1 + +This is a production release that fixes a `bc` dependency loop for minimal +environments and Linux from Scratch. + +## 6.3.0 + +This is a production release with a couple of fixes for manuals and a new +feature for `dc`: there is now a command to query whether extended registers are +enabled or not. + +Users who don't care do not need to upgrade. + +## 6.2.6 + +This is a production release that fixes an install bug that affected locale +installation of all locales when using `mksh`. Users do ***NOT*** need to +upgrade if they don't use `mksh` and/or don't need to install all locales. + +## 6.2.5 + +This is a production release that fixes a test bug that affected Android and +`mksh`. Users do ***NOT*** need to upgrade unless they use `mksh` or another +affected shell and need to run the test suite. + ## 6.2.4 This is a production release that fixes a test failure that happens when diff --git a/contrib/bc/gen/lib2.bc b/contrib/bc/gen/lib2.bc index 826f8a430cea..2811430d534e 100644 --- a/contrib/bc/gen/lib2.bc +++ b/contrib/bc/gen/lib2.bc @@ -36,7 +36,7 @@ define p(x,y){ auto a a=y$ - if(y==a)return (x^a)@scale + if(y==a)return(x^a)@scale return e(y*l(x)) } define r(x,p){ @@ -474,7 +474,7 @@ define bxor(a,b){ return bunrev(t) } define bshl(a,b){return abs(a)$*2^abs(b)$} -define bshr(a,b){return (abs(a)$/2^abs(b)$)$} +define bshr(a,b){return(abs(a)$/2^abs(b)$)$} define bnotn(x,n){ auto s,t,m[] s=scale diff --git a/contrib/bc/gen/strgen.c b/contrib/bc/gen/strgen.c index dbea0212f617..2cb3ed9e8475 100644 --- a/contrib/bc/gen/strgen.c +++ b/contrib/bc/gen/strgen.c @@ -157,11 +157,11 @@ bc_read_file(const char* path) assert(path != NULL); -#ifndef NDEBUG +#if BC_DEBUG // Need this to quiet MSan. // NOLINTNEXTLINE memset(&pstat, 0, sizeof(struct stat)); -#endif // NDEBUG +#endif // BC_DEBUG fd = bc_read_open(path, O_RDONLY); @@ -360,7 +360,7 @@ main(int argc, char* argv[]) has_define = (argc > 6 && strcmp("", argv[6]) != 0); define = has_define ? argv[6] : ""; - remove_tabs = (argc > 7); + remove_tabs = (argc > 7 && atoi(argv[7]) != 0); in = bc_read_file(argv[1]); if (in == NULL) return INVALID_INPUT_FILE; diff --git a/contrib/bc/gen/strgen.sh b/contrib/bc/gen/strgen.sh index a65e221ad0b4..2b8927b5528e 100755 --- a/contrib/bc/gen/strgen.sh +++ b/contrib/bc/gen/strgen.sh @@ -62,7 +62,9 @@ name="$4" label="$5" define="$6" remove_tabs="$7" -check_bool_arg "$remove_tabs" +if [ "$remove_tabs" != "" ]; then + check_bool_arg "$remove_tabs" +fi tmpinput=$(mktemp -t "${input##*/}_XXXXXX") diff --git a/contrib/bc/include/bcl.h b/contrib/bc/include/bcl.h index 234fe475f00e..253138231c66 100644 --- a/contrib/bc/include/bcl.h +++ b/contrib/bc/include/bcl.h @@ -41,6 +41,12 @@ #include #include +#ifndef NDEBUG +#define BC_DEBUG (1) +#else // NDEBUG +#define BC_DEBUG (0) +#endif // NDEBUG + #ifdef _WIN32 #include #include diff --git a/contrib/bc/include/lang.h b/contrib/bc/include/lang.h index 2d9776532249..97aeeaa98da8 100644 --- a/contrib/bc/include/lang.h +++ b/contrib/bc/include/lang.h @@ -277,6 +277,9 @@ typedef enum BcInst #if DC_ENABLED + /// dc extended registers command. + BC_INST_EXTENDED_REGISTERS, + /// dc's return; it pops an executing string off of the stack. BC_INST_POP_EXEC, @@ -575,7 +578,7 @@ bc_func_insert(BcFunc* f, struct BcProgram* p, char* name, BcType type, void bc_func_reset(BcFunc* f); -#ifndef NDEBUG +#if BC_DEBUG /** * Frees a function. This is a destructor. This is only used in debug builds * because all functions are freed at exit. We free them in debug builds to @@ -584,7 +587,7 @@ bc_func_reset(BcFunc* f); */ void bc_func_free(void* func); -#endif // NDEBUG +#endif // BC_DEBUG /** * Initializes an array, which is the array type in bc and dc source code. Since diff --git a/contrib/bc/include/lex.h b/contrib/bc/include/lex.h index 54d704f8b447..ac9b7b6ea69c 100644 --- a/contrib/bc/include/lex.h +++ b/contrib/bc/include/lex.h @@ -49,11 +49,11 @@ * @param l The lexer. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line)) -#else // NDEBUG +#else // BC_DEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line)) -#endif // NDEBUG +#endif // BC_DEBUG /** * A convenience macro for throwing errors in lex code. This takes care of @@ -61,12 +61,12 @@ * @param l The lexer. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_lex_verr(l, e, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line, __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG // BC_LEX_NEG_CHAR returns the char that corresponds to negative for the // current calculator. @@ -409,6 +409,9 @@ typedef enum BcLexType #if DC_ENABLED + /// dc extended registers keyword. + BC_LEX_EXTENDED_REGISTERS, + /// A special token for dc to calculate equal without a register. BC_LEX_EQ_NO_REG, @@ -533,7 +536,7 @@ void bc_lex_init(BcLex* l); /** - * Frees a lexer. This is not guarded by #ifndef NDEBUG because a separate + * Frees a lexer. This is not guarded by #if BC_DEBUG because a separate * parser is created at runtime to parse read() expressions and dc strings, and * that parser needs a lexer. * @param l The lexer to free. diff --git a/contrib/bc/include/parse.h b/contrib/bc/include/parse.h index 2527aeb824f8..ece413e7bd74 100644 --- a/contrib/bc/include/parse.h +++ b/contrib/bc/include/parse.h @@ -110,12 +110,12 @@ * @param p The parser. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_parse_err(p, e) \ (bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line)) -#else // NDEBUG +#else // BC_DEBUG #define bc_parse_err(p, e) (bc_vm_handleError((e), (p)->l.line)) -#endif // NDEBUG +#endif // BC_DEBUG /** * A convenience macro for throwing errors in parse code. This takes care of @@ -124,13 +124,13 @@ * @param e The error. * @param ... The varags that are needed. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_parse_verr(p, e, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line, __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_parse_verr(p, e, ...) \ (bc_vm_handleError((e), (p)->l.line, __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG // Forward declarations. struct BcParse; @@ -215,7 +215,7 @@ void bc_parse_init(BcParse* p, struct BcProgram* prog, size_t func); /** - * Frees a parser. This is not guarded by #ifndef NDEBUG because a separate + * Frees a parser. This is not guarded by #if BC_DEBUG because a separate * parser is created at runtime to parse read() expressions and dc strings. * @param p The parser to free. */ diff --git a/contrib/bc/include/program.h b/contrib/bc/include/program.h index 3a3ea6c9dab7..ff32d5db7760 100644 --- a/contrib/bc/include/program.h +++ b/contrib/bc/include/program.h @@ -247,9 +247,9 @@ typedef struct BcProgram // In debug mode, we want bc to check the stack, but otherwise, we don't because // the bc language implicitly mandates that the stack should always have enough // items. -#ifdef NDEBUG +#ifdef BC_DEBUG #define BC_PROG_NO_STACK_CHECK -#endif // NDEBUG +#endif // BC_DEBUG #endif // DC_ENABLED @@ -298,7 +298,7 @@ typedef void (*BcProgramUnary)(BcResult* r, BcNum* n); void bc_program_init(BcProgram* p); -#ifndef NDEBUG +#if BC_DEBUG /** * Frees a BcProgram. This is only used in debug builds because a BcProgram is @@ -309,7 +309,7 @@ bc_program_init(BcProgram* p); void bc_program_free(BcProgram* p); -#endif // NDEBUG +#endif // BC_DEBUG /** * Prints a stack trace of the bc functions or dc strings currently executing. @@ -608,6 +608,7 @@ extern const char bc_program_esc_seqs[]; &&lbl_BC_INST_MODEXP, \ &&lbl_BC_INST_DIVMOD, \ &&lbl_BC_INST_PRINT_STREAM, \ + &&lbl_BC_INST_EXTENDED_REGISTERS, \ &&lbl_BC_INST_POP_EXEC, \ &&lbl_BC_INST_EXECUTE, \ &&lbl_BC_INST_EXEC_COND, \ @@ -701,6 +702,7 @@ extern const char bc_program_esc_seqs[]; &&lbl_BC_INST_MODEXP, \ &&lbl_BC_INST_DIVMOD, \ &&lbl_BC_INST_PRINT_STREAM, \ + &&lbl_BC_INST_EXTENDED_REGISTERS, \ &&lbl_BC_INST_POP_EXEC, \ &&lbl_BC_INST_EXECUTE, \ &&lbl_BC_INST_EXEC_COND, \ @@ -959,6 +961,7 @@ extern const char bc_program_esc_seqs[]; &&lbl_BC_INST_MODEXP, \ &&lbl_BC_INST_DIVMOD, \ &&lbl_BC_INST_PRINT_STREAM, \ + &&lbl_BC_INST_EXTENDED_REGISTERS, \ &&lbl_BC_INST_POP_EXEC, \ &&lbl_BC_INST_EXECUTE, \ &&lbl_BC_INST_EXEC_COND, \ @@ -1027,6 +1030,7 @@ extern const char bc_program_esc_seqs[]; &&lbl_BC_INST_MODEXP, \ &&lbl_BC_INST_DIVMOD, \ &&lbl_BC_INST_PRINT_STREAM, \ + &&lbl_BC_INST_EXTENDED_REGISTERS, \ &&lbl_BC_INST_POP_EXEC, \ &&lbl_BC_INST_EXECUTE, \ &&lbl_BC_INST_EXEC_COND, \ diff --git a/contrib/bc/include/rand.h b/contrib/bc/include/rand.h index 7db0ee90af1f..e516295d7c5c 100644 --- a/contrib/bc/include/rand.h +++ b/contrib/bc/include/rand.h @@ -53,11 +53,11 @@ #if BC_ENABLE_LIBRARY #define BC_RAND_USE_FREE (1) #else // BC_ENABLE_LIBRARY -#ifndef NDEBUG +#if BC_DEBUG #define BC_RAND_USE_FREE (1) -#else // NDEBUG +#else // BC_DEBUG #define BC_RAND_USE_FREE (0) -#endif // NDEBUG +#endif // BC_DEBUG #endif // BC_ENABLE_LIBRARY /** diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index 9962d58d0be0..198cf5704a57 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -700,7 +700,7 @@ typedef enum BcMode #define BC_SIG_INTERRUPT(vm) BC_UNLIKELY((vm)->sig != 0) #endif // _WIN32 -#ifndef NDEBUG +#if BC_DEBUG /// Assert that signals are locked. There are non-async-signal-safe functions in /// bc, and they *must* have signals locked. Other functions are expected to @@ -724,7 +724,7 @@ typedef enum BcMode } \ while (0) -#else // NDEBUG +#else // BC_DEBUG /// Assert that signals are locked. There are non-async-signal-safe functions in /// bc, and they *must* have signals locked. Other functions are expected to @@ -738,7 +738,7 @@ typedef enum BcMode /// (no-op in non-debug mode) that check that signals are unlocked. #define BC_SIG_ASSERT_NOT_LOCKED -#endif // NDEBUG +#endif // BC_DEBUG /// Locks signals. #define BC_SIG_LOCK \ @@ -957,33 +957,33 @@ typedef enum BcMode * @param l The line of the script that the error happened. * @param ... Extra arguments for error messages as necessary. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_error(e, l, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, (l), __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_error(e, l, ...) (bc_vm_handleError((e), (l), __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG /** * Call bc's error handling routine. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_err(e) (bc_vm_handleError((e), __FILE__, __LINE__, 0)) -#else // NDEBUG +#else // BC_DEBUG #define bc_err(e) (bc_vm_handleError((e), 0)) -#endif // NDEBUG +#endif // BC_DEBUG /** * Call bc's error handling routine. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_verr(e, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, 0, __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_verr(e, ...) (bc_vm_handleError((e), 0, __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG #endif // BC_ENABLE_LIBRARY diff --git a/contrib/bc/include/vector.h b/contrib/bc/include/vector.h index 51c5e8b95293..b86be1424537 100644 --- a/contrib/bc/include/vector.h +++ b/contrib/bc/include/vector.h @@ -85,12 +85,12 @@ typedef enum BcDtorType #if !BC_ENABLE_LIBRARY -#ifndef NDEBUG +#if BC_DEBUG /// BcFunc destructor. BC_DTOR_FUNC, -#endif // NDEBUG +#endif // BC_DEBUG /// BcSlab destructor. BC_DTOR_SLAB, diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 6d8ddfea0940..f5e345b3b189 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 6.2.4 +#define VERSION 6.3.1 #endif // BC_VERSION_H diff --git a/contrib/bc/include/vm.h b/contrib/bc/include/vm.h index 1c303add2de0..dd21d43f5260 100644 --- a/contrib/bc/include/vm.h +++ b/contrib/bc/include/vm.h @@ -999,7 +999,7 @@ bc_vm_atexit(void); size_t bc_vm_numDigits(size_t val); -#ifndef NDEBUG +#if BC_DEBUG /** * Handle an error. This is the true error handler. It will start a jump series @@ -1013,7 +1013,7 @@ bc_vm_numDigits(size_t val); void bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...); -#else // NDEBUG +#else // BC_DEBUG /** * Handle an error. This is the true error handler. It will start a jump series @@ -1025,7 +1025,7 @@ bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...); void bc_vm_handleError(BcErr e, size_t line, ...); -#endif // NDEBUG +#endif // BC_DEBUG /** * Handle a fatal error. diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1 index b1996a1f282e..5de2d3529bcf 100644 --- a/contrib/bc/manuals/bc/A.1 +++ b/contrib/bc/manuals/bc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md index e7b4c8212190..3f34f451c9ed 100644 --- a/contrib/bc/manuals/bc/A.1.md +++ b/contrib/bc/manuals/bc/A.1.md @@ -372,7 +372,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1 index fea1cecdc4c5..ecb8b128712a 100644 --- a/contrib/bc/manuals/bc/E.1 +++ b/contrib/bc/manuals/bc/E.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/E.1.md b/contrib/bc/manuals/bc/E.1.md index 3631267f2dc9..5411dcf6cc70 100644 --- a/contrib/bc/manuals/bc/E.1.md +++ b/contrib/bc/manuals/bc/E.1.md @@ -344,7 +344,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/EH.1 b/contrib/bc/manuals/bc/EH.1 index 2a36cab7f778..507e7f4a9a7a 100644 --- a/contrib/bc/manuals/bc/EH.1 +++ b/contrib/bc/manuals/bc/EH.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/EH.1.md b/contrib/bc/manuals/bc/EH.1.md index f2f49ea76944..6f4c43263003 100644 --- a/contrib/bc/manuals/bc/EH.1.md +++ b/contrib/bc/manuals/bc/EH.1.md @@ -344,7 +344,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/EHN.1 b/contrib/bc/manuals/bc/EHN.1 index 75768a03c141..e00fcd578b1c 100644 --- a/contrib/bc/manuals/bc/EHN.1 +++ b/contrib/bc/manuals/bc/EHN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/EHN.1.md b/contrib/bc/manuals/bc/EHN.1.md index a38503cc8a24..6f7a33210205 100644 --- a/contrib/bc/manuals/bc/EHN.1.md +++ b/contrib/bc/manuals/bc/EHN.1.md @@ -344,7 +344,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/EN.1 b/contrib/bc/manuals/bc/EN.1 index 9c0158583199..ea842eac7e97 100644 --- a/contrib/bc/manuals/bc/EN.1 +++ b/contrib/bc/manuals/bc/EN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/EN.1.md b/contrib/bc/manuals/bc/EN.1.md index 28b558d8b21d..189193bf2a03 100644 --- a/contrib/bc/manuals/bc/EN.1.md +++ b/contrib/bc/manuals/bc/EN.1.md @@ -344,7 +344,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/H.1 b/contrib/bc/manuals/bc/H.1 index cbd93da0df81..d477dc8ab24b 100644 --- a/contrib/bc/manuals/bc/H.1 +++ b/contrib/bc/manuals/bc/H.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/H.1.md b/contrib/bc/manuals/bc/H.1.md index ac35def9019f..2cb0b4eb27cc 100644 --- a/contrib/bc/manuals/bc/H.1.md +++ b/contrib/bc/manuals/bc/H.1.md @@ -372,7 +372,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/HN.1 b/contrib/bc/manuals/bc/HN.1 index 5893d2a7f9a9..10d9621c42ee 100644 --- a/contrib/bc/manuals/bc/HN.1 +++ b/contrib/bc/manuals/bc/HN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/HN.1.md b/contrib/bc/manuals/bc/HN.1.md index 82a99addd344..25f136a21e0a 100644 --- a/contrib/bc/manuals/bc/HN.1.md +++ b/contrib/bc/manuals/bc/HN.1.md @@ -372,7 +372,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/N.1 b/contrib/bc/manuals/bc/N.1 index 791f47407001..f39e51277b65 100644 --- a/contrib/bc/manuals/bc/N.1 +++ b/contrib/bc/manuals/bc/N.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/N.1.md b/contrib/bc/manuals/bc/N.1.md index b8339ea31a5e..56a4b2274d29 100644 --- a/contrib/bc/manuals/bc/N.1.md +++ b/contrib/bc/manuals/bc/N.1.md @@ -372,7 +372,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bcl.3 b/contrib/bc/manuals/bcl.3 index 6bebaa8f02cd..5c3731a141eb 100644 --- a/contrib/bc/manuals/bcl.3 +++ b/contrib/bc/manuals/bcl.3 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BCL" "3" "October 2022" "Gavin D. Howard" "Libraries Manual" +.TH "BCL" "3" "February 2023" "Gavin D. Howard" "Libraries Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/dc/A.1 b/contrib/bc/manuals/dc/A.1 index 13ed8c4cf808..bef54876d7f2 100644 --- a/contrib/bc/manuals/dc/A.1 +++ b/contrib/bc/manuals/dc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -271,10 +271,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than \f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero. .RS .PP -This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). -.PP This is a \f[B]non-portable extension\f[R]. .RE .PP @@ -1255,6 +1251,12 @@ section). Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack. .TP +\f[B]gx\f[R] +Pushes \f[B]1\f[R] onto the stack if extended register mode is on, +\f[B]0\f[R] otherwise. +See the \f[I]Extended Register Mode\f[R] subsection of the +\f[B]REGISTERS\f[R] section for more information. +.TP \f[B]gz\f[R] Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options diff --git a/contrib/bc/manuals/dc/A.1.md b/contrib/bc/manuals/dc/A.1.md index b656650cb820..44b1578b670c 100644 --- a/contrib/bc/manuals/dc/A.1.md +++ b/contrib/bc/manuals/dc/A.1.md @@ -224,10 +224,6 @@ The following are the options that dc(1) accepts. : Makes dc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, - **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see - the **LIBRARY** section). - This is a **non-portable extension**. *** 1694 LINES SKIPPED *** From nobody Fri Feb 24 23:09:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNlvN5kTrz3v3ft; Fri, 24 Feb 2023 23:09: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 4PNlvN4zFwz4DjM; Fri, 24 Feb 2023 23:09:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677280144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21gg5cw1DLEWjPszC3WPBa5HMNqkeu4ynmGfiVPPHh0=; b=rVXQ/TVSYLnECCLbifeAVpeRKD3fWSW9lmGrgzf8z/TeVGaNIYAwqi+7TxECLuIUTDSRCh uq+t8YJYrxAjQtDAQPE1Upy48/RQgtP2M+oSAk1si7fzg2REJRKKtfk9iG4aStn77kSsYJ dE12NPZA+2GN4eXQNiE4oeckvwzjSXU/1T0PZ3dfqeS6m9xpjMn+xzGrd3dCyzcF7Am4dD SQfFrkagD7EHywHGdjF4OtCeGdATfGxDayWgGpTetidxNT0sLmsIXUehj5Qonfc6tUDlqv rrcoJ/r0czQHmOPNSYGGgl9b0aPwIFAFm9HkBUSYZ6j/cavFIlqcRDcZkMUupg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677280144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21gg5cw1DLEWjPszC3WPBa5HMNqkeu4ynmGfiVPPHh0=; b=GSO5SkByF7t0D1jy3Kj1C/8/op1VunhxHc/09iykGbW5CW7K9WPnkKGq82wR/gU3trW53u pJ2QQ4OMA5YUTz7ft6Mh/4UK/yUUmyDJoX7vBOvlRg57EN92d9+F3Fhp5m1njsNEdYorbA TP36yywyPWaDuxiNgKijIPVOMFW4r3CaWYQkfckzhcndDPD6xw2MrpP98suWGRx01DozEs 0HKD3Tc+vEdAmISAcxsm9KDQ9QqdZ2DTyhYoS9snF2OtACMnDydGmKpupC6mTIBd1id9mO Y91SODYcJ3zOgDKJ44ubca5YM9Dbx7GJUU7Zpc/T7S0kGulEL0x0TAvFJucGog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677280144; a=rsa-sha256; cv=none; b=b+TQj/xJutUvfquMJiOokbhdeEQ6SEBrtyJTpcfgDIXcwNAmtdAI22ye1oXXH+JpXM9zfJ fj5eh+cBizL6bsMMJq/7kgB52KFDLycE7P+dF1+EkgLo4UUh+ugmCJqqxwpPyK4UTuXFMO 6KMhc9FrErGbflPi1pzsJ2m4rGXV0O4E57yzox9KpGpX3St1CgG2bu6heI4OVFl2m6pv88 0WkVcg1innk/F2GKMyv+68uiEaF8qirAzfpzDmtAY4oBp5cz84t/UYjATBBx54Lq4OM7rS NKHKMM/IJzjf+3P9tP3qi6jhYZVgt9nH/PPKQGZQ5k8m9HM4bHWwWPHiC4GnJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNlvN3wkTzh0X; Fri, 24 Feb 2023 23:09: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 31ON942s015262; Fri, 24 Feb 2023 23:09:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31ON943f015261; Fri, 24 Feb 2023 23:09:04 GMT (envelope-from git) Date: Fri, 24 Feb 2023 23:09:04 GMT Message-Id: <202302242309.31ON943f015261@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: 77606d5a8c98 - main - usr.bin/gh-bc: clean-up Makefile List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77606d5a8c98032af2a78da3fd68db09e9acdcdb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=77606d5a8c98032af2a78da3fd68db09e9acdcdb commit 77606d5a8c98032af2a78da3fd68db09e9acdcdb Author: Stefan Eßer AuthorDate: 2023-02-24 23:07:25 +0000 Commit: Stefan Eßer CommitDate: 2023-02-24 23:07:25 +0000 usr.bin/gh-bc: clean-up Makefile Remove commented out debug options and re-enable LTO for most architectures. --- usr.bin/gh-bc/Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.bin/gh-bc/Makefile b/usr.bin/gh-bc/Makefile index 68725d420b24..154155085479 100644 --- a/usr.bin/gh-bc/Makefile +++ b/usr.bin/gh-bc/Makefile @@ -33,7 +33,6 @@ CATALOGS+= zh_CN.UTF-8 zh_CN.eucCN zh_CN.GB18030 zh_CN.GB2312 zh_CN.GBK NLSNAME= bc NLSSRCDIR= ${BCDIR}/locales -#CFLAGS=-g -O0 CFLAGS+= -DBC_DEFAULT_BANNER=0 CFLAGS+= -DBC_DEFAULT_DIGIT_CLAMP=0 CFLAGS+= -DBC_DEFAULT_EXPR_EXIT=1 @@ -74,7 +73,7 @@ MAN_SRC_DC= dc/A.1 # prevent floating point incompatibilities caused by -flto on some architectures .if ${MACHINE_ARCH:Mmips*} == "" && ${MACHINE_ARCH} != powerpc64 && \ ${MACHINE_ARCH} != riscv64 -#CFLAGS+= -flto +CFLAGS+= -flto .endif HAS_TESTS= yes @@ -114,10 +113,10 @@ NLSLINKS_pt_PT.ISO8859-1+= pt_PT.ISO8859-15 .endif lib.c: lib.bc Makefile - cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc ${.OBJDIR}/lib.c 0 bc_lib bc_lib_name 1 1 + cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc ${.OBJDIR}/lib.c 0 bc_lib bc_lib_name "" 1 lib2.c: lib2.bc Makefile - cd ${BCDIR} && sh gen/strgen.sh gen/lib2.bc ${.OBJDIR}/lib2.c 0 bc_lib2 bc_lib2_name 1 1 + cd ${BCDIR} && sh gen/strgen.sh gen/lib2.bc ${.OBJDIR}/lib2.c 0 bc_lib2 bc_lib2_name "" 1 bc_help.c: bc_help.txt Makefile cd ${BCDIR} && sh gen/strgen.sh gen/bc_help.txt ${.OBJDIR}/bc_help.c 0 bc_help "" 1 0 From nobody Fri Feb 24 20:50:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNmHk6lNdz3v4WB; Fri, 24 Feb 2023 23:26:42 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_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 4PNmHk495wz4J6G; Fri, 24 Feb 2023 23:26:42 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; none Date: Fri, 24 Feb 2023 21:50:01 +0100 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Ed Maste Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 2c709ee70ade - main - libc: handle zero alignment in memalign() Message-ID: <20230224205001.Fbn1A%steffen@sdaoden.eu> In-Reply-To: <202302241821.31OIL4ux075893@gitrepo.freebsd.org> References: <202302241821.31OIL4ux075893@gitrepo.freebsd.org> Mail-Followup-To: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org User-Agent: s-nail v14.9.24-418-gbf8954aec4 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4PNmHk495wz4J6G X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Ed Maste wrote in <202302241821.31OIL4ux075893@gitrepo.freebsd.org>: |URL: https://cgit.FreeBSD.org/src/commit/?id=2c709ee70ade9fd8f77b37917a4\ |169d667dda41d ... |commit 2c709ee70ade9fd8f77b37917a4169d667dda41d |Author: Paul Floyd |AuthorDate: 2023-02-24 16:29:01 +0000 |Commit: Ed Maste |CommitDate: 2023-02-24 18:19:06 +0000 | | libc: handle zero alignment in memalign() | | For compatibility with glibc. The previous code would trigger a \ | division | by zero in roundup() and terminate. Instead, just pass through to | malloc() for align == 0. ... |- return (aligned_alloc(align, roundup(size, align))); |+ /* |+ * glibc allows align == 0, but that is not valid for roundup. |+ * Just pass through to malloc in that case. |+ */ |+ if (align != 0) |+ return (aligned_alloc(align, roundup(size, align))); |+ else |+ return (malloc(size)); Just out of interest. Why not 1? Or "if(align==0)align=1;"? (Which is what i always did, as "allocating nothing" is merely a debug concern, which, for better memory pools like OpenBSD (i would presume), or during ASAN, causes better (even upon read).) (The machine language would also be smaller, would it.) Thank you. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From nobody Fri Feb 24 23:50:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNmpq1JDgz3v5Y6; Fri, 24 Feb 2023 23:50: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 4PNmpq0ktjz4Kry; Fri, 24 Feb 2023 23:50:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677282611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iAmPfbQkIGBoW/qKy3zscKRKGe/0NBWtlVi4vTrfIjk=; b=oJOR/MFLbQDfplO41Uyckq7nqJVkz+g9XKSSKE3iGzNcLKGw5c60iVkpO32eFUzjNLLH0O NWKft6MxxmnCZJ4SLe9r8/qh3lyaZJZAR9bTL1v5CYMkpw1H/Bpgu9xT75wIBL3V9AEbpY KSC4zQn0qs8pwS5yswb/tYIGnBTfsxwHfdJAe52Sj5UAF94QKEXR3W5pqpV+06aQcgd6Q7 z8Fo9evm0s6n6MzjdxXSRjy8wqD/tlcC1Dpq+8nDDSTCopCYR8MLoY5RmiLjU1HaQiJrCy hNVsiC1/cYYERTHv7CcoKtBlrCdZ55kabUTS/vO6EOFbKkSU6v5DMGR2vd58Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677282611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iAmPfbQkIGBoW/qKy3zscKRKGe/0NBWtlVi4vTrfIjk=; b=coXFMxzShs5gJuYmZsVBFpTXGoWkIalRjGDnc4utKMiW24I8tgaeL5vPciaiyEHPXHmxtw DXpP5+IbXbE3px9+r0Nwc7w8/ZvxulQl4gO4VbfEVgyR5vVwNKR2VRIy0k6o+vxWi8Ue/l TPf2X781KaIWoNPG50nuaADzXTWs4BXYMHBACxNiDHm6znNTNm7QTm1EyEGiUdYBpWaXB0 VedN/mcnFXw/kMKUDYKvJ2r8iGKfgvuM4fLCSRCRwISae0A3Heas6Pde2lgvU2q/53xOue vgaUg24X/uNDzbotqq2EBz4nFoDV4ioyMaxXp77jzxel5Y+RFP4PCasD9hicLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677282611; a=rsa-sha256; cv=none; b=hv2ggkHrtK66XGFy+QY5j15fjHLwFtRGzZh06f/CSZwbziwUr85MEiFgGmbY2Ki97WjY6M nE5vg6q7k0q15Im2/XfyjfTBUo3paUTcgs7J6e/S3wJgsbqYA6edPOWv1q+izM8Ys1lt1O Nu9ial4uRznyO6IIFdBVFVwAIo3m8Ktfu2w3xZ6msuiBrKYgxqbLwZsiaFPVwOdGj+jstA /kzmXMXHuCZN4z0gnafakg28sHsPednufaB4OXIfTZry831BJwZTfDXCP+3ZUJKu7lEEfK dZeNJrFOsTIgUaFOtlciRW1dDJPyON8o+zND89LxP+tRSoeiy4ZmHVhmsaFehA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNmpp6vYTzj6n; Fri, 24 Feb 2023 23:50: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 31ONoAVE082571; Fri, 24 Feb 2023 23:50:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31ONoAP3082564; Fri, 24 Feb 2023 23:50:10 GMT (envelope-from git) Date: Fri, 24 Feb 2023 23:50:10 GMT Message-Id: <202302242350.31ONoAP3082564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: 6ae90f59851c - main - gh-bc: don't disable LTO on powerpc64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ae90f59851cd574b1edfba0a2a67f436001c120 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=6ae90f59851cd574b1edfba0a2a67f436001c120 commit 6ae90f59851cd574b1edfba0a2a67f436001c120 Author: Piotr Kubaj AuthorDate: 2023-02-24 13:26:31 +0000 Commit: Piotr Kubaj CommitDate: 2023-02-24 23:49:27 +0000 gh-bc: don't disable LTO on powerpc64 Summary: The LTO issue has been fixed. While -flto for some reason is commented out, since it wasn't completely removed, it may be expected to be reenabled. Reviewers: se Approved by: se MFC after: 3 days Subscribers: imp Differential Revision: https://reviews.freebsd.org/D38755 --- usr.bin/gh-bc/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/gh-bc/Makefile b/usr.bin/gh-bc/Makefile index 154155085479..223440f2f54d 100644 --- a/usr.bin/gh-bc/Makefile +++ b/usr.bin/gh-bc/Makefile @@ -71,8 +71,7 @@ MAN_SRC_BC= bc/A.1 MAN_SRC_DC= dc/A.1 # prevent floating point incompatibilities caused by -flto on some architectures -.if ${MACHINE_ARCH:Mmips*} == "" && ${MACHINE_ARCH} != powerpc64 && \ - ${MACHINE_ARCH} != riscv64 +.if ${MACHINE_ARCH:Mmips*} == "" && ${MACHINE_ARCH} != riscv64 CFLAGS+= -flto .endif From nobody Sat Feb 25 00:08:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNnDL1VMGz3v6P1; Sat, 25 Feb 2023 00:08:50 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 4PNnDK2P67z4M2W; Sat, 25 Feb 2023 00:08:49 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.167.43 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com; dmarc=none Received: by mail-lf1-f43.google.com with SMTP id m7so1258512lfj.8; Fri, 24 Feb 2023 16:08:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=K9ho/T0bxd8Ft9wkvOwS3iQpwdVXSVQwmvgPbZu8Dto=; b=r9gBMy8RQqHFeKUE/53AYrulks4z3HuQ73eflJwb5mX8rF9SkqLrK7D6HNGoDRe1w0 aaT1GyJEpb6eedh9hX3REBQdepFbVQkZRstfSGkdsSavFxJnhKIPUt41LwT6rXSNkXsO rvlFXxQWENJK9djCjDwf/IiocVq++s43UcFreq0wWw6YEiu8QeJcsINrgm2lJVTZKHWz updpx0Strz9Xa0I3bhV3ITrwSzhtopKh4zoE462tXfvXgKtorOWbf/TyfDxQtco04Csp QzqhK9SHomTkBFApJ49p07YIpTPJb/lfrXVqpsReMOX4pr9RL2keHm3spYM/ywyTtNMP s/DQ== X-Gm-Message-State: AO0yUKWSbrtaqEZHX55NlLFHqrLOQlukdeclbRWzmQucWZa9LY6ou40V FVT9UnpfSJVKHPByBDJ9ukujhgOKt6rYO2hf8SkHXpW0 X-Google-Smtp-Source: AK7set91gAeuMU+C2qyEjY1SdBtthZaCbGjsF2AZK938t1UZWvaATegRiGPesYVTc5hxmICkEQbIWTAEsEM9uQdgE0E= X-Received: by 2002:a19:7416:0:b0:4d5:ca32:9bd6 with SMTP id v22-20020a197416000000b004d5ca329bd6mr5396653lfe.2.1677283726574; Fri, 24 Feb 2023 16:08:46 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302241821.31OIL4ux075893@gitrepo.freebsd.org> <20230224205001.Fbn1A%steffen@sdaoden.eu> In-Reply-To: <20230224205001.Fbn1A%steffen@sdaoden.eu> From: Ed Maste Date: Fri, 24 Feb 2023 19:08:36 -0500 Message-ID: Subject: Re: git: 2c709ee70ade - main - libc: handle zero alignment in memalign() To: Ed Maste , 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.97 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.971]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.43:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[carpeddiem]; FREEMAIL_ENVFROM(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.43:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4PNnDK2P67z4M2W X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Fri, 24 Feb 2023 at 18:26, Steffen Nurpmeso wrote: > > Ed Maste wrote in > <202302241821.31OIL4ux075893@gitrepo.freebsd.org>: > |URL: https://cgit.FreeBSD.org/src/commit/?id=2c709ee70ade9fd8f77b37917a4\ > |169d667dda41d > ... > |commit 2c709ee70ade9fd8f77b37917a4169d667dda41d > |Author: Paul Floyd > |AuthorDate: 2023-02-24 16:29:01 +0000 > |Commit: Ed Maste > |CommitDate: 2023-02-24 18:19:06 +0000 > | > | libc: handle zero alignment in memalign() > | > | For compatibility with glibc. The previous code would trigger a \ > | division > | by zero in roundup() and terminate. Instead, just pass through to > | malloc() for align == 0. > ... > |- return (aligned_alloc(align, roundup(size, align))); > |+ /* > |+ * glibc allows align == 0, but that is not valid for roundup. > |+ * Just pass through to malloc in that case. > |+ */ > |+ if (align != 0) > |+ return (aligned_alloc(align, roundup(size, align))); > |+ else > |+ return (malloc(size)); > > Just out of interest. Why not 1? > Or "if(align==0)align=1;"? Yes that's what I would have done, but it's fine either way and I just took the submission. > (Which is what i always did, as> "allocating nothing" is merely a debug concern, which, for better > memory pools like OpenBSD (i would presume), or during ASAN, > causes better (even upon read).) I don't really understand what you mean here, or how "allocating nothing" is related. From nobody Sat Feb 25 01:18:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNpmn1d5Wz3v9mJ; Sat, 25 Feb 2023 01:18: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 4PNpmn16Ycz3CgW; Sat, 25 Feb 2023 01:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677287913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=069wf9b2KCrjsB+wHciTE7mgSBGEs3NJSMXAHJgmACo=; b=F1TY1PrIFRnOWW2PR7KXiNckrH6krkuydKjFPQE5txKkwKSgf1uH01y6ANWUbfU8mV+gbA FAi5ZptmpqdIJggTb4xrnLGCAWBAYvkFZUsy+MHk7RyCzmMApTYalssWrnxmIDDXwE4cX3 Y4gC4hitscLwUPzzu1lZwrACd2Gi4cYqKIuYd3+/u/ybcrrx0hcwXc7QyMYvGB8B2KlHRo gpvAzBwKSMLa0DIQk+/elLdfVHQZWieF7zbq+agiad4MI5TKii1r7BZ6SOGQCgD+mDSVGm J3B++7iUNLIH99c3yGPagD+7/1ORE0U580hogpq6e1jCN+S5GevBKIPCuRWfRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677287913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=069wf9b2KCrjsB+wHciTE7mgSBGEs3NJSMXAHJgmACo=; b=QVa6V0xwLhqTybXyGNcYGB23YOy4Kn1Ahv9qWXP73Bq0L6Q1lVBqI8a8l9UEqdQWZg/DO0 X/2mSqSFRiV0Ud3QZDChf/HWoc+rAbJydcC4ehrsk6nMw0ZPfel/CJODMSWfrlhy1PzWs6 hYjsjeKzExb8aGbz/AYu/GRs28s6G+OK7lKLXqIfsOtMLe6KjIG9OeJS0KFrW0IUb+IOP0 yOAeBFXgi5w6ABilaJdZyQa1AHfUMrg1TqBvqT7qWxE0yzuoNpTmUad7X6IrUiHR30Sv2W J80rXQ6Wphr3VVOmjGrc5yflDE3KT5NF/CC0l0o81BXcv7B96hBaG7zzSpnOEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677287913; a=rsa-sha256; cv=none; b=o3azTYWMq2QKwmtF91+mE7oBOhf2d0l+fuztFwa52SRysGddcg9obEOgI/hFpBhBO2MT4v fUPrWkCcVeG+wQ/4ca6owFEzpZGPmfYxlX4rI4R/mFkMz+i0EEQogtAMVYpXPVAkwI+sre gx1gvHcXVuGEp0nKdOLFXs+4slk2eCz934Q14760rBWi+p+xDmkxAjjl1yHHDN4cXHFgdc zMoIkpYEyoBktkKKM3s2zbxDHRKy5G9I0RMziIQ8U816P2xUjfn7lnsbkQn9CwimyTCnfC 5p6ksKPouCnbphQG8+Nra1prsS0gMCsdg/eK1dAPlS5YZyCC1K6rVH/YC4vCQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNpmn0BK1zlQJ; Sat, 25 Feb 2023 01:18: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 31P1IWA0020024; Sat, 25 Feb 2023 01:18:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31P1IWIX020023; Sat, 25 Feb 2023 01:18:32 GMT (envelope-from git) Date: Sat, 25 Feb 2023 01:18:32 GMT Message-Id: <202302250118.31P1IWIX020023@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: f4f5e69c84df - main - lockstat: Use the correct type for a symbol size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4f5e69c84df74e8834aed173af1127b1ff50970 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f4f5e69c84df74e8834aed173af1127b1ff50970 commit f4f5e69c84df74e8834aed173af1127b1ff50970 Author: Mark Johnston AuthorDate: 2023-02-25 01:11:08 +0000 Commit: Mark Johnston CommitDate: 2023-02-25 01:11:08 +0000 lockstat: Use the correct type for a symbol size No functional change intended. MFC after: 1 week --- cddl/contrib/opensolaris/cmd/lockstat/lockstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c index 2fd29843b8ce..2cbad3442efb 100644 --- a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c +++ b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c @@ -632,7 +632,7 @@ predicate_destroy(char **pred) } static void -filter_add(char **filt, char *what, uintptr_t base, uintptr_t size) +filter_add(char **filt, char *what, uintptr_t base, size_t size) { char buf[256], *c = buf, *new; int len, newlen; From nobody Sat Feb 25 01:18:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNpmp3PvQz3v9mP; Sat, 25 Feb 2023 01:18: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 4PNpmp2HQZz3Cjv; Sat, 25 Feb 2023 01:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677287914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CkoCsAZwOF3FyGr6fhHjn2LHe6IQwFZabQ76wnRodWA=; b=qBrVhKNoRIGSSFZG0bJgUvJYfQB+EQzPaIqwmV1Xs2zR528W2OyfS9lQccdKBuRBDJ8wO7 z4JlMa1/IwSVKyNcYZsWeyLX7sEgw+zAXuMl0V0M7NOkhQllnunrrIb7gvB2YU0QCAQDnq feMPzo8LtehSA0X0yjNcSM55opZCuISVDfhQzj2EMcdkelOUhbv/0cdaPGSgYP1QSxBrGi gUYMK1bLn6ZhiBdBooGXyBtEoCdAX4FLu019TzIFnmHwtb0T4OGINSx0u35fzL/mrZBeJ8 4buuQxkz+ntZ2m5cRRLiC4GcOhPOX19cw9sNCaZxc66xKv6iMQ1oOUsBCnHylw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677287914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CkoCsAZwOF3FyGr6fhHjn2LHe6IQwFZabQ76wnRodWA=; b=CeZ4jtBe+C8/X++gP1rlmNgyg/YsIsrsV79tws5OTDefmQl/iTh5RdEEZzgQ4LQV0wM2S+ Hj8Q83kymGRqNZeKQWQjHLfw/NIucCYNu7dZu0d8+VUgFjY69JpIc28N5e/nm5e01z4HTH MDbqM+bahH/jZcgcQEZdslpokgjRwOdpJFV8z5pmDN3lJarqBilikYzPNKkVkkP6SHJ7XJ onFNGufkpF+5dh+a8LdoynG1BWZfx/OGyxIre43hER8ge91qJ/X82XECBRSJ22At3dzBMQ m+9i9QFg1mqkhrujRRI+1xVuvzjt5VwxYMpyQ/nF4pk/jeRm8fTueA4K88LZTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677287914; a=rsa-sha256; cv=none; b=TtW/dZZ2oDVff2dMUWFUxZCeEbd2BdGfl4mzWVp4vXHmO375LBjp+Y8D0WRmFwnfW2iskp 5Hm+CrVtiaMdNdnLlopklDhdrdAYzd1ziiW+ULMoUi2Ji9AHmfnE3xG6Z6bxZAnLAIKX81 Pd9jOlmQG1rzaCvVvSjUieaq7exEvnghX9tLZwX5OrilQkQTV6KA64jgveBEjOhkHpoBQf +kDcpAx7BVdlSvv5jRbJeEyrJjmRR8B/BNGv2EnQ9woZhjEV0lwbrD5yaUGqilWVBI7ugF qpxROfUW9J1DfkcnoILJv+cznezWpnRb/McBt2Nw9M01kpfFauJHxHn9MkjWDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNpmp15RHzlMl; Sat, 25 Feb 2023 01:18: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 31P1IYbJ020043; Sat, 25 Feb 2023 01:18:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31P1IYjY020042; Sat, 25 Feb 2023 01:18:34 GMT (envelope-from git) Date: Sat, 25 Feb 2023 01:18:34 GMT Message-Id: <202302250118.31P1IYjY020042@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: 49e3972afc11 - main - lockstat: Use gelf.h instead of playing games with the preprocessor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49e3972afc1112f95863a04cea7a4401b78dfd1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=49e3972afc1112f95863a04cea7a4401b78dfd1f commit 49e3972afc1112f95863a04cea7a4401b78dfd1f Author: Mark Johnston AuthorDate: 2023-02-25 01:15:21 +0000 Commit: Mark Johnston CommitDate: 2023-02-25 01:16:51 +0000 lockstat: Use gelf.h instead of playing games with the preprocessor This reverts a portion of 1477dd823ee ("Merge OpenZFS support in to HEAD."). No functional change intended. MFC after: 1 week --- cddl/contrib/opensolaris/cmd/lockstat/sym.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/lockstat/sym.c b/cddl/contrib/opensolaris/cmd/lockstat/sym.c index b5366c566857..7516e7d435f4 100644 --- a/cddl/contrib/opensolaris/cmd/lockstat/sym.c +++ b/cddl/contrib/opensolaris/cmd/lockstat/sym.c @@ -42,6 +42,7 @@ #include #include #include +#include #ifdef illumos #include @@ -54,7 +55,6 @@ #endif #include - typedef struct syment { uintptr_t addr; char *name; @@ -73,11 +73,6 @@ static char maxsymname[64]; #endif #endif -#define __sElfN(x) typedef __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x) x -__sElfN(Sym); -__sElfN(Shdr); -#define elf_getshdr __elfN(getshdr) - static void add_symbol(char *name, uintptr_t addr, size_t size) { @@ -174,7 +169,7 @@ symtab_init(void) { Elf *elf; Elf_Scn *scn = NULL; - Sym *symtab, *symp, *lastsym; + GElf_Sym *symtab, *symp, *lastsym; char *strtab; uint_t cnt; int fd; @@ -198,13 +193,13 @@ symtab_init(void) (void) elf_version(EV_CURRENT); elf = elf_begin(fd, ELF_C_READ, NULL); - for (cnt = 1; (scn = elf_nextscn(elf, scn)) != NULL; cnt++) { - Shdr *shdr = elf_getshdr(scn); - if (shdr->sh_type == SHT_SYMTAB) { - symtab = (Sym *)elf_getdata(scn, NULL)->d_buf; - nsyms = shdr->sh_size / shdr->sh_entsize; - strindex = shdr->sh_link; + GElf_Shdr shdr; + (void) gelf_getshdr(scn, &shdr); + if (shdr.sh_type == SHT_SYMTAB) { + symtab = (GElf_Sym *)elf_getdata(scn, NULL)->d_buf; + nsyms = shdr.sh_size / shdr.sh_entsize; + strindex = shdr.sh_link; } } From nobody Sat Feb 25 01:27:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNpzH2kSQz3vBGH; Sat, 25 Feb 2023 01:27:39 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_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 4PNpzH0LS9z3F1G; Sat, 25 Feb 2023 01:27:39 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; none Date: Sat, 25 Feb 2023 02:27:36 +0100 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Ed Maste Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2c709ee70ade - main - libc: handle zero alignment in memalign() Message-ID: <20230225012736.PT3cH%steffen@sdaoden.eu> In-Reply-To: References: <202302241821.31OIL4ux075893@gitrepo.freebsd.org> <20230224205001.Fbn1A%steffen@sdaoden.eu> Mail-Followup-To: Ed Maste , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org User-Agent: s-nail v14.9.24-418-gbf8954aec4 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4PNpzH0LS9z3F1G X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Ed Maste wrote in : |On Fri, 24 Feb 2023 at 18:26, Steffen Nurpmeso wrote: ... |> Just out of interest. Why not 1? |> Or "if(align==0)align=1;"? | |Yes that's what I would have done, but it's fine either way and I just |took the submission. | |> (Which is what i always did, as> "allocating nothing" is merely \ |> a debug concern, which, for better |> memory pools like OpenBSD (i would presume), or during ASAN, |> causes better (even upon read).) | |I don't really understand what you mean here, or how "allocating |nothing" is related. Me too. 'Was just thinking of allocators which give back valid but inaccessible memory for 0 bytes so that each access would fault. (As opposed to give back minimum allocation. Or give back minimum allocation but in debug mode "put canaries" so that write accesses "are detected", but read ones not. That mediocre stuff that i was and am doing thus. Whatever.) Thanks, and a nice weekend. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From nobody Sat Feb 25 06:26:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNxbY0Tn6z3vT8f; Sat, 25 Feb 2023 06:26: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 4PNxbX7497z3sg2; Sat, 25 Feb 2023 06:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677306361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ybN7JjCMBeHwociBFuQSoc3upzeuPpLNEZlcMAa+fg=; b=LFLuQn4ucomghfockQH1YgnAV++5u2hPJhndRKDZp0BBvC7f8dnpgqVW6NQCvHI1Sdj5Al LKhRfIO/5bzsBVxJY+isN98q1+hdaLTscOH1xHb+utrPXp/l/VnM+KDDo799HpMH9LbgGq jNXFsjSzrKip9IVV8f3gF7o/+x1xm/hErOKeBE2YLP6WXIt8KluPgwwW01UkL3u36CiMeW ws6sYbEjqYY3QaX9mdyrH3NuMp1e+NjSCHeKWeDSbeUJ4YF6C1J4JH3Fpl1lH7ZF3gZlHz BJ8kyOYBMQmyEsxgrf+xeFX6FkIDONVVsBimiIakJGoTiZppSTHAt0WKbwsrKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677306361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ybN7JjCMBeHwociBFuQSoc3upzeuPpLNEZlcMAa+fg=; b=tK7c2LtfU7vjaQ6rDcitxz9MHwTZP/8EKuaQJ6C5qTqfe5ee0Ddnlk8dvDtS8tOriyY97g YFRELwGj98mJFMRi0NndUYGfauDyacuMU5OXYA1IK77yPhAPBrLniKNsukLs9cPaZTsXm1 EbTKysVSLkBUIKC6t65s9UD6fiR92rqNQ3N9c06eeLm4yq17XKdSEHh1sfG5w94xrpm6q0 Ibp0wdl46s82Z/wof67jgh0MfwqfALJAZR+ogS8nxAmPBD9RdpRw4hJ00D0SrH9FmVtGj8 LA5tdAgIb4ytAwTIWFBUbycXkVGxETN8kIpsiBpqe4PxvD9Vkktc/LYcH3kwdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677306361; a=rsa-sha256; cv=none; b=nsD9M7DxXo838zxl3g1vJnD9WlGmvOfdBQJ7fl4h+/E9l7tNEm43oVb4R09VSiEtWwW3ds cPjBOeO6lCz2sBeC6gCvsG35Ym/YSgqVca4OtYIqqY8NfIkPE/uo59D4tl0KTIw8T3+mcy u0S92x1pHYG4pt79uZoYJenrlXnoLURwdbkzOoZs/ox8Xc13C0d1AL5bgX/tRQxcpqgtta Pqe1etSYfyuWVrEa6GV4AwZ1okdtW0bdvhjzwVYIRNhynlfHfgR35JmVQVIi/nmfn5khve /mCT4L5GxaRqf4U4u/dtTvjzDBSjvzOl9H7Al0gEMspBOmr882XhxJ7vL7R27w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNxbX67C9zv2y; Sat, 25 Feb 2023 06:26: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 31P6Q0JF011041; Sat, 25 Feb 2023 06:26:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31P6Q00o011040; Sat, 25 Feb 2023 06:26:00 GMT (envelope-from git) Date: Sat, 25 Feb 2023 06:26:00 GMT Message-Id: <202302250626.31P6Q00o011040@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: c51978f4b2f0 - main - kbd: add KBD_DELAY1 and KBD_DELAY2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c51978f4b2f080c80ddc891c24b151d35acb8ba4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c51978f4b2f080c80ddc891c24b151d35acb8ba4 commit c51978f4b2f080c80ddc891c24b151d35acb8ba4 Author: Michael Paepcke AuthorDate: 2023-02-18 09:11:37 +0000 Commit: Warner Losh CommitDate: 2023-02-25 06:19:05 +0000 kbd: add KBD_DELAY1 and KBD_DELAY2 Allow to configure KBD_DELAY* via KERNCONF for user-land less embedded and security appliances Reviewed by: imp (folded) Pull Request: https://github.com/freebsd/freebsd-src/pull/649 --- sys/conf/options | 3 ++- sys/dev/kbd/kbd.c | 4 ++-- sys/dev/kbd/kbdreg.h | 8 ++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/conf/options b/sys/conf/options index 7855a2f3f20e..42529a90a54e 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -803,8 +803,9 @@ KBD_INSTALL_CDEV opt_kbd.h KBD_MAXRETRY opt_kbd.h KBD_MAXWAIT opt_kbd.h KBD_RESETDELAY opt_kbd.h +KBD_DELAY1 opt_kbd.h +KBD_DELAY2 opt_kbd.h KBDIO_DEBUG opt_kbd.h - KBDMUX_DFLT_KEYMAP opt_kbdmux.h # options for the Atheros driver diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c index 205d76639e0f..ebc779de4073 100644 --- a/sys/dev/kbd/kbd.c +++ b/sys/dev/kbd/kbd.c @@ -143,8 +143,8 @@ kbd_init_struct(keyboard_t *kbd, char *name, int type, int unit, int config, kbd->kb_accentmap = NULL; kbd->kb_fkeytab = NULL; kbd->kb_fkeytab_size = 0; - kbd->kb_delay1 = KB_DELAY1; /* these values are advisory only */ - kbd->kb_delay2 = KB_DELAY2; + kbd->kb_delay1 = KBD_DELAY1; /* these values are advisory only */ + kbd->kb_delay2 = KBD_DELAY2; kbd->kb_count = 0L; bzero(kbd->kb_lastact, sizeof(kbd->kb_lastact)); } diff --git a/sys/dev/kbd/kbdreg.h b/sys/dev/kbd/kbdreg.h index 15b7e5183f35..2839e259420d 100644 --- a/sys/dev/kbd/kbdreg.h +++ b/sys/dev/kbd/kbdreg.h @@ -151,8 +151,12 @@ struct keyboard { void *kb_data; /* the driver's private data */ int kb_delay1; int kb_delay2; -#define KB_DELAY1 500 -#define KB_DELAY2 100 +#ifndef KBD_DELAY1 +#define KBD_DELAY1 500 +#endif +#ifndef KBD_DELAY2 +#define KBD_DELAY2 100 +#endif unsigned long kb_count; /* # of processed key strokes */ u_char kb_lastact[NUM_KEYS/2]; struct cdev *kb_dev; From nobody Sat Feb 25 06:26:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNxbZ14h0z3vTGn; Sat, 25 Feb 2023 06:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PNxbZ0ZrPz3sjV; Sat, 25 Feb 2023 06:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677306362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uxkg25HR56Am5TenWJhf0oIRBjhM8f2KPIgcQ58g4n8=; b=g9jbGxPkNNTdAxW2OYx2oKzCjqyY0vEUyiezUoqrOL0nDSoTgc8hW1dcvVbqjUphYjCiU6 g3gsEhGUPB7xAX/EpU9UmbkkrFofwFlK0j+lY0qiqTcO81RW3XlfypjwjFywUgdM3J/xT/ lzncL+bs8uqTmaQYnDdRW4MWh7Blv40zVPiouo/D8JEusxHtVxZ8d7ffYHe3dpByyMFFBt 4QVajwRqSgDkuWzOuT2vqR3NoQt0nJA2+fSHZgNcWVjtraxZFbax9elePUZFWXI3YEWIoy 7N+eNuu2Hq9jIQMmMQjMpCqVzBZfV3k9NWAR6JGaz+t+jbD3LblClCrrRUxyTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677306362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uxkg25HR56Am5TenWJhf0oIRBjhM8f2KPIgcQ58g4n8=; b=OkyrzhMbOMoYKdPKhRMXO6edPsRY6fM7r6L1gde3U6M2chsjm6gPeB3vIpCkRcLEkGDZ8h x+f39Dv8Ke0q+etTfGtswWZMRJUoKybzGy0soJJhiPW3B6uzgtJZ29997tZlVTBS0JytgF yE8pjFBILwuB2quJ5EDKVmRr66orMa/rKMPnQZAma1W033K5A+fJl7VacRZxmJIlEUH1LF lvJMIsgcG7dyyQUD7CYaO2+QIcZpnUTqKjEndUVIzljcE7JQcEnevD9+noVHGNz71kf8eI 53R+JWVUaJywK90mW6LuvH+XRreO/DbiwWGBNHEgjDQZ+z4/4+pEH7CpBew2dA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677306362; a=rsa-sha256; cv=none; b=huSea8Rj071yBcFYZtSPnvl4SEW+pWh/nmec2XfSa4tQD2NaADjJm7tWFlV4AguHoDhdL5 9zrvLKiEfXOJ31/C/OuxdSoFmIXR+7SAlUAFuLS3LAejExBNI18BomiVxsedo3fqR7MQ21 dgTNvK+1+i4ejEUsbPvZjcx88fk6xOKCbvb7eVt/w4/dsAkrezrHEdMicuDvTpjfPLmyuf V98KB+lgC7o0lO/ibPTJ8aZ8rhlD24L58k05N8OkiD79wmDh7PyKkVf/4w2sgxqREB4Jqx f4sq6DUNEpvtrHB2ycm/fQzlhGrNGIgbwpZwn+bhq7Cz6S9aoQHthk+vNdhXyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNxbY6gdhzv30; Sat, 25 Feb 2023 06:26: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 31P6Q1Uw011060; Sat, 25 Feb 2023 06:26:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31P6Q1HT011059; Sat, 25 Feb 2023 06:26:01 GMT (envelope-from git) Date: Sat, 25 Feb 2023 06:26:01 GMT Message-Id: <202302250626.31P6Q1HT011059@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: 1469c6331f38 - main - kbd: ukbd.4 and atkbdc.4 add section about new kernel options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1469c6331f38e5146c0db7ae24f2ea4eb3dbceca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1469c6331f38e5146c0db7ae24f2ea4eb3dbceca commit 1469c6331f38e5146c0db7ae24f2ea4eb3dbceca Author: Michael Paepcke AuthorDate: 2023-02-21 05:41:18 +0000 Commit: Warner Losh CommitDate: 2023-02-25 06:20:34 +0000 kbd: ukbd.4 and atkbdc.4 add section about new kernel options add section about new kernel options KBD_DELAY1 and KBD_DELAY2 Reviewed by: imp (small tweaks to man page) Pull Request: https://github.com/freebsd/freebsd-src/pull/649 --- share/man/man4/atkbdc.4 | 7 +++++++ share/man/man4/ukbd.4 | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/share/man/man4/atkbdc.4 b/share/man/man4/atkbdc.4 index d0fc50d145a5..cddc49969232 100644 --- a/share/man/man4/atkbdc.4 +++ b/share/man/man4/atkbdc.4 @@ -90,6 +90,13 @@ The default values are and 5 for .Fa Y . +.It Em KBD_DELAY1=X, KBD_DELAY2=Y +DELAY1 sets the intitial key repeat delay to +.Fa X . +The default value is 500ms. +DELAY2 sets the key repeat delay to +.Fa Y . +The default value is 200ms. .It Em KBDIO_DEBUG=N Sets the debug level to .Fa N . diff --git a/share/man/man4/ukbd.4 b/share/man/man4/ukbd.4 index f443f51ce8e1..dc8e62f0f245 100644 --- a/share/man/man4/ukbd.4 +++ b/share/man/man4/ukbd.4 @@ -136,6 +136,15 @@ or .D1 Cd "options KBD_DISABLE_KEYMAP_LOADING" .Pp Do not allow the user to change the keymap. +.Pp +.D1 Cd "options KBD_DELAY1=200" +.Pp +Set the keyboard initial key repeat delay. +.Pp +.D1 Cd "options KBD_DELAY2=15" +.Pp +Set the keyboard key repeat delay. +.Pp Note that these options also affect the AT keyboard driver, .Xr atkbd 4 . .Sh SYSCTL VARIABLES From nobody Sat Feb 25 06:26:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNxbb3f1Qz3vTDN; Sat, 25 Feb 2023 06:26: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 4PNxbb13v8z3srb; Sat, 25 Feb 2023 06:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677306363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kNKnjMh7yotthVgsOthSoNxSLDR1G61v/c3hf5AKjrM=; b=CMt8Ha2UrD9zvhB9zlOvdc/9ZmCGgDbvO5/6ta749Sl2K6WckrbOgA/v2SgEzoVWFwSs+N dtwQRaFO3syrp4kniBMfbUCpDgRaWyJ9gfX9EycFfsKXqVJSVcD54zD1anwpWxQ9dpK9rN QQTzsGIg3Eu3ULZxkijeXF2SQcCOMJS/I6WWu0vIqA6VLlT9zHkHbZpKUbNUp8YgPLidxb gy5w4c9vmUqmIY2PqzGMCuK2y//6IQwOVPzkJ6Dhf4NXPVrcrk6X6rd/vTZxMYplGOqMij w6SvjICRTmhpyGBkUp2AGRaCsgoYrLKm5MI5cAu86yl4VA+QdG9s/RMRvBRvnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677306363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kNKnjMh7yotthVgsOthSoNxSLDR1G61v/c3hf5AKjrM=; b=X6vu6Y/KQXGp3TJk9ITNJY16fItsiUVFTDX+fs0YtAzeidD129lixYh+efoDVg85ngKh25 04i0tD1YIqJ+ScfFjGyYjyZdK8T2GaZpLoLFluG2YhZlueKWHJ44b6bvjyZTRDGCnERECf MgoMyz330154VE8B6ADFuxRxgU56ngaEnSBqD49GSqFVLxvITeNj+uVpOR1HJYBOvRRPuc H0Q2z6+oIyaYzXATvCMVz2/crFY1llpo+cOyHD/6KTakxVt0ePurxuXKs0opiDPpZJo14t ihBMI1FapMXbo7qq1dqMoLNSjyDWm5+MfujwoED+NsvKjVijum9BeZzyUnABZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677306363; a=rsa-sha256; cv=none; b=dS+qFO62nuOw4qm1J3DQxjFo3e6HfYDLGeeYsUFEQJ5IALFjY1t4O8gsl1fERp2C/1petc qkhik07oUAOiH5xZr3CFjVWHHoqmX/Q2YcjOTFQB1aw8b4igeiU8RQ6sIhWl7teVXT+s/7 WtgSmaM8/Q7XdXyyiFX2NjC3MtF0w4X03W8j1VKgguMTvekbtyMX1oZ7cCS0xZZPnZaq48 Srv1Rg2inotk0eXOCjZCtIXCF0mVq3gOS7Srb41TCxquMeV3ajRHltvZ+h/YGKq7Dmd1Zo RiVwSBs2Y6eyfZ++11BE4B98RujfRIYosqwuTlK3Gl/7Bw06B86f844EOcTEYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNxbb09lFztQD; Sat, 25 Feb 2023 06:26: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 31P6Q2WV011081; Sat, 25 Feb 2023 06:26:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31P6Q2UW011080; Sat, 25 Feb 2023 06:26:02 GMT (envelope-from git) Date: Sat, 25 Feb 2023 06:26:02 GMT Message-Id: <202302250626.31P6Q2UW011080@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: 8d966fb02ea7 - main - sys/conf/NOTES add new KBD_DELAY kernel options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d966fb02ea796fbd5a647ffd26231b0e01119c8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8d966fb02ea796fbd5a647ffd26231b0e01119c8 commit 8d966fb02ea796fbd5a647ffd26231b0e01119c8 Author: Michael Paepcke AuthorDate: 2023-02-21 06:17:00 +0000 Commit: Warner Losh CommitDate: 2023-02-25 06:20:52 +0000 sys/conf/NOTES add new KBD_DELAY kernel options add section for new kernel keyboard options Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/649 --- sys/conf/NOTES | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 6cea39d27ad6..f6a85c80f034 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1493,7 +1493,11 @@ options PCI_IOV # PCI SR-IOV support # These options are valid for other keyboard drivers as well. options KBD_DISABLE_KEYMAP_LOAD # refuse to load a keymap -options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options KBD_INSTALL_CDEV # install a CDEV entry in /dev + +# Define keyboard latency (try 200/15 for a snappy interactive console) +options KBD_DELAY1=500 # define initial key delay +options KBD_DELAY2=100 # define key delay device kbdmux # keyboard multiplexer options KBDMUX_DFLT_KEYMAP # specify the built-in keymap From nobody Sat Feb 25 06:26:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PNxbc3Dm5z3vT8p; Sat, 25 Feb 2023 06:26: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 4PNxbc2S1vz3svF; Sat, 25 Feb 2023 06:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677306364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+QYTxSyEcHC34cU3AILDV32MsCPBLMvMt/cSQFNbmYE=; b=OH78hPWLDPymdIJ2CEaNEPM43dJLPMM30FmQo1H13SKrxovB5qCLkk0wR++8c6L0MPoAow imHG+LE5SlBQ7qxwkcXk9aFgXOKauh83amRHYIXqdDgl9Qnz39kYoXBMs3fRdLTZcYtlGc 0DUxQBoXja+AIVENAlrCOadHFppPtQ1v6KaxdDpA95+3tVZ/lWzTk80S8DCbJ9WjxP8arP 9qcmNi6Tst9Ota1KZu2oPlgi+oZ+0cmumt9ibTe38RVHn1VzE4c3w3ec1Okn+AmuuoJ/Wi GObOyz9bGlcEhL867u2pxFrPGb9S1/QOpSQEdeR55jYIa2QGh8NCa/kS2oBBhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677306364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+QYTxSyEcHC34cU3AILDV32MsCPBLMvMt/cSQFNbmYE=; b=UhgV4+69Fqfi74B2JkV8M0nG0Fped1k0kvm233JvCdHYMC0Q6UAyAAQxA+xTUWoLwDtkR1 ifA3WHETHzpsGr2tEmqxJgvxsfdONZbT2onLWdnlufByEBlxOMXUngwZpSaSuUELQ8LN2R r1QLsPwtNqqqjbwLLKYia6szscJMi724rVM44rrhYCeYCtHsAEzIHdDcHLG+TLiaIDObZU PU7GdCaDssI+ALW+nqhtLrHJAV7qebt6/Om3a4+OiU7NgRlSI5no+wtDKLirhRGV9uxeGv S5/CSNnS8pTOgF/midfmJFPnrX/x/fxOxthwX08EqQiJLqXhx8AVJyikUPWxhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677306364; a=rsa-sha256; cv=none; b=OPE7+Sw2X5A/39ZmTEtsiQjIR3XdPcrkm5oUQ7o9uJpTNByHP4rdrUt3H5ENqL8UbAV/Nf LfxOGaJYiiCm2WnVhw4OJgyv2QnEeGmvU9n7LC+8DKh3yGfriA8G+cGNNlP15mAZ0K2L6A c0HEQ0wv7z5hJ2cGrbr/7V2Ed9hZVBMKHY51FQaFgRlh5AZ3GIX6dYRiakN5g9v7bPusN1 UaPtfb0UFIJHFZTTAMTBi2GZjXRUTmN61duFpChol+a54Nz7TFDQRwnt7/X9nHOxRHC3hd mr96gUj98L48FgK2CCf9i2JI4iLjz0y53KkX+yNfwdhnk3CIwkdYtz6jmZ/wZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PNxbc1Lylzv0P; Sat, 25 Feb 2023 06:26: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 31P6Q4wx011104; Sat, 25 Feb 2023 06:26:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31P6Q4m7011103; Sat, 25 Feb 2023 06:26:04 GMT (envelope-from git) Date: Sat, 25 Feb 2023 06:26:04 GMT Message-Id: <202302250626.31P6Q4m7011103@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: 9b70ce712caa - main - UPDATING List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b70ce712caa028604caaa2322f79573d71a4d9b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9b70ce712caa028604caaa2322f79573d71a4d9b commit 9b70ce712caa028604caaa2322f79573d71a4d9b Author: Michael Paepcke AuthorDate: 2023-02-21 05:36:24 +0000 Commit: Warner Losh CommitDate: 2023-02-25 06:20:52 +0000 UPDATING Add notice to kernel options KBD_DELAY1 and KBD_DELAY2 Reviewed by: imp (tweaked whitespace too) Pull Request: https://github.com/freebsd/freebsd-src/pull/649 --- UPDATING | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UPDATING b/UPDATING index a1a02a755713..dbaa5f2a92db 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20230221: + Introduce new kernel options KBD_DELAY1 and KBD_DELAY2. See atkbdc(4) + for details. + 20230206: sshd now defaults to having X11Forwarding disabled, following upstream. Administrators who wish to enable X11Forwarding should add From nobody Sat Feb 25 13:11:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PP6bs4dxgz3t91D; Sat, 25 Feb 2023 13:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PP6bs2rBDz4V8W; Sat, 25 Feb 2023 13:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677330713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JhWog2heIk9SNtXdjlUV6bK0SgEu8/UMDxIW9zEUOJ8=; b=XYjmG8EEGOnNPaHGpNYDO1Q7zBym4XQCyBzOOK4VHKX4x3wRpEMBdBW+tcKgiOzIA2j0Tg HH8WiRpQ42TxM5kEGUEaW3DN4B4w6lcVngSgXbOd6y/z3SzvYoHiOz1qs+9LXqMHuZ/VVO Sd2IIrTO1wg11+WCJJ5C9qk2FELLd/Ce5OeEgTNvuqejP/l8JrLW0f9B1eoaCU39xtP7HR uFxnJe0j7gQikFDJ8A/vna046la8aeDLITr0TPOeNjkZ/YKL4elvJmTYU7QgroAbL2zmtC +cuFxmhKdhIllKuy4y98DnLxDGriBulSNe1U6JPdSzQ6Cl5/zqXM6+tLP5wo6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677330713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JhWog2heIk9SNtXdjlUV6bK0SgEu8/UMDxIW9zEUOJ8=; b=Alr4tULvWYWChP+VY78CrQm6ZbAlH6ntR6SvFPDAtsw8aRt2auajoHzyFfVqL9BLzTsVNq qUOCDzoEE9WmZzau5Wy6zZqC7psuoYhBZqTY59no2puwpqy9mQmngbCPw2Zmi6sAGI3at/ p/cfoVVJXO7054EvLweoY9iagR8ZQGQkp8H4qidzcQddFSub95xN1pYJ+S8nqYYlSJ3TIy ldtLqlrSA1rOtMHI6Kqf+lUNMHcTpfx2Cst4Q8S6ugrYeiPp9+1nud6St8jqvcdlT5UPmm oaUHbqqIe7nuxdBBEsnCuc4NmOXs4krlRMDDLFZ+WgbQ2FjUSzn/75RGXotO1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677330713; a=rsa-sha256; cv=none; b=W8zZxPP4XcguV++ryvmzgmUXQFh9XONHG4aWFZFuxnO+fjeJdksWlmZr5gYxbbldPfyKzl TLA6+w6Ao5B/5/ooImUSenQ+/dvZEByFrIj2TUKu7304dPpEcUuDDTsxTZIEjJT/eWDl3l I3RIWOWBKgJeicHky2ru/M8W1SyrWKvUleYgh0Y5LAsEvp1dx71O+iUtZtdJC1zXvHExCd RIp4FZjuBCSwJTdEuA39uxjiFXPf73FV0coGh+JxI4+W06Hledp6QAB/Bxrg8ArEZEMjNN VjDRSAgoDcrGL4zXvRdNcK+T8kNNC3GgPqm3t4ddcnpkFXJzoVULPxWrZTOZSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PP6bs1vhmz1542; Sat, 25 Feb 2023 13:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31PDBrjk056824; Sat, 25 Feb 2023 13:11:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PDBrR0056823; Sat, 25 Feb 2023 13:11:53 GMT (envelope-from git) Date: Sat, 25 Feb 2023 13:11:53 GMT Message-Id: <202302251311.31PDBrR0056823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 211ceb62e85d - main - inet6_opt_init.3: Some enhancements List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 211ceb62e85d8d01ea89af0de8e43430de550e72 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=211ceb62e85d8d01ea89af0de8e43430de550e72 commit 211ceb62e85d8d01ea89af0de8e43430de550e72 Author: Gordon Bergling AuthorDate: 2023-02-25 13:11:27 +0000 Commit: Gordon Bergling CommitDate: 2023-02-25 13:11:27 +0000 inet6_opt_init.3: Some enhancements - Be consistent with RFC references, so add a space after 'RFC' - Add a LIBRARY section - Use standard integer types in the SYNOPSIS section Obtained from: DragonflyBSD MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D27548 --- lib/libc/net/inet6_opt_init.3 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/libc/net/inet6_opt_init.3 b/lib/libc/net/inet6_opt_init.3 index 484767f781fa..0813e6ca7838 100644 --- a/lib/libc/net/inet6_opt_init.3 +++ b/lib/libc/net/inet6_opt_init.3 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2021 +.Dd February 25, 2023 .Dt INET6_OPT_INIT 3 .Os .\" @@ -43,20 +43,22 @@ .Nm inet6_opt_get_val .Nd IPv6 Hop-by-Hop and Destination Options manipulation .\" +.Sh LIBRARY +.Lb libc .Sh SYNOPSIS .In netinet/in.h .Ft "int" .Fn inet6_opt_init "void *extbuf" "socklen_t extlen" .Ft "int" -.Fn inet6_opt_append "void *extbuf" "socklen_t extlen" "int offset" "u_int8_t type" "socklen_t len" "u_int8_t align" "void **databufp" +.Fn inet6_opt_append "void *extbuf" "socklen_t extlen" "int offset" "uint8_t type" "socklen_t len" "uint8_t align" "void **databufp" .Ft "int" .Fn inet6_opt_finish "void *extbuf" "socklen_t extlen" "int offset" .Ft "int" .Fn inet6_opt_set_val "void *databuf" "int offset" "void *val" "socklen_t vallen" .Ft "int" -.Fn inet6_opt_next "void *extbuf" "socklen_t extlen" "int offset" "u_int8_t *typep" "socklen_t *lenp" "void **databufp" +.Fn inet6_opt_next "void *extbuf" "socklen_t extlen" "int offset" "uint8_t *typep" "socklen_t *lenp" "void **databufp" .Ft "int" -.Fn inet6_opt_find "void *extbuf" "socklen_t extlen" "int offset" "u_int8_t type" "socklen_t *lenp" "void **databufp" +.Fn inet6_opt_find "void *extbuf" "socklen_t extlen" "int offset" "uint8_t type" "socklen_t *lenp" "void **databufp" .Ft "int" .Fn inet6_opt_get_val "void *databuf" "int offset" "void *val" "socklen_t vallen" .\" @@ -67,9 +69,9 @@ The advanced sockets API defines a set of functions to help applications create and manipulate Hop-by-Hop and Destination options. This man page describes the functions specified in -IETF Draft RFC3542. +IETF Draft RFC 3542. These functions use the -formatting rules specified in Appendix B in RFC2460, i.e., that the +formatting rules specified in Appendix B in RFC 2460, i.e., that the largest field is placed last in the option. The function prototypes for these functions are all contained in the @@ -206,7 +208,7 @@ inserted into the extension header, and the argument indicates how much data to copy. .Pp The caller should ensure that each field is aligned on its natural -boundaries as described in Appendix B of RFC2460. +boundaries as described in Appendix B of RFC 2460. .Pp The function returns the offset for the next field which is calculated as .Fa offset @@ -281,7 +283,7 @@ or functions. The .Fa val -argument points where the data will be extracted. +argument points to where the data will be extracted. The .Fa offset argument specifies from where in the data portion of the option the @@ -289,7 +291,7 @@ value should be extracted; the first byte of option data is specified by an offset of zero. .Pp It is expected that each field is aligned on its natural boundaries as -described in Appendix B of RFC2460. +described in Appendix B of RFC 2460. .Pp The function returns the offset for the next field by calculating @@ -305,7 +307,7 @@ All the functions return on an error. .\" .Sh EXAMPLES -RFC3542 gives comprehensive examples in Section 22. +RFC 3542 gives comprehensive examples in Section 22. .Pp KAME also provides examples in the .Pa advapitest @@ -318,20 +320,20 @@ directory of its kit. .%A E. Nordmark .%A T. Jinmei .%T "Advanced Sockets API for IPv6" -.%N RFC3542 +.%N RFC 3542 .%D October 2002 .Re .Rs .%A S. Deering .%A R. Hinden .%T "Internet Protocol, Version 6 (IPv6) Specification" -.%N RFC2460 +.%N RFC 2460 .%D December 1998 .Re .Sh STANDARDS The functions are documented in .Dq Advanced Sockets API for IPv6 -.Pq RFC3542 . +.Pq RFC 3542 . .\" .Sh HISTORY The implementation first appeared in KAME advanced networking kit. From nobody Sat Feb 25 15:27:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PP9cK07dVz3tHfW; Sat, 25 Feb 2023 15:27: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 4PP9cJ6jFkz3GY7; Sat, 25 Feb 2023 15:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677338848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SLR3BQAOUpKSZSZ5DF27lYn9zv4N4aTzviWEmAkplKE=; b=ZCVo5cBPyWlPrX9DV39Yqhf5en8yoL2kQbi516XTB4fqyvncoKVTbfKCA0ah0IX3GbIS/w 1zMv1VFMBE3WwQKYGKW8aeAgfgNHtYhY3iklmVYxt0vP1akC4ZbXMX7ybLFXwaISTkxUmQ +0QcWbr0Ahuqj6OB0BQhC2NxTSXZw3JEx4NRdyv+krr1wPZiQJWT0s0g6TjS/OgX9XdlzS x3ERPI3fWnfiEUpCUopJ17ZwvajC50ldlipxarsjoD0SCxkbsdDIJXOsowN1nw6UiMj/JU xUsClWHgt7eKRaoDwydf7OPbZ1Xsqhx1hgNaSCUWkrmpFxTeJsKwa+b5npNLZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677338848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SLR3BQAOUpKSZSZ5DF27lYn9zv4N4aTzviWEmAkplKE=; b=tjAo99tEgle7k2siKm4nUo/cTds3YSvybepGxXPC/34IR7XbgIUiMjAUnbhqXWDdQTykH8 fHffHZvXZ/TD4zKxs3MIQCxlQabRNLm7cUZFq1DYLqHF/RJ9b2WLU+8nqt89yywT6u2i5O BimK5SpAX44ZCxv9rw79ywkS1zw+8EPQK5rr2OciT86ToAQgMYkHGHtazljPqfG5JrXyvD iBdNUXnJ19X754lmCSjaDGsnMG5NUL/SdD9V22yXeQ2sSRDprxAZ+chcSiYTmMuOre8XMb x3r1QkVBexTHzczY4N4qhzUNiFmOa0I22iRt/6ykWJTGNQ6zEJ232eqbMW8XrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677338848; a=rsa-sha256; cv=none; b=m2crBTRPkdQS42FTa5Cm8S4J/9r7mLoO7uJFDTjpRgczGtcu/3tuXenL1kvOSzLhICdKL2 LFXvNOJ0ZtI77IvPZbYxoQNOrp5/OkkiElgb5p1uQZPjh40mBcb/+wd+itZ/RXpHslG+ND paZSMzNrXqbcD4AHZSfv3WkrMU07zSM9NpvA5Znk3TgnYtWS0m6Fg1DxnwmDwJtqtldJCt GSRrJy9vcVUAHhDTcBdtlUp1OWcowfIMqkDWP8TacFW/XKk4/FQ4znfoxwNJHv4csdorVf KkSKS0OKWYMjFkPA5EVb9P2+8aoqXeFXI2ScTr3IAEjfQKb4Y2MGkwwdbDNNsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PP9cJ5ddlz187b; Sat, 25 Feb 2023 15:27: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 31PFRSkx065605; Sat, 25 Feb 2023 15:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PFRSVk065604; Sat, 25 Feb 2023 15:27:28 GMT (envelope-from git) Date: Sat, 25 Feb 2023 15:27:28 GMT Message-Id: <202302251527.31PFRSVk065604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: b739bc986099 - main - sys/conf/NOTES: clean up whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b739bc986099cbf9dcb355088af8cefeaed42d17 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=b739bc986099cbf9dcb355088af8cefeaed42d17 commit b739bc986099cbf9dcb355088af8cefeaed42d17 Author: Mike Karels AuthorDate: 2023-02-25 14:04:00 +0000 Commit: Mike Karels CommitDate: 2023-02-25 15:27:06 +0000 sys/conf/NOTES: clean up whitespace Most options in kernel config files use "optionsOPTION". This allows the option to be commented out without shifting columns. A few options had two tabs, and some had spaces. Make them consistent. I missed this file on the last pass. --- sys/conf/NOTES | 70 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index f6a85c80f034..6d79905967aa 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -228,7 +228,7 @@ options SMP # Symmetric MultiProcessor Kernel # kernel startup process (before devices are probed) rather than at the # end. This is a temporary option for use during the transition from # late to early AP startup. -options EARLY_AP_STARTUP +options EARLY_AP_STARTUP # MAXCPU defines the maximum number of CPUs that can boot in the system. # A default value should be already present, for every architecture. @@ -439,17 +439,17 @@ options SYSCTL_DEBUG # # Enable textdump by default, this disables kernel core dumps. # -options TEXTDUMP_PREFERRED +options TEXTDUMP_PREFERRED # # Enable extra debug messages while performing textdumps. # -options TEXTDUMP_VERBOSE +options TEXTDUMP_VERBOSE # # NO_SYSCTL_DESCR omits the sysctl node descriptions to save space in the # resulting kernel. -options NO_SYSCTL_DESCR +options NO_SYSCTL_DESCR # # MALLOC_DEBUG_MAXZONES enables multiple uma zones for malloc(9) @@ -485,7 +485,7 @@ options DEBUG_REDZONE # it is not defined. It is commented out here because this feature # isn't generally available. And the required eputc() isn't defined. # -#options EARLY_PRINTF +#options EARLY_PRINTF # # KTRACE enables the system-call tracing facility ktrace(2). To be more @@ -674,9 +674,9 @@ options ROUTETABLES=2 # allocated fibs up to 65536. default is 1. # but that would be a bad idea as they are large. options TCP_OFFLOAD # TCP offload support. -options TCP_RFC7413 # TCP Fast Open +options TCP_RFC7413 # TCP Fast Open -options TCPHPTS +options TCPHPTS makeoptions WITH_EXTRA_TCP_STACKS=1 # RACK and BBR TCP kernel modules # In order to enable IPSEC you MUST also add device crypto to @@ -686,15 +686,15 @@ options IPSEC #IP security (requires device crypto) # Option IPSEC_SUPPORT does not enable IPsec, but makes it possible to # load it as a kernel module. You still MUST add device crypto to your kernel # configuration. -options IPSEC_SUPPORT +options IPSEC_SUPPORT #options IPSEC_DEBUG #debug for IP security # TLS framing and encryption/decryption of data over TCP sockets. -options KERN_TLS # TLS transmit and receive offload +options KERN_TLS # TLS transmit and receive offload # Netlink kernel/user<>kernel/user messaging interface -options NETLINK +options NETLINK # # SMB/CIFS requester @@ -851,8 +851,8 @@ options NGATM_UNI options NGATM_CCATM # Network stack virtualization. -options VIMAGE -options VNET_DEBUG # debug for VIMAGE +options VIMAGE +options VNET_DEBUG # debug for VIMAGE # # Network interfaces: @@ -1165,7 +1165,7 @@ options MD_ROOT options MD_ROOT_READONLY # Allow to read MD image from external memory regions -options MD_ROOT_MEM +options MD_ROOT_MEM # Disk quotas are supported when this option is enabled. options QUOTA #enable disk quotas @@ -1411,8 +1411,8 @@ options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS options SCSI_DELAY=5000 # Be pessimistic about Joe SCSI device options CAM_IOSCHED_DYNAMIC -options CAM_IO_STATS -options CAM_TEST_FAILURE +options CAM_IO_STATS +options CAM_TEST_FAILURE # Options for the CAM CDROM driver: # CHANGER_MIN_BUSY_SECONDS: Guaranteed minimum time quantum for a changer LUN @@ -1493,14 +1493,14 @@ options PCI_IOV # PCI SR-IOV support # These options are valid for other keyboard drivers as well. options KBD_DISABLE_KEYMAP_LOAD # refuse to load a keymap -options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options KBD_INSTALL_CDEV # install a CDEV entry in /dev # Define keyboard latency (try 200/15 for a snappy interactive console) -options KBD_DELAY1=500 # define initial key delay -options KBD_DELAY2=100 # define key delay +options KBD_DELAY1=500 # define initial key delay +options KBD_DELAY2=100 # define key delay device kbdmux # keyboard multiplexer -options KBDMUX_DFLT_KEYMAP # specify the built-in keymap +options KBDMUX_DFLT_KEYMAP # specify the built-in keymap makeoptions KBDMUX_DFLT_KEYMAP=it.iso options FB_DEBUG # Frame buffer debugging @@ -1511,17 +1511,17 @@ options TEKEN_UTF8 # UTF-8 output handling # The vt video console driver. device vt -options VT_ALT_TO_ESC_HACK=1 # Prepend ESC sequence to ALT keys -options VT_MAXWINDOWS=16 # Number of virtual consoles -options VT_TWOBUTTON_MOUSE # Use right mouse button to paste +options VT_ALT_TO_ESC_HACK=1 # Prepend ESC sequence to ALT keys +options VT_MAXWINDOWS=16 # Number of virtual consoles +options VT_TWOBUTTON_MOUSE # Use right mouse button to paste # The following options set the maximum framebuffer size. -options VT_FB_MAX_HEIGHT=480 -options VT_FB_MAX_WIDTH=640 +options VT_FB_MAX_HEIGHT=480 +options VT_FB_MAX_WIDTH=640 # The following options will let you change the default vt terminal colors. -options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK) -options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) +options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK) +options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK) # # Optional devices: @@ -1998,7 +1998,7 @@ device ath_hal # pci/cardbus chip support # for this work around, but without it things don't work at all. The DMA # from the card usually bursts 128 bytes, but on the affected CPUs, only # 4 are safe. -options AH_RXCFG_SDMAMW_4BYTES +options AH_RXCFG_SDMAMW_4BYTES #device ath_ar9160 # AR9160 chips #device ath_ar9280 # AR9280 chips #device ath_ar9285 # AR9285 chips @@ -2144,13 +2144,13 @@ envvar hint.gusc.0.flags="0x13" # SND_OLDSTEREO Only 2 channels are allowed, effectively # disabling multichannel processing. # -options SND_DEBUG -options SND_DIAGNOSTIC -options SND_FEEDER_MULTIFORMAT -options SND_FEEDER_FULL_MULTIFORMAT -options SND_FEEDER_RATE_HP -options SND_PCM_64 -options SND_OLDSTEREO +options SND_DEBUG +options SND_DIAGNOSTIC +options SND_FEEDER_MULTIFORMAT +options SND_FEEDER_FULL_MULTIFORMAT +options SND_FEEDER_RATE_HP +options SND_PCM_64 +options SND_OLDSTEREO # # Cardbus @@ -2787,7 +2787,7 @@ options GZIO options ZSTDIO # BHND(4) drivers -options BHND_LOGLEVEL # Logging threshold level +options BHND_LOGLEVEL # Logging threshold level # evdev interface device evdev # input event device support From nobody Sat Feb 25 15:34:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PP9m63YVgz3tJ16; Sat, 25 Feb 2023 15:34: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 4PP9m632Lsz3Gmw; Sat, 25 Feb 2023 15:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677339254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z4ZCpi2q+/D/ZfpXZKZxYxPF6238F8MUVkGl8G5/3To=; b=EYh354UUfzNdPhC6nGQWnjQRv7YoWqOPNMvnmij9lUIjts0+Tnp4YtE05aL42LpNIMvujX UDGOYLrIkhrJYXn2cbsGNqDoiWk3m4zcDjzFLNv3AwbCm+YYyRY+9dJPplmDgvZH66++3z dj5UjOsL55zdY0u2FLNVn3H+xy2EnXFo6O8fRTrmK6UwT2ncyYYpuQw4ZdaKfD3V46BZ49 Jc0XNy3POBTol3HogNXp1EvpgEA/qtZlzOe6YZmOneMNf8F1YDX17E0+5c8yPVlRFx0xJw ipmSz+oqhr/b6I4JRxtkb//+EOfSwd+LvDbDmjXv1DibRXban0hv3N0OMJNj4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677339254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z4ZCpi2q+/D/ZfpXZKZxYxPF6238F8MUVkGl8G5/3To=; b=VKpyRDjAuHCyI05Leo3Ii/Oak1RiHJwqlmn/azqd8RykuXMIOIi0X/ge30eqeCFN4p0ubJ TpnwhpHN8FqfpKYP2SWTy6BJx2W4HCGGPcuF8+XjRW1d+L7uuKv4zjoR2L73AoaVHdCKOi rqBC9iRqz4kuHgFxB9iS9HBeGyeUNIll2fkvSt41++ToZbQLXbrACWuJP+Xm/75BVrJe6b 7QCpkNY423qvZaj5wircTUFJusaeUY4plZtVelyLaZbWuntDwfIMkvSbTqgK0fXjPCG6jc V5YtMTJk3Hc0XnD1ssxqLZGwUOk6FJsKDXAjlgL6quq7a7cMB3PcKhnmHNLG4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677339254; a=rsa-sha256; cv=none; b=okrOHQQTWsNAF0AV2q0cctd/CUAPNAGWr9q9Z7qvs974to3JaYyl3RY3adeBYVYarjU8Uq dJ2mWrVt4LstxG6lWehh3x9lWuorzm20iAvYr66prVJ0cT8XRAc9WB+eUAVGNEnGTf7cKg noQ68zU4zX23vU7VeOeYgAhLPRl/kzNBJfRM92th9Dov5S88Ez7VF5NzS8i1qeObqyjvNq lYO9e56T9Z1VyqeFH77+CQ/Ow+s4dsK5QVLzdv2t2Vz/zz84UPjQB6erWH2cQpyzAh7tP6 XchMWrXmoEr4klRNqiHu8B7lAJTtKMIemLNZP7fuoO0Ml97205ZAYxrHJ46IOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PP9m624mBz18k3; Sat, 25 Feb 2023 15:34: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 31PFYEwj080929; Sat, 25 Feb 2023 15:34:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PFYEST080928; Sat, 25 Feb 2023 15:34:14 GMT (envelope-from git) Date: Sat, 25 Feb 2023 15:34:14 GMT Message-Id: <202302251534.31PFYEST080928@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: 6f48a4acbeb8 - main - ck_queue: add CK_*_FOREACH_FROM List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f48a4acbeb86ebbef90290ad73ea6be83507aa9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6f48a4acbeb86ebbef90290ad73ea6be83507aa9 commit 6f48a4acbeb86ebbef90290ad73ea6be83507aa9 Author: Mark Johnston AuthorDate: 2023-02-25 15:21:19 +0000 Commit: Mark Johnston CommitDate: 2023-02-25 15:34:06 +0000 ck_queue: add CK_*_FOREACH_FROM This is a variant of CK_*_FOREACH from FreeBSD queue.h which starts iteration at the specified item. If the item pointer is NULL, iteration starts from the beginning of the list. Upstream commit 74366be35a6f4635f248a3c62d2d23245a4eb0f4. MFC after: 2 weeks Sponsored by: Klara, Inc. --- sys/contrib/ck/include/ck_queue.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/contrib/ck/include/ck_queue.h b/sys/contrib/ck/include/ck_queue.h index fd38d8a583fa..3472b0e40ad9 100644 --- a/sys/contrib/ck/include/ck_queue.h +++ b/sys/contrib/ck/include/ck_queue.h @@ -153,6 +153,11 @@ struct { \ (var); \ (var) = CK_SLIST_NEXT((var), field)) +#define CK_SLIST_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) != NULL ? (var) : CK_SLIST_FIRST((head))); \ + (var); \ + (var) = CK_SLIST_NEXT((var), field)) + #define CK_SLIST_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = CK_SLIST_FIRST(head); \ (var) && ((tvar) = CK_SLIST_NEXT(var, field), 1); \ @@ -262,6 +267,11 @@ struct { \ (var); \ (var) = CK_STAILQ_NEXT((var), field)) +#define CK_STAILQ_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) != NULL ? (var) : CK_STAILQ_FIRST((head))); \ + (var); \ + (var) = CK_STAILQ_NEXT((var), field)) + #define CK_STAILQ_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = CK_STAILQ_FIRST((head)); \ (var) && ((tvar) = \ @@ -374,6 +384,11 @@ struct { \ (var); \ (var) = CK_LIST_NEXT((var), field)) +#define CK_LIST_FOREACH_FROM(var, head, field) \ + for ((var) = ((var) != NULL ? (var) : CK_LIST_FIRST((head))); \ + (var); \ + (var) = CK_LIST_NEXT((var), field)) + #define CK_LIST_FOREACH_SAFE(var, head, field, tvar) \ for ((var) = CK_LIST_FIRST((head)); \ (var) && ((tvar) = CK_LIST_NEXT((var), field), 1); \ From nobody Sat Feb 25 16:08:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPBXC4xksz3tZTm; Sat, 25 Feb 2023 16:08: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 4PPBXC4TrCz3L8Z; Sat, 25 Feb 2023 16:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677341339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lLRwBG++HFOPndymfL9WcSewwor3rUXokmwQpmJnch8=; b=Ze0jyra2e9Y7FOIqUx/DM7Bab2Da658aGuTrFVLRBFLvzZ1VecH3i0p8PN9Sqja+et0klJ 5C/bKMxmhGjOdmUzMcKAXuFMNex2sUbSD8rTHEeZH6Nd1HXl1Lsy7wwbw1DJZDMomnRzmy SaQL7hQsTfRBuDdsLMK5iwqR/YQZy32wOn2ovwHwQceYha/L8qI9rHEwtcP9SMNyRUzJ2j fWo0dkXkxGhgLzGPncXRXIGvsh2EYK15kZgYP9iryQrciJ/mmEK2vB5+nWrvOaKDs4jV7f M4DB8YYialyMckvbQ5AzIduZStXJDmGLJj95XHKdkG40+y/AJviVMWwpM4pDNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677341339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lLRwBG++HFOPndymfL9WcSewwor3rUXokmwQpmJnch8=; b=o2iT6VetPtMnmZsxdzsRsglt2QhfepEsxU6ml5khff0/ZdpiPBjwVySxqDXHDAoDd+Lz6w Gkkvno/CCfrmQRR7I/egEib39N49rS3JxAnhxgANY6rqUq3gvSvep77VnjE4Zcw0BKAxjv /C3vBr67VGmJSLmqQ3zKxt/apV0Ok7c3+s35gWuTA8QjeZgF+v5SwCRmLF+QDGlnq0QdzH BYfwbccMx7JLYdJES9qJDHtrxjKy4AcS0g+T8Q+NfTGqPOTH20F3lIPya/gJ0vhzcBFJ82 KZJCTDsO8VYgAHtL4tnQuX4kW87XxkvpsHNBIFzCQLZriVtZQopz5jN28yiXxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677341339; a=rsa-sha256; cv=none; b=wNGO7w8isaSX4cVxdIkA7rj6UQMELVld7wAUHdvFPy0IEW+jaJ+/Meah6Xvsb9uzA3i7Oc swE98hoN8vwcBTOQj5w/B0o/gMiZzYciwO7pTn84pEmgXguEsaf7/2zYLqEGIa0XAFnVOD SD8rySx03MMzdtXacrGsHpJJFlIiYb+FGnm0K7FOyfzeEFcxJ01IWVnrfhI49X8U79y2Lc 0rHhqnkkNhr44UB9hnHwvq0AtnyBUpA3mI9Im2PS7jkCqH4wQJcOVhhD8QqwtxbGk0vkIL GGvmUS7VVNYFaYjp2pwmLZTsAmOoDd3wqc5GbBnGY3E3KPkSvd1uJOkzngFCaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPBXC3XNpz1980; Sat, 25 Feb 2023 16:08: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 31PG8xsc029486; Sat, 25 Feb 2023 16:08:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PG8xFc029485; Sat, 25 Feb 2023 16:08:59 GMT (envelope-from git) Date: Sat, 25 Feb 2023 16:08:59 GMT Message-Id: <202302251608.31PG8xFc029485@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: 3b7d00ddbd81 - main - Xref rc.conf in my previous addition. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b7d00ddbd8110ebc03f899a647d70c769182cf2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=3b7d00ddbd8110ebc03f899a647d70c769182cf2 commit 3b7d00ddbd8110ebc03f899a647d70c769182cf2 Author: Poul-Henning Kamp AuthorDate: 2023-02-25 16:08:06 +0000 Commit: Poul-Henning Kamp CommitDate: 2023-02-25 16:08:06 +0000 Xref rc.conf in my previous addition. Prodded by: karels --- share/man/man4/lagg.4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man4/lagg.4 b/share/man/man4/lagg.4 index f3c7d9a5f713..bdb3d4841263 100644 --- a/share/man/man4/lagg.4 +++ b/share/man/man4/lagg.4 @@ -215,7 +215,8 @@ The following example shows how to create an infiniband failover interface. 1.1.1.1 netmask 255.255.255.0 .Ed .Pp -Configure two ethernets for failover and static IP in /etc/rc.conf: +Configure two ethernets for failover with static IP in +.Xr /etc/rc.conf 5 : .Bd -literal -offset indent cloned_interfaces="lagg0" ifconfig_lagg0="laggproto failover laggport bge0 laggport bge1 \e @@ -225,6 +226,7 @@ ifconfig_bge1="up" .Ed .Sh SEE ALSO .Xr ng_one2many 4 , +.Xr rc.conf 5 , .Xr ifconfig 8 , .Xr sysctl 8 .Sh HISTORY From nobody Sat Feb 25 16:27:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPBxj0dqRz3tbl7; Sat, 25 Feb 2023 16:27: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 4PPBxj089nz3QGh; Sat, 25 Feb 2023 16:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677342457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HXAVsuRATMeOY9UUzfrVsUl6Af9NE8E7RNs09B5dwCw=; b=tORccAIw23/IQkkyVI1USARt/MSCpm67M+CzFlQ2IfLiic5yIys1sVYw+cfNnrbfi4Y+df Sf2kHtiUGB0h3i7M3jcF36aEgyNc3sux30D/ooHFd8IHMs+Qah2y35LIBpu8fZBFcXhM6k skBIyI4uamuxINHABGfjYAH405Mta3oMSO6gRcyn6hjTnokDkmdf9yHGCIXjETAx0XFzmi 8ooKC9FA0FnpMs80yBTsovoyxJyS8aX0x9CanAgnPkuMjHp0k29quhlA5xjEHrBZwJpoET W4Xjr96RYcz71SxpuiCkV8Ro75LsZZzzK+R+PdePbg0oESVdROZOCdNICi3m3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677342457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HXAVsuRATMeOY9UUzfrVsUl6Af9NE8E7RNs09B5dwCw=; b=Pn8+U/3O8+SEsS1GOoDcOQ5KfSPn/gqifV/8u/9IokghBtdGCj4atYxbQcuJpa6WEjfMJa q7vW+0T8jUpIzfScaY8i8jPR3vaR+j+UATSWpMqMv9sypPoBVTcZY/XJf5tsdYdysyhM3u i9Grds1GA964f/nTSBF4voR+7fW6HpKoO9bHD0hm+fziHhJvmZkTWJRM8DOvfg6CuJ5/5o CuBgwkphd1AZRhnuptoUq2FOFA0tGQTA1EYLEBPBzh9Y0/subV9/a1fTPzoy5kFBoatWQ/ vBWCx51IqhV7Dl//trlqTkwW3hM6yOHh8+MBBvQ4dvZro6yiT/Iklj7UyLYk5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677342457; a=rsa-sha256; cv=none; b=R2wEgHnTPCcl1xQidyxYvwQ1u36qAPlqWIqpWwo1gAJKA6Ae666zhpzzKm7B8i4BRf7dSc llsDi+3RkM1H2IPftcAvBAk8AGjjS1u4JiPdTIyaKYsX9G1WKKlX+wpvG5Z0hAjzi3BcAF KCiC1PFqhJB0TNunv57hS/M+B6g717eH7pR4I0p8/IbLgB5KBlulz+RdlINW2bNMrbRAP8 tnj1eQOW5ONNM0+0Z/qbcqRDzxIqC0Tu/f/DMyTsgpiNoipHfcv3cnxuieKLL/dVFA+Vry yAtCYm6iV/R+5DWMCSH+uzbZJwF6OOpQFL6WeSauRvp5w/uliBjwwJO6FkdlYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPBxh6Jp5z19k6; Sat, 25 Feb 2023 16:27: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 31PGRaMI060555; Sat, 25 Feb 2023 16:27:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PGRamA060554; Sat, 25 Feb 2023 16:27:36 GMT (envelope-from git) Date: Sat, 25 Feb 2023 16:27:36 GMT Message-Id: <202302251627.31PGRamA060554@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: 996d07a059cf - main - zpool: install vdevprops(7) man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 996d07a059cf04d912068bc0b06ebd2f3b7cbcc0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=996d07a059cf04d912068bc0b06ebd2f3b7cbcc0 commit 996d07a059cf04d912068bc0b06ebd2f3b7cbcc0 Author: Yuri AuthorDate: 2023-02-24 20:15:20 +0000 Commit: Warner Losh CommitDate: 2023-02-25 16:24:20 +0000 zpool: install vdevprops(7) man page Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/666 --- cddl/sbin/zpool/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/cddl/sbin/zpool/Makefile b/cddl/sbin/zpool/Makefile index 7020439a4366..c08de1747cf1 100644 --- a/cddl/sbin/zpool/Makefile +++ b/cddl/sbin/zpool/Makefile @@ -14,6 +14,7 @@ PACKAGE= zfs PROG= zpool MAN= \ spl.4 \ + vdevprops.7 \ zfs.4 \ zpool.8 \ zpool-add.8 \ From nobody Sat Feb 25 16:30:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPC1V2f6pz3tbWv; Sat, 25 Feb 2023 16:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PPC1V1rykz3Qfl; Sat, 25 Feb 2023 16:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677342654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ku4bKEMZog7ucADFG7NgMHYnVRkNjh3XxFtw3LlFAe0=; b=PXyLIQGLQ6cPUV4BCAUTLwR34c5TtSbwuSp8jRNCBTnIcvmwbM1MxFfQLjeLL9mTt34Xxf JIG/Faw/xM4q6rL8BK4JVMuJ4kHhrPkPHtRkIkxPheSu9VpQwXeqSCp206bVFEdELGMEnR y3NHgOsu1jW+7Pdsrzcv81w3bZZOH8YH3zLYNc5Q5lh5iRAQaYGFCCibf2bZI3IUXYQEme N+lS81yG6jY/5LL1D3dTYT7htIX+OEVbZ+wjd1GeIVnX8JumNQdvsOCrAbUTUA/7mES+8y 2ccS/my+bqT4hAbnkXYejyBLI4bIJc7fYL8Zupya/7pGn/HczZBQFAk6f3afFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677342654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ku4bKEMZog7ucADFG7NgMHYnVRkNjh3XxFtw3LlFAe0=; b=DhJpwzFuPvEdiDTz9Dbpv3fzIGXcpeQYD1fqT49Oa3UHHf04Qrp/0mn5Qyi1P4Ibp/hV71 u24DkU6hA22FCoioDorPjoSOXj2KKg2ROgFU9TZUyi8o72mGDKIEKeoGWIkIDJJ4lMNRYa hMgSpqWLHcL8sZ7XP7I98qMOiiYZvmDciZ5+qMjadypZY+IZX8hSYvkne4s9jXEO6pA2V4 J/gww8GyzaklgC449LDUtvKiN4JWFObxAZ8Vxs/4yteE7JNN5OjN3kibWDeB49ANJTHvxe aMXS2y9JrPVXuTdmyk1iMqWcR+DFMtAw5zMnMASQyUFjZ7KiWMGjVqbbHkqkSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677342654; a=rsa-sha256; cv=none; b=YUIo83udGUTr1v+cYWE1eiMc5lJoSep8JA+oeMbsc9lOBKWIwNbGwZKHwt8DfjJqPknWQk IfaYxV2F5DP7j/5cT/4rjOc+P/jImB5UCjkmyWUa1qZY/i0Q3vX0y/5ClRhjO4LG1i0Yke 53IC++7IJKg9ILX9XxAX7aQYpQqZI7JzqYoO1YJtIYjdopWAZOh6S6p+p4PC3hZKMF6vdY RCnoUvPjXzzW5Bu+3D1+IlS3vk+dSuX8FcQse9Vgb/GnRUvHz22v6JS6RKML3ITkHnOpi9 WzkVpH2mnBeXsPhKnXYnf3UTQwsPZr0Y3fQabcTYdqXJsbpZjPxdRpjtZITXTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPC1V0vk2z19SH; Sat, 25 Feb 2023 16:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31PGUshk069504; Sat, 25 Feb 2023 16:30:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PGUsp8069503; Sat, 25 Feb 2023 16:30:54 GMT (envelope-from git) Date: Sat, 25 Feb 2023 16:30:54 GMT Message-Id: <202302251630.31PGUsp8069503@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 28111ddf9ee6 - main - powerd.8: Provide a whole path to power_profile for clarity List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28111ddf9ee6d14eea6941a66168f2aeb361746d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=28111ddf9ee6d14eea6941a66168f2aeb361746d commit 28111ddf9ee6d14eea6941a66168f2aeb361746d Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-02-25 16:28:49 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-02-25 16:30:27 +0000 powerd.8: Provide a whole path to power_profile for clarity MFC after: 3 weeks --- usr.sbin/powerd/powerd.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/powerd/powerd.8 b/usr.sbin/powerd/powerd.8 index 9c5133f536d7..bb77ef66f9ed 100644 --- a/usr.sbin/powerd/powerd.8 +++ b/usr.sbin/powerd/powerd.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2021 +.Dd February 25, 2023 .Dt POWERD 8 .Os .Sh NAME @@ -170,7 +170,7 @@ utility should also power down idle disks and other components besides the CPU. If .Nm is used with -.Pa power_profile , +.Pa /etc/rc.d/power_profile , they may override each other. .Pp The From nobody Sat Feb 25 16:53:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPCWm3BhMz3tcts; Sat, 25 Feb 2023 16:53: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 4PPCWm2d90z3l2C; Sat, 25 Feb 2023 16:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677344020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X5IckCRRrC+xUsAhnAGaUrNO6kgtsdt9D2Rz3GiVNlw=; b=i1sYfByiZkQADhhGaiN0Q6indvXgh7PFQztn/ckFdHajchuUg49sDydxoPYkso/JDbEGUA lqb8GoHU/jIuVEfXBLbWTjaPZKir+qFxMBF0PpyuMj7VPvHvURV/rmI3L/KXyUXul1xMrr U0moKabFJ4rUuS3bMLemaf91oBCxU0g2uC4DqsgvnECMQT1kuGGqDk4OGdsiyLqnSFWrgH yBxSZgeteLmmCUqzobulPOefpx1eOLecPJ+POe/Pzc6a38jhNVZ0Qe9o5gkfRUnMhMpRUU 3YUUb+FPTY6fJyJguJvRcAN79GZYunuKr/4R2FVxB3PvJ2eNdPQwmpwuiVXTog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677344020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X5IckCRRrC+xUsAhnAGaUrNO6kgtsdt9D2Rz3GiVNlw=; b=q8zHKi3JmTQUvKpK2EdN1VdCqpq3DfQST24FtANz1fEVLGu2y+u3YwgPbLgOpgcNJMwpSB TSdafu/yzdLImJ29cvxmg3sAOSJ5qruXV76munxzMVtQiia3R5oIZ7eBGaGStngpbxwPQL qqsNWb6H7fed0FkPRaabwl7oqMFFh6fgB7AYIGob3z76LP4HkCIlFnpu1uosH0NX3yvcBT Hb8Kp8uztVL/KIPnwIJhg1hdL+YqmMp8a24C6y5BBZv+aCxcu/HR0j0fkAocbYawwokvjk Ab0GtxzCwcWgLMrxLqOmlD4pPllnA349gxspUgi6FNbO+Xlz8Zp5dqiSPbAhFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677344020; a=rsa-sha256; cv=none; b=A+rcixoGd1OB7RWZH2Xaq3xFxCWa5d1VWUXSQoah35ZDX7X9MRQAUvrTur+bPPWH0Sk1ZZ DV9vE0NKSYSdj086JnKHClN0yKrbEsVIsmBu3rbW16QzCMFopQMS4zaBth5WMm+Nj8zaPV WTsClUfQWsSbPnyveP/u6PSnBRXXjKD4qZ9ZDqp+qGfj1ACQglq2un15JLjFa0t7C9PySx 0RD9d7AdrBFqf2qFk6o2SveiFobY65YHWhWS1UnWb/xDB2mMUlNSdvBXe21NafOal7i7KV tDdE8jgsBGOBqJeTGTpO9AhE1KmKvuOtSCYzAlr9bkQDvWjQMWz6qeKpB4N7Pw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPCWm1hjvz1BVv; Sat, 25 Feb 2023 16:53: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 31PGreDl007689; Sat, 25 Feb 2023 16:53:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PGregX007688; Sat, 25 Feb 2023 16:53:40 GMT (envelope-from git) Date: Sat, 25 Feb 2023 16:53:40 GMT Message-Id: <202302251653.31PGregX007688@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: 499171a98c88 - main - apic: prevent divide by zero in CPU frequency init List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 499171a98c8813e4dc6e085461d5c47750efa555 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=499171a98c8813e4dc6e085461d5c47750efa555 commit 499171a98c8813e4dc6e085461d5c47750efa555 Author: Mina Galić AuthorDate: 2023-02-24 11:07:42 +0000 Commit: Warner Losh CommitDate: 2023-02-25 16:47:40 +0000 apic: prevent divide by zero in CPU frequency init If a CPU for some reason returns 0 as CPU frequency, we currently panic on the resulting divide by zero when trying to initialize the CPU(s) via APIC. When this happens, we'll fallback to measuring the frequency instead. PR: 269767 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/664 --- sys/x86/x86/local_apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 609635bdad3d..22392901b731 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -953,7 +953,7 @@ lapic_calibrate_initcount_cpuid_vm(void) /* Record divided frequency. */ count_freq = freq / lapic_timer_divisor; - return (true); + return (count_freq != 0); } static uint64_t From nobody Sat Feb 25 17:16:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPD1n3Pw8z3tf9G; Sat, 25 Feb 2023 17:16: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 4PPD1n2sGgz3pW0; Sat, 25 Feb 2023 17:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677345373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FRXGig8fHqjkDWcxkfZhBHEUiuqBaMaekWP8xX75UFI=; b=FjMYgTjia1tuWrwB2zmhDKxdVvp4f0WMXBU0N0M1MBGYQ96dDWPRgVTNsNAbpe+svRAeUx f2x+cZdwh0PIcQ5yJTKhBjvwPsVeoS8vy4NKnwHFWX2F9JMpQTFWAU2KNx+mu5LQU8gqY3 0PykveUc5Qc/1FXzbcb620yGGV2YozSkplgqQTVIQZ8ukagtlhKOaIt4+IKxBA8jjBMhHn 9OUNo0Qybw6mmyNmv75h6X0HRVgOG/YWx9hn7PbOA/Kuk7ZELtDRMYOZhokAENYDVqHv1L ety4XOoSK8v3mf82sCnP6a+ikiBj2n7mB2GXQ46VH7bwrZmnSsCZ7Pi7W4pt7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677345373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FRXGig8fHqjkDWcxkfZhBHEUiuqBaMaekWP8xX75UFI=; b=C8wHGlnye+J05A3AJKtPJSQfxMGunmgxbY/hLlMC62iXk6Fk7YjmxB0Zx3ARUvChZOzRIU Y5AZXs9SH0dU8vuA4JZvfkNv5ANEdqhF5jkyGccT2+2Ka0qcYI3AQyE9+PV3bpkW0CX7JU GZBHqVqQUUkYJwQhK4JYCs7v4PjHOSjz9KpUOOryS0SCgY8ByPL4fdEb1PWwnwr2/DD4OW XqfqiMHPsh1ZmtpUYLIX2Rzktm5OIxkaiFpikL2RExZEP+bg311jMj6HlidgXSy/AdHUoU //qNCk0HHuZMe3LF3a/0Yjh1qM8oG7y/d/uMG/6MXi4qIdoFOKu5yg71ulS2UQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677345373; a=rsa-sha256; cv=none; b=DlJbPd0S5lTlb94shsSO8sWEwOn9LUy52VK1Gt+rzv1uthW7kUJCJzMEf5iqdDWZYMSlI0 Yk0c+RuUwpYQnN9AoOecoxJKp9KYAdP+gLJ4KzQ3lTswKO+PbMwhWlsjIPkPo5EwR1hCZG rHPFjfNX/z3znkUkdsVwhO3Wm7guRQ7h93hkrB9vMha5LNZIQVdU7fwD58aRYzOJq6iXmp hfRE9Xj7qQq5U8L5Q4sRjGrLzfbpn5UabPqn+zxJsWMlJi5ZpbHl4qu/EnBplfgl99oBph oLpzDn+0cV03cgEIDuoVSdyyw1mk3j26cPmsLEUmy/8Qivg40foWm2X++6x2IA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPD1n1w0bz1C91; Sat, 25 Feb 2023 17:16: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 31PHGDM7040849; Sat, 25 Feb 2023 17:16:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PHGDZA040848; Sat, 25 Feb 2023 17:16:13 GMT (envelope-from git) Date: Sat, 25 Feb 2023 17:16:13 GMT Message-Id: <202302251716.31PHGDZA040848@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: 2f201df1f875 - main - Change hw_tls to a bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f201df1f875349417cafe30b8322291641aadb0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2f201df1f875349417cafe30b8322291641aadb0 commit 2f201df1f875349417cafe30b8322291641aadb0 Author: Alfonso AuthorDate: 2021-07-20 20:17:28 +0000 Commit: Warner Losh CommitDate: 2023-02-25 16:59:11 +0000 Change hw_tls to a bool Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/512 --- sys/netinet/tcp_output.c | 4 +--- sys/netinet/tcp_var.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index db9d96a1a58e..35be3163fa62 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -222,9 +222,7 @@ tcp_default_output(struct tcpcb *tp) #endif #ifdef INET6 struct ip6_hdr *ip6 = NULL; - int isipv6; - - isipv6 = (inp->inp_vflag & INP_IPV6) != 0; + const bool isipv6 = (inp->inp_vflag & INP_IPV6) != 0; #endif #ifdef KERN_TLS const bool hw_tls = tp->t_nic_ktls_xmit != 0; diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index f0469e09fe6d..8ab7433eb3b8 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1283,7 +1283,7 @@ tcp_set_flags(struct tcphdr *th, uint16_t flags) static inline void tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, - uint8_t is_tlp, int hw_tls) + uint8_t is_tlp, bool hw_tls) { if (is_tlp) { tp->t_sndtlppack++; From nobody Sat Feb 25 17:16:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPD1p5ZpCz3tfCk; Sat, 25 Feb 2023 17:16: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 4PPD1p3gR9z3pNR; Sat, 25 Feb 2023 17:16:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677345374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y7/N5myjdDuzw6GsTkHVHEvmcfsnw2BlVgXXPfQZj00=; b=xmgvc4q9Rz5M346O1Lf4tryvcMWDokruDXVJ0HB9PUGirpTbuA/8ra43a9ZSnAeSxQt3fE Qx2pCeFO6bnOdE+mNwaEg4v8g9Mbujf/m9QCBAgInWt6UFSfSl8FtdMOaDpYao3zVtM2oZ lBenjb5eOfeBQHNRMuI19XnEgy75INw8IuzUaWMa6k0tQDKujsPxASQ6zklc1T91SVVp65 dhlAWbdpCO21PKgWFfRHU8ghFd6heuOfmguEji1rFk2S4gdv027QUJoPjVwgu3pQJFjBUj H+Oh5+oojB0C+VSOkhDONUaLW3tQ1WnvSsKkRYALni7eyFSCdtkyvabdaouNBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677345374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y7/N5myjdDuzw6GsTkHVHEvmcfsnw2BlVgXXPfQZj00=; b=gfDZ/fwtBWaKmTXIeizMlZmEQ19Cl/qCa/ZC4W7wfgcn85sigbaAWsLbA+bp3zjRa6lWVm td188zSdP8cBPLZcq4ME5qprtlRXhWd15pbxA0chb2mB/lscPrPYWr95PbwcfaUy61qffg r/QEZtQNmGG4o7Hex08/t7QH144RNRJEVmxqcbuD73VyWRh21ohZtmBAJMte89LDsHtrZT GY06eKyutzunFC3kkrBPLJcyqHtTZY6zEU0C8cmHDhbYGCFwR775amKiE3YjXRooZsMWM2 7tLGjCOEyNo79bvwK/hgRrDEP+YC/fJ+MLxvZDtpypkaeovdm0kmKcXmx46rTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677345374; a=rsa-sha256; cv=none; b=wJo8wgy3xHh3lf4Mj9ki+KOjqTiyOijmk0aAkN0QaTrbgqYk6Bhb8wg/CMe23jGgrHOY4b P28cfpDt8MSj4t8jPY/JDX4Lei1RYtIsPF1rBVsfn8WUCOI5AbgJrjitZnp5Y2nNouESJs eE1gOYx1HinPXLMREvPcQz4bd0ErnQtHhzxRNlSMre8eEOadbpSYMPLvDlUX28TDt5TCRV OIwMmUQitvyQa3vaJhu/S6skgv05jpCRJe77Xpiwv8v0EyDNlXbbOoc7yTaZziGlksKd2n WXAqRBH8+ctk3SyifzPRkhgL5zngQ0i2IoRE06bPYvOpNSJJVYkHw24OROTZ3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPD1p2mzzz1Bp8; Sat, 25 Feb 2023 17:16: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 31PHGEKK040868; Sat, 25 Feb 2023 17:16:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PHGE30040867; Sat, 25 Feb 2023 17:16:14 GMT (envelope-from git) Date: Sat, 25 Feb 2023 17:16:14 GMT Message-Id: <202302251716.31PHGE30040867@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: 4d59545d0cac - main - stand: fix build userboot without zfs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d59545d0cacb5881e2515eecce15e8478f07276 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4d59545d0cacb5881e2515eecce15e8478f07276 commit 4d59545d0cacb5881e2515eecce15e8478f07276 Author: Michael Paepcke AuthorDate: 2023-02-24 19:27:40 +0000 Commit: Warner Losh CommitDate: 2023-02-25 17:14:07 +0000 stand: fix build userboot without zfs Fix regression in building userboot -DWITHOUT_LOADER_ZFS Fixes: e307eb94ae520 MFC After: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/665 --- stand/userboot/userboot/Makefile | 4 ++++ stand/userboot/userboot/main.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/stand/userboot/userboot/Makefile b/stand/userboot/userboot/Makefile index 43011b9577c9..986bfdccfdd6 100644 --- a/stand/userboot/userboot/Makefile +++ b/stand/userboot/userboot/Makefile @@ -36,9 +36,13 @@ SRCS+= gfx_fb_stub.c CFLAGS+= -Wall CFLAGS+= -I${BOOTSRC}/userboot + +.if ${MK_LOADER_ZFS} != "no" CFLAGS.main.c+= -I${BOOTSRC}/libsa/zfs CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs +.endif + CWARNFLAGS.main.c += -Wno-implicit-function-declaration CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c index 40911f35020a..b134d86de9bd 100644 --- a/stand/userboot/userboot/main.c +++ b/stand/userboot/userboot/main.c @@ -32,13 +32,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "bootstrap.h" #include "disk.h" #include "libuserboot.h" #if defined(USERBOOT_ZFS_SUPPORT) +#include #include "libzfs.h" static void userboot_zfs_probe(void); From nobody Sat Feb 25 17:27:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPDGQ0G61z3tfd0; Sat, 25 Feb 2023 17:27: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 4PPDGP6s8cz3s8t; Sat, 25 Feb 2023 17:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677346030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hfh0i25GMQGY6M2vZ6H25xbpROMpZcAlDbdwueXuJz0=; b=MvfVwiIZ3PJWJg6ygZj+07OhM3aul+UUiT6MPsTmvKxWrZwbY8aSKqaI87tnTyqdp7OpEn gTu3cm4zeQObSAu5cPNo6akNLNouaPhASjtdeuZwEJKZkstfTN1jE4beflpBEHBghOyszx Z348xqbMVhedOJHShUtwQ+av/EplDO8JvQetTxIOfebs3JFFNEuJQW8CZHd1eHmXMkEHUP 9yha0GWFAAv+DZjZxOmY5WuwDkibg4upY9woMuR3m41WtiJnZDbPSoCrplvpgFVrNL8du4 +mRPcWWefQjl08nD7btB9CFnY5d45+uDU/ueinJQPoeyTm7B3d1XGKUrl23hTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677346030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hfh0i25GMQGY6M2vZ6H25xbpROMpZcAlDbdwueXuJz0=; b=RuhTcc8HVbwt84kbUb//1DGiw/IY1FBhjgr45s50vKnsDwUXz01UU8W0WwM1DSTJiB24Bo wTo8qlG3YVLDbHM3sZD2ftsGGwziQ7x9Z/WnmFMbBBHv2oIzu96J9ameZvMG7/39c/eSUL APLok5MselYT1/M34C0naPGuGFZHF4GY12/Atd0t0yaE/Zm8UDEK6+KW+JF4ly4GMj9T8U lDaCy0viERdMtyAfGA/IRoRBjJXO1++54aWyqqf6duxGfgzp0cXjXuAzV4lvG378pN12ft 8E405ZVgATaasF+FBfPZ2NT/Ad3MxHpbAOoJ4/dPk03+HeACm57vGqNFUDTe5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677346030; a=rsa-sha256; cv=none; b=VDBvwqmW8V6hvxcGyleaSjFQ+1ARGv50ZNVfR/uE2WFd2WHSgVqJn3mLD9O9YhsEm2awGZ KY6Nb4R7129CmGiNFUrvNH7Pmo2X4TtEeY65qQjZtGaaKqQ2UHY7q6F4uiWjLHtrNKmZsK X8bxfSxOtUienSGwiiKWvBdxlVegg20E1zIS4MQpWLNrihQoueGYZEPTJkNgMLEe5AmLTJ pU5gpiCl1dguh7Jy3MieFGofop0G1e4Cfoi5jN+jopwLw9fkj2MsbGPxVUL1EG0FZxHFOO LzPsltY6xG/18YAkJah6G7uniqdzltX2nBx9lxZqJMuY31DmmMoRywL0jSCb8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPDGP5vZGz1C9v; Sat, 25 Feb 2023 17:27: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 31PHR94w056490; Sat, 25 Feb 2023 17:27:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PHR9LR056489; Sat, 25 Feb 2023 17:27:09 GMT (envelope-from git) Date: Sat, 25 Feb 2023 17:27:09 GMT Message-Id: <202302251727.31PHR9LR056489@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: e052829e3e16 - main - uniq(1): use strtonum to parse options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e052829e3e16dfd82d0adcbb69fd0e30f47a3a6c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e052829e3e16dfd82d0adcbb69fd0e30f47a3a6c commit e052829e3e16dfd82d0adcbb69fd0e30f47a3a6c Author: Daniel Tameling AuthorDate: 2023-02-25 17:25:51 +0000 Commit: Warner Losh CommitDate: 2023-02-25 17:25:51 +0000 uniq(1): use strtonum to parse options Previously strtol was used and the result was directly cast to an int without checking for an overflow. Use strtonum instead since it is safer and tells us what went wrong. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/643 --- usr.bin/uniq/uniq.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c index 5d2a7c1f2245..36fb037df283 100644 --- a/usr.bin/uniq/uniq.c +++ b/usr.bin/uniq/uniq.c @@ -102,7 +102,7 @@ main (int argc, char *argv[]) int ch, comp; size_t prevbuflen, thisbuflen, b1; char *prevline, *thisline, *p; - const char *ifn; + const char *ifn, *errstr;; cap_rights_t rights; (void) setlocale(LC_ALL, ""); @@ -131,14 +131,14 @@ main (int argc, char *argv[]) iflag = 1; break; case 'f': - numfields = strtol(optarg, &p, 10); - if (numfields < 0 || *p) - errx(1, "illegal field skip value: %s", optarg); + numfields = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr) + errx(1, "field skip value is %s: %s", errstr, optarg); break; case 's': - numchars = strtol(optarg, &p, 10); - if (numchars < 0 || *p) - errx(1, "illegal character skip value: %s", optarg); + numchars = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr != NULL) + errx(1, "character skip value is %s: %s", errstr, optarg); break; case 'u': uflag = 1; From nobody Sat Feb 25 17:37:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPDTq1qxyz3tgcT; Sat, 25 Feb 2023 17:37: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 4PPDTq1CBWz3tPj; Sat, 25 Feb 2023 17:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677346623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GNQI7tHWym26FY1XXTD+J+06AWTKH2VGp7rsATdr+9Q=; b=rYWTQZWI4ZN+VsD9eZJojPuBWW0I5brqW+J6CpFnCsPwrr/2Euz2KVlJojDu5YSiAk5/Wo jVsLM3X+TgOpDaFPjGkNP7KptHtyr/4E605GaXm3tgPszpZ7IjpKOAqLOtaJaZQJfmQUfF omBt/V57GpCXb6fMnkFjW+7VkTzT0J8UNowCRhd3/fk72k0Mo33qj1F45Zdtn7YiN47e+l 4GRbG4X3nFyQzTWzjiQs6iNSsFyWc3sgRU6l1Q0CBBKCnA+7IVpdtXTUm6fli1jE/SJ4Km i5ZxhObTaJuvdsEN9h57CNK8y3r1anzUI7RhxfyfcX5qW1hpG3+9zZDBddO86Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677346623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GNQI7tHWym26FY1XXTD+J+06AWTKH2VGp7rsATdr+9Q=; b=bQALqU7jUFMaRZKiOPsxkqyt7KcWnf0fTZyQtyBF5M4Gt5HWQBVAJT7mGIOyfsVxI2SWHq okTRrss79yvKSQCOsPqqHfToZDsidEKSthmDGVA0kMGvYNcqFj4Kb76VZmXOmMAqBb+Njt FTBxiQT6UmYISW9HEeV6Vaff73XtK3fScrnt7p3EvriIXcHg2ND+IFIhD9wo6RtJUI++px UbOgTZQaL3xPAPsXpYYVeS4akH3vAMajmkmGp4qmxWMuSroX749osAZkFps7375l2g3n4A +DUvSVGI3HV+iqKZ9YPLxFcN7AWDG+YduOj4fpm+4W+qtAWBmZDeDKAu8TwpGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677346623; a=rsa-sha256; cv=none; b=e0OW+O+XsqXNgTGLS/+UOpQ2HDJrhj7sR+2+/uN09aJvyGgITkxk8KrGpmRJZNFzoZuYLm qvDf+y6F3ofuG3MSH+OK0hPVcbM1jI/QqWpubHNzFw4fSafe92DqUbqlcM37AZGt3/QhSF h25EBe449G0ZYRLbK6iHz8fjv37WfP13CYYdDn3Cth8ktWJdoxTdENduuIW8vl0Cdi4liY JhFwXzUHt9PB5JrH565SbMPAaESpL+aMHRFghGN12kED3ObzXzug//5H20zYLF7X4HEy/y eBbkWss6rSTxsuloNUzP8Vi1dGu1RtjMSSiPSu5R+R8THMWfILop6ghmFCQ/WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPDTq0FRfz1C2V; Sat, 25 Feb 2023 17:37: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 31PHb2si072301; Sat, 25 Feb 2023 17:37:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PHb2R8072300; Sat, 25 Feb 2023 17:37:02 GMT (envelope-from git) Date: Sat, 25 Feb 2023 17:37:02 GMT Message-Id: <202302251737.31PHb2R8072300@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: 773c13c686e4 - main - kldxref: skip .pkgsave files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 773c13c686e4b6ae9dbbc150b342b82c3f47d73a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=773c13c686e4b6ae9dbbc150b342b82c3f47d73a commit 773c13c686e4b6ae9dbbc150b342b82c3f47d73a Author: Mina Galić AuthorDate: 2023-02-25 17:31:58 +0000 Commit: Warner Losh CommitDate: 2023-02-25 17:35:43 +0000 kldxref: skip .pkgsave files This should help people transitioning from traditional setups to pkgbase experience a lot less friction. We do this by skipping all files containing two dots. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/661 Differential Revision: https://reviews.freebsd.org/D27959 --- usr.sbin/kldxref/kldxref.8 | 12 +++++++++++- usr.sbin/kldxref/kldxref.c | 14 ++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/usr.sbin/kldxref/kldxref.8 b/usr.sbin/kldxref/kldxref.8 index 1a3b9118dd5c..38db9d6922ce 100644 --- a/usr.sbin/kldxref/kldxref.8 +++ b/usr.sbin/kldxref/kldxref.8 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 9, 2001 +.Dd February 25, 2023 .Dt KLDXREF 8 .Os .Sh NAME @@ -51,6 +51,16 @@ If no hint records are generated for a particular directory, no hint file is created, and the preexisting hint file (if there was one in that directory) is removed. .Pp +.Nm +ignores files with at least two "."s in the filename, such as +.Pa foo.ko.debug +or +.Pa bar.ko.pkgsave . +Note that this means that modules cannot have names such as +.Pa foo.bar.ko . +This limitation however, has been lived practice since the beginning of +FreeBSD's kernel modules. +.Pp The following options are available: .Bl -tag -width indent .It Fl R diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index 7a4d704356b8..933de4991e62 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -685,6 +685,7 @@ main(int argc, char *argv[]) { FTS *ftsp; FTSENT *p; + char *dot = NULL; int opt, fts_options, ival; struct stat sb; @@ -752,14 +753,15 @@ main(int argc, char *argv[]) fwrite(&ival, sizeof(ival), 1, fxref); reccnt = 0; } - /* skip non-files and separate debug files */ + /* skip non-files.. */ if (p->fts_info != FTS_F) continue; - if (p->fts_namelen >= 6 && - strcmp(p->fts_name + p->fts_namelen - 6, ".debug") == 0) - continue; - if (p->fts_namelen >= 8 && - strcmp(p->fts_name + p->fts_namelen - 8, ".symbols") == 0) + /* + * Skip files that generate errors like .debug, .symbol and .pkgsave + * by generally skipping all files with 2 dots. + */ + dot = strchr(p->fts_name, '.'); + if (dot && strchr(dot + 1, '.') != NULL) continue; read_kld(p->fts_path, p->fts_name); } From nobody Sat Feb 25 18:43:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPFxw5YHMz3tlH4; Sat, 25 Feb 2023 18:43: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 4PPFxw54dHz43ZG; Sat, 25 Feb 2023 18:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677350580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s2GDjrD8cP0IsdB0t+LwsUuZnmWdsK3+EE4SyCYguFQ=; b=CakSOyuab/dP9f1+tlQ1CpYcGbrFZqEtLuUl2btsJL/+efG0Pu5mRdEA4B284l+mwNBUC7 LyTTVBi2h/YCxsCOxc06kelXtPg+l8q5c/LGYVdfV8gPXoWK4njYFEBdy9nVWCzpl3XLqU G1HjPNZovirrg8oWsAFL/E+VlBYDR446agv1yIHCB3b6UDXNaU9uBw5cSPcK8YOWjEeqEw WDehy+m5D8xwWJ/DFm0WgisXMEIEn5gnjMp/xw+HNPBOthb8u/IK+HPHnGCme2EjnkbGgl 5xvQyJHSrMgoTDYicTfkd0NdSj4PLBT15LVmCwVmfhTuoKVNR3kfCyA0tM+3fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677350580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s2GDjrD8cP0IsdB0t+LwsUuZnmWdsK3+EE4SyCYguFQ=; b=tF6E6V+sOd55asWjmD97Wmdlqzv4lxGUVpdpjd00DqKRsL6QbTYRzEEL2iXKqWjqIpRNXx ZN3nnemyt+oxAmL3KKHpy+uDNaL8dI7CM8yk5Rq1BARsejqRQB+TtxXxl12tmjMlKr3uUY iyhAK9d1r360GWfa4ZJs4toCEBrRq3vb+MztU7Kzn2DaeF9GZ7c/UwwKd9/9lGlNEYVrS+ 83C5JeV1yMVL5Q/xFlsln17DYnHtVAUO+X+NuEP9gEiaIXrPU5yVSvew+JJMUdACP4+ORS tUGNpLJkOOuwDOb1KVJ8QZh7vzDgMXrVSGRcyf42PAXhemtrcgzj1j6MOxiUGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677350580; a=rsa-sha256; cv=none; b=UTDTvRZA0qDNLGX1ZtlS7Cumn4+dd/aqUAwS/qLpPEEzuYKSSLRP4BwoOtyMBGntKt5Rny WZrxGrQimn15A9s/AnSqKAxEPlaSl9zwublBzMckAkcZT4uXObWNowRayk8gFEjMtI6VFD QcZSDXe1p+g4JMnTQj+pXlxNKNgSzPRM2fbHcgcI/f/xb+2SMK+Sj5e5w5vgq7vHj91TRC z50qvXH0kScoB6yoB16XjCaZozPHCeT+Lp67jG422ohEM7FEUYihEdR5dJLthvGtoLN+Xu 1nhgbIo95GFzlfXzPtpZ37bbZY1lTr6uiEYi1wYoR8UKrUfAGkE2kXICW/O47w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPFxw47M7zFdN; Sat, 25 Feb 2023 18:43: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 31PIh0WT082241; Sat, 25 Feb 2023 18:43:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PIh0HS082240; Sat, 25 Feb 2023 18:43:00 GMT (envelope-from git) Date: Sat, 25 Feb 2023 18:43:00 GMT Message-Id: <202302251843.31PIh0HS082240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: c5f019807059 - main - stand: fix buffer overflow in getrootmount() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5f01980705930bf46059a004e20e010d8e21dfa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=c5f01980705930bf46059a004e20e010d8e21dfa commit c5f01980705930bf46059a004e20e010d8e21dfa Author: Robert Wing AuthorDate: 2023-02-25 09:37:32 +0000 Commit: Robert Wing CommitDate: 2023-02-25 09:37:32 +0000 stand: fix buffer overflow in getrootmount() Reviewed by: imp, allanjude Sponsored By: Beckhoff Automation GmbH & Co. KG Sponsored By: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38734 --- stand/common/boot.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stand/common/boot.c b/stand/common/boot.c index 06f604f595df..3ec827617d56 100644 --- a/stand/common/boot.c +++ b/stand/common/boot.c @@ -32,8 +32,9 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include +#include +#include #include #include "bootstrap.h" @@ -321,14 +322,14 @@ getbootfile(int try) int getrootmount(char *rootdev) { - char lbuf[128], *cp, *ep, *dev, *fstyp, *options; + char lbuf[KENV_MVALLEN], *cp, *ep, *dev, *fstyp, *options; int fd, error; if (getenv("vfs.root.mountfrom") != NULL) return(0); error = 1; - sprintf(lbuf, "%s/etc/fstab", rootdev); + snprintf(lbuf, sizeof(lbuf), "%s/etc/fstab", rootdev); if ((fd = open(lbuf, O_RDONLY)) < 0) goto notfound; @@ -382,7 +383,7 @@ getrootmount(char *rootdev) *cp = 0; options = strdup(ep); /* Build the : and save it in vfs.root.mountfrom */ - sprintf(lbuf, "%s:%s", fstyp, dev); + snprintf(lbuf, sizeof(lbuf), "%s:%s", fstyp, dev); setenv("vfs.root.mountfrom", lbuf, 0); /* Don't override vfs.root.mountfrom.options if it is already set */ From nobody Sat Feb 25 18:50:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPG6T6mCtz3tlKq; Sat, 25 Feb 2023 18:50: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 4PPG6T6HsKz449D; Sat, 25 Feb 2023 18:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677351025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FA3Yu6sjZYEh/R7XUc4jOk6TTAA3a145BT141+o1peY=; b=CGm4HMMFaKyVueH5L3l+NJTguaq5aavMZiQaNyvGAsxY9/VSEeCNShzDOu2zZ2wY/9KqMo O9O4R9tVf4HOjJm9iK44ctVW+Da9hLMWjhneMWx3WI9/7NtmpgEeV5WwRn+5/0+ISTSk2h pGh4BGx40zTSf8TOupjYQWaIKA82zcmS5d09Xk6En7FtBXuiUla/r0GnkwEUdU589PEr1j I6GukfGcHMwpxNj/QW6xdIcMLQdH4KxFyuIRwF4B36gHso5LgSMMuQyYIJRHaYioxmy+/J ctozsW/sNIsFZKhglECLl2qdayWLwDxjbe6VPHqMtAz7ayFrUVbO7VCNDY83OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677351025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FA3Yu6sjZYEh/R7XUc4jOk6TTAA3a145BT141+o1peY=; b=DhHY4QgAfo5Cnvp+zcgWnB2cKdtj5uwJk6fugnY/Xehrj4Rs5eNQK9AtfLYN9JbwGAjHop nqRIAJ9Q8trv2y1Ktd5Nedv/4uLV6lYDrHwqnS7Xmo0XPjgirKiaN4uaLiSe6mMV6VqWoS pX1AkEND7+39Zs2upeA3K4BxW25MhcfLZHGUf6v15fGroiZFpIIlcbFwcXDTxO6+m8Vo5D NU4tMIieC5AYgew9dn6r0vtylbpXRCwHVUQdVsjRRB0exoQ1TzPIWmFlQLKQu4Xi9XwMb7 zbF7McbB/YrJ85OWTKJ7zd38d6GMitsPPQ2sUYXJjK84PR5z1Ncm5+l+KgFznA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677351025; a=rsa-sha256; cv=none; b=CuNSEtKPg+5WaTKZ+5i4vn9SgbF5QWQt8BOMo+59i21SO0oD5152BISxScblCWhsDEi1WY 4Lo3blhaVucCH4/21TAU3IW2xvryEtd09XXrUZ3vpc538IjhrbPXM/L7+NXo2TBEpU0aE1 rU0zv6+ttwhgW1JzJBTrwirFK60f1qNuzD1ExtAgp66Sd4GofLVwCaX+Zd33+zCXIEmirG wYREcfYKvQfRgxcHoc53DtcuQ2DbhCGi9pxB7B9r1DUGxBF817zlWSYfNB5dFx3/vtFBoh jud/4CsRiVrCTg1AzMW1WVxM3xaGXFmDAH7FRU1HUjWyaoHJh9PY6M2fn5XUbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPG6T5LR6zFY9; Sat, 25 Feb 2023 18:50: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 31PIoPcv091719; Sat, 25 Feb 2023 18:50:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PIoPme091718; Sat, 25 Feb 2023 18:50:25 GMT (envelope-from git) Date: Sat, 25 Feb 2023 18:50:25 GMT Message-Id: <202302251850.31PIoPme091718@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: b5d248c0c82c - main - kern: Remove gcc2_compiled stripping List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5d248c0c82ce7fd502d90af3a6e41bfef736216 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b5d248c0c82ce7fd502d90af3a6e41bfef736216 commit b5d248c0c82ce7fd502d90af3a6e41bfef736216 Author: Warner Losh AuthorDate: 2023-02-25 18:33:22 +0000 Commit: Warner Losh CommitDate: 2023-02-25 18:49:25 +0000 kern: Remove gcc2_compiled stripping Bruce added stripping of gcc2_compiled and other symbols when he made the boot loader load the symbols for the kernel in 1995 (b5d89ca8ade3) before the FreeBSD 2.1 release. This was copied around a bit and tweaked over the years, but these symbols aren't produced by clang, nor gcc12. The were to support dbx for a.out stabs format. gcc removed them with stabs support last year. gcc 2.95.4 in FreeBSD 4.x continued to emit these symbols unconditionally (it was missing a test for aout vs elf it would appaer). They disappeared entirely with gcc 3.2.4 in 5.x for all non a.out builds, and entirely in FreeBSD 6.x which had gcc 3.2.6. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D38764 --- sys/conf/kern.pre.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index e347f9fb9903..ca04e348808d 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -339,8 +339,7 @@ SYSTEM_LD_BASECMD= \ --no-warn-mismatch --warn-common --export-dynamic \ --dynamic-linker /red/herring -X SYSTEM_LD= @${SYSTEM_LD_BASECMD} -o ${.TARGET} ${SYSTEM_OBJS} vers.o -SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ - ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} +SYSTEM_LD_TAIL= @${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} SYSTEM_DEP+= ${LDSCRIPT} # Calculate path for .m files early, if needed. From nobody Sat Feb 25 20:20:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPJ761Gvmz3tqSq; Sat, 25 Feb 2023 20:21:06 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.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 4PPJ750pQxz4Dpc; Sat, 25 Feb 2023 20:21:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com; dmarc=none Received: by mail-lf1-f49.google.com with SMTP id t11so3552337lfr.1; Sat, 25 Feb 2023 12:21:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=KrNbQrY3bfMnC28vP1hjtgsp/Qimme0sn3jYccqn/dI=; b=P4tEMqpMYNMhVCY9gqOzTM125OJo/DsnlpCEOUfAXvX7h5kfuBBp/emaQkh+966tmQ E+FxOgSXIxXLPu1N4MO0FlapE9RAyIYmLebXtiTC2Nqv530p8ZF7j1xGPVO/UlLkj64r IdeqfHu+QzASyIG4C0lankNTsSqJOetV8SoMHi6FS/bsj5zXEEBTzGVHzk5+Rr6nB9x9 FC6RsjEphAYMydWpIMYN3NlB800gPEZxiXHh4dgSWA1II9DLr2ClgXwukEss/v/n7Fe7 OgdI/rUtDaHfYW6fVepsW0haZCuOxkQ53JErsb31xl2xEfi7yrL6iLW/pJ/EZ/UyEfKQ 9TYw== X-Gm-Message-State: AO0yUKVJYnH3Ex9/xFYZ+wQpxZhXTRqQ1HmUsOUak/Ka1sXOm2w3Z7+d yQBXw2szyUt9qo3DOwh3ZwQ9tpKFgl+slRdPh06lrHNv X-Google-Smtp-Source: AK7set9DW/cUD2BT0HvhwX8sQOGfriTA9EvzssSTrk1aGU7ice4KTVT9E0Ny9Ltj6dOMcMFmNuIFCRbX/rYndSNO3UM= X-Received: by 2002:ac2:5470:0:b0:4db:1a22:ed85 with SMTP id e16-20020ac25470000000b004db1a22ed85mr6162788lfn.2.1677356461876; Sat, 25 Feb 2023 12:21:01 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202302241821.31OIL4ux075893@gitrepo.freebsd.org> <20230224205001.Fbn1A%steffen@sdaoden.eu> <20230225012736.PT3cH%steffen@sdaoden.eu> In-Reply-To: <20230225012736.PT3cH%steffen@sdaoden.eu> From: Ed Maste Date: Sat, 25 Feb 2023 15:20:51 -0500 Message-ID: Subject: Re: git: 2c709ee70ade - main - libc: handle zero alignment in memalign() To: Ed Maste , 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.84 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.84)[-0.837]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.49:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.49:from]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; FREEFALL_USER(0.00)[carpeddiem]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4PPJ750pQxz4Dpc X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Fri, 24 Feb 2023 at 20:27, Steffen Nurpmeso wrote: > > Me too. 'Was just thinking of allocators which give back valid > but inaccessible memory for 0 bytes so that each access would > fault. The size is not (necessarily) zero though. The alignment requested is. From nobody Sat Feb 25 22:29:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPLzn5CCBz3tx8b; Sat, 25 Feb 2023 22:29:57 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_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 4PPLzn1gvsz4M0g; Sat, 25 Feb 2023 22:29:57 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; none Date: Sat, 25 Feb 2023 23:29:52 +0100 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Ed Maste Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2c709ee70ade - main - libc: handle zero alignment in memalign() Message-ID: <20230225222952.t3oH3%steffen@sdaoden.eu> In-Reply-To: References: <202302241821.31OIL4ux075893@gitrepo.freebsd.org> <20230224205001.Fbn1A%steffen@sdaoden.eu> <20230225012736.PT3cH%steffen@sdaoden.eu> Mail-Followup-To: Ed Maste , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org User-Agent: s-nail v14.9.24-418-gbf8954aec4 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4PPLzn1gvsz4M0g X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Ed Maste wrote in : |On Fri, 24 Feb 2023 at 20:27, Steffen Nurpmeso wrote: |> Me too. 'Was just thinking of allocators which give back valid |> but inaccessible memory for 0 bytes so that each access would |> fault. | |The size is not (necessarily) zero though. The alignment requested is. I personally would fail EINVAL for 0: something really must be bogus if you reqest an alignment of 0. The standard says Upon successful completion, posix_memalign( ) shall return zero; otherwise, an error number shall be returned to indicate the error and the contents of memptr shall either be left unmodified or be set to a null pointer. If size is 0, either: . posix_memalign( ) shall not attempt to allocate any space, in which case either an implementation-defined error number shall be returned, or zero shall be returned with a null pointer returned in memptr, or . posix_memalign( ) shall attempt to allocate some space and, if the allocation succeeds, zero shall be returned and a pointer to the allocated space shall be returned in memptr. The application shall ensure that the pointer is not used to access an object. The latter is hard (expensive, special-cased) to implement (here). Also the claim of the commit message was wrong: The address of the allocated memory will be a multiple of alignment, which must be a power of two and a multiple of sizeof(void *). As can be seen: #?0|kent:tmp$ cat t.c; for i in $(seq 8); do tcc -run t.c $i;echo $?;done #include #include #include #include int main(int argc, char **argv){ char *vp; int err; if(!(err = posix_memalign((void**)&vp, atoi(argv[1]), 1))){ if(vp) *vp = '\0'; else printf("x1\n"); }else printf("x2: %s\n",strerror(err)); return err != 0; } x2: Invalid argument 1 x2: Invalid argument 1 x2: Invalid argument 1 x2: Invalid argument 1 x2: Invalid argument 1 x2: Invalid argument 1 x2: Invalid argument 1 0 On the other "size" is ok: #?0|kent:tmp$ cat t.c; for i in $(seq 0 2); do tcc -run t.c $i;echo $?;done #include #include #include #include int main(int argc, char **argv){ char *vp; int err; if(!(err = posix_memalign((void**)&vp, 8, atoi(argv[1])))){ if(vp) *vp = '\0'; else printf("x1\n"); }else printf("x2: %s\n",strerror(err)); return err != 0; } 0 0 Yet it is not because *vp is accessible, contradicting the standard -- no? (Exaggerating a bit, but the last two weeks for me and GNU: iconv(3) is special for ILSEQ on output [non-conforming], sysconf(3) PROCESSORS_ONLN is wrong in cgroup [echo 1-3 > /sys/fs/cgroup/NAME/cpuset.cpus], causing over-thread-usage in programs like xz and zstd [seems wrong and implementation-specific non-conforming], whereas those using nproc(1) are right, and now posix_memalign().) Ciao, and a nice Sunday everone (who can)! --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From nobody Sat Feb 25 23:57:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPNwH1zpnz3v29s; Sat, 25 Feb 2023 23:57: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 4PPNwH1Sd9z3CKd; Sat, 25 Feb 2023 23:57:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677369423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=60yqR3Zh+oGYQh+Lhh/qk0uuKsv59jSudj/tdtDgdGA=; b=aLwHixy96pX04mYeI99NEm9rZeo3X+JPOZ6g6LQebbz8VvqmIdHOe7kUkeDKYDthB+mMR/ iK3A6eZb00HbokWsdwg/fhNPgU/X/dVYNTIPEuLUXHVNtjUckWWhg1DG55AbD4VD/NOMHO DRgmn8GXR0uBG6s8aR1KrgPiBJzEJXGIHSq5GjktP77PNvLpcTklvL4IP9/2BvoTyX+qL9 9t0RdtoqOoQj0/EEo8VQKontOyFnO+hvlI5MnXz4/gCCfRTZeVuDy2r0/MUPg7iHGAKj3e uHEZddRTGD4+45Kb4sTSpgNHEXFaNUgUCPT45glUX5lvI/WSl8xmnby3qt+yhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677369423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=60yqR3Zh+oGYQh+Lhh/qk0uuKsv59jSudj/tdtDgdGA=; b=JtE9cAEK32cQrVsTisJ1/oOWzeVbLQ/EdnWJmTLaStVfXW0joOCDiXuibkq/iy1ZATeYRa +MkcGY020NTH05GrrUfE1u0/U2rYp4grHZiBztWX3GkDYFa81d8CUv8EHxU1q2Y+Kgsi5K VSV6PRpORmM683SfKVczdHG76KXaBeYV9YXUIIxsKlXRR8Kk6tLoCbLNmfC72VRSrbipWa etDiyZlUkQCx29hbzIGlkkQ7135sXjH6H2wUNBk83oViOzJoOkGrNLRwhUeTtyCfr1QPKa 0rqPX10ryBGS2Zltb5pwLUCDHuUbQSCryxqN/M6ErOxXOcjJAS4BZn0U2ilqxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677369423; a=rsa-sha256; cv=none; b=PA8mbHAf4xt/lIZFp4fG0p7GKkq+Y0z/qFtQYJhr2VVCxSOaFMgcxcsJZv/SfWr8NFUmAE 3srYbvO1uBRipv+SCESakkP8jWd4G36xovR7gELRxBSKb2zIkmeMl6UYg2mgSKJZujvx89 vWGWgIDcyR2nVEg/jQ7anJj+y/Y92AgkVczGbDE+I9YpxF3dGyoA6nYQ3MQbIL+Bl2jLrs SQBfsfT0sC0g/LHNd2QhKyH38s8H2NV0/qSmPUh7yQtCwQ6BZqhIb3zc07omY7K2SroU30 wvAxLZIWRBYDTVjKODoFxXk79Zx7l6YwDo1H8yOhJUs1CK5GKUWooAGSTLIMig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPNwH0W5yzNVS; Sat, 25 Feb 2023 23:57: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 31PNv20v071968; Sat, 25 Feb 2023 23:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PNv23r071967; Sat, 25 Feb 2023 23:57:02 GMT (envelope-from git) Date: Sat, 25 Feb 2023 23:57:02 GMT Message-Id: <202302252357.31PNv23r071967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: 83d6d8877ef7 - main - powerpc64*: port mlx5, OFED, KTLS and krping List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83d6d8877ef7dad4f4e8f409a01c9f28139cd026 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=83d6d8877ef7dad4f4e8f409a01c9f28139cd026 commit 83d6d8877ef7dad4f4e8f409a01c9f28139cd026 Author: Piotr Kubaj AuthorDate: 2023-02-25 21:09:41 +0000 Commit: Piotr Kubaj CommitDate: 2023-02-25 23:56:37 +0000 powerpc64*: port mlx5, OFED, KTLS and krping Summary: This review ports mlx5 driver, kernel's OFED stack (userland is already enabled), KTLS and krping to powerpc64 and powerpc64le. krping requires a small change since it uses assembly for amd64 / i386. NOTE: On powerpc64le RDMA works fine in the userspace with libmlx5, but on powerpc64 it does not. The problem is that contrib/ofed/libmlx5/doorbell.h checks for SIZEOF_LONG but this macro exists on neither powerpc64* nor amd64. Thus, the file silently goes to the fallback function written for 32-bit architectures. It works fine on little-endian architectures, but causes a hard fail on big-endian. It's possible it may also cause some runtime issues on little-endian. Thus, on powerpc64 I verified that RDMA works with krping. Reviewers: #powerpc, hselasky Subscribers: bdrewery, imp, emaste, jhibbits Differential Revision: https://reviews.freebsd.org/D38786 --- share/mk/src.opts.mk | 4 ++-- sys/conf/kern.opts.mk | 3 ++- sys/contrib/rdma/krping/krping.c | 4 ++++ sys/modules/Makefile | 13 +++++++++++++ sys/powerpc/conf/GENERIC64 | 10 ++++++++++ sys/powerpc/conf/GENERIC64LE | 10 ++++++++++ 6 files changed, 41 insertions(+), 3 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index fe2159cd4f5e..8008a94ae329 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -318,8 +318,8 @@ BROKEN_OPTIONS+=LOADER_UBOOT BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA .endif -# Kernel TLS is enabled by default on amd64 and aarch64 -.if ${__T} == "aarch64" || ${__T} == "amd64" +# Kernel TLS is enabled by default on amd64, aarch64 and powerpc64* +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T:Mpowerpc64*} != "" __DEFAULT_YES_OPTIONS+=OPENSSL_KTLS .else __DEFAULT_NO_OPTIONS+=OPENSSL_KTLS diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 5cda70156394..93edc1b6e63f 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -84,7 +84,8 @@ BROKEN_OPTIONS+= ZFS # Things that don't work because the kernel doesn't have the support # for them. -.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" +.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" && \ + ${MACHINE_ARCH:Mpowerpc64*} == "" BROKEN_OPTIONS+= OFED .endif diff --git a/sys/contrib/rdma/krping/krping.c b/sys/contrib/rdma/krping/krping.c index 182e5f111028..98f129597464 100644 --- a/sys/contrib/rdma/krping/krping.c +++ b/sys/contrib/rdma/krping/krping.c @@ -69,9 +69,13 @@ MODULE_DEPEND(krping, linuxkpi, 1, 1, 1); static __inline uint64_t get_cycles(void) { +#if defined(__amd64__) || defined(__i386__) uint32_t low, high; __asm __volatile("rdtsc" : "=a" (low), "=d" (high)); return (low | ((u_int64_t)high << 32)); +#elif defined(__powerpc64__) + return __builtin_readcyclecounter(); +#endif } typedef uint64_t cycles_t; diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 9c2664460067..4397c7beb56e 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -843,8 +843,21 @@ _nvme= nvme .if ${MACHINE_ARCH:Mpowerpc64*} != "" _ipmi= ipmi _ixl= ixl +_mlx5= mlx5 _nvram= opal_nvram +.if ${MK_OFED} != "no" || defined(ALL_MODULES) +_ibcore= ibcore +_ipoib= ipoib +_iser= iser +_mlx5ib= mlx5ib +_rdma= rdma +.endif +.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ + defined(ALL_MODULES) +_mlx5en= mlx5en +.endif .endif + .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe" # Don't build powermac_nvram for powerpcspe, it's never supported. _nvram+= powermac_nvram diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index ab36e2032203..6c40b031bee6 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -49,6 +49,7 @@ options TCP_BLACKBOX # Enhanced TCP event logging options TCP_HHOOK # hhook(9) framework for TCP options TCP_RFC7413 # TCP Fast Open options SCTP_SUPPORT # Allow kldload of SCTP +options KERN_TLS # TLS transmit & receive offload options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists @@ -128,6 +129,8 @@ device pci options PCI_HP # PCI-Express native HotPlug device agp +options COMPAT_LINUXKPI + # ATA controllers device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers @@ -189,6 +192,12 @@ device fxp # Intel EtherExpress PRO/100B (82557, 82558) device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 +# Nvidia/Mellanox Connect-X 4 and later, Ethernet only +# mlx5ib requires ibcore infra and is not included by default +device mlx5 # Base driver +device mlxfw # Firmware update +device mlx5en # Ethernet driver + # Pseudo devices. device crypto # core crypto support device loop # Network loopback @@ -199,6 +208,7 @@ device md # Memory "disks" device ofwd # Open Firmware disks device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module +device xz # lzma decompression # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index ffb43628d2b1..99d1975442f7 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -46,6 +46,7 @@ options TCP_BLACKBOX # Enhanced TCP event logging options TCP_HHOOK # hhook(9) framework for TCP options TCP_RFC7413 # TCP Fast Open options SCTP_SUPPORT # Allow kldload of SCTP +options KERN_TLS # TLS transmit & receive offload options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists @@ -123,6 +124,8 @@ device pci options PCI_HP # PCI-Express native HotPlug device agp +options COMPAT_LINUXKPI + # ATA controllers device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers @@ -184,6 +187,12 @@ device fxp # Intel EtherExpress PRO/100B (82557, 82558) device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 +# Nvidia/Mellanox Connect-X 4 and later, Ethernet only +# mlx5ib requires ibcore infra and is not included by default +device mlx5 # Base driver +device mlxfw # Firmware update +device mlx5en # Ethernet driver + # Pseudo devices. device crypto # core crypto support device loop # Network loopback @@ -194,6 +203,7 @@ device md # Memory "disks" device ofwd # Open Firmware disks device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module +device xz # lzma decompression # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! From nobody Sat Feb 25 23:58:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPNxf41s9z3v2JH; Sat, 25 Feb 2023 23:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PPNxf3Pmyz3CqC; Sat, 25 Feb 2023 23:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677369494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jft14yIQtVR5O/R+janWObSQAoWdfg7gAJgg7FYe3Yg=; b=vLHFwf/TeZUUg6OOwzSz7vW0BtpIbP15vq0gZDT2WIUqFzy2MT1kMM5ZqcDfW9Vz5vrv/c qhvj/3KnCgpV5zQ6dsrfbKj/einkhUVaDy1WjSxobXyv6zxVl93uf5mdAsKPLggT16toRU EShcdd7GAxszVODQH9erWc7Ny+e+g4NXJfhTxqGyg2j5L9dERP0GRYD/nDuLIOXHUaRYNz Ak0ma0Zkh9C8v0MQqK/jt8SpgG6/KltpNEm2KhEmm/2Y+BpGhqgGX7/a0Nn6CK5wNRHTCS 97HArkzhRUXgoMfmio8RNLPkqlralgJiqL6Fbc5r6mnCAP/i9+2PVloXWUKp7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677369494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jft14yIQtVR5O/R+janWObSQAoWdfg7gAJgg7FYe3Yg=; b=bfMFvezibBHidafmGH7c9fSdwAJsD9tP+Mgc4PfL5hKbRgb1AJ8RsESXGmhq3CtXk0ryKQ ty8bVk+SJu2V81Um+Sq3N3NlAD7XoHUGUp2PSUsUg0mOG+cGMTzi4q+p2Vszbhk3Q5cybf 1IzZSB3RXSsxAHDmllmvBKO6Co/+ON14pg+aKvTG2UgUuky7uVa+sK/lt4l97EEQr0Blh6 CJUJ435Dfn4n4MBM99m01t/VjcaZo7jUX4JgYVniWmbAWyWozaVkCHx+q5GG0QEfagxiH1 RXNjcaUNgpRPFe/wYj6a7+wHlQp3h1SFLNSDfNG709u1lTxgtCN+3wLzIXe2dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677369494; a=rsa-sha256; cv=none; b=PMObgkI+p2L721701Djjph2BVyK+eLTidz/+8Mit17KHu+Y73F5TZylfo8+6g8WFXsyYLT Fv3+jqGKwg6fpxfN1y5/OQ1pzxrW6SuoRsj+Dp7Ht35uOZEFQkvhtu6L31TfSeTLLIJrD7 2xUFoxvLF5xi5K4on/ejnBaIZ+pbMgkik6R350WvWz2V1duFvNDTd2/n6t7qk4TpR3xtTl op7tS3LymqLKGKvjgGZ6odojDoKaOfdapcn3fg0BxP6oE0qS+cR2IW5fhoqSHEm6GzLUoq jlqks1/LuZNt9hM/kokcOZORLfR1gVq3TDaaks8l94UcaAyTFRTOXwZvnPS1rQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPNxf2SYTzPBj; Sat, 25 Feb 2023 23:58: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 31PNwEAN072216; Sat, 25 Feb 2023 23:58:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PNwEpV072215; Sat, 25 Feb 2023 23:58:14 GMT (envelope-from git) Date: Sat, 25 Feb 2023 23:58:14 GMT Message-Id: <202302252358.31PNwEpV072215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: f5a1c871e6a7 - main - Revert "powerpc64*: port mlx5, OFED, KTLS and krping" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5a1c871e6a7c80a7646c2b95db9e98ec2b283a2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=f5a1c871e6a7c80a7646c2b95db9e98ec2b283a2 commit f5a1c871e6a7c80a7646c2b95db9e98ec2b283a2 Author: Piotr Kubaj AuthorDate: 2023-02-25 23:57:41 +0000 Commit: Piotr Kubaj CommitDate: 2023-02-25 23:57:41 +0000 Revert "powerpc64*: port mlx5, OFED, KTLS and krping" Wrong push, another commit was supposed to be pushed. This reverts commit 83d6d8877ef7dad4f4e8f409a01c9f28139cd026. --- share/mk/src.opts.mk | 4 ++-- sys/conf/kern.opts.mk | 3 +-- sys/contrib/rdma/krping/krping.c | 4 ---- sys/modules/Makefile | 13 ------------- sys/powerpc/conf/GENERIC64 | 10 ---------- sys/powerpc/conf/GENERIC64LE | 10 ---------- 6 files changed, 3 insertions(+), 41 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 8008a94ae329..fe2159cd4f5e 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -318,8 +318,8 @@ BROKEN_OPTIONS+=LOADER_UBOOT BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA .endif -# Kernel TLS is enabled by default on amd64, aarch64 and powerpc64* -.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T:Mpowerpc64*} != "" +# Kernel TLS is enabled by default on amd64 and aarch64 +.if ${__T} == "aarch64" || ${__T} == "amd64" __DEFAULT_YES_OPTIONS+=OPENSSL_KTLS .else __DEFAULT_NO_OPTIONS+=OPENSSL_KTLS diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 93edc1b6e63f..5cda70156394 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -84,8 +84,7 @@ BROKEN_OPTIONS+= ZFS # Things that don't work because the kernel doesn't have the support # for them. -.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" && \ - ${MACHINE_ARCH:Mpowerpc64*} == "" +.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" BROKEN_OPTIONS+= OFED .endif diff --git a/sys/contrib/rdma/krping/krping.c b/sys/contrib/rdma/krping/krping.c index 98f129597464..182e5f111028 100644 --- a/sys/contrib/rdma/krping/krping.c +++ b/sys/contrib/rdma/krping/krping.c @@ -69,13 +69,9 @@ MODULE_DEPEND(krping, linuxkpi, 1, 1, 1); static __inline uint64_t get_cycles(void) { -#if defined(__amd64__) || defined(__i386__) uint32_t low, high; __asm __volatile("rdtsc" : "=a" (low), "=d" (high)); return (low | ((u_int64_t)high << 32)); -#elif defined(__powerpc64__) - return __builtin_readcyclecounter(); -#endif } typedef uint64_t cycles_t; diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 4397c7beb56e..9c2664460067 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -843,21 +843,8 @@ _nvme= nvme .if ${MACHINE_ARCH:Mpowerpc64*} != "" _ipmi= ipmi _ixl= ixl -_mlx5= mlx5 _nvram= opal_nvram -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_ibcore= ibcore -_ipoib= ipoib -_iser= iser -_mlx5ib= mlx5ib -_rdma= rdma -.endif -.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ - defined(ALL_MODULES) -_mlx5en= mlx5en -.endif .endif - .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe" # Don't build powermac_nvram for powerpcspe, it's never supported. _nvram+= powermac_nvram diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 6c40b031bee6..ab36e2032203 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -49,7 +49,6 @@ options TCP_BLACKBOX # Enhanced TCP event logging options TCP_HHOOK # hhook(9) framework for TCP options TCP_RFC7413 # TCP Fast Open options SCTP_SUPPORT # Allow kldload of SCTP -options KERN_TLS # TLS transmit & receive offload options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists @@ -129,8 +128,6 @@ device pci options PCI_HP # PCI-Express native HotPlug device agp -options COMPAT_LINUXKPI - # ATA controllers device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers @@ -192,12 +189,6 @@ device fxp # Intel EtherExpress PRO/100B (82557, 82558) device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 -# Nvidia/Mellanox Connect-X 4 and later, Ethernet only -# mlx5ib requires ibcore infra and is not included by default -device mlx5 # Base driver -device mlxfw # Firmware update -device mlx5en # Ethernet driver - # Pseudo devices. device crypto # core crypto support device loop # Network loopback @@ -208,7 +199,6 @@ device md # Memory "disks" device ofwd # Open Firmware disks device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module -device xz # lzma decompression # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 99d1975442f7..ffb43628d2b1 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -46,7 +46,6 @@ options TCP_BLACKBOX # Enhanced TCP event logging options TCP_HHOOK # hhook(9) framework for TCP options TCP_RFC7413 # TCP Fast Open options SCTP_SUPPORT # Allow kldload of SCTP -options KERN_TLS # TLS transmit & receive offload options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists @@ -124,8 +123,6 @@ device pci options PCI_HP # PCI-Express native HotPlug device agp -options COMPAT_LINUXKPI - # ATA controllers device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers @@ -187,12 +184,6 @@ device fxp # Intel EtherExpress PRO/100B (82557, 82558) device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 -# Nvidia/Mellanox Connect-X 4 and later, Ethernet only -# mlx5ib requires ibcore infra and is not included by default -device mlx5 # Base driver -device mlxfw # Firmware update -device mlx5en # Ethernet driver - # Pseudo devices. device crypto # core crypto support device loop # Network loopback @@ -203,7 +194,6 @@ device md # Memory "disks" device ofwd # Open Firmware disks device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module -device xz # lzma decompression # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this!