From nobody Sat Feb 18 23:01:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 03:10:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:10:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 07:04:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 Mon Feb 20 08:37:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PKwmy5cvkz3sByR for ; Mon, 20 Feb 2023 08:38:42 +0000 (UTC) (envelope-from bT.1fxwx6od30=83agqkb00waw=8c508hg6ck@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 4PKwmy18gNz4C8f for ; Mon, 20 Feb 2023 08:38:42 +0000 (UTC) (envelope-from bT.1fxwx6od30=83agqkb00waw=8c508hg6ck@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=i2wEM14B; dkim=pass header.d=fubar.geek.nz header.s=s790814 header.b=LczKQesN; spf=pass (mx1.freebsd.org: domain of "bT.1fxwx6od30=83agqkb00waw=8c508hg6ck@em790814.fubar.geek.nz" designates 103.2.142.68 as permitted sender) smtp.mailfrom="bT.1fxwx6od30=83agqkb00waw=8c508hg6ck@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=1676883222; h=Feedback-ID: X-Smtpcorp-Track:To:Date:Subject:Message-Id:From:Reply-To:Sender: List-Unsubscribe; bh=amHu9OdxrEC9iyodXPla7AD71gqGAUsEp895wRuiFAA=; b=i2wEM14B NdMA8Y0Ag4XAkaFo+cptSFQXotxPUXmd1THgykQQ8fGE31vRdnImEZsZBD2fmtWYtH6AAPyy2CekZ Jlgm9EvBZKarfob0Zl4s0LHrWCxVLHhUaJUciMmgVHJ7Sfho993h2Npu5vEhV73ziIMkRHyupPXWd 84bjefpTh75FQ9+se48e53FpQsOpS+lHnA6r/L2MF27VXTyHR8fbUukHtXgvJIrLhgm3ZmYw/nYcy I37rTx4AC/6CQlY3iDEA1JM/TMKuCRwHUGJ1nkr+888wAMoTGl9Dae820PxpHWnRlJZNJLevNP49M SSr2zFgTeTeIbn4zfhhZCrUrMg==; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; i=@fubar.geek.nz; q=dns/txt; s=s790814; t=1676882322; h=from : subject : to : message-id : date; bh=amHu9OdxrEC9iyodXPla7AD71gqGAUsEp895wRuiFAA=; b=LczKQesNdTqsd4luE8kJ1ol/7KCAn37DVGir0hVUYDxidGIbBRQPGlcyJVldzatTvh0EQ M6Jz8HD7OyeWPQN1i6+tcyokxyyhvy9w+wx2C0Buz2tUEVVqqIHAm2FCk0hyHwz9y2Om7wK fX9NzhJsTSp0IfmaHJ117E6sY/sMaCpSPCGGWMGtP/iIXx/VfEP/qfIinZXHj6zJ/W0nFUW 1HiKiLQeaeKrHXK3AfJqEakkZSrqIrAGRJpdAhcnXQBZCL/v9giRjdqIoMJoM35RYlksGXO GTRgUVu6O9WD5Jmq5PsPbLoeX66W6Q4ntr6r88WjUfuMrEuqb8id6LkRaUnA== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.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.8AGuByCQ0O_gw 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=83agqkb00waw=8c508hg6ck@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-main@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=83agqkb00waw=8c508hg6ck@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: 4PKwmy18gNz4C8f 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 15:30:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.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 18:55:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLCTc2sH6z3rZdS for ; Mon, 20 Feb 2023 19:41:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLCTc0Sfqz3Gsq 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-f44.google.com with SMTP id p3-20020a05600c358300b003e206711347so1624640wmq.0 for ; Mon, 20 Feb 2023 11:41:23 -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=Aw6IpTozbHo3O3qwhTFV4tUwF88Q8GvxvCUiyrlAr858+O8i7bkeAP5RCbEMJwsri+ xF2P/4N7RVoaeVe6kQimHMP37bHflvM50f/BRk65AcZO3zRTbL4i8idhwcWiBRypkFMi rmEjIwRkzg/4psIu4KP413ZZA5U7Kjv7PqzAslE4G9hBVArQnCNQ3rB1/IqRAkb8kE+R IZHP66UAjEUxjgrYiR5Or4Y9spQMy/d28nbs1xQDw3rTNhhaRq0+F3COVmzHxbmOj8UX 4jTX2EJ4B83oQ+i0iAGvQiAqQ9Up9RxqM3+cLFf+YMcThETC475LW3jC8307ai2tuXW0 RC3w== X-Gm-Message-State: AO0yUKW5vhYodAH4EeNDQRPTbWVQjqxYyVZ/ZNApSf4pnqclClhcxhrK DE0MbVQogS7/mOCrebIZdiGxlw== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 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: 4PLCTc0Sfqz3Gsq 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 21:12:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 03:44:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:16:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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 09:46:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <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:50:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:51:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:05:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <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:47:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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:43:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 23:16:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 Wed Feb 22 01:43:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PM3xd0X1zz3sH17 for ; Wed, 22 Feb 2023 05:05:09 +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 4PM3xc5Wm3z40NJ 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-x536.google.com with SMTP id ec43so25159297edb.8 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=GnRDVId0yMeEYwOl1hMO6azq/2TcIfe/vq+MSyZmnYk235m1S8pD3iMeWu3jwINqE6 LS55uIndWsYaiXvJ4xHvbz1q9grmXwVywnz/yX2ZoR5hIDN07EEwdTWb1pdPlCR6MQID UduB43kuOEdjbu2zSlr4NWmUysyhgDWqpIycwMGk/VBdnUB4GwF+fiR6wbWhtK5Fby76 FJS95Gf1iM6bOwVIoUgYKUBczCCiNd0DmOaRIcC038m58IKyccXDW6vOyECV3Ab08Sl8 YquAOAXTzkl/EUxp/XsSYMaQI9kZ4W3idscbdK1PS4kXc2yaAytZ5z9tbnUXxWZKGBlN PdEg== X-Gm-Message-State: AO0yUKWK5OM55e0u7lGrV23jsiz8Jy5RwG978+5yZgs1o+6p8un7C1y8 ZItaunKuh8YMYYSQPJL8jFxieBE6Wdnl5/VdA7/7oA== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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: 4PM3xc5Wm3z40NJ 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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:31:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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 15:14:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMSzX62R6z3sBn7 for ; Wed, 22 Feb 2023 20:53:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (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 4PMSzX5fHnz3KTK for ; Wed, 22 Feb 2023 20:53:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x530.google.com with SMTP id o12so36085107edb.9 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=hSjqYtIERp/deGdez80lF8NVKsUI1pd+C8aumGzsxA3DCHZWHmF5WFtvY5zLt5lUmD tNPjtUR+jgkt9kj/kAW31qDIM5XVvABKLJLdFmkbLZrUglEufy58eDN++vCYm8NlLwbC NYiy+OaLeQAcyHeoWfYv1qVVW02sE2zkYmUS2BMH0HVDyRS5lfYYw8SNmPwwyjLi+FV6 V1p4GLa0qf9lTUOyl5GovZIvz3gkMwZc6bijHObLHf2XtJwse117LkWEvBhU6Z8Os6jw B2e+azz85g+K4l9nFLTNFHmf571Ra8jbl5uTt/mBBochnUILcgjfJ6He++6nLX4dZ+Dq 1pcg== X-Gm-Message-State: AO0yUKWZK6P7fSpeuG4LmRnf7rapCOxJRbE0lwJYtR6SOYYjcqFMVNcw wMYe3AFMuWjGPdL4TNQxsKz33HRR30zTM9AarHM1hw== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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: 4PMSzX5fHnz3KTK 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:41:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: git: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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 01:04:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 06:28:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [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 08:01:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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 16:33:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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:43:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 18:10:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 19:13:42 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 21:14:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [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 10:21:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 12:20:25 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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 14:37:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkoshy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:25:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:03:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPCl15YRdz3tdVH for ; Sat, 25 Feb 2023 17:03:25 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-20.consmr.mail.gq1.yahoo.com (sonic306-20.consmr.mail.gq1.yahoo.com [98.137.68.83]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PPCl03bvvz3nWj for ; Sat, 25 Feb 2023 17:03:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=JXxFES88; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.68.83 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1677344602; bh=DiJE3YY55gWr5Ys8bMj/PTxh8284alKAmwvpTgFyx/c=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=JXxFES88UNCshtpz97uTgya3e/G/CflDF3ZQlSODB99eHb63Z1pcjwqexuZ/zoDYEia530D7nMBqEeKiVBrBgBXPTxwz5J41xxZTsi5WySJGvSv3vKqxG2M4DluZbTQKG26RAYdxhIw9A25zzmKcndM87fRLrIzb8xqEo6yMPZuBLvyPm7+1mkBRR2sU5FySympt9zBIHfkJC8aibEt5RW+5kmkpSngGiOc1B4VPF+xk6SrxprKxNhIf9SPkMW+UyZUdDrNk4CEONHyyAzgQtjYTqMZocQB/hcYKtjexh/DyJYsAl3Pn6JftkXqDc+lF4gKgrsUK8Q4Kd7DYJc+WMg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1677344602; bh=9JHqi1979EuU2RZ2mgfoCJzusH6ezAXpFNIudHhnFUK=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=iGTQBdqYaAHztaJh3c9U6qLfZGArS41WTHc9Iw+HS/JxjcNHqKnEDWlxgsDS/Mi5/Uyt1BFlHTzBTXs9uw8ICXRNmnWohU5L/6AeyGTSi2HT9lcKMaQQNaoapFg5vmrXg9TMAQuJEzAVBPgHuUF4henB5VX6psCoQyS7qj0KPiZrXwF+BeVTGTVP7DuwUUWTHsyt7X5y93uyHUSfLF7K74lG/Bi3dr9E9aM+kqFsFyRqBesRa5nAhh6k0NF1Sip+oCI3tsEINjHFd07OWy8Xf+SuWcbr5HqW5lL4vAUBAWoR0Gtg6r9ZN/A0JpCjfBejgH4JkWN/QVoIheRhYvSMDg== X-YMail-OSG: T4G8KYQVM1ko9M63alYIfqhXknY1TYn9hzhqeatOznxduI6APahWgFOyWpgttk9 gl4q.s_2zmgD0E1BdMZi66jvLtd3b26SSXzvcf.pXd92vcbYIRIVY58Icz9AV3h45jRZJXFcc2fy kSZBXv.zDIm4egFQuku8Og3G5y0pOTmRPmZWy1UOw1uEPDxE37W3slTn_AEeHLWTu24c3mk2.VFz uxi9KBig7g1PoIkZ7CyJVxBwNeADrGTHnncOOGS2fYRfzU1WWOMFZPOjP2eKyddC9CM8DW2Y2hXb 3nt8t4wN7WMyKaXaceRckH9S6CdjxPspwPYNQ7YaOmSTp5bKzoL3JTPVS5D7I2BFxBNMzqUIbtpx I9m678DieO7bg82.tEogZpHiVtsRec0AnuKSzBQv_TFNS7_Ubt7NqTHExlMXRkq3WoW.YWSxOByw OC5_1dd9o2qMqqYcQyaf8KXsc9Mn44T7A3meHQjy_J6iuAnbz9j7wrH2Kx6aIW5bVs_Vr_8eR090 zZyGL3keZIjb5K_cK9VRkKsg3YusAhcBo1vGZG02CBXXFL6cQoLJlxFKM6DPkFQq0QD5Zl3zhDma .M1bWXPcAOQj_qHN8DKUzTFHEiSZ1hqbqYAUv8HVFUCMWm32GRO.aO2e6R2.VzyTYW7_lBmXlmQI Nmftu.t_izwRCXnNGygYpMp6puaJRDnYgWMctPllzeULPEmwJ6.2j50heGonpFwh4YsIjGrOL7Ah Ljp6vuPV8bE4BBG.tCQFI56uc2SG.8yGR6bVgpcpDJFVx7WV23DkzxAXUbr2hbfQuk6ffQTN56OH CiCG6KEX..tinbebOzjPO2R1xTkzhh4nozP20TgSj0ErVUGFMyuooWnIOTOiPKETdAwxmgD1Yndm RiVA2K9yR87FEbDUY9t7CHTG3Rb0poLfWX4NC23NvJzzg0tJEVobL3hywl9UvDvSIqsIEITF8Q_n ZzVg0wokTPJ.KkQw7Jv9haeCMYqSeQmO_hcz08kZ.7ukE1NtP5YYAgsoNaXmpxI2C6VPAaRxkYIJ 23WonfFRpKlPB1gfUjlYnVjpzlm2GkgLTxzPDHdtTbnbiwlvOBVCkSfvsMu8ySXyOrJvT9OW.TF1 Av4oUSioUi4dpGfxOH8Hnb97TXN5uwovOAQOjNSRWEKOiTSpWss6zvT6L2pyluEorsXFWDebSo1b yD.IYOpPu8U3dGa6is15MWqgp5AvAJ.Nl1saxQWcIhF_qCJMzIZvtAAeGIbXXP3YYRpOPwcIllta P7bMub.RqnlIBv9nNBoldGPX7pBkozPQkjJEmjNyFo7qL7bDqaEeyYkTnFhkXJA3DYgPIDgHzGRA cTXzOptNgRNYLNWGGA5GKWGo2q50BlH9Bl0BnsHFOZxT1RCp6pwgdLbE_TCdcLtcR_IrtYqlEgPH zUzuhWawmLKQsYggCtxJ.wAeKF8hUyPqWbZLooRIeT0FwwhHU9cqHZdANxpWvtHZJXXgpWkj8OIR yhxfcZUn1ytMl3d9Gl3caKeknE0XigvM8Xu97c.a6RoXDjK2S4xpLoSctm9KnLfV06teXTCq15H4 0hbOUO4hgM0ZtzZ8_wpj2z4VbabOqabl7mN1X9RDMWn5vpKC5j9pI5KfW.BZBKQ_PkNPCTUJqxng mjpZxCVfJ2gI_pqhOL1PdJVfHg4Beh3z0Dc6dd5OSCjmQbdfO6p9k.sgVS264asMXWX9b3iBCi7F AL2FLYAUjYrmQWsfgOVHZe6Nyj5_3Y9IU8C9RG78q0W8yvvpsrzICckib1XrrQlGiGroj2TEFqlv ubevxctfUT9Gxovk8bETX3l.VKhQI4DYbD9_EaqSdlMLYNID48oVWJNwxpPUGpDCrondT8A5Li8R 12ZdtcjCsolKv8XXqJYjK1lI5W0PAXZlIR_24dD5lC6CNzZi2x47CVaeZVpnJH55TI1ka.jTVyEl sOL50vLEMV6LMFzPx.tLopIJA2i7_wwLI1lwrRmk3K3TpAbcuJtHh4Ry24taiKGgkoMjE8_jnA30 Hb5woM_K2op8kjV.TCxMhvGqUrd6R1t4XD8uULz7JP.XSF5o7T_qGKM6StGBM0YiOKllMddRwA2t Cqs0rojMOqBVZwsLf4U7hmZYnOlT9kHquqxuW58yygutrLdKTitQ.HIBlTD9vxo5QwJ703j6KWCJ Ze2qY4hNdrVQLaPz8JgV.DE92ARIT9uCFu6uv4SsWEBshQxKllz2gG40A6Gx_qKkki87E3ImXZMK wpVQ0xXoHveKli1RVqhE17QiuiyJqZgnL3JuZC3Vi9V5D7oDH_4ftN2gPSDqDc3TdkU.TOaogrfe C X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Sat, 25 Feb 2023 17:03:22 +0000 Received: by hermes--production-ne1-746bc6c6c4-z5pmw (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID e38b5cdcdf9937895c1cb505586cdab2; Sat, 25 Feb 2023 17:03:17 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: RE: git: c51978f4b2f0 - main - kbd: add KBD_DELAY1 and KBD_DELAY2 Message-Id: <66452C86-02AA-4604-B65C-5E32EEBAFCC3@yahoo.com> Date: Sat, 25 Feb 2023 09:03:06 -0800 To: imp@freebsd.org, dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.400.51.1.1) References: <66452C86-02AA-4604-B65C-5E32EEBAFCC3.ref@yahoo.com> X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.83:from]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; DKIM_TRACE(0.00)[yahoo.com:+]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org] X-Rspamd-Queue-Id: 4PPCl03bvvz3nWj X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Warner Losh wrote on Date: Sat, 25 Feb 2023 06:26:00 UTC : > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc51978f4b2f080c80ddc891c24b151d3= 5acb8ba4 >=20 > commit c51978f4b2f080c80ddc891c24b151d35acb8ba4 > Author: Michael Paepcke > AuthorDate: 2023-02-18 09:11:37 +0000 > Commit: Warner Losh > CommitDate: 2023-02-25 06:19:05 +0000 >=20 > kbd: add KBD_DELAY1 and KBD_DELAY2 > =20 > Allow to configure KBD_DELAY* via KERNCONF for user-land less = embedded > and security appliances > =20 > 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(-) >=20 > 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 > =20 > # 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 =3D NULL; > kbd->kb_fkeytab =3D NULL; > kbd->kb_fkeytab_size =3D 0; > - kbd->kb_delay1 =3D KB_DELAY1; /* these values are advisory = only */ > - kbd->kb_delay2 =3D KB_DELAY2; > + kbd->kb_delay1 =3D KBD_DELAY1; /* these values are advisory = only */ > + kbd->kb_delay2 =3D KBD_DELAY2; > kbd->kb_count =3D 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 [Just reporting Ximalas's Discord note.] So opt_kbd.h must be included before kbdreg.h in order to avoid: macro redefined in opt_kbd.h ? Should something force the right order? > unsigned long kb_count; /* # of processed key strokes */ > u_char kb_lastact[NUM_KEYS/2]; > struct cdev *kb_dev; =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Sat Feb 25 17:16:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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!