From owner-dev-commits-src-main@freebsd.org Mon Jul 19 04:07:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33726676A4C; Mon, 19 Jul 2021 04:07: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 4GSpFt0fhzz3kS9; Mon, 19 Jul 2021 04:07:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED07710650; Mon, 19 Jul 2021 04:07: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 16J47DvP055205; Mon, 19 Jul 2021 04:07:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J47Di1055204; Mon, 19 Jul 2021 04:07:13 GMT (envelope-from git) Date: Mon, 19 Jul 2021 04:07:13 GMT Message-Id: <202107190407.16J47Di1055204@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: 46438b5366f9 - main - kenv: s/dump/list/ to clarify meaning 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: 46438b5366f9405beb6f76474a5aae822352f012 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 04:07:14 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=46438b5366f9405beb6f76474a5aae822352f012 commit 46438b5366f9405beb6f76474a5aae822352f012 Author: Kyle Evans AuthorDate: 2021-06-21 03:11:26 +0000 Commit: Kyle Evans CommitDate: 2021-07-19 04:05:30 +0000 kenv: s/dump/list/ to clarify meaning The contents of the kenv will be dumped to stdout, while dump could have also meant 'discard'. Call it 'list' instead. Suggested by: imp Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D30836 --- bin/kenv/kenv.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/kenv/kenv.1 b/bin/kenv/kenv.1 index f93b73f15816..0cadbefb41b3 100644 --- a/bin/kenv/kenv.1 +++ b/bin/kenv/kenv.1 @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2020 +.Dd June 20, 2021 .Dt KENV 1 .Os .Sh NAME .Nm kenv -.Nd dump or modify the kernel environment +.Nd list or modify the kernel environment .Sh SYNOPSIS .Nm .Op Fl hNq @@ -43,7 +43,7 @@ .Sh DESCRIPTION The .Nm -utility will dump the kernel environment if +utility will list all variables in the kernel environment if invoked without arguments. If the .Fl h From owner-dev-commits-src-main@freebsd.org Mon Jul 19 04:07:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DCC5676F91; Mon, 19 Jul 2021 04:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSpFv1SKbz3kVg; Mon, 19 Jul 2021 04:07:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14B1310A40; Mon, 19 Jul 2021 04:07: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 16J47Eum055233; Mon, 19 Jul 2021 04:07:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J47EU3055232; Mon, 19 Jul 2021 04:07:14 GMT (envelope-from git) Date: Mon, 19 Jul 2021 04:07:14 GMT Message-Id: <202107190407.16J47EU3055232@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: 7a129c973b5b - main - kern: add an option for preserving the early kenv 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: 7a129c973b5ba0fa916dfa658d523bec66dbd02d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 04:07:15 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7a129c973b5ba0fa916dfa658d523bec66dbd02d commit 7a129c973b5ba0fa916dfa658d523bec66dbd02d Author: Kyle Evans AuthorDate: 2021-06-20 19:29:31 +0000 Commit: Kyle Evans CommitDate: 2021-07-19 04:05:48 +0000 kern: add an option for preserving the early kenv Some downstream configurations do not store secrets in the early (loader/static) environments and desire a way to preserve these for diagnostic reasons. Provide an option to do so. Reviewed by: imp, jhb (earlier version) Differential Revision: https://reviews.freebsd.org/D30834 --- sys/conf/options | 8 ++++++++ sys/kern/kern_environment.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/sys/conf/options b/sys/conf/options index 882460fbf35b..774850158221 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -1021,3 +1021,11 @@ IICHID_DEBUG opt_hid.h IICHID_SAMPLING opt_hid.h HKBD_DFLT_KEYMAP opt_hkbd.h HIDRAW_MAKE_UHID_ALIAS opt_hid.h + +# kenv options +# The early kernel environment (loader environment, config(8)-provided static) +# is typically cleared after the dynamic environment comes up to ensure that +# we're not inadvertently holding on to 'secret' values in these stale envs. +# This option is insecure except in controlled environments where the static +# environment's contents are known to be safe. +PRESERVE_EARLY_KENV opt_global.h diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c index 54992e6594ed..8dc345559e95 100644 --- a/sys/kern/kern_environment.c +++ b/sys/kern/kern_environment.c @@ -365,7 +365,11 @@ init_dynamic_kenv_from(char *init_env, int *curpos) kenvp[i] = malloc(len, M_KENV, M_WAITOK); strcpy(kenvp[i++], cp); sanitize: +#ifdef PRESERVE_EARLY_KENV + continue; +#else explicit_bzero(cp, len - 1); +#endif } *curpos = i; } From owner-dev-commits-src-main@freebsd.org Mon Jul 19 04:07:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3BBA676747; Mon, 19 Jul 2021 04:07: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 4GSpFw2bjlz3kmd; Mon, 19 Jul 2021 04:07:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 347AC10651; Mon, 19 Jul 2021 04:07: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 16J47GD5055260; Mon, 19 Jul 2021 04:07:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J47GCd055259; Mon, 19 Jul 2021 04:07:16 GMT (envelope-from git) Date: Mon, 19 Jul 2021 04:07:16 GMT Message-Id: <202107190407.16J47GCd055259@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: db0f26439357 - main - kenv: allow listing of static kernel environments 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: db0f26439357b78863e61985acd1e5acf75ce73d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 04:07:16 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=db0f26439357b78863e61985acd1e5acf75ce73d commit db0f26439357b78863e61985acd1e5acf75ce73d Author: Kyle Evans AuthorDate: 2021-06-20 19:36:10 +0000 Commit: Kyle Evans CommitDate: 2021-07-19 04:06:19 +0000 kenv: allow listing of static kernel environments The early environment is typically cleared, so these new options need the PRESERVE_EARLY_KENV kernel config(8) option. These environments are reported as missing by kenv(1) if the option is not present in the running kernel. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D30835 --- bin/kenv/kenv.1 | 18 +++++++ bin/kenv/kenv.c | 38 +++++++++---- lib/libc/sys/kenv.2 | 24 +++++++-- sys/kern/kern_environment.c | 129 +++++++++++++++++++++++++++++--------------- sys/sys/kenv.h | 10 ++-- 5 files changed, 160 insertions(+), 59 deletions(-) diff --git a/bin/kenv/kenv.1 b/bin/kenv/kenv.1 index 0cadbefb41b3..980bec117515 100644 --- a/bin/kenv/kenv.1 +++ b/bin/kenv/kenv.1 @@ -32,6 +32,7 @@ .Nd list or modify the kernel environment .Sh SYNOPSIS .Nm +.Op Fl l | s .Op Fl hNq .Nm .Op Fl qv @@ -45,6 +46,23 @@ The .Nm utility will list all variables in the kernel environment if invoked without arguments. +.Pp +If the +.Fl l +option is specified, then the static environment provided by +.Xr loader 8 +will be listed instead. +Similarly, the +.Fl s +option will list the static environment defined by the kernel config. +Both of the +.Fl l +and +.Fl s +options are dependent on the kernel being configured to preserve early kernel +environments. +The default kernel configuration does not preserve these environments. +.Pp If the .Fl h option is specified, it will limit the report to kernel probe hints. diff --git a/bin/kenv/kenv.c b/bin/kenv/kenv.c index 77caeaf5bca2..ecf30ee6b617 100644 --- a/bin/kenv/kenv.c +++ b/bin/kenv/kenv.c @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -36,14 +37,16 @@ __FBSDID("$FreeBSD$"); #include static void usage(void); -static int kdumpenv(void); +static int kdumpenv(int dump_type); static int kgetenv(const char *); static int ksetenv(const char *, char *); static int kunsetenv(const char *); static int hflag = 0; +static int lflag = 0; static int Nflag = 0; static int qflag = 0; +static int sflag = 0; static int uflag = 0; static int vflag = 0; @@ -51,7 +54,7 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n", - "usage: kenv [-hNq]", + "usage: kenv [-l|-s] [-hNq]", " kenv [-qv] variable[=value]", " kenv [-q] -u variable"); exit(1); @@ -65,17 +68,23 @@ main(int argc, char **argv) val = NULL; env = NULL; - while ((ch = getopt(argc, argv, "hNquv")) != -1) { + while ((ch = getopt(argc, argv, "hlNqsuv")) != -1) { switch (ch) { case 'h': hflag++; break; + case 'l': + lflag++; + break; case 'N': Nflag++; break; case 'q': qflag++; break; + case 's': + sflag++; + break; case 'u': uflag++; break; @@ -100,12 +109,23 @@ main(int argc, char **argv) } if ((hflag || Nflag) && env != NULL) usage(); + if (lflag && sflag) + usage(); if (argc > 0 || ((uflag || vflag) && env == NULL)) usage(); if (env == NULL) { - error = kdumpenv(); - if (error && !qflag) - warn("kdumpenv"); + if (lflag) + error = kdumpenv(KENV_DUMP_LOADER); + else if (sflag) + error = kdumpenv(KENV_DUMP_STATIC); + else + error = kdumpenv(KENV_DUMP); + if (error && !qflag) { + if (errno == ENOENT) + warnx("requested environment is unavailable"); + else + warn("kdumpenv"); + } } else if (val == NULL) { if (uflag) { error = kunsetenv(env); @@ -125,12 +145,12 @@ main(int argc, char **argv) } static int -kdumpenv(void) +kdumpenv(int dump_type) { char *buf, *bp, *cp; int buflen, envlen; - envlen = kenv(KENV_DUMP, NULL, NULL, 0); + envlen = kenv(dump_type, NULL, NULL, 0); if (envlen < 0) return (-1); for (;;) { @@ -138,7 +158,7 @@ kdumpenv(void) buf = calloc(1, buflen + 1); if (buf == NULL) return (-1); - envlen = kenv(KENV_DUMP, NULL, buf, buflen); + envlen = kenv(dump_type, NULL, buf, buflen); if (envlen < 0) { free(buf); return (-1); diff --git a/lib/libc/sys/kenv.2 b/lib/libc/sys/kenv.2 index 06f708170a2f..a1f994569111 100644 --- a/lib/libc/sys/kenv.2 +++ b/lib/libc/sys/kenv.2 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2017 +.Dd June 20, 2021 .Dt KENV 2 .Os .Sh NAME @@ -49,7 +49,7 @@ the kernel environment. The .Fa action argument can be one of the following: -.Bl -tag -width ".Dv KENV_UNSET" +.Bl -tag -width ".Dv KENV_DUMP_LOADER" .It Dv KENV_GET Get the .Fa value @@ -90,7 +90,7 @@ and arguments are ignored. This option is only available to the superuser. .It Dv KENV_DUMP -Dump as much of the kernel environment as will fit in +Dump as much of the dynamic kernel environment as will fit in .Fa value , whose size is given in .Fa len . @@ -103,6 +103,18 @@ will return the number of bytes required to copy out the entire environment. The .Fa name is ignored. +.It Dv KENV_DUMP_LOADER +Dump the static environment provided by +.Xr loader 8 , +with semantics identical to +.Dv KENV_DUMP . +Duplicate and malformed variables originally present in this environment are +discarded by the kernel and will not appear in the output. +.It Dv KENV_DUMP_STATIC +Dump the static environment defined by the kernel +.Xr config 5 . +The semantics are identical to +.Dv KENV_DUMP_LOADER . .El .Sh RETURN VALUES The @@ -142,6 +154,12 @@ for a .Dv KENV_GET or .Dv KENV_UNSET . +.It Bq Er ENOENT +The requested environment is not available for a +.Dv KENV_DUMP_LOADER +or +.Dv KENV_DUMP_STATIC . +The kernel is configured to destroy these environments by default. .It Bq Er EPERM A user other than the superuser attempted to set or unset a kernel environment variable. diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c index 8dc345559e95..2a4c62d64a0f 100644 --- a/sys/kern/kern_environment.c +++ b/sys/kern/kern_environment.c @@ -92,60 +92,103 @@ bool dynamic_kenv; #define KENV_CHECK if (!dynamic_kenv) \ panic("%s: called before SI_SUB_KMEM", __func__) +static int +kenv_dump(struct thread *td, char **envp, int what, char *value, int len) +{ + char *buffer, *senv; + size_t done, needed, buflen; + int error; + + error = 0; + buffer = NULL; + done = needed = 0; + + MPASS(what == KENV_DUMP || what == KENV_DUMP_LOADER || + what == KENV_DUMP_STATIC); + + /* + * For non-dynamic kernel environment, we pass in either md_envp or + * kern_envp and we must traverse with kernenv_next(). This shuffling + * of pointers simplifies the below loop by only differing in how envp + * is modified. + */ + if (what != KENV_DUMP) { + senv = (char *)envp; + envp = &senv; + } + + buflen = len; + if (buflen > KENV_SIZE * (KENV_MNAMELEN + kenv_mvallen + 2)) + buflen = KENV_SIZE * (KENV_MNAMELEN + + kenv_mvallen + 2); + if (len > 0 && value != NULL) + buffer = malloc(buflen, M_TEMP, M_WAITOK|M_ZERO); + + /* Only take the lock for the dynamic kenv. */ + if (what == KENV_DUMP) + mtx_lock(&kenv_lock); + while (*envp != NULL) { + len = strlen(*envp) + 1; + needed += len; + len = min(len, buflen - done); + /* + * If called with a NULL or insufficiently large + * buffer, just keep computing the required size. + */ + if (value != NULL && buffer != NULL && len > 0) { + bcopy(*envp, buffer + done, len); + done += len; + } + + /* Advance the pointer depending on the kenv format. */ + if (what == KENV_DUMP) + envp++; + else + senv = kernenv_next(senv); + } + if (what == KENV_DUMP) + mtx_unlock(&kenv_lock); + if (buffer != NULL) { + error = copyout(buffer, value, done); + free(buffer, M_TEMP); + } + td->td_retval[0] = ((done == needed) ? 0 : needed); + return (error); +} + int -sys_kenv(td, uap) - struct thread *td; - struct kenv_args /* { - int what; - const char *name; - char *value; - int len; - } */ *uap; +sys_kenv(struct thread *td, struct kenv_args *uap) { - char *name, *value, *buffer = NULL; - size_t len, done, needed, buflen; - int error, i; + char *name, *value; + size_t len; + int error; KASSERT(dynamic_kenv, ("kenv: dynamic_kenv = false")); error = 0; - if (uap->what == KENV_DUMP) { + + switch (uap->what) { + case KENV_DUMP: #ifdef MAC error = mac_kenv_check_dump(td->td_ucred); if (error) return (error); #endif - done = needed = 0; - buflen = uap->len; - if (buflen > KENV_SIZE * (KENV_MNAMELEN + kenv_mvallen + 2)) - buflen = KENV_SIZE * (KENV_MNAMELEN + - kenv_mvallen + 2); - if (uap->len > 0 && uap->value != NULL) - buffer = malloc(buflen, M_TEMP, M_WAITOK|M_ZERO); - mtx_lock(&kenv_lock); - for (i = 0; kenvp[i] != NULL; i++) { - len = strlen(kenvp[i]) + 1; - needed += len; - len = min(len, buflen - done); - /* - * If called with a NULL or insufficiently large - * buffer, just keep computing the required size. - */ - if (uap->value != NULL && buffer != NULL && len > 0) { - bcopy(kenvp[i], buffer + done, len); - done += len; - } - } - mtx_unlock(&kenv_lock); - if (buffer != NULL) { - error = copyout(buffer, uap->value, done); - free(buffer, M_TEMP); - } - td->td_retval[0] = ((done == needed) ? 0 : needed); - return (error); - } - - switch (uap->what) { + return (kenv_dump(td, kenvp, uap->what, uap->value, uap->len)); + case KENV_DUMP_LOADER: + case KENV_DUMP_STATIC: +#ifdef MAC + error = mac_kenv_check_dump(td->td_ucred); + if (error) + return (error); +#endif +#ifdef PRESERVE_EARLY_KENV + return (kenv_dump(td, + uap->what == KENV_DUMP_LOADER ? (char **)md_envp : + (char **)kern_envp, uap->what, uap->value, uap->len)); +#else + return (ENOENT); +#endif case KENV_SET: error = priv_check(td, PRIV_KENV_SET); if (error) diff --git a/sys/sys/kenv.h b/sys/sys/kenv.h index 4c851631f343..eccdc027adcc 100644 --- a/sys/sys/kenv.h +++ b/sys/sys/kenv.h @@ -34,10 +34,12 @@ /* * Constants for the kenv(2) syscall */ -#define KENV_GET 0 -#define KENV_SET 1 -#define KENV_UNSET 2 -#define KENV_DUMP 3 +#define KENV_GET 0 +#define KENV_SET 1 +#define KENV_UNSET 2 +#define KENV_DUMP 3 +#define KENV_DUMP_LOADER 4 +#define KENV_DUMP_STATIC 5 #define KENV_MNAMELEN 128 /* Maximum name length (for the syscall) */ #define KENV_MVALLEN 128 /* Maximum value length (for the syscall) */ From owner-dev-commits-src-main@freebsd.org Mon Jul 19 04:21:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2533676EEE for ; Mon, 19 Jul 2021 04:21:04 +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 4GSpYr5mpWz3mjp for ; Mon, 19 Jul 2021 04:21:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A59782C15E for ; Mon, 19 Jul 2021 04:21:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f171.google.com with SMTP id q15so7181899qtp.0 for ; Sun, 18 Jul 2021 21:21:04 -0700 (PDT) X-Gm-Message-State: AOAM530AUMBfvteOtH7yFlGGe1GoRq70GstSXjG5I9Jhg5nJ+YtoOjxo 3IPFebs9tEAfNVYQ5ruu+IX0PGRF9WbxWhlf1Aw= X-Received: by 2002:ac8:5ad2:: with SMTP id d18mt16268052qtd.53.1626668464234; Sun, 18 Jul 2021 21:21:04 -0700 (PDT) MIME-Version: 1.0 References: <202107190407.16J47GCd055259@gitrepo.freebsd.org> In-Reply-To: <202107190407.16J47GCd055259@gitrepo.freebsd.org> From: Kyle Evans Date: Sun, 18 Jul 2021 21:20:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: db0f26439357 - main - kenv: allow listing of static kernel environments Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 04:21:05 -0000 On Sun, Jul 18, 2021 at 9:07 PM Kyle Evans wrote: > > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=db0f26439357b78863e61985acd1e5acf75ce73d > > commit db0f26439357b78863e61985acd1e5acf75ce73d > Author: Kyle Evans > AuthorDate: 2021-06-20 19:36:10 +0000 > Commit: Kyle Evans > CommitDate: 2021-07-19 04:06:19 +0000 > > kenv: allow listing of static kernel environments > > The early environment is typically cleared, so these new options > need the PRESERVE_EARLY_KENV kernel config(8) option. These environments > are reported as missing by kenv(1) if the option is not present in the > running kernel. > > Reviewed by: imp > Differential Revision: https://reviews.freebsd.org/D30835 Hi, Apologies; this series is also missing: Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Thanks, Kyle Evans From owner-dev-commits-src-main@freebsd.org Mon Jul 19 09:53:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B952C653D25; Mon, 19 Jul 2021 09:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSxxp4ZVBz3pc3; Mon, 19 Jul 2021 09:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84A8F15254; Mon, 19 Jul 2021 09:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16J9roNS023460; Mon, 19 Jul 2021 09:53:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J9rotO023459; Mon, 19 Jul 2021 09:53:50 GMT (envelope-from git) Date: Mon, 19 Jul 2021 09:53:50 GMT Message-Id: <202107190953.16J9rotO023459@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: 9ef5b65085ed - main - arm: bcmp -> memcmp 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: 9ef5b65085ed2acdb1db19a1ec4d44ab5137e8b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 09:53:50 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=9ef5b65085ed2acdb1db19a1ec4d44ab5137e8b9 commit 9ef5b65085ed2acdb1db19a1ec4d44ab5137e8b9 Author: Mateusz Guzik AuthorDate: 2021-07-19 09:52:23 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-19 09:52:23 +0000 arm: bcmp -> memcmp The bcmp symbol is not used, at the same time memcmp as pulled from libkern does byte-by-byte comparison. So happens bcmp as found in support.S is in fact renamed memcmp, rename it back. Discussed with: cognet Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/arm/arm/support.S | 4 ++-- sys/conf/files.arm | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/arm/arm/support.S b/sys/arm/arm/support.S index 7a39c283aed1..bcb0b8cffbbb 100644 --- a/sys/arm/arm/support.S +++ b/sys/arm/arm/support.S @@ -216,7 +216,7 @@ do_memset: EEND(memset) END(bzero) -ENTRY(bcmp) +ENTRY(memcmp) mov ip, r0 cmp r2, #0x06 beq .Lmemcmp_6bytes @@ -324,7 +324,7 @@ ENTRY(bcmp) RETne /* Return if mismatch on #4 */ sub r0, r3, r2 /* r0 = b1#5 - b2#5 */ RET -END(bcmp) +END(memcmp) ENTRY(bcopy) /* switch the source and destination registers */ diff --git a/sys/conf/files.arm b/sys/conf/files.arm index e2af76567549..c68522eddbd0 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -123,7 +123,6 @@ libkern/fls.c optional !armv7 !armv6 libkern/flsl.c optional !armv7 !armv6 libkern/flsll.c optional !armv7 !armv6 libkern/lshrdi3.c standard -libkern/memcmp.c standard libkern/moddi3.c standard libkern/qdivrem.c standard libkern/strlen.c standard From owner-dev-commits-src-main@freebsd.org Mon Jul 19 09:53:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CC2C653DA3; Mon, 19 Jul 2021 09:53: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 4GSxxr1ZWTz3pc5; Mon, 19 Jul 2021 09:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC97E15255; Mon, 19 Jul 2021 09:53: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 16J9rp6B023484; Mon, 19 Jul 2021 09:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J9rpAg023483; Mon, 19 Jul 2021 09:53:51 GMT (envelope-from git) Date: Mon, 19 Jul 2021 09:53:51 GMT Message-Id: <202107190953.16J9rpAg023483@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: 6799c73d1e35 - main - arm: retire bcopy 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: 6799c73d1e35cffc2bc86c49e1bc42faaf3f8e9d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 09:53:52 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6799c73d1e35cffc2bc86c49e1bc42faaf3f8e9d commit 6799c73d1e35cffc2bc86c49e1bc42faaf3f8e9d Author: Mateusz Guzik AuthorDate: 2021-07-19 09:53:02 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-19 09:53:02 +0000 arm: retire bcopy It is obsolete since ba96f37758412151 ("Use __builtin for various mem* and b* (e.g. bzero) routines.") Discussed with: cognet Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/arm/arm/support.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/arm/arm/support.S b/sys/arm/arm/support.S index bcb0b8cffbbb..9390b03f62a3 100644 --- a/sys/arm/arm/support.S +++ b/sys/arm/arm/support.S @@ -326,12 +326,7 @@ ENTRY(memcmp) RET END(memcmp) -ENTRY(bcopy) - /* switch the source and destination registers */ - eor r0, r1, r0 - eor r1, r0, r1 - eor r0, r1, r0 -EENTRY(memmove) +ENTRY(memmove) /* Do the buffers overlap? */ cmp r0, r1 RETeq /* Bail now if src/dst are the same */ @@ -736,8 +731,7 @@ EENTRY(memmove) .Lmemmove_bsrcul1l4: add r1, r1, #1 b .Lmemmove_bl4 -EEND(memmove) -END(bcopy) +END(memmove) /* LINTSTUB: Func: void *memcpy(void *dst, const void *src, size_t len) */ ENTRY(memcpy) From owner-dev-commits-src-main@freebsd.org Mon Jul 19 12:01:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AA51655CE9; Mon, 19 Jul 2021 12:01: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 4GT0nd25w3z4dR2; Mon, 19 Jul 2021 12:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ED5A16D7C; Mon, 19 Jul 2021 12:01: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 16JC1v8E096982; Mon, 19 Jul 2021 12:01:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JC1vZP096981; Mon, 19 Jul 2021 12:01:57 GMT (envelope-from git) Date: Mon, 19 Jul 2021 12:01:57 GMT Message-Id: <202107191201.16JC1vZP096981@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: 78e3a168616d - main - arm: dedup counter(9) address calculation 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: 78e3a168616dbe3a2c96efe568c960a1344f42e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 12:01:57 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=78e3a168616dbe3a2c96efe568c960a1344f42e9 commit 78e3a168616dbe3a2c96efe568c960a1344f42e9 Author: Mateusz Guzik AuthorDate: 2021-07-19 10:46:01 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-19 10:46:25 +0000 arm: dedup counter(9) address calculation Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/arm/include/counter.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/arm/include/counter.h b/sys/arm/include/counter.h index e3fb03abd352..203a1ebda64e 100644 --- a/sys/arm/include/counter.h +++ b/sys/arm/include/counter.h @@ -45,8 +45,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (atomic_load_64((uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * - cpu))); + return (atomic_load_64((uint64_t *)zpcpu_get_cpu(p, cpu))); } static inline uint64_t @@ -66,8 +65,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - atomic_store_64((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * - PCPU_GET(cpuid)), 0); + atomic_store_64((uint64_t *)zpcpu_get(arg), 0); } static inline void From owner-dev-commits-src-main@freebsd.org Mon Jul 19 13:33:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E0F96575DD; Mon, 19 Jul 2021 13:33: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 4GT2pt3WP5z4tKy; Mon, 19 Jul 2021 13:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60A4718301; Mon, 19 Jul 2021 13:33: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 16JDXAfi017118; Mon, 19 Jul 2021 13:33:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JDXAIV017117; Mon, 19 Jul 2021 13:33:10 GMT (envelope-from git) Date: Mon, 19 Jul 2021 13:33:10 GMT Message-Id: <202107191333.16JDXAIV017117@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: f9aa757d8d1e - main - pf: add a comment to pf_kstate concerning compat with pf_state_cmp 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: f9aa757d8d1e1bfc7951f462e92f00639256cad6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 13:33:10 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f9aa757d8d1e1bfc7951f462e92f00639256cad6 commit f9aa757d8d1e1bfc7951f462e92f00639256cad6 Author: Mateusz Guzik AuthorDate: 2021-07-19 12:17:33 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-19 12:54:49 +0000 pf: add a comment to pf_kstate concerning compat with pf_state_cmp Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 46b71c5eedce..297f26f1553d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -586,10 +586,16 @@ _Static_assert(sizeof(struct pf_state_export) == 384, "size incorrect"); #ifdef _KERNEL struct pf_kstate { + /* + * Area shared with pf_state_cmp + */ u_int64_t id; u_int32_t creatorid; u_int8_t direction; u_int8_t pad[3]; + /* + * end of the area + */ u_int refs; TAILQ_ENTRY(pf_kstate) sync_list; From owner-dev-commits-src-main@freebsd.org Mon Jul 19 13:33:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7496A657374; Mon, 19 Jul 2021 13:33:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GT2ps2j24z4tG3; Mon, 19 Jul 2021 13:33:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45B79180B6; Mon, 19 Jul 2021 13:33: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 16JDX9Jr017094; Mon, 19 Jul 2021 13:33:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JDX9pG017093; Mon, 19 Jul 2021 13:33:09 GMT (envelope-from git) Date: Mon, 19 Jul 2021 13:33:09 GMT Message-Id: <202107191333.16JDX9pG017093@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: 144ec0713daa - main - pf: add a branch prediction to expire state check in pf_find_state 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: 144ec0713daa532342a298fd888a1656ae24a62d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 13:33:09 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=144ec0713daa532342a298fd888a1656ae24a62d commit 144ec0713daa532342a298fd888a1656ae24a62d Author: Mateusz Guzik AuthorDate: 2021-07-19 12:50:08 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-19 12:54:49 +0000 pf: add a branch prediction to expire state check in pf_find_state Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 51b26350d0bb..fa8b6006571a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1376,7 +1376,7 @@ pf_find_state(struct pfi_kkif *kif, struct pf_state_key_cmp *key, u_int dir) if (s->kif == V_pfi_all || s->kif == kif) { PF_STATE_LOCK(s); PF_HASHROW_UNLOCK(kh); - if (s->timeout >= PFTM_MAX) { + if (__predict_false(s->timeout >= PFTM_MAX)) { /* * State is either being processed by * pf_unlink_state() in an other thread, or From owner-dev-commits-src-main@freebsd.org Mon Jul 19 13:33:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D34B3657786; Mon, 19 Jul 2021 13:33: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 4GT2pv4rqCz4tJR; Mon, 19 Jul 2021 13:33:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C44518302; Mon, 19 Jul 2021 13:33: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 16JDXBfo017142; Mon, 19 Jul 2021 13:33:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JDXB2C017141; Mon, 19 Jul 2021 13:33:11 GMT (envelope-from git) Date: Mon, 19 Jul 2021 13:33:11 GMT Message-Id: <202107191333.16JDXB2C017141@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: 9009d36afd1e - main - pf: shrink struct pf_kstate 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: 9009d36afd1e0107e1e5b6988f49436087b3d474 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 13:33:12 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=9009d36afd1e0107e1e5b6988f49436087b3d474 commit 9009d36afd1e0107e1e5b6988f49436087b3d474 Author: Mateusz Guzik AuthorDate: 2021-07-19 12:35:31 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-19 12:54:49 +0000 pf: shrink struct pf_kstate Makes room for a pointer. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 297f26f1553d..1ed74e0781c9 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -597,6 +597,10 @@ struct pf_kstate { * end of the area */ + u_int8_t state_flags; + u_int8_t timeout; + u_int8_t sync_state; /* PFSYNC_S_x */ + u_int8_t sync_updates; /* XXX */ u_int refs; TAILQ_ENTRY(pf_kstate) sync_list; TAILQ_ENTRY(pf_kstate) key_list[2]; @@ -622,13 +626,6 @@ struct pf_kstate { u_int32_t pqid; u_int16_t tag; u_int8_t log; - u_int8_t state_flags; - u_int8_t timeout; - u_int8_t sync_state; /* PFSYNC_S_x */ - - /* XXX */ - u_int8_t sync_updates; - u_int8_t _tail[3]; }; /* From owner-dev-commits-src-main@freebsd.org Mon Jul 19 13:37:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C17AB6571E3; Mon, 19 Jul 2021 13:37:42 +0000 (UTC) (envelope-from wschnr@googlemail.com) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GT2w56WzMz4ttf; Mon, 19 Jul 2021 13:37:41 +0000 (UTC) (envelope-from wschnr@googlemail.com) Received: by mail-lj1-f173.google.com with SMTP id y7so25957224ljm.1; Mon, 19 Jul 2021 06:37:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nUj+TXbRpxeEAm/atViN6S3Hcq7zXyIq/CqGYvL62NQ=; b=b/jnRqN5PKKxQfA6CAWkVeQkwCCVGKrt6hQpn7rwlvU2c+JLBon0oqTpDJ9LCwW77h XbtpZaNNjJuLezjavC4eEmSUEdcZXAoc+BpWUJ+l+lYNNZ2AoZeV+dsRGXuGVmj7Aaww 0z4p098+0CRKRxvjnhFzfAO7NbQS/fAtPxtjVZtesWl//yt3JdEKQLoK0gMU0tDsbtUb VBUlcy9JAxvMrx6JNAJKgg2ZiXyG4k2MI8gJIiyD6hJoOQ5K8Upv/ojGgmCExf3A6VYB uLnFXsr7MEBcHENAKMO5G6QJUBWmMMmpjNrUOwzYBhI1abLFMMyAAkEDpWEpa7K38HGa jsBA== X-Gm-Message-State: AOAM531wyK2Pv+is442CcrgbuHwOCQTl4iCDGR1Sfv5vQkOwEGZk5o/u /7AXuzMMUeW9RT2ZrT8gOtddqei2QfhEoUsEQXsYFG2HG2A= X-Google-Smtp-Source: ABdhPJxPSfR1KzN5aLPFt/4bMJulMw0ND4oNPAY9t67hcYttYHRCuH0nqMXmYgjdI/sMdtz9SaU6CkTiW9fnn0nMJVo= X-Received: by 2002:a2e:989a:: with SMTP id b26mr22906821ljj.436.1626701860037; Mon, 19 Jul 2021 06:37:40 -0700 (PDT) MIME-Version: 1.0 References: <202107072012.167KC1IL065912@gitrepo.freebsd.org> In-Reply-To: <202107072012.167KC1IL065912@gitrepo.freebsd.org> From: Wolfram Schneider Date: Mon, 19 Jul 2021 15:37:28 +0200 Message-ID: Subject: Re: git: f6043a672135 - main - ObsoleteFiles.inc: Remove manpages from OLD_FILES To: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= , marklmi@yahoo.com, Ed Maste , Wolfram Schneider Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4GT2w56WzMz4ttf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of wschnr@googlemail.com designates 209.85.208.173 as permitted sender) smtp.mailfrom=wschnr@googlemail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[googlemail.com]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.208.173:from]; SPAMHAUS_ZRD(0.00)[209.85.208.173:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.173:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEMAIL_TO(0.00)[freebsd.org,yahoo.com]; FORGED_SENDER(0.30)[wosch@freebsd.org,wschnr@googlemail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.173:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[wosch@freebsd.org,wschnr@googlemail.com]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 13:37:42 -0000 How about apm.8.gz and apmconf.8.gz? $ git grep -E '(apm|apmconf|nvram|apmd|sconfig)\.8' | grep OLD_FILES ObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/apm.8.gz ObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/apmconf.8.gz tools/build/mk/OptionalObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/am= d64/apm.8.gz tools/build/mk/OptionalObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/am= d64/apmconf.8.gz -Wolfram On Wed, 7 Jul 2021 at 22:12, Fernando Apestegu=C3=ADa = wrote: > > The branch main has been updated by fernape (doc, ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Df6043a672135da8ec090d8878c= c844b8aace54f9 > > commit f6043a672135da8ec090d8878cc844b8aace54f9 > Author: Fernando Apestegu=C3=ADa > AuthorDate: 2021-07-07 13:15:02 +0000 > Commit: Fernando Apestegu=C3=ADa > CommitDate: 2021-07-07 18:09:02 +0000 > > ObsoleteFiles.inc: Remove manpages from OLD_FILES > > In 0a0f7486413c147d56808b38055c40c64cff61f5 sconfig.8.gz and apmd.8.g= z > were moved back to the parent directory share/man/man8. > > This conflicts with a previous entry in OLD_FILES so running 'make > delete-old' would delete the new installed files. > > Reported by: marklmi@yahoo.com > Approved by: emaste@ > Fixes: 0a0f7486413c - Build manpages for all architectures > MFH: 4 weeks > Differential Revision: https://reviews.freebsd.org/D31092 > --- > ObsoleteFiles.inc | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc > index 60707faebefc..d72aea5e8efc 100644 > --- a/ObsoleteFiles.inc > +++ b/ObsoleteFiles.inc > @@ -14840,11 +14840,9 @@ OLD_FILES+=3Dusr/share/man/man7/mmroff.7.gz > OLD_FILES+=3Dusr/share/man/man7/mwww.7.gz > OLD_FILES+=3Dusr/share/man/man8/apm.8.gz > OLD_FILES+=3Dusr/share/man/man8/apmconf.8.gz > -OLD_FILES+=3Dusr/share/man/man8/apmd.8.gz > OLD_FILES+=3Dusr/share/man/man8/dm.8.gz > OLD_FILES+=3Dusr/share/man/man8/pam_ftp.8.gz > OLD_FILES+=3Dusr/share/man/man8/pam_wheel.8.gz > -OLD_FILES+=3Dusr/share/man/man8/sconfig.8.gz > OLD_FILES+=3Dusr/share/man/man8/ssl.8.gz > OLD_FILES+=3Dusr/share/man/man8/wlconfig.8.gz > OLD_FILES+=3Dusr/share/man/man9/CURSIG.9.gz --=20 Wolfram Schneider https://wolfram.schneider.org From owner-dev-commits-src-main@freebsd.org Mon Jul 19 14:44:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D85C65852C; Mon, 19 Jul 2021 14:44: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 4GT4PH0S8vz3N3v; Mon, 19 Jul 2021 14:44:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E613018EBD; Mon, 19 Jul 2021 14:44: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 16JEiY5Y010390; Mon, 19 Jul 2021 14:44:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JEiYPJ010389; Mon, 19 Jul 2021 14:44:34 GMT (envelope-from git) Date: Mon, 19 Jul 2021 14:44:34 GMT Message-Id: <202107191444.16JEiYPJ010389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 2423585b1de5 - main - bin/ps: Avoid function name conflict with libc uname() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2423585b1de50dd2daea8478318e94ff80e0e6ec Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 14:44:35 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2423585b1de50dd2daea8478318e94ff80e0e6ec commit 2423585b1de50dd2daea8478318e94ff80e0e6ec Author: Alex Richardson AuthorDate: 2021-07-19 14:03:38 +0000 Commit: Alex Richardson CommitDate: 2021-07-19 14:04:09 +0000 bin/ps: Avoid function name conflict with libc uname() This prevents ps from being built with address sanitizer instrumentation. Reviewed By: trasz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31048 --- bin/ps/extern.h | 2 +- bin/ps/keyword.c | 2 +- bin/ps/print.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ps/extern.h b/bin/ps/extern.h index 723d7fcb85dd..ea4362eeadd9 100644 --- a/bin/ps/extern.h +++ b/bin/ps/extern.h @@ -86,7 +86,7 @@ char *tdev(KINFO *, VARENT *); char *tdnam(KINFO *, VARENT *); char *tname(KINFO *, VARENT *); char *ucomm(KINFO *, VARENT *); -char *uname(KINFO *, VARENT *); +char *username(KINFO *, VARENT *); char *upr(KINFO *, VARENT *); char *usertime(KINFO *, VARENT *); char *vsize(KINFO *, VARENT *); diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index 2a8382a2273e..e78cf984e455 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -222,7 +222,7 @@ static VAR var[] = { {"upr", "UPR", NULL, "user-priority", 0, upr, 0, CHAR, NULL, 0}, {"uprocp", "UPROCP", NULL, "process-address", 0, kvar, KOFF(ki_paddr), KPTR, "lx", 0}, - {"user", "USER", NULL, "user", LJUST, uname, 0, CHAR, NULL, 0}, + {"user", "USER", NULL, "user", LJUST, username, 0, CHAR, NULL, 0}, {"usertime", "USERTIME", NULL, "user-time", USER, usertime, 0, CHAR, NULL, 0}, {"usrpri", "", "upr", NULL, 0, NULL, 0, CHAR, NULL, 0}, diff --git a/bin/ps/print.c b/bin/ps/print.c index 3d3a543c8a5d..2b61c6b0a15a 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -311,7 +311,7 @@ upr(KINFO *k, VARENT *ve __unused) #undef scalepri char * -uname(KINFO *k, VARENT *ve __unused) +username(KINFO *k, VARENT *ve __unused) { return (strdup(user_from_uid(k->ki_p->ki_uid, 0))); From owner-dev-commits-src-main@freebsd.org Mon Jul 19 14:44:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3176D6582C8; Mon, 19 Jul 2021 14:44:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GT4PJ0lbTz3NNH; Mon, 19 Jul 2021 14:44:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 031E419108; Mon, 19 Jul 2021 14:44:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16JEiZ3d010416; Mon, 19 Jul 2021 14:44:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JEiZIt010415; Mon, 19 Jul 2021 14:44:35 GMT (envelope-from git) Date: Mon, 19 Jul 2021 14:44:35 GMT Message-Id: <202107191444.16JEiZIt010415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 8ef98a8045d4 - main - Allow building usr.bin/vi with MK_ASAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ef98a8045d4623edd75b91ce76eedeaa4ad3f01 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 14:44:36 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8ef98a8045d4623edd75b91ce76eedeaa4ad3f01 commit 8ef98a8045d4623edd75b91ce76eedeaa4ad3f01 Author: Alex Richardson AuthorDate: 2021-07-19 14:04:19 +0000 Commit: Alex Richardson CommitDate: 2021-07-19 14:04:19 +0000 Allow building usr.bin/vi with MK_ASAN We have to namespace the regex functions to avoid duplicate symbol errors. This also ensures that vi doesn't define the libc reg* functions with mismatched signatures. ld: error: duplicate symbol: regcomp >>> defined at sanitizer_common_interceptors.inc:7519 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:7519) >>> asan_interceptors.o:(__interceptor_regcomp) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a >>> defined at regcomp.c >>> .../regex/regcomp.c.o:(.text+0x0) ld: error: duplicate symbol: regerror >>> defined at sanitizer_common_interceptors.inc:7543 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:7543) >>> asan_interceptors.o:(__interceptor_regerror) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a >>> defined at regerror.c >>> .../regex/regerror.c.o:(.text+0x0) ld: error: duplicate symbol: regexec >>> defined at sanitizer_common_interceptors.inc:7530 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:7530) >>> asan_interceptors.o:(__interceptor_regexec) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a >>> defined at regexec.c >>> .../regex/regexec.c.o:(.text+0x0) ld: error: duplicate symbol: regfree >>> defined at sanitizer_common_interceptors.inc:7553 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:7553) >>> asan_interceptors.o:(__interceptor_regfree) in archive /usr/lib/clang/10.0.1/lib/freebsd/libclang_rt.asan-x86_64.a >>> defined at regfree.c >>> .../regex/regfree.c.o:(.text+0x0) Committed upstream as https://github.com/lichray/nvi2/pull/92 Reviewed By: bapt Differential Revision: https://reviews.freebsd.org/D31050 --- contrib/nvi/regex/regex.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/contrib/nvi/regex/regex.h b/contrib/nvi/regex/regex.h index 20ea7865c0a0..7d788514a54c 100644 --- a/contrib/nvi/regex/regex.h +++ b/contrib/nvi/regex/regex.h @@ -96,6 +96,16 @@ typedef struct { #define REG_LARGE 01000 /* force large representation */ #define REG_BACKR 02000 /* force use of backref code */ +#ifdef USE_WIDECHAR +/* + * Avoid function name conflicts with the system regex functions. + * This is needed e.g. to build with AddressSanitizer. + */ +#define regcomp nvi_regcomp +#define regerror nvi_regerror +#define regexec nvi_regexec +#define regfree nvi_regfree +#endif int regcomp(regex_t *, const RCHAR_T *, int); size_t regerror(int, const regex_t *, char *, size_t); int regexec(const regex_t *, From owner-dev-commits-src-main@freebsd.org Mon Jul 19 14:44:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DADC658628; Mon, 19 Jul 2021 14:44: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 4GT4PK2NBwz3NWY; Mon, 19 Jul 2021 14:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2353E18FF2; Mon, 19 Jul 2021 14:44: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 16JEibQC010440; Mon, 19 Jul 2021 14:44:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JEibm3010439; Mon, 19 Jul 2021 14:44:37 GMT (envelope-from git) Date: Mon, 19 Jul 2021 14:44:37 GMT Message-Id: <202107191444.16JEibm3010439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: c5d1d88a351a - main - Don't build lldb-tablegen if MK_LLDB=no MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5d1d88a351abe869c436f4f70c85d4c29e6e98c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 14:44:37 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c5d1d88a351abe869c436f4f70c85d4c29e6e98c commit c5d1d88a351abe869c436f4f70c85d4c29e6e98c Author: Alex Richardson AuthorDate: 2021-07-05 17:36:02 +0000 Commit: Alex Richardson CommitDate: 2021-07-19 14:05:22 +0000 Don't build lldb-tablegen if MK_LLDB=no Split out from D31060. Reviewed by: emaste --- Makefile.inc1 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 067516c9288e..c2e34a0b02dc 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2298,14 +2298,17 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptree # We need to build tblgen when we're building clang or lld, either as # bootstrap tools, or as the part of the normal build. .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \ - ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no" + ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no" || \ + ${MK_LLDB} != "no" _clang_tblgen= \ lib/clang/libllvmminimal \ - usr.bin/clang/llvm-tblgen \ - usr.bin/clang/clang-tblgen \ - usr.bin/clang/lldb-tblgen -# XXX: lldb-tblgen is not needed, if top-level MK_LLDB=no - + usr.bin/clang/llvm-tblgen +.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" +_clang_tblgen+= usr.bin/clang/clang-tblgen +.endif +.if ${MK_LLDB} != "no" +_clang_tblgen+= usr.bin/clang/lldb-tblgen +.endif ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal ${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal From owner-dev-commits-src-main@freebsd.org Mon Jul 19 15:34:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8256A658F2A; Mon, 19 Jul 2021 15:34:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GT5VR31cdz3lsY; Mon, 19 Jul 2021 15:34:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ED9119C24; Mon, 19 Jul 2021 15:34:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16JFY7pk080736; Mon, 19 Jul 2021 15:34:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JFY7Gj080735; Mon, 19 Jul 2021 15:34:07 GMT (envelope-from git) Date: Mon, 19 Jul 2021 15:34:07 GMT Message-Id: <202107191534.16JFY7Gj080735@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 857ad3e4fff0 - main - arm64: std.allwinner: Add aw_syscon MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 857ad3e4fff0eb4ba1eea6b6aeec3d30920507e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 15:34:07 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=857ad3e4fff0eb4ba1eea6b6aeec3d30920507e5 commit 857ad3e4fff0eb4ba1eea6b6aeec3d30920507e5 Author: Emmanuel Vadot AuthorDate: 2021-07-19 15:31:57 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-19 15:31:57 +0000 arm64: std.allwinner: Add aw_syscon This was missed during the conversion of kernel configs PR: 257278 Reported by: Manuel Stühn --- sys/arm64/conf/std.allwinner | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/arm64/conf/std.allwinner b/sys/arm64/conf/std.allwinner index 71d71300c9b1..2bcbdc32e111 100644 --- a/sys/arm64/conf/std.allwinner +++ b/sys/arm64/conf/std.allwinner @@ -34,6 +34,9 @@ device aw_rtc # Allwinner Real-time Clock # Watchdog controllers device aw_wdog # Allwinner Watchdog +# Syscon controller +device aw_syscon # Allwinner System Controller + # Power management controllers device axp81x # X-Powers AXP81x PMIC From owner-dev-commits-src-main@freebsd.org Mon Jul 19 16:19:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 695D2659B3A; Mon, 19 Jul 2021 16:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GT6Vq2FBnz3vRm; Mon, 19 Jul 2021 16:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30E391A56D; Mon, 19 Jul 2021 16:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16JGJVmx036064; Mon, 19 Jul 2021 16:19:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JGJVIu036063; Mon, 19 Jul 2021 16:19:31 GMT (envelope-from git) Date: Mon, 19 Jul 2021 16:19:31 GMT Message-Id: <202107191619.16JGJVIu036063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 52fba9a943cc - main - acpi: Fix a repeated vm_offset_t that should be a vm_size_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52fba9a943cca518d2978f7588e99a35da37e5f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 16:19:31 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=52fba9a943cca518d2978f7588e99a35da37e5f2 commit 52fba9a943cca518d2978f7588e99a35da37e5f2 Author: Jessica Clarke AuthorDate: 2021-07-19 16:19:23 +0000 Commit: Jessica Clarke CommitDate: 2021-07-19 16:19:23 +0000 acpi: Fix a repeated vm_offset_t that should be a vm_size_t The underlying types for both are the same so arguably this doesn't really matter, but using the wrong type is still confusing and technically incorrect. --- sys/amd64/acpica/acpi_machdep.c | 2 +- sys/arm64/acpica/acpi_machdep.c | 2 +- sys/i386/acpica/acpi_machdep.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c index 7d8b303f6f16..9bf4eb020f7a 100644 --- a/sys/amd64/acpica/acpi_machdep.c +++ b/sys/amd64/acpica/acpi_machdep.c @@ -98,7 +98,7 @@ static void * map_table(vm_paddr_t pa, const char *sig) { ACPI_TABLE_HEADER *header; - vm_offset_t length; + vm_size_t length; void *table; header = pmap_mapbios(pa, sizeof(ACPI_TABLE_HEADER)); diff --git a/sys/arm64/acpica/acpi_machdep.c b/sys/arm64/acpica/acpi_machdep.c index 05ec00ccbe61..d164ac250d4f 100644 --- a/sys/arm64/acpica/acpi_machdep.c +++ b/sys/arm64/acpica/acpi_machdep.c @@ -66,7 +66,7 @@ static void * map_table(vm_paddr_t pa, const char *sig) { ACPI_TABLE_HEADER *header; - vm_offset_t length; + vm_size_t length; void *table; header = pmap_mapbios(pa, sizeof(ACPI_TABLE_HEADER)); diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index e8810ac88009..3acf149dba11 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -116,7 +116,7 @@ static void * map_table(vm_paddr_t pa, const char *sig) { ACPI_TABLE_HEADER *header; - vm_offset_t length; + vm_size_t length; void *table; header = pmap_mapbios(pa, sizeof(ACPI_TABLE_HEADER)); From owner-dev-commits-src-main@freebsd.org Mon Jul 19 16:19:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C19E6659B3B; Mon, 19 Jul 2021 16:19: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 4GT6Vr2xs3z3vMQ; Mon, 19 Jul 2021 16:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 493E41A413; Mon, 19 Jul 2021 16:19: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 16JGJWI2036088; Mon, 19 Jul 2021 16:19:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JGJWcr036087; Mon, 19 Jul 2021 16:19:32 GMT (envelope-from git) Date: Mon, 19 Jul 2021 16:19:32 GMT Message-Id: <202107191619.16JGJWcr036087@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 439097486ba0 - main - acpi: Fix a repeated comment typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 439097486ba0453e057c05d548fa306d91c784e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 16:19:32 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=439097486ba0453e057c05d548fa306d91c784e5 commit 439097486ba0453e057c05d548fa306d91c784e5 Author: Jessica Clarke AuthorDate: 2021-07-19 16:19:23 +0000 Commit: Jessica Clarke CommitDate: 2021-07-19 16:19:23 +0000 acpi: Fix a repeated comment typo --- sys/amd64/acpica/acpi_machdep.c | 2 +- sys/arm64/acpica/acpi_machdep.c | 2 +- sys/i386/acpica/acpi_machdep.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c index 9bf4eb020f7a..a443c8693aa3 100644 --- a/sys/amd64/acpica/acpi_machdep.c +++ b/sys/amd64/acpica/acpi_machdep.c @@ -122,7 +122,7 @@ map_table(vm_paddr_t pa, const char *sig) /* * See if a given ACPI table is the requested table. Returns the - * length of the able if it matches or zero on failure. + * length of the table if it matches or zero on failure. */ static int probe_table(vm_paddr_t address, const char *sig) diff --git a/sys/arm64/acpica/acpi_machdep.c b/sys/arm64/acpica/acpi_machdep.c index d164ac250d4f..478da9ec49ec 100644 --- a/sys/arm64/acpica/acpi_machdep.c +++ b/sys/arm64/acpica/acpi_machdep.c @@ -91,7 +91,7 @@ map_table(vm_paddr_t pa, const char *sig) /* * See if a given ACPI table is the requested table. Returns the - * length of the able if it matches or zero on failure. + * length of the table if it matches or zero on failure. */ static int probe_table(vm_paddr_t address, const char *sig) diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index 3acf149dba11..ca18b6d11f68 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -140,7 +140,7 @@ map_table(vm_paddr_t pa, const char *sig) /* * See if a given ACPI table is the requested table. Returns the - * length of the able if it matches or zero on failure. + * length of the table if it matches or zero on failure. */ static int probe_table(vm_paddr_t address, const char *sig) From owner-dev-commits-src-main@freebsd.org Mon Jul 19 20:41:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD81365E882; Mon, 19 Jul 2021 20:41: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 4GTDKP4RnBz3n47; Mon, 19 Jul 2021 20:41:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81C2D1DBB5; Mon, 19 Jul 2021 20:41: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 16JKfjcF096743; Mon, 19 Jul 2021 20:41:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JKfjPw096726; Mon, 19 Jul 2021 20:41:45 GMT (envelope-from git) Date: Mon, 19 Jul 2021 20:41:45 GMT Message-Id: <202107192041.16JKfjPw096726@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: 79e6eb5c018d - main - zfs: Remove zfs-images submodule 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: 79e6eb5c018d44ee59c5b9b10755d116c860c366 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 20:41:45 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=79e6eb5c018d44ee59c5b9b10755d116c860c366 commit 79e6eb5c018d44ee59c5b9b10755d116c860c366 Author: Ed Maste AuthorDate: 2021-06-14 13:31:39 +0000 Commit: Ed Maste CommitDate: 2021-07-19 20:40:09 +0000 zfs: Remove zfs-images submodule This can cause issues like 'No url found for submodule path' in downstream or derived projects making use of submodules. Reviewed by: imp --- sys/contrib/openzfs/.gitmodules | 3 --- sys/contrib/openzfs/scripts/zfs-images | 1 - 2 files changed, 4 deletions(-) diff --git a/sys/contrib/openzfs/.gitmodules b/sys/contrib/openzfs/.gitmodules deleted file mode 100644 index 9eaa2b0495dc..000000000000 --- a/sys/contrib/openzfs/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "scripts/zfs-images"] - path = scripts/zfs-images - url = https://github.com/openzfs/zfs-images diff --git a/sys/contrib/openzfs/scripts/zfs-images b/sys/contrib/openzfs/scripts/zfs-images deleted file mode 160000 index 3331601f6dc5..000000000000 --- a/sys/contrib/openzfs/scripts/zfs-images +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3331601f6dc50ef2c9779c1656218701b48b276c From owner-dev-commits-src-main@freebsd.org Mon Jul 19 22:33:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CE7965FED7; Mon, 19 Jul 2021 22:33: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 4GTGnm20lRz4gMY; Mon, 19 Jul 2021 22:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D0B81F604; Mon, 19 Jul 2021 22:33: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 16JMX0EU044019; Mon, 19 Jul 2021 22:33:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JMX0k4044018; Mon, 19 Jul 2021 22:33:00 GMT (envelope-from git) Date: Mon, 19 Jul 2021 22:33:00 GMT Message-Id: <202107192233.16JMX0k4044018@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: a730d82378d3 - main - tcp: fix RACK and BBR when using VIMAGE enabled kernel 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: a730d82378d3cdf5356775ec0c23ad2ca40c5edb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 22:33:00 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a730d82378d3cdf5356775ec0c23ad2ca40c5edb commit a730d82378d3cdf5356775ec0c23ad2ca40c5edb Author: Michael Tuexen AuthorDate: 2021-07-19 22:29:18 +0000 Commit: Michael Tuexen CommitDate: 2021-07-19 22:29:18 +0000 tcp: fix RACK and BBR when using VIMAGE enabled kernel Fix a bug in VNET handling, which occurs when using specific NICs. PR: 257195 Reviewed by: rrs MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D31212 --- sys/netinet/tcp_stacks/rack_bbr_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index baa267b43752..bf93359368f9 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -508,16 +508,18 @@ skip_vnet: m_freem(m); m = m_save; } - if (no_vn == 0) + if (no_vn == 0) { CURVNET_RESTORE(); + } INP_UNLOCK_ASSERT(inp); return(retval); } skipped_pkt: m = m_save; } - if (no_vn == 0) + if (no_vn == 0) { CURVNET_RESTORE(); + } return(retval); } From owner-dev-commits-src-main@freebsd.org Mon Jul 19 22:39:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C862066040D; Mon, 19 Jul 2021 22:39: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 4GTGxC232Zz4hBG; Mon, 19 Jul 2021 22:39:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EF371ED66; Mon, 19 Jul 2021 22:39: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 16JMdRGF044606; Mon, 19 Jul 2021 22:39:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JMdRsk044605; Mon, 19 Jul 2021 22:39:27 GMT (envelope-from git) Date: Mon, 19 Jul 2021 22:39:27 GMT Message-Id: <202107192239.16JMdRsk044605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 4a7d15ebb6af - main - cxgbei: Remove invalid assertion. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a7d15ebb6afe1b662afd2fde0ed2725790a1ba1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 22:39:28 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4a7d15ebb6afe1b662afd2fde0ed2725790a1ba1 commit 4a7d15ebb6afe1b662afd2fde0ed2725790a1ba1 Author: John Baldwin AuthorDate: 2021-07-19 22:36:31 +0000 Commit: John Baldwin CommitDate: 2021-07-19 22:36:31 +0000 cxgbei: Remove invalid assertion. A non-placed PDU can be delivered by CPL_RX_ISCSI_CMP in the middle of a burst of placed PDUs (received via DDP) in which case the rcv_nxt will not match the start of the non-placed PDU. Reported by: Jithesh Arakkan @ Chelsio Sponsored by: Chelsio Communications --- sys/dev/cxgbe/cxgbei/cxgbei.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index c70bda7e0436..5135fc68d197 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -592,7 +592,6 @@ do_rx_iscsi_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) } else { MPASS(icp->icp_flags & (ICPF_RX_FLBUF)); MPASS(ip->ip_data_len == ip->ip_data_mbuf->m_pkthdr.len); - MPASS(icp->icp_seq == tp->rcv_nxt); } tp->rcv_nxt = icp->icp_seq + pdu_len; From owner-dev-commits-src-main@freebsd.org Mon Jul 19 22:39:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86B1F66040F; Mon, 19 Jul 2021 22:39: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 4GTGxD4KpKz4hWv; Mon, 19 Jul 2021 22:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 373251ED67; Mon, 19 Jul 2021 22:39: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 16JMdS68044630; Mon, 19 Jul 2021 22:39:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JMdSSM044629; Mon, 19 Jul 2021 22:39:28 GMT (envelope-from git) Date: Mon, 19 Jul 2021 22:39:28 GMT Message-Id: <202107192239.16JMdSSM044629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b5e73dd952f9 - main - cxgbei: Don't assert F for data completion PDUs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5e73dd952f9d5224e9e076bb9719f7bcec871b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 22:39:29 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b5e73dd952f9d5224e9e076bb9719f7bcec871b0 commit b5e73dd952f9d5224e9e076bb9719f7bcec871b0 Author: John Baldwin AuthorDate: 2021-07-19 22:36:31 +0000 Commit: John Baldwin CommitDate: 2021-07-19 22:36:31 +0000 cxgbei: Don't assert F for data completion PDUs. If a data PDU encounters an error such as a digest error, the firmware will report that data PDU when completion moderation is active even if it is not the final data PDU in a burst. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/cxgbei/cxgbei.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index 5135fc68d197..5cce7d3fce05 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -552,9 +552,6 @@ do_rx_iscsi_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) } MPASS(cmp != NULL); - /* Must be the final PDU. */ - MPASS(bhsdo->bhsdo_flags & BHSDO_FLAGS_F); - /* * The difference between the end of the last burst * and the offset of the last PDU in this burst is From owner-dev-commits-src-main@freebsd.org Tue Jul 20 00:38:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86D6466193A; Tue, 20 Jul 2021 00:38: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 4GTKb03FzTz3LsM; Tue, 20 Jul 2021 00:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FBA020CDE; Tue, 20 Jul 2021 00:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K0cqOT003174; Tue, 20 Jul 2021 00:38:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K0cqhJ003173; Tue, 20 Jul 2021 00:38:52 GMT (envelope-from git) Date: Tue, 20 Jul 2021 00:38:52 GMT Message-Id: <202107200038.16K0cqhJ003173@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: 7685f8344d9a - main - nfscl: Send stateid.seqid of 0 for NFSv4.1/4.2 mounts 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: 7685f8344d9a59e9498bdfebb48066f98216fecd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 00:38:52 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=7685f8344d9a59e9498bdfebb48066f98216fecd commit 7685f8344d9a59e9498bdfebb48066f98216fecd Author: Rick Macklem AuthorDate: 2021-07-20 00:35:39 +0000 Commit: Rick Macklem CommitDate: 2021-07-20 00:35:39 +0000 nfscl: Send stateid.seqid of 0 for NFSv4.1/4.2 mounts For NFSv4.1/4.2, the client may set the "seqid" field of the stateid to 0 in RPC requests. This indicates to the server that it should not check the "seqid" or return NFSERR_OLDSTATEID if the "seqid" value is not up to date w.r.t. Open/Lock operations on the stateid. This "seqid" is incremented by the NFSv4 server for each Open/OpenDowngrade/Lock/Locku operation done on the stateid. Since a failure return of NFSERR_OLDSTATEID is of no use to the client for I/O operations, it makes sense to set "seqid" to 0 for the stateid argument for I/O operations. This avoids server failure replies of NFSERR_OLDSTATEID, although I am not aware of any case where this failure occurs. This makes the FreeBSD NFSv4.1/4.2 client compatible with the Linux NFSv4.1/4.2 client. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clstate.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 8ea5d77d2053..406dcc9d9b80 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -569,7 +569,11 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, !NFSBCMP(nfhp, dp->nfsdl_fh, fhlen)) { if (!(mode & NFSV4OPEN_ACCESSWRITE) || (dp->nfsdl_flags & NFSCLDL_WRITE)) { - stateidp->seqid = dp->nfsdl_stateid.seqid; + if (NFSHASNFSV4N(nmp)) + stateidp->seqid = 0; + else + stateidp->seqid = + dp->nfsdl_stateid.seqid; stateidp->other[0] = dp->nfsdl_stateid.other[0]; stateidp->other[1] = dp->nfsdl_stateid.other[1]; stateidp->other[2] = dp->nfsdl_stateid.other[2]; @@ -604,8 +608,10 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, own, own, mode, &lp, &op); if (error == 0 && lp != NULL && fords == 0) { /* Don't return a lock stateid for a DS. */ - stateidp->seqid = - lp->nfsl_stateid.seqid; + if (NFSHASNFSV4N(nmp)) + stateidp->seqid = 0; + else + stateidp->seqid = lp->nfsl_stateid.seqid; stateidp->other[0] = lp->nfsl_stateid.other[0]; stateidp->other[1] = @@ -656,7 +662,10 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, /* * No lock stateid, so return the open stateid. */ - stateidp->seqid = op->nfso_stateid.seqid; + if (NFSHASNFSV4N(nmp)) + stateidp->seqid = 0; + else + stateidp->seqid = op->nfso_stateid.seqid; stateidp->other[0] = op->nfso_stateid.other[0]; stateidp->other[1] = op->nfso_stateid.other[1]; stateidp->other[2] = op->nfso_stateid.other[2]; From owner-dev-commits-src-main@freebsd.org Tue Jul 20 04:33:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 228AF664A8D; Tue, 20 Jul 2021 04:33: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 4GTQp507Cbz3DCb; Tue, 20 Jul 2021 04:33:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0C6A2437C; Tue, 20 Jul 2021 04:33: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 16K4Xm1C022075; Tue, 20 Jul 2021 04:33:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K4XmJr022074; Tue, 20 Jul 2021 04:33:48 GMT (envelope-from git) Date: Tue, 20 Jul 2021 04:33:48 GMT Message-Id: <202107200433.16K4XmJr022074@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: b891aedcdd2d - main - awk: Add more details top the FS variable 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: b891aedcdd2d9a3e1530e45f6b785b768cccc466 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 04:33:49 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b891aedcdd2d9a3e1530e45f6b785b768cccc466 commit b891aedcdd2d9a3e1530e45f6b785b768cccc466 Author: Warner Losh AuthorDate: 2021-07-20 02:10:22 +0000 Commit: Warner Losh CommitDate: 2021-07-20 04:33:26 +0000 awk: Add more details top the FS variable The current description of the FS is true, but only part of the truth. Add information about single characters and note that FS="" is undefined by the standard, though the two other awk implenetations (mawk and gawk) also have this interpretation. PR: 226112 Sponsored by: Netflix --- usr.bin/awk/awk.1 | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/usr.bin/awk/awk.1 b/usr.bin/awk/awk.1 index 4be4b96cabce..b85efe9d87cd 100644 --- a/usr.bin/awk/awk.1 +++ b/usr.bin/awk/awk.1 @@ -131,8 +131,9 @@ and newlines are used as field separators This is convenient when working with multi-line records. .Pp An input line is normally made up of fields separated by whitespace, -or by the regular expression -.Va FS . +or by the extended regular expression +.Va FS +as described below. The fields are denoted .Va $1 , $2 , ... , while @@ -141,6 +142,22 @@ refers to the entire line. If .Va FS is null, the input line is split into one field per character. +While both gawk and mawk have the same behavior, it is unspecified in the +.St -p1003.1-2008 +standard. +If +.Va FS +is a single space, then leading and trailing blank and newline characters are +skipped. +Fields are delimited by one or more blank or newline characters. +A blank character is a space or a tab. +If +.Va FS +is a single character, other than space, fields are delimited by each single +occurrence of that character. +The +.Va FS +variable defaults to a single space. .Pp Normally, any number of blanks separate fields. In order to set the field separator to a single blank, use the From owner-dev-commits-src-main@freebsd.org Tue Jul 20 04:35:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFDF0664B78; Tue, 20 Jul 2021 04:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTQqd4YFqz3Dd5; Tue, 20 Jul 2021 04:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 798DC2437D; Tue, 20 Jul 2021 04:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K4Z9Ot022287; Tue, 20 Jul 2021 04:35:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K4Z9v8022286; Tue, 20 Jul 2021 04:35:09 GMT (envelope-from git) Date: Tue, 20 Jul 2021 04:35:09 GMT Message-Id: <202107200435.16K4Z9v8022286@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: 0c92d88c9180 - main - awk: remove proctab.c 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: 0c92d88c9180bf25187f01f1d7e419edea9a0fef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 04:35:09 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0c92d88c9180bf25187f01f1d7e419edea9a0fef commit 0c92d88c9180bf25187f01f1d7e419edea9a0fef Author: Warner Losh AuthorDate: 2021-07-12 03:26:08 +0000 Commit: Warner Losh CommitDate: 2021-07-20 04:34:37 +0000 awk: remove proctab.c proctab.c is a generated file and never should have been committed to the tree. This file has been added and removed a couple of times, most recently added by me in my 2019 updates. Sponsored by: Netflix --- contrib/one-true-awk/proctab.c | 213 ----------------------------------------- 1 file changed, 213 deletions(-) diff --git a/contrib/one-true-awk/proctab.c b/contrib/one-true-awk/proctab.c deleted file mode 100644 index 96fad36e601c..000000000000 --- a/contrib/one-true-awk/proctab.c +++ /dev/null @@ -1,213 +0,0 @@ -#include -#include "awk.h" -#include "awkgram.tab.h" - -static const char * const printname[96] = { - "FIRSTTOKEN", /* 258 */ - "PROGRAM", /* 259 */ - "PASTAT", /* 260 */ - "PASTAT2", /* 261 */ - "XBEGIN", /* 262 */ - "XEND", /* 263 */ - "NL", /* 264 */ - "ARRAY", /* 265 */ - "MATCH", /* 266 */ - "NOTMATCH", /* 267 */ - "MATCHOP", /* 268 */ - "FINAL", /* 269 */ - "DOT", /* 270 */ - "ALL", /* 271 */ - "CCL", /* 272 */ - "NCCL", /* 273 */ - "CHAR", /* 274 */ - "OR", /* 275 */ - "STAR", /* 276 */ - "QUEST", /* 277 */ - "PLUS", /* 278 */ - "EMPTYRE", /* 279 */ - "ZERO", /* 280 */ - "AND", /* 281 */ - "BOR", /* 282 */ - "APPEND", /* 283 */ - "EQ", /* 284 */ - "GE", /* 285 */ - "GT", /* 286 */ - "LE", /* 287 */ - "LT", /* 288 */ - "NE", /* 289 */ - "IN", /* 290 */ - "ARG", /* 291 */ - "BLTIN", /* 292 */ - "BREAK", /* 293 */ - "CLOSE", /* 294 */ - "CONTINUE", /* 295 */ - "DELETE", /* 296 */ - "DO", /* 297 */ - "EXIT", /* 298 */ - "FOR", /* 299 */ - "FUNC", /* 300 */ - "GENSUB", /* 301 */ - "SUB", /* 302 */ - "GSUB", /* 303 */ - "IF", /* 304 */ - "INDEX", /* 305 */ - "LSUBSTR", /* 306 */ - "MATCHFCN", /* 307 */ - "NEXT", /* 308 */ - "NEXTFILE", /* 309 */ - "ADD", /* 310 */ - "MINUS", /* 311 */ - "MULT", /* 312 */ - "DIVIDE", /* 313 */ - "MOD", /* 314 */ - "ASSIGN", /* 315 */ - "ASGNOP", /* 316 */ - "ADDEQ", /* 317 */ - "SUBEQ", /* 318 */ - "MULTEQ", /* 319 */ - "DIVEQ", /* 320 */ - "MODEQ", /* 321 */ - "POWEQ", /* 322 */ - "PRINT", /* 323 */ - "PRINTF", /* 324 */ - "SPRINTF", /* 325 */ - "ELSE", /* 326 */ - "INTEST", /* 327 */ - "CONDEXPR", /* 328 */ - "POSTINCR", /* 329 */ - "PREINCR", /* 330 */ - "POSTDECR", /* 331 */ - "PREDECR", /* 332 */ - "VAR", /* 333 */ - "IVAR", /* 334 */ - "VARNF", /* 335 */ - "CALL", /* 336 */ - "NUMBER", /* 337 */ - "STRING", /* 338 */ - "REGEXPR", /* 339 */ - "GETLINE", /* 340 */ - "RETURN", /* 341 */ - "SPLIT", /* 342 */ - "SUBSTR", /* 343 */ - "WHILE", /* 344 */ - "CAT", /* 345 */ - "NOT", /* 346 */ - "UMINUS", /* 347 */ - "UPLUS", /* 348 */ - "POWER", /* 349 */ - "DECR", /* 350 */ - "INCR", /* 351 */ - "INDIRECT", /* 352 */ - "LASTTOKEN", /* 353 */ -}; - - -Cell *(*proctab[96])(Node **, int) = { - nullproc, /* FIRSTTOKEN */ - program, /* PROGRAM */ - pastat, /* PASTAT */ - dopa2, /* PASTAT2 */ - nullproc, /* XBEGIN */ - nullproc, /* XEND */ - nullproc, /* NL */ - array, /* ARRAY */ - matchop, /* MATCH */ - matchop, /* NOTMATCH */ - nullproc, /* MATCHOP */ - nullproc, /* FINAL */ - nullproc, /* DOT */ - nullproc, /* ALL */ - nullproc, /* CCL */ - nullproc, /* NCCL */ - nullproc, /* CHAR */ - nullproc, /* OR */ - nullproc, /* STAR */ - nullproc, /* QUEST */ - nullproc, /* PLUS */ - nullproc, /* EMPTYRE */ - nullproc, /* ZERO */ - boolop, /* AND */ - boolop, /* BOR */ - nullproc, /* APPEND */ - relop, /* EQ */ - relop, /* GE */ - relop, /* GT */ - relop, /* LE */ - relop, /* LT */ - relop, /* NE */ - instat, /* IN */ - arg, /* ARG */ - bltin, /* BLTIN */ - jump, /* BREAK */ - closefile, /* CLOSE */ - jump, /* CONTINUE */ - awkdelete, /* DELETE */ - dostat, /* DO */ - jump, /* EXIT */ - forstat, /* FOR */ - nullproc, /* FUNC */ - gensub, /* GENSUB */ - sub, /* SUB */ - gsub, /* GSUB */ - ifstat, /* IF */ - sindex, /* INDEX */ - nullproc, /* LSUBSTR */ - matchop, /* MATCHFCN */ - jump, /* NEXT */ - jump, /* NEXTFILE */ - arith, /* ADD */ - arith, /* MINUS */ - arith, /* MULT */ - arith, /* DIVIDE */ - arith, /* MOD */ - assign, /* ASSIGN */ - nullproc, /* ASGNOP */ - assign, /* ADDEQ */ - assign, /* SUBEQ */ - assign, /* MULTEQ */ - assign, /* DIVEQ */ - assign, /* MODEQ */ - assign, /* POWEQ */ - printstat, /* PRINT */ - awkprintf, /* PRINTF */ - awksprintf, /* SPRINTF */ - nullproc, /* ELSE */ - intest, /* INTEST */ - condexpr, /* CONDEXPR */ - incrdecr, /* POSTINCR */ - incrdecr, /* PREINCR */ - incrdecr, /* POSTDECR */ - incrdecr, /* PREDECR */ - nullproc, /* VAR */ - nullproc, /* IVAR */ - getnf, /* VARNF */ - call, /* CALL */ - nullproc, /* NUMBER */ - nullproc, /* STRING */ - nullproc, /* REGEXPR */ - awkgetline, /* GETLINE */ - jump, /* RETURN */ - split, /* SPLIT */ - substr, /* SUBSTR */ - whilestat, /* WHILE */ - cat, /* CAT */ - boolop, /* NOT */ - arith, /* UMINUS */ - arith, /* UPLUS */ - arith, /* POWER */ - nullproc, /* DECR */ - nullproc, /* INCR */ - indirect, /* INDIRECT */ - nullproc, /* LASTTOKEN */ -}; - -const char *tokname(int n) -{ - static char buf[100]; - - if (n < FIRSTTOKEN || n > LASTTOKEN) { - snprintf(buf, sizeof(buf), "token %d", n); - return buf; - } - return printname[n-FIRSTTOKEN]; -} From owner-dev-commits-src-main@freebsd.org Tue Jul 20 05:14:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A02AD664CC6; Tue, 20 Jul 2021 05:14: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 4GTRhq14NKz3LhP; Tue, 20 Jul 2021 05:14:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3186243F7; Tue, 20 Jul 2021 05:14: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 16K5EIuS075473; Tue, 20 Jul 2021 05:14:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K5EIq3075472; Tue, 20 Jul 2021 05:14:18 GMT (envelope-from git) Date: Tue, 20 Jul 2021 05:14:18 GMT Message-Id: <202107200514.16K5EIq3075472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: f22100012776 - main - elf: Remove R_RISCV_[GT]PREL_[IS] relocation defines MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f221000127767d33ea06d3a00e731c0164f9a70f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 05:14:19 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f221000127767d33ea06d3a00e731c0164f9a70f commit f221000127767d33ea06d3a00e731c0164f9a70f Author: Jessica Clarke AuthorDate: 2021-07-20 05:13:43 +0000 Commit: Jessica Clarke CommitDate: 2021-07-20 05:13:43 +0000 elf: Remove R_RISCV_[GT]PREL_[IS] relocation defines These were internal binutils relocations that have no way to be generated in assembly nor will ever be seen in the output, and so should never have been defined in the psABI in the first place. They have therefore been removed from the spec as of [1], so do so here too. [1] https://github.com/riscv/riscv-elf-psabi-doc/commit/44f98e0fd8104def00f2a5a8d94b23dd647d18fb --- sys/sys/elf_common.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 76bda8f71f3b..d362f51ed833 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -1350,10 +1350,6 @@ typedef struct { #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 #define R_RISCV_RVC_LUI 46 -#define R_RISCV_GPREL_I 47 -#define R_RISCV_GPREL_S 48 -#define R_RISCV_TPREL_I 49 -#define R_RISCV_TPREL_S 50 #define R_RISCV_RELAX 51 #define R_RISCV_SUB6 52 #define R_RISCV_SET6 53 From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D0AB666499; Tue, 20 Jul 2021 07:10: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 4GTVGj71X6z3swh; Tue, 20 Jul 2021 07:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA96F25BF0; Tue, 20 Jul 2021 07:10: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 16K7ALoh030034; Tue, 20 Jul 2021 07:10:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7ALxc030026; Tue, 20 Jul 2021 07:10:21 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:21 GMT Message-Id: <202107200710.16K7ALxc030026@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: 815165be201e - main - linux(4): Remove function prototypes from the vDSO. 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: 815165be201e49d118e93dec6c257cd63b69d158 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:22 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=815165be201e49d118e93dec6c257cd63b69d158 commit 815165be201e49d118e93dec6c257cd63b69d158 Author: Dmitry Chagin AuthorDate: 2021-07-20 06:52:08 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 06:52:08 +0000 linux(4): Remove function prototypes from the vDSO. In preparation for vDSO code revision get rid of incomplete vDSO methods from locore, but leave .note.Linux section commented out. .note.Linux section is used by glibc rtld to get the kernel version, that saves one system call call. I'll try to implement it later, if figure out how to use it with jails. MFC after: 2 weeks --- sys/amd64/linux/linux_locore.asm | 26 -------------------------- sys/arm64/linux/linux_locore.asm | 17 ----------------- 2 files changed, 43 deletions(-) diff --git a/sys/amd64/linux/linux_locore.asm b/sys/amd64/linux/linux_locore.asm index 4e358f583a45..dd482cb87cc8 100644 --- a/sys/amd64/linux/linux_locore.asm +++ b/sys/amd64/linux/linux_locore.asm @@ -32,32 +32,6 @@ ENTRY(linux_rt_sigcode) .endrtsigcode: 0: jmp 0b -ENTRY(__vdso_clock_gettime) - movq $LINUX_SYS_linux_clock_gettime,%rax - syscall - ret -.weak clock_gettime -.set clock_gettime, __vdso_clock_gettime - -ENTRY(__vdso_time) - movq $LINUX_SYS_linux_time,%rax - syscall - ret -.weak time -.set time, __vdso_time - -ENTRY(__vdso_gettimeofday) - movq $LINUX_SYS_gettimeofday,%rax - syscall - ret -.weak gettimeofday -.set gettimeofday, __vdso_gettimeofday - -ENTRY(__vdso_getcpu) - movq $-38,%rax /* not implemented */ - ret -.weak getcpu -.set getcpu, __vdso_getcpu #if 0 .section .note.Linux, "a",@note diff --git a/sys/arm64/linux/linux_locore.asm b/sys/arm64/linux/linux_locore.asm index 5f0729b363e8..24a48d74f7b5 100644 --- a/sys/arm64/linux/linux_locore.asm +++ b/sys/arm64/linux/linux_locore.asm @@ -48,20 +48,3 @@ ENTRY(__kernel_rt_sigreturn) brk #0 /* LINUXTODO: implement __kernel_rt_sigreturn */ ret END(__kernel_rt_sigreturn) - -ENTRY(__kernel_gettimeofday) - ldr x8, =LINUX_SYS_gettimeofday - svc #0 - ret -END(__kernel_gettimeofday) - -ENTRY(__kernel_clock_gettime) - ldr x8, =LINUX_SYS_linux_clock_gettime - svc #0 - ret -END(__kernel_clock_gettime) - -ENTRY(__kernel_clock_getres) - brk #0 /* LINUXTODO: implement __kernel_clock_getres */ - ret -END(__kernel_clock_getres) From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D7FA666448; Tue, 20 Jul 2021 07: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 4GTVGl0x0Xz3st5; Tue, 20 Jul 2021 07:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08FF92631D; Tue, 20 Jul 2021 07: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 16K7AMXN030206; Tue, 20 Jul 2021 07:10:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7AMeY030205; Tue, 20 Jul 2021 07:10:22 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:22 GMT Message-Id: <202107200710.16K7AMeY030205@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: 21629e2a4564 - main - Modify exec_sysvec_init() to allow non-native abi to setup their sysentvecs. 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: 21629e2a456446bff101813a16f8cba046f44176 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:23 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=21629e2a456446bff101813a16f8cba046f44176 commit 21629e2a456446bff101813a16f8cba046f44176 Author: Dmitry Chagin AuthorDate: 2021-07-20 06:53:21 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 06:53:21 +0000 Modify exec_sysvec_init() to allow non-native abi to setup their sysentvecs. For future use in the Linux emulation layer modify the exec_sysvec_init() to allow non-native abi to fill sv_timekeep_base and sv_shared_page_obj. Reviewed by: kib Differential revision: https://reviews.freebsd.org/D30898 MFC after: 2 weeks --- sys/kern/kern_sharedpage.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_sharedpage.c b/sys/kern/kern_sharedpage.c index 6f14117abf39..335f49b7a9f6 100644 --- a/sys/kern/kern_sharedpage.c +++ b/sys/kern/kern_sharedpage.c @@ -308,27 +308,43 @@ exec_sysvec_init(void *param) #ifdef RANDOM_FENESTRASX ptrdiff_t base; #endif + u_int flags; sv = (struct sysentvec *)param; - if ((sv->sv_flags & SV_SHP) == 0) + flags = sv->sv_flags; + if ((flags & SV_SHP) == 0) return; + MPASS(sv->sv_shared_page_obj == NULL); + MPASS(sv->sv_shared_page_base != 0); + sv->sv_shared_page_obj = shared_page_obj; - sv->sv_sigcode_base = sv->sv_shared_page_base + - shared_page_fill(*(sv->sv_szsigcode), 16, sv->sv_sigcode); - if ((sv->sv_flags & SV_ABI_MASK) != SV_ABI_FREEBSD) - return; - if ((sv->sv_flags & SV_TIMEKEEP) != 0) { + if ((flags & SV_ABI_MASK) == SV_ABI_FREEBSD) { + sv->sv_sigcode_base = sv->sv_shared_page_base + + shared_page_fill(*(sv->sv_szsigcode), 16, sv->sv_sigcode); + } + if ((flags & SV_TIMEKEEP) != 0) { #ifdef COMPAT_FREEBSD32 - if ((sv->sv_flags & SV_ILP32) != 0) { - KASSERT(compat32_svtk == NULL, - ("Compat32 already registered")); - compat32_svtk = alloc_sv_tk_compat32(); + if ((flags & SV_ILP32) != 0) { + if ((flags & SV_ABI_MASK) == SV_ABI_FREEBSD) { + KASSERT(compat32_svtk == NULL, + ("Compat32 already registered")); + compat32_svtk = alloc_sv_tk_compat32(); + } else { + KASSERT(compat32_svtk != NULL, + ("Compat32 not registered")); + } sv->sv_timekeep_base = sv->sv_shared_page_base + compat32_svtk->sv_timekeep_off; } else { #endif - KASSERT(host_svtk == NULL, ("Host already registered")); - host_svtk = alloc_sv_tk(); + if ((flags & SV_ABI_MASK) == SV_ABI_FREEBSD) { + KASSERT(host_svtk == NULL, + ("Host already registered")); + host_svtk = alloc_sv_tk(); + } else { + KASSERT(host_svtk != NULL, + ("Host not registered")); + } sv->sv_timekeep_base = sv->sv_shared_page_base + host_svtk->sv_timekeep_off; #ifdef COMPAT_FREEBSD32 @@ -336,7 +352,8 @@ exec_sysvec_init(void *param) #endif } #ifdef RANDOM_FENESTRASX - if ((sv->sv_flags & SV_RNG_SEED_VER) != 0) { + if ((flags & (SV_ABI_MASK | SV_RNG_SEED_VER)) == + (SV_ABI_FREEBSD | SV_RNG_SEED_VER)) { /* * Only allocate a single VDSO entry for multiple sysentvecs, * i.e., native and COMPAT32. From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD3346665E4; Tue, 20 Jul 2021 07:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTVGm2P3Xz3sqY; Tue, 20 Jul 2021 07:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F0E12628B; Tue, 20 Jul 2021 07:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K7AO6b030230; Tue, 20 Jul 2021 07:10:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7AONP030229; Tue, 20 Jul 2021 07:10:24 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:24 GMT Message-Id: <202107200710.16K7AONP030229@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: b39fa4770dd1 - main - Remove bogus cast from exec_sysvec_init(). 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: b39fa4770dd19ff32b2d70622521135dd384c7c1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:24 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b39fa4770dd19ff32b2d70622521135dd384c7c1 commit b39fa4770dd19ff32b2d70622521135dd384c7c1 Author: Dmitry Chagin AuthorDate: 2021-07-20 06:54:09 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 06:54:09 +0000 Remove bogus cast from exec_sysvec_init(). Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D30910 MFC after: 2 weeks --- sys/kern/kern_sharedpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_sharedpage.c b/sys/kern/kern_sharedpage.c index 335f49b7a9f6..e47fbbe62bb7 100644 --- a/sys/kern/kern_sharedpage.c +++ b/sys/kern/kern_sharedpage.c @@ -310,7 +310,7 @@ exec_sysvec_init(void *param) #endif u_int flags; - sv = (struct sysentvec *)param; + sv = param; flags = sv->sv_flags; if ((flags & SV_SHP) == 0) return; From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD8D866613C; Tue, 20 Jul 2021 07:10: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 4GTVGn4PSRz3st8; Tue, 20 Jul 2021 07:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54E4225BF1; Tue, 20 Jul 2021 07:10: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 16K7APPe030260; Tue, 20 Jul 2021 07:10:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7APcq030259; Tue, 20 Jul 2021 07:10:25 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:25 GMT Message-Id: <202107200710.16K7APcq030259@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: 62ba4cd34067 - main - Call sv_onexec hook after the process VA is created. 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: 62ba4cd340670e901fbaab98766bd5490b4334bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:25 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=62ba4cd340670e901fbaab98766bd5490b4334bd commit 62ba4cd340670e901fbaab98766bd5490b4334bd Author: Dmitry Chagin AuthorDate: 2021-07-20 06:55:14 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 06:55:14 +0000 Call sv_onexec hook after the process VA is created. For future use in the Linux emulation layer call sv_onexec hook right after the new process address space is created. It's safe, as sv_onexec used only by Linux abi and linux_on_exec() does not depend on a state of process VA. Reviewed by: kib Differential revision: https://reviews.freebsd.org/D30899 MFC after: 2 weeks --- sys/kern/kern_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index edb4ad1af3c1..eff48b2c86f3 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1072,8 +1072,6 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) if (p->p_sysent->sv_onexec_old != NULL) p->p_sysent->sv_onexec_old(td); itimers_exec(p); - if (sv->sv_onexec != NULL) - sv->sv_onexec(p, imgp); EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); @@ -1165,6 +1163,8 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) vmspace->vm_ssize = sgrowsiz >> PAGE_SHIFT; vmspace->vm_maxsaddr = (char *)stack_addr; + if (sv->sv_onexec != NULL) + sv->sv_onexec(p, imgp); return (0); } From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C59F66664B0; Tue, 20 Jul 2021 07:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTVGp4XgQz3tBk; Tue, 20 Jul 2021 07:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71EFD26387; Tue, 20 Jul 2021 07:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K7AQnB030285; Tue, 20 Jul 2021 07:10:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7AQZS030284; Tue, 20 Jul 2021 07:10:26 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:26 GMT Message-Id: <202107200710.16K7AQZS030284@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: 5fd9cd53d256 - main - linux(4): Modify sv_onexec hook to return an error. 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: 5fd9cd53d256e08c601548c425bfcb3472f2d09b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:27 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=5fd9cd53d256e08c601548c425bfcb3472f2d09b commit 5fd9cd53d256e08c601548c425bfcb3472f2d09b Author: Dmitry Chagin AuthorDate: 2021-07-20 06:56:25 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 06:56:25 +0000 linux(4): Modify sv_onexec hook to return an error. Temporary add stubs to the Linux emulation layer which calls the existing hook. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D30911 MFC after: 2 weeks --- sys/amd64/linux/linux_sysvec.c | 12 +++++++++++- sys/amd64/linux32/linux32_sysvec.c | 12 +++++++++++- sys/arm64/linux/linux_sysvec.c | 12 +++++++++++- sys/i386/linux/linux_sysvec.c | 14 ++++++++++++-- sys/kern/kern_exec.c | 4 +--- sys/sys/sysent.h | 2 +- 6 files changed, 47 insertions(+), 9 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 566af6de29e7..2d3406582a33 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -106,6 +106,8 @@ static void linux_set_syscall_retval(struct thread *td, int error); static int linux_fetch_syscall_args(struct thread *td); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack); +static int linux_on_exec_vmspace(struct proc *p, + struct image_params *imgp); static int linux_vsyscall(struct thread *td); #define LINUX_T_UNKNOWN 255 @@ -766,12 +768,20 @@ struct sysentvec elf_linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = linux_vsyscall, - .sv_onexec = linux_on_exec, + .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, .sv_setid_allowed = &linux_setid_allowed_query, }; +static int +linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) +{ + + linux_on_exec(p, imgp); + return (0); +} + static void linux_vdso_install(void *param) { diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 7dfd57a74a1e..90b6207a50c9 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -111,6 +111,8 @@ static int linux_copyout_strings(struct image_params *imgp, static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack); +static int linux_on_exec_vmspace(struct proc *p, + struct image_params *imgp); static void linux32_fixlimit(struct rlimit *rl, int which); static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); @@ -938,12 +940,20 @@ struct sysentvec elf_linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = NULL, - .sv_onexec = linux_on_exec, + .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, .sv_setid_allowed = &linux_setid_allowed_query, }; +static int +linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) +{ + + linux_on_exec(p, imgp); + return (0); +} + static void linux_vdso_install(void *param) { diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index e684fb604889..706b97894f9c 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -86,6 +86,8 @@ static void linux_set_syscall_retval(struct thread *td, int error); static int linux_fetch_syscall_args(struct thread *td); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack); +static int linux_on_exec_vmspace(struct proc *p, + struct image_params *imgp); /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); @@ -433,12 +435,20 @@ struct sysentvec elf_linux_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf_hwcap, .sv_hwcap2 = &elf_hwcap2, - .sv_onexec = linux_on_exec, + .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, .sv_setid_allowed = &linux_setid_allowed_query, }; +static int +linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) +{ + + linux_on_exec(p, imgp); + return (0); +} + static void linux_vdso_install(const void *param) { diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index a0959d55b585..048bc6dffdca 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -94,6 +94,8 @@ static int linux_fixup_elf(uintptr_t *stack_base, static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack); +static int linux_on_exec_vmspace(struct proc *p, + struct image_params *imgp); static int linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base); static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); @@ -838,7 +840,7 @@ struct sysentvec linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = NULL, - .sv_onexec = linux_on_exec, + .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, .sv_setid_allowed = &linux_setid_allowed_query, @@ -880,12 +882,20 @@ struct sysentvec elf_linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = NULL, - .sv_onexec = linux_on_exec, + .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, .sv_setid_allowed = &linux_setid_allowed_query, }; +static int +linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) +{ + + linux_on_exec(p, imgp); + return (0); +} + static void linux_vdso_install(void *param) { diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index eff48b2c86f3..e5944bfc5ac6 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1163,9 +1163,7 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) vmspace->vm_ssize = sgrowsiz >> PAGE_SHIFT; vmspace->vm_maxsaddr = (char *)stack_addr; - if (sv->sv_onexec != NULL) - sv->sv_onexec(p, imgp); - return (0); + return (sv->sv_onexec != NULL ? sv->sv_onexec(p, imgp) : 0); } /* diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index f0bb084d59dc..1b43e9692153 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -151,7 +151,7 @@ struct sysentvec { const char *(*sv_machine_arch)(struct proc *); vm_offset_t sv_fxrng_gen_base; void (*sv_onexec_old)(struct thread *td); - void (*sv_onexec)(struct proc *, struct image_params *); + int (*sv_onexec)(struct proc *, struct image_params *); void (*sv_onexit)(struct proc *); void (*sv_ontdexit)(struct thread *td); int (*sv_setid_allowed)(struct thread *td, From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F0FD6665F3; Tue, 20 Jul 2021 07:10: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 4GTVGs1BMJz3sx6; Tue, 20 Jul 2021 07:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADFA52631E; Tue, 20 Jul 2021 07:10: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 16K7ASCi030333; Tue, 20 Jul 2021 07:10:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7ASDN030332; Tue, 20 Jul 2021 07:10:28 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:28 GMT Message-Id: <202107200710.16K7ASDN030332@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: a543556c8128 - main - linux(4): Constify vdso install/deinstall. 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: a543556c8128c52fb044250b8f52f9702c81788d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:29 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=a543556c8128c52fb044250b8f52f9702c81788d commit a543556c8128c52fb044250b8f52f9702c81788d Author: Dmitry Chagin AuthorDate: 2021-07-20 07:01:47 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 07:01:47 +0000 linux(4): Constify vdso install/deinstall. In order to reduce diff between arches constify vdso install/deinstall functions like arm64. Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D30901 MFC after: 2 weeks --- sys/amd64/linux/linux_sysvec.c | 8 ++++---- sys/amd64/linux32/linux32_sysvec.c | 8 ++++---- sys/i386/linux/linux_sysvec.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 7be7411a960a..999f22a410ab 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -115,8 +115,8 @@ static int linux_copyout_strings(struct image_params *imgp, static int linux_fixup_elf(uintptr_t *stack_base, struct image_params *iparams); static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); -static void linux_vdso_install(void *param); -static void linux_vdso_deinstall(void *param); +static void linux_vdso_install(const void *param); +static void linux_vdso_deinstall(const void *param); static void linux_vdso_reloc(char *mapping, Elf_Addr offset); static void linux_set_syscall_retval(struct thread *td, int error); static int linux_fetch_syscall_args(struct thread *td); @@ -830,7 +830,7 @@ SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC, SI_ORDER_ANY, linux_exec_sysvec_init, &elf_linux_sysvec); static void -linux_vdso_install(void *param) +linux_vdso_install(const void *param) { char *vdso_start = &_binary_linux_vdso_so_o_start; char *vdso_end = &_binary_linux_vdso_so_o_end; @@ -854,7 +854,7 @@ SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_install, NULL); static void -linux_vdso_deinstall(void *param) +linux_vdso_deinstall(const void *param) { __elfN(linux_shared_page_fini)(linux_vdso_obj, diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 165eb7b2a1d2..720df298b670 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -125,8 +125,8 @@ static int linux_on_exec_vmspace(struct proc *p, struct image_params *imgp); static void linux32_fixlimit(struct rlimit *rl, int which); static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); -static void linux_vdso_install(void *param); -static void linux_vdso_deinstall(void *param); +static void linux_vdso_install(const void *param); +static void linux_vdso_deinstall(const void *param); static void linux_vdso_reloc(char *mapping, Elf_Addr offset); static void linux32_set_syscall_retval(struct thread *td, int error); @@ -995,7 +995,7 @@ SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC, SI_ORDER_ANY, linux_exec_sysvec_init, &elf_linux_sysvec); static void -linux_vdso_install(void *param) +linux_vdso_install(const void *param) { char *vdso_start = &_binary_linux32_vdso_so_o_start; char *vdso_end = &_binary_linux32_vdso_so_o_end; @@ -1017,7 +1017,7 @@ SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_install, NULL); static void -linux_vdso_deinstall(void *param) +linux_vdso_deinstall(const void *param) { __elfN(linux_shared_page_fini)(linux_vdso_obj, diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index f630a0e1f659..833819101ed0 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -111,8 +111,8 @@ static int linux_on_exec_vmspace(struct proc *p, static int linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base); static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); -static void linux_vdso_install(void *param); -static void linux_vdso_deinstall(void *param); +static void linux_vdso_install(const void *param); +static void linux_vdso_deinstall(const void *param); static void linux_vdso_reloc(char *mapping, Elf_Addr offset); #define LINUX_T_UNKNOWN 255 @@ -940,7 +940,7 @@ SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC, SI_ORDER_ANY, linux_exec_sysvec_init, &elf_linux_sysvec); static void -linux_vdso_install(void *param) +linux_vdso_install(const void *param) { char *vdso_start = &_binary_linux_vdso_so_o_start; char *vdso_end = &_binary_linux_vdso_so_o_end; @@ -962,7 +962,7 @@ SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_install, NULL); static void -linux_vdso_deinstall(void *param) +linux_vdso_deinstall(const void *param) { __elfN(linux_shared_page_fini)(linux_vdso_obj, From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F613666155; Tue, 20 Jul 2021 07:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTVGt2fqzz3tC5; Tue, 20 Jul 2021 07:10:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D05C025E61; Tue, 20 Jul 2021 07:10:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K7ATFL030357; Tue, 20 Jul 2021 07:10:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7AT9U030356; Tue, 20 Jul 2021 07:10:29 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:29 GMT Message-Id: <202107200710.16K7AT9U030356@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: 09cffde975b8 - main - linux(4): Fixup the vDSO initialization order. 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: 09cffde975b87b293457c9a228cb980ec729384a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:31 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=09cffde975b87b293457c9a228cb980ec729384a commit 09cffde975b87b293457c9a228cb980ec729384a Author: Dmitry Chagin AuthorDate: 2021-07-20 07:02:34 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 07:02:34 +0000 linux(4): Fixup the vDSO initialization order. The vDSO initialisation order should be as follows: - native abi init via exec_sysvec_init(); - vDSO symbols queued to the linux_vdso_syms list; - linux_vdso_install(); - linux_exec_sysvec_init(); As the exec_sysvec_init() called with SI_ORDER_ANY (last) at SI_SUB_EXEC order, move linux_vdso_install() and linux_exec_sysvec_init() to the SI_SUB_EXEC+1 order. Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D30902 MFC after 2 weeks --- sys/amd64/linux/linux_sysvec.c | 8 ++++++-- sys/amd64/linux32/linux32_sysvec.c | 8 ++++++-- sys/arm64/linux/linux_sysvec.c | 8 ++++++-- sys/i386/linux/linux_sysvec.c | 13 +++++++++++-- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 999f22a410ab..2a429f323682 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -804,6 +804,10 @@ linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) return (error); } +/* + * linux_vdso_install() and linux_exec_sysvec_init() must be called + * after exec_sysvec_init() which is SI_SUB_EXEC (SI_ORDER_ANY). + */ static void linux_exec_sysvec_init(void *param) { @@ -826,7 +830,7 @@ linux_exec_sysvec_init(void *param) if (bootverbose) printf("Linux x86-64 vDSO tsc_selector: %lu\n", *ktsc_selector); } -SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC + 1, SI_ORDER_ANY, linux_exec_sysvec_init, &elf_linux_sysvec); static void @@ -850,7 +854,7 @@ linux_vdso_install(const void *param) linux_vdso_reloc(linux_vdso_mapping, linux_vdso_base); } -SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_FIRST, +SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC + 1, SI_ORDER_FIRST, linux_vdso_install, NULL); static void diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 720df298b670..38b777fb5629 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -970,6 +970,10 @@ linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) return (error); } +/* + * linux_vdso_install() and linux_exec_sysvec_init() must be called + * after exec_sysvec_init() which is SI_SUB_EXEC (SI_ORDER_ANY). + */ static void linux_exec_sysvec_init(void *param) { @@ -991,7 +995,7 @@ linux_exec_sysvec_init(void *param) if (bootverbose) printf("Linux i386 vDSO tsc_selector: %u\n", *ktsc_selector); } -SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC + 1, SI_ORDER_ANY, linux_exec_sysvec_init, &elf_linux_sysvec); static void @@ -1013,7 +1017,7 @@ linux_vdso_install(const void *param) linux_vdso_reloc(linux_vdso_mapping, linux_vdso_base); } -SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_FIRST, +SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC + 1, SI_ORDER_FIRST, linux_vdso_install, NULL); static void diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 1d467540fd36..247b6dc9fa3b 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -476,6 +476,10 @@ linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) return (error); } +/* + * linux_vdso_install() and linux_exec_sysvec_init() must be called + * after exec_sysvec_init() which is SI_SUB_EXEC (SI_ORDER_ANY). + */ static void linux_exec_sysvec_init(void *param) { @@ -491,7 +495,7 @@ linux_exec_sysvec_init(void *param) ktimekeep_base = (l_uintptr_t *)(linux_vdso_mapping + tkoff); *ktimekeep_base = sv->sv_timekeep_base; } -SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC + 1, SI_ORDER_ANY, linux_exec_sysvec_init, &elf_linux_sysvec); static void @@ -513,7 +517,7 @@ linux_vdso_install(const void *param) linux_vdso_reloc(linux_vdso_mapping, linux_vdso_base); } -SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_FIRST, +SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC + 1, SI_ORDER_FIRST, linux_vdso_install, NULL); static void diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 833819101ed0..f3101db96d41 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -915,6 +915,10 @@ linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) return (error); } +/* + * linux_vdso_install() and linux_exec_sysvec_init() must be called + * after exec_sysvec_init() which is SI_SUB_EXEC (SI_ORDER_ANY). + */ static void linux_exec_sysvec_init(void *param) { @@ -936,7 +940,7 @@ linux_exec_sysvec_init(void *param) if (bootverbose) printf("Linux i386 vDSO tsc_selector: %u\n", *ktsc_selector); } -SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC + 1, SI_ORDER_ANY, linux_exec_sysvec_init, &elf_linux_sysvec); static void @@ -958,7 +962,7 @@ linux_vdso_install(const void *param) linux_vdso_reloc(linux_vdso_mapping, linux_vdso_base); } -SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_FIRST, +SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC + 1, SI_ORDER_FIRST, linux_vdso_install, NULL); static void @@ -1169,3 +1173,8 @@ static moduledata_t linux_elf_mod = { DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); FEATURE(linux, "Linux 32bit support"); + +/* + * linux_vdso_install() and linux_exec_sysvec_init() must be called + * after exec_sysvec_init() which is SI_SUB_EXEC (SI_ORDER_ANY). + */ From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56CD5666146; Tue, 20 Jul 2021 07:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTVGq5Zd1z3t8W; Tue, 20 Jul 2021 07:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9716126388; Tue, 20 Jul 2021 07:10: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 16K7ARbM030309; Tue, 20 Jul 2021 07:10:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7ARbM030308; Tue, 20 Jul 2021 07:10:27 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:27 GMT Message-Id: <202107200710.16K7ARbM030308@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: 9931033bbfbe - main - linux(4); Almost complete the vDSO. 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: 9931033bbfbe56a037723638cf3712366c6d943f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:28 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=9931033bbfbe56a037723638cf3712366c6d943f commit 9931033bbfbe56a037723638cf3712366c6d943f Author: Dmitry Chagin AuthorDate: 2021-07-20 07:01:18 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 07:01:18 +0000 linux(4); Almost complete the vDSO. The vDSO (virtual dynamic shared object) is a small shared library that the kernel maps R/O into the address space of all Linux processes on image activation. The vDSO is a fully formed ELF image, shared by all processes with the same ABI, has no process private data. The primary purpose of the vDSO: - non-executable stack, signal trampolines not copied to the stack; - signal trampolines unwind, mandatory for the NPTL; - to avoid contex-switch overhead frequently used system calls can be implemented in the vDSO: for now gettimeofday, clock_gettime. The first two have been implemented, so add the implementation of system calls. System calls implemenation based on a native timekeeping code with some limitations: - ifunc can't be used, as vDSO r/o mapped to the process VA and rtld can't relocate symbols; - reading HPET memory is not implemented for now (TODO). In case on any error vDSO system calls fallback to the kernel system calls. For unimplemented vDSO system calls added prototypes which call corresponding kernel system call. Tested by: trasz (arm64) Differential revision: https://reviews.freebsd.org/D30900 MFC after: 2 weeks --- sys/amd64/linux/linux_sysvec.c | 161 ++++++++++--- sys/amd64/linux/linux_vdso.lds.s | 12 +- sys/amd64/linux/linux_vdso_gtod.c | 146 ++++++++++++ sys/amd64/linux32/linux32_locore.asm | 6 +- sys/amd64/linux32/linux32_sysvec.c | 158 ++++++++++--- sys/amd64/linux32/linux32_vdso.lds.s | 24 +- sys/amd64/linux32/linux32_vdso_gtod.c | 146 ++++++++++++ sys/arm64/linux/linux_sysvec.c | 154 ++++++++++--- sys/arm64/linux/linux_vdso.lds.s | 65 +++++- sys/arm64/linux/linux_vdso_gtod.c | 153 +++++++++++++ sys/compat/linux/linux_vdso.c | 210 ++++++----------- sys/compat/linux/linux_vdso.h | 10 +- sys/compat/linux/linux_vdso_gtod.inc | 337 ++++++++++++++++++++++++++++ sys/i386/linux/linux.h | 3 - sys/i386/linux/linux_locore.asm | 6 +- sys/i386/linux/linux_sysvec.c | 161 ++++++++++--- sys/i386/linux/linux_vdso.lds.s | 25 ++- sys/i386/linux/linux_vdso_gtod.c | 145 ++++++++++++ sys/modules/linux/Makefile | 60 +++-- sys/modules/linux64/Makefile | 49 ++-- sys/x86/linux/linux_vdso_gettc_x86.inc | 164 ++++++++++++++ sys/x86/linux/linux_vdso_tsc_selector_x86.c | 57 +++++ sys/x86/linux/linux_x86.h | 33 +++ 23 files changed, 1956 insertions(+), 329 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 2d3406582a33..7be7411a960a 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -72,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -85,11 +87,24 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux64, 1); +#define LINUX_VDSOPAGE_SIZE PAGE_SIZE * 2 +#define LINUX_VDSOPAGE_LA48 (VM_MAXUSER_ADDRESS_LA48 - \ + LINUX_VDSOPAGE_SIZE) +#define LINUX_SHAREDPAGE_LA48 (LINUX_VDSOPAGE_LA48 - PAGE_SIZE) + /* + * PAGE_SIZE - the size + * of the native SHAREDPAGE + */ +#define LINUX_USRSTACK_LA48 LINUX_SHAREDPAGE_LA48 +#define LINUX_PS_STRINGS_LA48 (LINUX_USRSTACK_LA48 - \ + sizeof(struct ps_strings)) + static int linux_szsigcode; -static vm_object_t linux_shared_page_obj; -static char *linux_shared_page_mapping; -extern char _binary_linux_locore_o_start; -extern char _binary_linux_locore_o_end; +static vm_object_t linux_vdso_obj; +static char *linux_vdso_mapping; +extern char _binary_linux_vdso_so_o_start; +extern char _binary_linux_vdso_so_o_end; +static vm_offset_t linux_vdso_base; extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; @@ -102,10 +117,12 @@ static int linux_fixup_elf(uintptr_t *stack_base, static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); +static void linux_vdso_reloc(char *mapping, Elf_Addr offset); static void linux_set_syscall_retval(struct thread *td, int error); static int linux_fetch_syscall_args(struct thread *td); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack); +static void linux_exec_sysvec_init(void *param); static int linux_on_exec_vmspace(struct proc *p, struct image_params *imgp); static int linux_vsyscall(struct thread *td); @@ -151,6 +168,8 @@ static int _bsd_to_linux_trapcode[] = { LINUX_VDSO_SYM_INTPTR(linux_rt_sigcode); LINUX_VDSO_SYM_CHAR(linux_platform); +LINUX_VDSO_SYM_INTPTR(kern_timekeep_base); +LINUX_VDSO_SYM_INTPTR(kern_tsc_selector); /* * If FreeBSD & Linux have a difference of opinion about what a trap @@ -264,8 +283,7 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) M_WAITOK | M_ZERO); issetugid = p->p_flag & P_SUGID ? 1 : 0; - AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR, - imgp->proc->p_sysent->sv_shared_page_base); + AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR, linux_vdso_base); AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature); AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz); AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, stclohz); @@ -739,7 +757,7 @@ struct sysentvec elf_linux_sysvec = { .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_rt_sendsig, - .sv_sigcode = &_binary_linux_locore_o_start, + .sv_sigcode = &_binary_linux_vdso_so_o_start, .sv_szsigcode = &linux_szsigcode, .sv_name = "Linux ELF64", .sv_coredump = elf64_coredump, @@ -750,8 +768,8 @@ struct sysentvec elf_linux_sysvec = { .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS_LA48, - .sv_usrstack = USRSTACK_LA48, - .sv_psstrings = PS_STRINGS_LA48, + .sv_usrstack = LINUX_USRSTACK_LA48, + .sv_psstrings = LINUX_PS_STRINGS_LA48, .sv_stackprot = VM_PROT_ALL, .sv_copyout_auxargs = linux_copyout_auxargs, .sv_copyout_strings = linux_copyout_strings, @@ -759,11 +777,11 @@ struct sysentvec elf_linux_sysvec = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_LINUX | SV_LP64 | SV_SHP | SV_SIG_DISCIGN | - SV_SIG_WAITNDQ, + SV_SIG_WAITNDQ | SV_TIMEKEEP, .sv_set_syscall_retval = linux_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, - .sv_shared_page_base = SHAREDPAGE_LA48, + .sv_shared_page_base = LINUX_SHAREDPAGE_LA48, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, @@ -777,47 +795,130 @@ struct sysentvec elf_linux_sysvec = { static int linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) { + int error; - linux_on_exec(p, imgp); - return (0); + error = linux_map_vdso(p, linux_vdso_obj, linux_vdso_base, + LINUX_VDSOPAGE_SIZE, imgp); + if (error == 0) + linux_on_exec(p, imgp); + return (error); } static void -linux_vdso_install(void *param) +linux_exec_sysvec_init(void *param) { + l_uintptr_t *ktimekeep_base, *ktsc_selector; + struct sysentvec *sv; + ptrdiff_t tkoff; + + sv = param; + amd64_lower_shared_page(sv); + /* Fill timekeep_base */ + exec_sysvec_init(sv); + + tkoff = kern_timekeep_base - linux_vdso_base; + ktimekeep_base = (l_uintptr_t *)(linux_vdso_mapping + tkoff); + *ktimekeep_base = sv->sv_timekeep_base; + + tkoff = kern_tsc_selector - linux_vdso_base; + ktsc_selector = (l_uintptr_t *)(linux_vdso_mapping + tkoff); + *ktsc_selector = linux_vdso_tsc_selector_idx(); + if (bootverbose) + printf("Linux x86-64 vDSO tsc_selector: %lu\n", *ktsc_selector); +} +SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC, SI_ORDER_ANY, + linux_exec_sysvec_init, &elf_linux_sysvec); - amd64_lower_shared_page(&elf_linux_sysvec); - - linux_szsigcode = (&_binary_linux_locore_o_end - - &_binary_linux_locore_o_start); +static void +linux_vdso_install(void *param) +{ + char *vdso_start = &_binary_linux_vdso_so_o_start; + char *vdso_end = &_binary_linux_vdso_so_o_end; - if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) - panic("Linux invalid vdso size\n"); + linux_szsigcode = vdso_end - vdso_start; + MPASS(linux_szsigcode <= LINUX_VDSOPAGE_SIZE); - __elfN(linux_vdso_fixup)(&elf_linux_sysvec); + linux_vdso_base = LINUX_VDSOPAGE_LA48; + if (hw_lower_amd64_sharedpage != 0) + linux_vdso_base -= PAGE_SIZE; - linux_shared_page_obj = __elfN(linux_shared_page_init) - (&linux_shared_page_mapping); + __elfN(linux_vdso_fixup)(vdso_start, linux_vdso_base); - __elfN(linux_vdso_reloc)(&elf_linux_sysvec); + linux_vdso_obj = __elfN(linux_shared_page_init) + (&linux_vdso_mapping, LINUX_VDSOPAGE_SIZE); + bcopy(vdso_start, linux_vdso_mapping, linux_szsigcode); - bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, - linux_szsigcode); - elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; + linux_vdso_reloc(linux_vdso_mapping, linux_vdso_base); } -SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_install, NULL); static void linux_vdso_deinstall(void *param) { - __elfN(linux_shared_page_fini)(linux_shared_page_obj, - linux_shared_page_mapping); + __elfN(linux_shared_page_fini)(linux_vdso_obj, + linux_vdso_mapping, LINUX_VDSOPAGE_SIZE); } SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_deinstall, NULL); +static void +linux_vdso_reloc(char *mapping, Elf_Addr offset) +{ + const Elf_Ehdr *ehdr; + const Elf_Shdr *shdr; + Elf64_Addr *where, val; + Elf_Size rtype, symidx; + const Elf_Rela *rela; + Elf_Addr addr, addend; + int relacnt; + int i, j; + + MPASS(offset != 0); + + relacnt = 0; + ehdr = (const Elf_Ehdr *)mapping; + shdr = (const Elf_Shdr *)(mapping + ehdr->e_shoff); + for (i = 0; i < ehdr->e_shnum; i++) + { + switch (shdr[i].sh_type) { + case SHT_REL: + printf("Linux x86_64 vDSO: unexpected Rel section\n"); + break; + case SHT_RELA: + rela = (const Elf_Rela *)(mapping + shdr[i].sh_offset); + relacnt = shdr[i].sh_size / sizeof(*rela); + } + } + + for (j = 0; j < relacnt; j++, rela++) { + where = (Elf_Addr *)(mapping + rela->r_offset); + addend = rela->r_addend; + rtype = ELF_R_TYPE(rela->r_info); + symidx = ELF_R_SYM(rela->r_info); + + switch (rtype) { + case R_X86_64_NONE: /* none */ + break; + + case R_X86_64_RELATIVE: /* B + A */ + addr = (Elf_Addr)(offset + addend); + val = addr; + if (*where != val) + *where = val; + break; + case R_X86_64_IRELATIVE: + printf("Linux x86_64 vDSO: unexpected ifunc relocation, " + "symbol index %ld\n", symidx); + break; + default: + printf("Linux x86_64 vDSO: unexpected relocation type %ld, " + "symbol index %ld\n", rtype, symidx); + } + } +} + static char GNULINUX_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; diff --git a/sys/amd64/linux/linux_vdso.lds.s b/sys/amd64/linux/linux_vdso.lds.s index 94f0266095fb..ccf7c80565bb 100644 --- a/sys/amd64/linux/linux_vdso.lds.s +++ b/sys/amd64/linux/linux_vdso.lds.s @@ -54,16 +54,20 @@ VERSION { LINUX_2.6 { global: - time; __vdso_time; - gettimeofday; __vdso_gettimeofday; - getcpu; __vdso_getcpu; - clock_gettime; __vdso_clock_gettime; + __vdso_clock_getres; + local: *; + }; + + LINUX_0.0 { + global: linux_rt_sigcode; linux_platform; + kern_timekeep_base; + kern_tsc_selector; local: *; }; } diff --git a/sys/amd64/linux/linux_vdso_gtod.c b/sys/amd64/linux/linux_vdso_gtod.c new file mode 100644 index 000000000000..ad23dc33575a --- /dev/null +++ b/sys/amd64/linux/linux_vdso_gtod.c @@ -0,0 +1,146 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Dmitry Chagin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#define _KERNEL +#include +#undef _KERNEL +#include +#include + +#include +#include + +#include +#include +#include +#include + +/* The kernel fixup this at vDSO install */ +uintptr_t *kern_timekeep_base = NULL; +uint32_t kern_tsc_selector = 0; + +#include + +/* for debug purpose */ +static int +write(int fd, const void *buf, size_t size) +{ + int res; + + __asm__ __volatile__ + ( + "syscall" + : "=a"(res) + : "a"(LINUX_SYS_write), "D"(fd), "S"(buf), "d"(size) + : "cc", "rcx", "r11", "memory" + ); + return (res); +} + +static int +__vdso_clock_gettime_fallback(clockid_t clock_id, struct l_timespec *ts) +{ + int res; + + __asm__ __volatile__ + ( + "syscall" + : "=a"(res) + : "a"(LINUX_SYS_linux_clock_gettime), "D"(clock_id), "S"(ts) + : "cc", "rcx", "r11", "memory" + ); + return (res); +} + +static int +__vdso_gettimeofday_fallback(l_timeval *tv, struct timezone *tz) +{ + int res; + + __asm__ __volatile__ + ( + "syscall" + : "=a"(res) + : "a"(LINUX_SYS_gettimeofday), "D"(tv), "S"(tz) + : "cc", "rcx", "r11", "memory" + ); + return (res); +} + +static int +__vdso_clock_getres_fallback(clockid_t clock_id, struct l_timespec *ts) +{ + int res; + + __asm__ __volatile__ + ( + "syscall" + : "=a"(res) + : "a"(LINUX_SYS_linux_clock_getres), "D"(clock_id), "S"(ts) + : "cc", "rcx", "r11", "memory" + ); + return (res); +} + +static int +__vdso_getcpu_fallback(uint32_t *cpu, uint32_t *node, void *cache) +{ + int res; + + __asm__ __volatile__ + ( + "syscall" + : "=a"(res) + : "a"(LINUX_SYS_linux_getcpu), "D"(cpu), "S"(node), "d"(cache) + : "cc", "rcx", "r11", "memory" + ); + return (res); +} + +static int +__vdso_time_fallback(long *tm) +{ + int res; + + __asm__ __volatile__ + ( + "syscall" + : "=a"(res) + : "a"(LINUX_SYS_linux_time), "D"(tm) + : "cc", "rcx", "r11", "memory" + ); + return (res); +} + +#include diff --git a/sys/amd64/linux32/linux32_locore.asm b/sys/amd64/linux32/linux32_locore.asm index 7dbde5a2c854..f96b3e730f9f 100644 --- a/sys/amd64/linux32/linux32_locore.asm +++ b/sys/amd64/linux32/linux32_locore.asm @@ -18,7 +18,7 @@ linux_platform: * To avoid excess stack frame the signal trampoline code emulates * the 'call' instruction. */ -ENTRY(linux32_sigcode) +ENTRY(__kernel_sigreturn) movl %esp, %ebx /* preserve sigframe */ call .getip0 .getip0: @@ -33,7 +33,7 @@ ENTRY(linux32_sigcode) .endsigcode: 0: jmp 0b -ENTRY(linux32_rt_sigcode) +ENTRY(__kernel_rt_sigreturn) leal LINUX_RT_SIGF_UC(%esp),%ebx /* linux ucp */ leal LINUX_RT_SIGF_SC(%ebx),%ecx /* linux sigcontext */ movl %esp, %edi @@ -49,7 +49,7 @@ ENTRY(linux32_rt_sigcode) .endrtsigcode: 0: jmp 0b -ENTRY(linux32_vsyscall) +ENTRY(__kernel_vsyscall) .startvsyscall: int $0x80 ret diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 90b6207a50c9..165eb7b2a1d2 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -78,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -91,14 +93,21 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux, 1); #define LINUX32_MAXUSER ((1ul << 32) - PAGE_SIZE) -#define LINUX32_SHAREDPAGE (LINUX32_MAXUSER - PAGE_SIZE) +#define LINUX32_VDSOPAGE_SIZE PAGE_SIZE * 2 +#define LINUX32_VDSOPAGE (LINUX32_MAXUSER - LINUX32_VDSOPAGE_SIZE) +#define LINUX32_SHAREDPAGE (LINUX32_VDSOPAGE - PAGE_SIZE) + /* + * PAGE_SIZE - the size + * of the native SHAREDPAGE + */ #define LINUX32_USRSTACK LINUX32_SHAREDPAGE static int linux_szsigcode; -static vm_object_t linux_shared_page_obj; -static char *linux_shared_page_mapping; -extern char _binary_linux32_locore_o_start; -extern char _binary_linux32_locore_o_end; +static vm_object_t linux_vdso_obj; +static char *linux_vdso_mapping; +extern char _binary_linux32_vdso_so_o_start; +extern char _binary_linux32_vdso_so_o_end; +static vm_offset_t linux_vdso_base; extern struct sysent linux32_sysent[LINUX32_SYS_MAXSYSCALL]; @@ -111,12 +120,14 @@ static int linux_copyout_strings(struct image_params *imgp, static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack); +static void linux_exec_sysvec_init(void *param); static int linux_on_exec_vmspace(struct proc *p, struct image_params *imgp); static void linux32_fixlimit(struct rlimit *rl, int which); static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); +static void linux_vdso_reloc(char *mapping, Elf_Addr offset); static void linux32_set_syscall_retval(struct thread *td, int error); #define LINUX_T_UNKNOWN 255 @@ -167,9 +178,11 @@ struct linux32_ps_strings { #define LINUX32_PS_STRINGS (LINUX32_USRSTACK - \ sizeof(struct linux32_ps_strings)) -LINUX_VDSO_SYM_INTPTR(linux32_sigcode); -LINUX_VDSO_SYM_INTPTR(linux32_rt_sigcode); -LINUX_VDSO_SYM_INTPTR(linux32_vsyscall); +LINUX_VDSO_SYM_INTPTR(__kernel_vsyscall); +LINUX_VDSO_SYM_INTPTR(__kernel_sigreturn); +LINUX_VDSO_SYM_INTPTR(__kernel_rt_sigreturn); +LINUX_VDSO_SYM_INTPTR(kern_timekeep_base); +LINUX_VDSO_SYM_INTPTR(kern_tsc_selector); LINUX_VDSO_SYM_CHAR(linux_platform); /* @@ -206,9 +219,8 @@ linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) M_WAITOK | M_ZERO); issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; - AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO, linux32_vsyscall); - AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR, - imgp->proc->p_sysent->sv_shared_page_base); + AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO, __kernel_vsyscall); + AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR, linux_vdso_base); AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature); AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz); @@ -354,7 +366,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) /* Build context to run handler in. */ regs->tf_rsp = PTROUT(fp); - regs->tf_rip = linux32_rt_sigcode; + regs->tf_rip = __kernel_rt_sigreturn; regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; @@ -460,7 +472,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) /* Build context to run handler in. */ regs->tf_rsp = PTROUT(fp); - regs->tf_rip = linux32_sigcode; + regs->tf_rip = __kernel_sigreturn; regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; @@ -911,7 +923,7 @@ struct sysentvec elf_linux_sysvec = { .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_sendsig, - .sv_sigcode = &_binary_linux32_locore_o_start, + .sv_sigcode = &_binary_linux32_vdso_so_o_start, .sv_szsigcode = &linux_szsigcode, .sv_name = "Linux ELF32", .sv_coredump = elf32_coredump, @@ -931,7 +943,7 @@ struct sysentvec elf_linux_sysvec = { .sv_fixlimit = linux32_fixlimit, .sv_maxssiz = &linux32_maxssiz, .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32 | SV_SHP | - SV_SIG_DISCIGN | SV_SIG_WAITNDQ, + SV_SIG_DISCIGN | SV_SIG_WAITNDQ | SV_TIMEKEEP, .sv_set_syscall_retval = linux32_set_syscall_retval, .sv_fetch_syscall_args = linux32_fetch_syscall_args, .sv_syscallnames = NULL, @@ -949,45 +961,127 @@ struct sysentvec elf_linux_sysvec = { static int linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) { + int error; - linux_on_exec(p, imgp); - return (0); + error = linux_map_vdso(p, linux_vdso_obj, linux_vdso_base, + LINUX32_VDSOPAGE_SIZE, imgp); + if (error == 0) + linux_on_exec(p, imgp); + return (error); } static void -linux_vdso_install(void *param) +linux_exec_sysvec_init(void *param) { + l_uintptr_t *ktimekeep_base, *ktsc_selector; + struct sysentvec *sv; + ptrdiff_t tkoff; + + sv = param; + /* Fill timekeep_base */ + exec_sysvec_init(sv); + + tkoff = kern_timekeep_base - linux_vdso_base; + ktimekeep_base = (l_uintptr_t *)(linux_vdso_mapping + tkoff); + *ktimekeep_base = sv->sv_timekeep_base; + + tkoff = kern_tsc_selector - linux_vdso_base; + ktsc_selector = (l_uintptr_t *)(linux_vdso_mapping + tkoff); + *ktsc_selector = linux_vdso_tsc_selector_idx(); + if (bootverbose) + printf("Linux i386 vDSO tsc_selector: %u\n", *ktsc_selector); +} +SYSINIT(elf_linux_exec_sysvec_init, SI_SUB_EXEC, SI_ORDER_ANY, + linux_exec_sysvec_init, &elf_linux_sysvec); - linux_szsigcode = (&_binary_linux32_locore_o_end - - &_binary_linux32_locore_o_start); +static void +linux_vdso_install(void *param) +{ + char *vdso_start = &_binary_linux32_vdso_so_o_start; + char *vdso_end = &_binary_linux32_vdso_so_o_end; - if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) - panic("Linux invalid vdso size\n"); + linux_szsigcode = vdso_end - vdso_start; + MPASS(linux_szsigcode <= LINUX32_VDSOPAGE_SIZE); - __elfN(linux_vdso_fixup)(&elf_linux_sysvec); + linux_vdso_base = LINUX32_VDSOPAGE; - linux_shared_page_obj = __elfN(linux_shared_page_init) - (&linux_shared_page_mapping); + __elfN(linux_vdso_fixup)(vdso_start, linux_vdso_base); - __elfN(linux_vdso_reloc)(&elf_linux_sysvec); + linux_vdso_obj = __elfN(linux_shared_page_init) + (&linux_vdso_mapping, LINUX32_VDSOPAGE_SIZE); + bcopy(vdso_start, linux_vdso_mapping, linux_szsigcode); - bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, - linux_szsigcode); - elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; + linux_vdso_reloc(linux_vdso_mapping, linux_vdso_base); } -SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_install, NULL); static void linux_vdso_deinstall(void *param) { - __elfN(linux_shared_page_fini)(linux_shared_page_obj, - linux_shared_page_mapping); + __elfN(linux_shared_page_fini)(linux_vdso_obj, + linux_vdso_mapping, LINUX32_VDSOPAGE_SIZE); } SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, linux_vdso_deinstall, NULL); +static void +linux_vdso_reloc(char *mapping, Elf_Addr offset) +{ + const Elf_Shdr *shdr; + const Elf_Rel *rel; + const Elf_Ehdr *ehdr; + Elf32_Addr *where; + Elf_Size rtype, symidx; + Elf32_Addr addr, addend; + int i, relcnt; + + MPASS(offset != 0); + + relcnt = 0; + ehdr = (const Elf_Ehdr *)mapping; + shdr = (const Elf_Shdr *)(mapping + ehdr->e_shoff); + for (i = 0; i < ehdr->e_shnum; i++) + { + switch (shdr[i].sh_type) { + case SHT_REL: + rel = (const Elf_Rel *)(mapping + shdr[i].sh_offset); + relcnt = shdr[i].sh_size / sizeof(*rel); + break; + case SHT_RELA: + printf("Linux i386 vDSO: unexpected Rela section\n"); + break; + } + } + + for (i = 0; i < relcnt; i++, rel++) { + where = (Elf32_Addr *)(mapping + rel->r_offset); + addend = *where; + rtype = ELF_R_TYPE(rel->r_info); + symidx = ELF_R_SYM(rel->r_info); + + switch (rtype) { + case R_386_NONE: /* none */ + break; + + case R_386_RELATIVE: /* B + A */ + addr = (Elf32_Addr)PTROUT(offset + addend); + if (*where != addr) + *where = addr; + break; + + case R_386_IRELATIVE: + printf("Linux i386 vDSO: unexpected ifunc relocation, " + "symbol index %ld\n", (intmax_t)symidx); + break; + default: + printf("Linux i386 vDSO: unexpected relocation type %ld, " + "symbol index %ld\n", (intmax_t)rtype, (intmax_t)symidx); + } + } +} + static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; diff --git a/sys/amd64/linux32/linux32_vdso.lds.s b/sys/amd64/linux32/linux32_vdso.lds.s index a49c209a1ebc..0a392e6380b6 100644 --- a/sys/amd64/linux32/linux32_vdso.lds.s +++ b/sys/amd64/linux32/linux32_vdso.lds.s @@ -51,16 +51,30 @@ PHDRS eh_frame_hdr PT_GNU_EH_FRAME; } -ENTRY(linux32_vsyscall); - VERSION { + LINUX_2.6 { + global: + __vdso_clock_gettime; + __vdso_gettimeofday; + __vdso_time; + __vdso_clock_getres; + __vdso_clock_gettime64; + }; + LINUX_2.5 { global: - linux32_vsyscall; - linux32_sigcode; - linux32_rt_sigcode; + __kernel_vsyscall; + __kernel_sigreturn; + __kernel_rt_sigreturn; + local: *; + }; + + LINUX_0.0 { + global: linux_platform; + kern_timekeep_base; + kern_tsc_selector; local: *; }; } diff --git a/sys/amd64/linux32/linux32_vdso_gtod.c b/sys/amd64/linux32/linux32_vdso_gtod.c new file mode 100644 index 000000000000..f1573ca3c1b1 --- /dev/null +++ b/sys/amd64/linux32/linux32_vdso_gtod.c @@ -0,0 +1,146 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Dmitry Chagin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#define _KERNEL +#include +#undef _KERNEL +#include +#include + +#include +#include + +#include +#include +#include +#include + +/* The kernel fixup this at vDSO install */ +uintptr_t *kern_timekeep_base = NULL; +uint32_t kern_tsc_selector = 0; + +#include + +static int +write(int fd, const void *buf, size_t size) +{ + int res; + + __asm__ __volatile__ + ( + "int $0x80" + : "=a"(res) + : "a"(LINUX32_SYS_write), "b"(fd), "c"(buf), "d"(size) + : "cc", "memory" + ); + return (res); +} + +static int +__vdso_clock_gettime_fallback(clockid_t clock_id, struct l_timespec *ts) +{ + int res; + + __asm__ __volatile__ + ( + "int $0x80" + : "=a"(res) + : "a"(LINUX32_SYS_linux_clock_gettime), "b"(clock_id), "c"(ts) + : "cc", "memory" + ); + return (res); +} + +static int +__vdso_clock_gettime64_fallback(clockid_t clock_id, struct l_timespec64 *ts) +{ + int res; + + __asm__ __volatile__ + ( + "int $0x80" + : "=a"(res) + : "a"(LINUX32_SYS_linux_clock_gettime64), "b"(clock_id), "c"(ts) + : "cc", "memory" + ); + return (res); +} + +static int +__vdso_gettimeofday_fallback(l_timeval *tv, struct timezone *tz) +{ + int res; + + __asm__ __volatile__ + ( + "int $0x80" + : "=a"(res) + : "a"(LINUX32_SYS_linux_gettimeofday), "b"(tv), "c"(tz) + : "cc", "memory" + ); + return (res); +} + +static int +__vdso_clock_getres_fallback(clockid_t clock_id, struct l_timespec *ts) +{ + int res; + + __asm__ __volatile__ + ( + "int $0x80" + : "=a"(res) + : "a"(LINUX32_SYS_linux_clock_getres), "b"(clock_id), "c"(ts) + : "cc", "memory" + ); + return (res); +} *** 2155 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D569866645C; Tue, 20 Jul 2021 07:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTVGv2TzVz3tC8; Tue, 20 Jul 2021 07:10:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC7DF26389; Tue, 20 Jul 2021 07:10: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 16K7AUmA030383; Tue, 20 Jul 2021 07:10:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7AUud030382; Tue, 20 Jul 2021 07:10:30 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:30 GMT Message-Id: <202107200710.16K7AUud030382@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: fe7409530c54 - main - linprocfs: Fixup vDSO name in the procmaps after 9931033bbf. 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: fe7409530c5420c739aee72b3dfd036c05628a2c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:32 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fe7409530c5420c739aee72b3dfd036c05628a2c commit fe7409530c5420c739aee72b3dfd036c05628a2c Author: Dmitry Chagin AuthorDate: 2021-07-20 07:04:20 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 07:04:20 +0000 linprocfs: Fixup vDSO name in the procmaps after 9931033bbf. As the sv_shared_page_base now pointed out to the native sharedpage and the process VA layout has changed as follows: VDSOPAGE (2 * PAGE_SIZE) SHAREDPAGE (PAGE_SIZE) USRSTACK fixup the vDSO name by calculating the start of page relative to the native sharedpage. Differential revision: https://reviews.freebsd.org/D30903 MFC after: 2 weeks --- sys/compat/linprocfs/linprocfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index fc2c29240893..ae5823d96fdf 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1342,7 +1342,13 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) ino = vat.va_fileid; vput(vp); } else if (SV_PROC_ABI(p) == SV_ABI_LINUX) { - if (e_start == p->p_sysent->sv_shared_page_base) + /* + * sv_shared_page_base pointed out to the + * FreeBSD sharedpage, PAGE_SIZE is a size + * of it. The vDSO page is above. + */ + if (e_start == p->p_sysent->sv_shared_page_base + + PAGE_SIZE) name = vdso_str; if (e_end == p->p_sysent->sv_usrstack) name = stack_str; From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 155426664C8; Tue, 20 Jul 2021 07:10: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 4GTVGw3Xm3z3t6Z; Tue, 20 Jul 2021 07:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AC782631F; Tue, 20 Jul 2021 07:10:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K7AVnA030411; Tue, 20 Jul 2021 07:10:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7AVrT030410; Tue, 20 Jul 2021 07:10:31 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:31 GMT Message-Id: <202107200710.16K7AVrT030410@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: ae8330b44868 - main - linux(4): Add arch name to the some printfs. 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: ae8330b44868b260267d850fbd003a11d01c9444 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:33 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=ae8330b44868b260267d850fbd003a11d01c9444 commit ae8330b44868b260267d850fbd003a11d01c9444 Author: Dmitry Chagin AuthorDate: 2021-07-20 07:05:08 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 07:05:08 +0000 linux(4): Add arch name to the some printfs. Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D30904 MFC after: 2 weeks --- sys/amd64/linux/linux_sysvec.c | 4 ++-- sys/amd64/linux32/linux32_sysvec.c | 8 ++++---- sys/arm64/linux/linux_sysvec.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 2a429f323682..fbc397ec139e 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -1040,9 +1040,9 @@ linux64_elf_modevent(module_t mod, int type, void *data) SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); if (bootverbose) - printf("Linux ELF exec handler removed\n"); + printf("Linux x86_64 ELF exec handler removed\n"); } else - printf("Could not deinstall ELF interpreter entry\n"); + printf("Could not deinstall Linux x86_64 ELF interpreter entry\n"); break; default: return (EOPNOTSUPP); diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 38b777fb5629..5176029605bf 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -1184,9 +1184,9 @@ linux_elf_modevent(module_t mod, int type, void *data) linux32_ioctl_register_handler(*lihp); stclohz = (stathz ? stathz : hz); if (bootverbose) - printf("Linux ELF exec handler installed\n"); + printf("Linux i386 ELF exec handler installed\n"); } else - printf("cannot insert Linux ELF brand handler\n"); + printf("cannot insert Linux i386 ELF brand handler\n"); break; case MOD_UNLOAD: for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; @@ -1203,9 +1203,9 @@ linux_elf_modevent(module_t mod, int type, void *data) SET_FOREACH(lihp, linux_ioctl_handler_set) linux32_ioctl_unregister_handler(*lihp); if (bootverbose) - printf("Linux ELF exec handler removed\n"); + printf("Linux i386 ELF exec handler removed\n"); } else - printf("Could not deinstall ELF interpreter entry\n"); + printf("Could not deinstall Linux i386 ELF interpreter entry\n"); break; default: return (EOPNOTSUPP); diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 247b6dc9fa3b..72621b4bbfbd 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -664,9 +664,9 @@ linux64_elf_modevent(module_t mod, int type, void *data) SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); if (bootverbose) - printf("Linux ELF exec handler removed\n"); + printf("Linux arm64 ELF exec handler removed\n"); } else - printf("Could not deinstall ELF interpreter entry\n"); + printf("Could not deinstall Linux arm64 ELF interpreter entry\n"); break; default: return (EOPNOTSUPP); From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DC4266664E; Tue, 20 Jul 2021 07:10: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 4GTVGy5b3xz3t6l; Tue, 20 Jul 2021 07:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52E5625E63; Tue, 20 Jul 2021 07:10: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 16K7AYTk030459; Tue, 20 Jul 2021 07:10:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7AYEf030458; Tue, 20 Jul 2021 07:10:34 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:34 GMT Message-Id: <202107200710.16K7AYEf030458@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: 2b3818633090 - main - Drop rdivacky@ "All rights reserved" from linux_event. 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: 2b3818633090aed7941b9d484cb7d05f810ca8f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:35 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=2b3818633090aed7941b9d484cb7d05f810ca8f5 commit 2b3818633090aed7941b9d484cb7d05f810ca8f5 Author: Dmitry Chagin AuthorDate: 2021-07-20 07:06:16 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 07:06:16 +0000 Drop rdivacky@ "All rights reserved" from linux_event. I got explicit permission from Roman. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D30913 MFC after: 2 weeks --- sys/compat/linux/linux_event.c | 1 - sys/compat/linux/linux_event.h | 1 - 2 files changed, 2 deletions(-) diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 9860acd8900d..331732eb4234 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2007 Roman Divacky - * All rights reserved. * Copyright (c) 2014 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without diff --git a/sys/compat/linux/linux_event.h b/sys/compat/linux/linux_event.h index 27b25b4e28e3..445564da4150 100644 --- a/sys/compat/linux/linux_event.h +++ b/sys/compat/linux/linux_event.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2007 Roman Divacky - * All rights reserved. * Copyright (c) 2014 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:10:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88973666166; Tue, 20 Jul 2021 07:10: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 4GTVGx57b7z3t90; Tue, 20 Jul 2021 07:10:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 392E52638A; Tue, 20 Jul 2021 07:10: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 16K7AXVa030435; Tue, 20 Jul 2021 07:10:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7AXE8030434; Tue, 20 Jul 2021 07:10:33 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:10:33 GMT Message-Id: <202107200710.16K7AXE8030434@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: 1ca6b15bbdce - main - Drop "All rights reserved" from my copyright statements. 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: 1ca6b15bbdcebd6a0726dae2e9b72f383139d16c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:10:37 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=1ca6b15bbdcebd6a0726dae2e9b72f383139d16c commit 1ca6b15bbdcebd6a0726dae2e9b72f383139d16c Author: Dmitry Chagin AuthorDate: 2021-07-20 07:05:50 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 07:05:50 +0000 Drop "All rights reserved" from my copyright statements. Add email and fixup years while here. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D30912 MFC after: 2 weeks --- sys/amd64/linux/linux.h | 2 +- sys/amd64/linux/linux_dummy_machdep.c | 3 +-- sys/amd64/linux/linux_machdep.c | 2 +- sys/amd64/linux/linux_sysvec.c | 2 +- sys/arm64/linux/linux.h | 2 +- sys/arm64/linux/linux_dummy_machdep.c | 3 +-- sys/compat/linux/linux.c | 3 +-- sys/compat/linux/linux.h | 3 +-- sys/compat/linux/linux_common.h | 2 +- sys/compat/linux/linux_dummy.c | 3 +-- sys/compat/linux/linux_emul.c | 2 +- sys/compat/linux/linux_emul.h | 2 +- sys/compat/linux/linux_event.c | 2 +- sys/compat/linux/linux_event.h | 2 +- sys/compat/linux/linux_futex.c | 2 +- sys/compat/linux/linux_vdso.c | 3 +-- sys/compat/linux/linux_vdso.h | 3 +-- sys/kern/sys_eventfd.c | 2 +- sys/x86/linux/linux_dummy_x86.c | 3 +-- 19 files changed, 19 insertions(+), 27 deletions(-) diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h index 4e736cc11c22..9080bcb36cbc 100644 --- a/sys/amd64/linux/linux.h +++ b/sys/amd64/linux/linux.h @@ -1,9 +1,9 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2013 Dmitry Chagin * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. + * Copyright (c) 2013 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/amd64/linux/linux_dummy_machdep.c b/sys/amd64/linux/linux_dummy_machdep.c index aba79b69d55d..4e4d0f9c0d8b 100644 --- a/sys/amd64/linux/linux_dummy_machdep.c +++ b/sys/amd64/linux/linux_dummy_machdep.c @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2013 Dmitry Chagin - * All rights reserved. + * Copyright (c) 2013 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index b54674e793c8..d7b31ce89509 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -1,9 +1,9 @@ /*- - * Copyright (c) 2013 Dmitry Chagin * Copyright (c) 2004 Tim J. Robbins * Copyright (c) 2002 Doug Rabson * Copyright (c) 2000 Marcel Moolenaar * All rights reserved. + * Copyright (c) 2013 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index fbc397ec139e..dc9a77093bcd 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -1,11 +1,11 @@ /*- - * Copyright (c) 2013 Dmitry Chagin * Copyright (c) 2004 Tim J. Robbins * Copyright (c) 2003 Peter Wemm * Copyright (c) 2002 Doug Rabson * Copyright (c) 1998-1999 Andrew Gallatin * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. + * Copyright (c) 2013, 2021 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h index 2e683b77f8e8..ab3bab8264f4 100644 --- a/sys/arm64/linux/linux.h +++ b/sys/arm64/linux/linux.h @@ -1,6 +1,6 @@ /*- * Copyright (c) 1994-1996 Søren Schmidt - * Copyright (c) 2013 Dmitry Chagin + * Copyright (c) 2013 Dmitry Chagin * Copyright (c) 2018 Turing Robotic Industries Inc. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/arm64/linux/linux_dummy_machdep.c b/sys/arm64/linux/linux_dummy_machdep.c index 4bd339de4af5..0b722c632709 100644 --- a/sys/arm64/linux/linux_dummy_machdep.c +++ b/sys/arm64/linux/linux_dummy_machdep.c @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2013 Dmitry Chagin - * All rights reserved. + * Copyright (c) 2013 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c index 350d2c1abaf9..e72e5cbc7bfc 100644 --- a/sys/compat/linux/linux.c +++ b/sys/compat/linux/linux.c @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2015 Dmitry Chagin - * All rights reserved. + * Copyright (c) 2015 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index 9b75e6032445..15830b5b387e 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2015 Dmitry Chagin - * All rights reserved. + * Copyright (c) 2015 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux_common.h b/sys/compat/linux/linux_common.h index b0e3408e42df..c6837a6a3b52 100644 --- a/sys/compat/linux/linux_common.h +++ b/sys/compat/linux/linux_common.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2019 Dmitry Chagin + * Copyright (c) 2019 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index aa579d762c93..fbec69f4ac31 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2013 Dmitry Chagin - * All rights reserved. + * Copyright (c) 2013 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 499bebe8926a..fbfe9080cac7 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -3,8 +3,8 @@ * * Copyright (c) 1994-1996 Søren Schmidt * Copyright (c) 2006 Roman Divacky - * Copyright (c) 2013 Dmitry Chagin * All rights reserved. + * Copyright (c) 2013 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h index d5f37c918b6c..ed5332b2c96c 100644 --- a/sys/compat/linux/linux_emul.h +++ b/sys/compat/linux/linux_emul.h @@ -2,8 +2,8 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2006 Roman Divacky - * Copyright (c) 2013 Dmitry Chagin * All rights reserved. + * Copyright (c) 2013 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 991af1b539e4..9860acd8900d 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -2,8 +2,8 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2007 Roman Divacky - * Copyright (c) 2014 Dmitry Chagin * All rights reserved. + * Copyright (c) 2014 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux_event.h b/sys/compat/linux/linux_event.h index d6a0c2d42d0c..27b25b4e28e3 100644 --- a/sys/compat/linux/linux_event.h +++ b/sys/compat/linux/linux_event.h @@ -1,7 +1,7 @@ /*- * Copyright (c) 2007 Roman Divacky - * Copyright (c) 2014 Dmitry Chagin * All rights reserved. + * Copyright (c) 2014 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 6d4c31a8a6df..d1fd7725650d 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -3,9 +3,9 @@ /*- * SPDX-License-Identifier: BSD-4-Clause * - * Copyright (c) 2009-2016 Dmitry Chagin * Copyright (c) 2005 Emmanuel Dreyfus * All rights reserved. + * Copyright (c) 2009-2016 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux_vdso.c b/sys/compat/linux/linux_vdso.c index af90941d1981..f5fc7a20b1ef 100644 --- a/sys/compat/linux/linux_vdso.c +++ b/sys/compat/linux/linux_vdso.c @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2013 Dmitry Chagin - * All rights reserved. + * Copyright (c) 2013-2021 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/compat/linux/linux_vdso.h b/sys/compat/linux/linux_vdso.h index 870d0dd97fa2..6708b94f2694 100644 --- a/sys/compat/linux/linux_vdso.h +++ b/sys/compat/linux/linux_vdso.h @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2013 Dmitry Chagin - * All rights reserved. + * Copyright (c) 2013-2021 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/kern/sys_eventfd.c b/sys/kern/sys_eventfd.c index 8a884e4c9a55..91c045e85faf 100644 --- a/sys/kern/sys_eventfd.c +++ b/sys/kern/sys_eventfd.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2014 Dmitry Chagin + * Copyright (c) 2014 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/x86/linux/linux_dummy_x86.c b/sys/x86/linux/linux_dummy_x86.c index d6a1ce38da48..c48443096180 100644 --- a/sys/x86/linux/linux_dummy_x86.c +++ b/sys/x86/linux/linux_dummy_x86.c @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2013 Dmitry Chagin - * All rights reserved. + * Copyright (c) 2013 Dmitry Chagin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:11:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3D12666CAB; Tue, 20 Jul 2021 07:11: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 4GTVJG44Lxz3tQw; Tue, 20 Jul 2021 07:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D88C264CB; Tue, 20 Jul 2021 07:11: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 16K7Bg2U034696; Tue, 20 Jul 2021 07:11:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7Bgfc034695; Tue, 20 Jul 2021 07:11:42 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:11:42 GMT Message-Id: <202107200711.16K7Bgfc034695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 41f02257146d - main - e1000: Clean up igb_txrx MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41f02257146d128cdd4aa2bdcfdab7f9e08a4314 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:11:42 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=41f02257146d128cdd4aa2bdcfdab7f9e08a4314 commit 41f02257146d128cdd4aa2bdcfdab7f9e08a4314 Author: Kevin Bowling AuthorDate: 2021-07-20 07:06:31 +0000 Commit: Kevin Bowling CommitDate: 2021-07-20 07:11:30 +0000 e1000: Clean up igb_txrx The intention here is to reduce differences between em, igb, igc, ixgbe. The main functional change is logical simplification in igb_rx_checksum and getting interface caps from scctx instead of the ifp. Reviewed by: gallatin, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30073 --- sys/dev/e1000/igb_txrx.c | 119 +++++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 60 deletions(-) diff --git a/sys/dev/e1000/igb_txrx.c b/sys/dev/e1000/igb_txrx.c index 9f1921bf0c7e..ac768f84f810 100644 --- a/sys/dev/e1000/igb_txrx.c +++ b/sys/dev/e1000/igb_txrx.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2016 Matthew Macy * All rights reserved. * @@ -47,16 +49,20 @@ static int igb_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear); static void igb_isc_rxd_refill(void *arg, if_rxd_update_t iru); -static void igb_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, qidx_t pidx); -static int igb_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget); +static void igb_isc_rxd_flush(void *arg, uint16_t rxqid, uint8_t flid __unused, + qidx_t pidx); +static int igb_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, + qidx_t budget); static int igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri); -static int igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, u32 *cmd_type_len, u32 *olinfo_status); -static int igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, u32 *cmd_type_len, u32 *olinfo_status); +static int igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, + uint32_t *cmd_type_len, uint32_t *olinfo_status); +static int igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, + uint32_t *cmd_type_len, uint32_t *olinfo_status); -static void igb_rx_checksum(u32 staterr, if_rxd_info_t ri, u32 ptype); -static int igb_determine_rsstype(u16 pkt_info); +static void igb_rx_checksum(uint32_t staterr, if_rxd_info_t ri, uint32_t ptype); +static int igb_determine_rsstype(uint16_t pkt_info); extern void igb_if_enable_intr(if_ctx_t ctx); extern int em_intr(void *arg); @@ -79,13 +85,14 @@ struct if_txrx igb_txrx = { * **********************************************************************/ static int -igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, u32 *cmd_type_len, u32 *olinfo_status) +igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len, + uint32_t *olinfo_status) { struct e1000_adv_tx_context_desc *TXD; struct adapter *adapter = txr->adapter; - u32 type_tucmd_mlhl = 0, vlan_macip_lens = 0; - u32 mss_l4len_idx = 0; - u32 paylen; + uint32_t type_tucmd_mlhl = 0, vlan_macip_lens = 0; + uint32_t mss_l4len_idx = 0; + uint32_t paylen; switch(pi->ipi_etype) { case ETHERTYPE_IPV6: @@ -143,12 +150,13 @@ igb_tso_setup(struct tx_ring *txr, if_pkt_info_t pi, u32 *cmd_type_len, u32 *oli * **********************************************************************/ static int -igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, u32 *cmd_type_len, u32 *olinfo_status) +igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, uint32_t *cmd_type_len, + uint32_t *olinfo_status) { struct e1000_adv_tx_context_desc *TXD; - struct adapter *adapter = txr->adapter; - u32 vlan_macip_lens, type_tucmd_mlhl; - u32 mss_l4len_idx; + struct adapter *adapter = txr->adapter; + uint32_t vlan_macip_lens, type_tucmd_mlhl; + uint32_t mss_l4len_idx; mss_l4len_idx = vlan_macip_lens = type_tucmd_mlhl = 0; /* First check if TSO is to be used */ @@ -162,7 +170,7 @@ igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, u32 *cmd_type_len, u32 * TXD = (struct e1000_adv_tx_context_desc *) &txr->tx_base[pi->ipi_pidx]; /* - ** In advanced descriptors the vlan tag must + ** In advanced descriptors the vlan tag must ** be placed into the context descriptor. Hence ** we need to make one even if not doing offloads. */ @@ -171,7 +179,7 @@ igb_tx_ctx_setup(struct tx_ring *txr, if_pkt_info_t pi, u32 *cmd_type_len, u32 * } else if ((pi->ipi_csum_flags & IGB_CSUM_OFFLOAD) == 0) { return (0); } - + /* Set the ether header length */ vlan_macip_lens |= pi->ipi_ehdrlen << E1000_ADVTXD_MACLEN_SHIFT; @@ -236,7 +244,7 @@ igb_isc_txd_encap(void *arg, if_pkt_info_t pi) bus_dma_segment_t *segs = pi->ipi_segs; union e1000_adv_tx_desc *txd = NULL; int i, j, pidx_last; - u32 olinfo_status, cmd_type_len, txd_flags; + uint32_t olinfo_status, cmd_type_len, txd_flags; qidx_t ntxd; pidx_last = olinfo_status = 0; @@ -395,7 +403,7 @@ igb_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget) struct em_rx_queue *que = &sc->rx_queues[rxqid]; struct rx_ring *rxr = &que->rxr; union e1000_adv_rx_desc *rxd; - u32 staterr = 0; + uint32_t staterr = 0; int cnt, i; for (cnt = 0, i = idx; cnt < scctx->isc_nrxd[0] && cnt <= budget;) { @@ -426,16 +434,15 @@ igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if_softc_ctx_t scctx = adapter->shared; struct em_rx_queue *que = &adapter->rx_queues[ri->iri_qsidx]; struct rx_ring *rxr = &que->rxr; - struct ifnet *ifp = iflib_get_ifp(adapter->ctx); union e1000_adv_rx_desc *rxd; - u16 pkt_info, len; - u16 vtag = 0; - u32 ptype; - u32 staterr = 0; + uint16_t pkt_info, len, vtag; + uint32_t ptype, staterr; + int i, cidx; bool eop; - int i = 0; - int cidx = ri->iri_cidx; + + staterr = i = vtag = 0; + cidx = ri->iri_cidx; do { rxd = (union e1000_adv_rx_desc *)&rxr->rx_base[cidx]; @@ -485,14 +492,15 @@ igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) rxr->rx_packets++; - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + if ((scctx->isc_capenable & IFCAP_RXCSUM) != 0) igb_rx_checksum(staterr, ri, ptype); - if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 && + if ((scctx->isc_capenable & IFCAP_VLAN_HWTAGGING) != 0 && (staterr & E1000_RXD_STAT_VP) != 0) { ri->iri_vtag = vtag; ri->iri_flags |= M_VLANTAG; } + ri->iri_flowid = le32toh(rxd->wb.lower.hi_dword.rss); ri->iri_rsstype = igb_determine_rsstype(pkt_info); @@ -509,46 +517,37 @@ igb_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) * *********************************************************************/ static void -igb_rx_checksum(u32 staterr, if_rxd_info_t ri, u32 ptype) +igb_rx_checksum(uint32_t staterr, if_rxd_info_t ri, uint32_t ptype) { - u16 status = (u16)staterr; - u8 errors = (u8) (staterr >> 24); - bool sctp = FALSE; + uint16_t status = (uint16_t)staterr; + uint8_t errors = (uint8_t)(staterr >> 24); /* Ignore Checksum bit is set */ - if (status & E1000_RXD_STAT_IXSM) { - ri->iri_csum_flags = 0; + if (__predict_false(status & E1000_RXD_STAT_IXSM)) return; - } - if ((ptype & E1000_RXDADV_PKTTYPE_ETQF) == 0 && - (ptype & E1000_RXDADV_PKTTYPE_SCTP) != 0) - sctp = 1; - else - sctp = 0; - - if (status & E1000_RXD_STAT_IPCS) { - /* Did it pass? */ - if (!(errors & E1000_RXD_ERR_IPE)) { - /* IP Checksum Good */ - ri->iri_csum_flags = CSUM_IP_CHECKED; - ri->iri_csum_flags |= CSUM_IP_VALID; - } else - ri->iri_csum_flags = 0; - } + /* If there is a layer 3 or 4 error we are done */ + if (errors & (E1000_RXD_ERR_IPE | E1000_RXD_ERR_TCPE)) + return; - if (status & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS)) { - u64 type = (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - if (sctp) /* reassign */ - type = CSUM_SCTP_VALID; - /* Did it pass? */ - if (!(errors & E1000_RXD_ERR_TCPE)) { - ri->iri_csum_flags |= type; - if (sctp == 0) - ri->iri_csum_data = htons(0xffff); + /* IP Checksum Good */ + if (status & E1000_RXD_STAT_IPCS) + ri->iri_csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); + + /* Valid L4E checksum */ + if (__predict_true(status & + (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS))) { + /* SCTP header present. + * XXXKB: ETQF doesn't appear to be used in igb? + */ + if (__predict_false((ptype & E1000_RXDADV_PKTTYPE_ETQF) == 0 && + (ptype & E1000_RXDADV_PKTTYPE_SCTP) != 0)) { + ri->iri_csum_flags |= CSUM_SCTP_VALID; + } else { + ri->iri_csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + ri->iri_csum_data = htons(0xffff); } } - return; } /******************************************************************** @@ -557,7 +556,7 @@ igb_rx_checksum(u32 staterr, if_rxd_info_t ri, u32 ptype) * ******************************************************************/ static int -igb_determine_rsstype(u16 pkt_info) +igb_determine_rsstype(uint16_t pkt_info) { switch (pkt_info & E1000_RXDADV_RSSTYPE_MASK) { case E1000_RXDADV_RSSTYPE_IPV4_TCP: From owner-dev-commits-src-main@freebsd.org Tue Jul 20 07:23:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 688C2666F0F; Tue, 20 Jul 2021 07:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTVYm2QqTz4QqK; Tue, 20 Jul 2021 07:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AE9F262BF; Tue, 20 Jul 2021 07:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K7NO1g047820; Tue, 20 Jul 2021 07:23:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K7NOJ3047819; Tue, 20 Jul 2021 07:23:24 GMT (envelope-from git) Date: Tue, 20 Jul 2021 07:23:24 GMT Message-Id: <202107200723.16K7NOJ3047819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 9fd0cda92d33 - main - e1000: Add missing branch prediction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fd0cda92d3346e1daa30eb48e185e2077ac0566 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 07:23:24 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9fd0cda92d3346e1daa30eb48e185e2077ac0566 commit 9fd0cda92d3346e1daa30eb48e185e2077ac0566 Author: Kevin Bowling AuthorDate: 2021-07-20 07:21:21 +0000 Commit: Kevin Bowling CommitDate: 2021-07-20 07:21:21 +0000 e1000: Add missing branch prediction I missed this edit from the ixgbe review (D30074) Reviewed by: gallatin MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30073 --- sys/dev/e1000/igb_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/e1000/igb_txrx.c b/sys/dev/e1000/igb_txrx.c index ac768f84f810..75c5c160bf3e 100644 --- a/sys/dev/e1000/igb_txrx.c +++ b/sys/dev/e1000/igb_txrx.c @@ -527,7 +527,7 @@ igb_rx_checksum(uint32_t staterr, if_rxd_info_t ri, uint32_t ptype) return; /* If there is a layer 3 or 4 error we are done */ - if (errors & (E1000_RXD_ERR_IPE | E1000_RXD_ERR_TCPE)) + if (__predict_false(errors & (E1000_RXD_ERR_IPE | E1000_RXD_ERR_TCPE))) return; /* IP Checksum Good */ From owner-dev-commits-src-main@freebsd.org Tue Jul 20 08:19:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E5FE667F7E; Tue, 20 Jul 2021 08:19: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 4GTWnz1xhhz4bR0; Tue, 20 Jul 2021 08:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AC5927195; Tue, 20 Jul 2021 08:19: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 16K8J39F015202; Tue, 20 Jul 2021 08:19:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K8J3wG015201; Tue, 20 Jul 2021 08:19:03 GMT (envelope-from git) Date: Tue, 20 Jul 2021 08:19:03 GMT Message-Id: <202107200819.16K8J3wG015201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 76c890229628 - main - cxgbe(4): Initialize abs_id for ctrl and ofld queues. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76c890229628109e46f01c5037b773b59247a1f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 08:19:03 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=76c890229628109e46f01c5037b773b59247a1f8 commit 76c890229628109e46f01c5037b773b59247a1f8 Author: Navdeep Parhar AuthorDate: 2021-07-19 22:47:07 +0000 Commit: Navdeep Parhar CommitDate: 2021-07-20 07:54:13 +0000 cxgbe(4): Initialize abs_id for ctrl and ofld queues. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_sge.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 5091c8f992bd..1d0e334896be 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4219,6 +4219,7 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) } eq->cntxt_id = G_FW_EQ_CTRL_CMD_EQID(be32toh(c.cmpliqid_eqid)); + eq->abs_id = G_FW_EQ_CTRL_CMD_PHYSEQID(be32toh(c.physeqid_pkd)); cntxt_id = eq->cntxt_id - sc->sge.eq_start; if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__, @@ -4308,6 +4309,7 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq) } eq->cntxt_id = G_FW_EQ_OFLD_CMD_EQID(be32toh(c.eqid_pkd)); + eq->abs_id = G_FW_EQ_OFLD_CMD_PHYSEQID(be32toh(c.physeqid_pkd)); cntxt_id = eq->cntxt_id - sc->sge.eq_start; if (cntxt_id >= sc->sge.eqmap_sz) panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__, From owner-dev-commits-src-main@freebsd.org Tue Jul 20 08:36:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 924076681AB; Tue, 20 Jul 2021 08:36: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 4GTXBY3Kb5z4f84; Tue, 20 Jul 2021 08:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A9D4271BB; Tue, 20 Jul 2021 08:36: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 16K8armu040869; Tue, 20 Jul 2021 08:36:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K8ar7T040868; Tue, 20 Jul 2021 08:36:53 GMT (envelope-from git) Date: Tue, 20 Jul 2021 08:36:53 GMT Message-Id: <202107200836.16K8ar7T040868@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: ee9c3d38039e - main - pf: factor out pf_synproxy() 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: ee9c3d38039eb29966e1f0b8f617bc564c078289 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 08:36:53 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ee9c3d38039eb29966e1f0b8f617bc564c078289 commit ee9c3d38039eb29966e1f0b8f617bc564c078289 Author: Kristof Provost AuthorDate: 2021-06-10 13:49:09 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 08:36:13 +0000 pf: factor out pf_synproxy() MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31137 --- sys/netpfil/pf/pf.c | 85 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index fa8b6006571a..ac98fafa3d43 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4485,45 +4485,13 @@ pf_tcp_track_sloppy(struct pf_state_peer *src, struct pf_state_peer *dst, } static int -pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, - struct mbuf *m, int off, void *h, struct pf_pdesc *pd, - u_short *reason) +pf_synproxy(struct pf_pdesc *pd, struct pf_kstate **state, u_short *reason) { - struct pf_state_key_cmp key; + struct pf_state_key *sk = (*state)->key[pd->didx]; struct tcphdr *th = &pd->hdr.tcp; - int copyback = 0; - struct pf_state_peer *src, *dst; - struct pf_state_key *sk; - - bzero(&key, sizeof(key)); - key.af = pd->af; - key.proto = IPPROTO_TCP; - if (direction == PF_IN) { /* wire side, straight */ - PF_ACPY(&key.addr[0], pd->src, key.af); - PF_ACPY(&key.addr[1], pd->dst, key.af); - key.port[0] = th->th_sport; - key.port[1] = th->th_dport; - } else { /* stack side, reverse */ - PF_ACPY(&key.addr[1], pd->src, key.af); - PF_ACPY(&key.addr[0], pd->dst, key.af); - key.port[1] = th->th_sport; - key.port[0] = th->th_dport; - } - - STATE_LOOKUP(kif, &key, direction, *state, pd); - - if (direction == (*state)->direction) { - src = &(*state)->src; - dst = &(*state)->dst; - } else { - src = &(*state)->dst; - dst = &(*state)->src; - } - - sk = (*state)->key[pd->didx]; if ((*state)->src.state == PF_TCPS_PROXY_SRC) { - if (direction != (*state)->direction) { + if (pd->dir != (*state)->direction) { REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } @@ -4551,7 +4519,7 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, (*state)->src.state = PF_TCPS_PROXY_DST; } if ((*state)->src.state == PF_TCPS_PROXY_DST) { - if (direction == (*state)->direction) { + if (pd->dir == (*state)->direction) { if (((th->th_flags & (TH_SYN|TH_ACK)) != TH_ACK) || (ntohl(th->th_ack) != (*state)->src.seqhi + 1) || (ntohl(th->th_seq) != (*state)->src.seqlo + 1)) { @@ -4602,6 +4570,51 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, } } + return (PF_PASS); +} + +static int +pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, + struct mbuf *m, int off, void *h, struct pf_pdesc *pd, + u_short *reason) +{ + struct pf_state_key_cmp key; + struct tcphdr *th = &pd->hdr.tcp; + int copyback = 0; + int action; + struct pf_state_peer *src, *dst; + struct pf_state_key *sk; + + bzero(&key, sizeof(key)); + key.af = pd->af; + key.proto = IPPROTO_TCP; + if (direction == PF_IN) { /* wire side, straight */ + PF_ACPY(&key.addr[0], pd->src, key.af); + PF_ACPY(&key.addr[1], pd->dst, key.af); + key.port[0] = th->th_sport; + key.port[1] = th->th_dport; + } else { /* stack side, reverse */ + PF_ACPY(&key.addr[1], pd->src, key.af); + PF_ACPY(&key.addr[0], pd->dst, key.af); + key.port[1] = th->th_sport; + key.port[0] = th->th_dport; + } + + STATE_LOOKUP(kif, &key, direction, *state, pd); + + if (direction == (*state)->direction) { + src = &(*state)->src; + dst = &(*state)->dst; + } else { + src = &(*state)->dst; + dst = &(*state)->src; + } + + sk = (*state)->key[pd->didx]; + + if ((action = pf_synproxy(pd, state, reason)) != PF_PASS) + return (action); + if (((th->th_flags & (TH_SYN|TH_ACK)) == TH_SYN) && dst->state >= TCPS_FIN_WAIT_2 && src->state >= TCPS_FIN_WAIT_2) { From owner-dev-commits-src-main@freebsd.org Tue Jul 20 08:36:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4592668078; Tue, 20 Jul 2021 08:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTXBb5dGNz4f0P; Tue, 20 Jul 2021 08:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3237276D6; Tue, 20 Jul 2021 08:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K8atwf040923; Tue, 20 Jul 2021 08:36:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K8athD040922; Tue, 20 Jul 2021 08:36:55 GMT (envelope-from git) Date: Tue, 20 Jul 2021 08:36:55 GMT Message-Id: <202107200836.16K8athD040922@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: 231e83d3422f - main - pf: syncookie ioctl interface 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: 231e83d3422ff58fe94de8375a9532a1726056ed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 08:36:56 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=231e83d3422ff58fe94de8375a9532a1726056ed commit 231e83d3422ff58fe94de8375a9532a1726056ed Author: Kristof Provost AuthorDate: 2021-05-26 08:18:19 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 08:36:13 +0000 pf: syncookie ioctl interface Kernel side implementation to allow switching between on and off modes, and allow this configuration to be retrieved. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31139 --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf_ioctl.c | 18 +++++++++ sys/netpfil/pf/pf_syncookies.c | 84 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 767c47999940..35f906a8cbb2 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1572,6 +1572,7 @@ struct pf_idhash { struct mtx lock; }; +extern u_long pf_ioctl_maxcount; extern u_long pf_hashmask; extern u_long pf_srchashmask; #define PF_HASHSIZ (131072) @@ -1840,7 +1841,6 @@ void pf_send_tcp(const struct pf_krule *, sa_family_t, u_int16_t); void pf_syncookies_init(void); -int pf_syncookies_setmode(u_int8_t); int pf_get_syncookies(struct pfioc_nv *); int pf_set_syncookies(struct pfioc_nv *); int pf_synflood_check(struct pf_pdesc *); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index f98895da3e77..a9f5b2c18041 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -275,6 +275,14 @@ pflog_packet_t *pflog_packet_ptr = NULL; extern u_long pf_ioctl_maxcount; +#define ERROUT_FUNCTION(target, x) \ + do { \ + error = (x); \ + SDT_PROBE3(pf, ioctl, function, error, __func__, error, \ + __LINE__); \ + goto target; \ + } while (0) + static void pfattach_vnet(void) { @@ -2136,6 +2144,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td case DIOCOSFPGET: case DIOCGETSRCNODES: case DIOCCLRSRCNODES: + case DIOCGETSYNCOOKIES: case DIOCIGETIFACES: case DIOCGIFSPEEDV0: case DIOCGIFSPEEDV1: @@ -2183,6 +2192,7 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td case DIOCRTSTADDRS: case DIOCOSFPGET: case DIOCGETSRCNODES: + case DIOCGETSYNCOOKIES: case DIOCIGETIFACES: case DIOCGIFSPEEDV1: case DIOCGIFSPEEDV0: @@ -4538,6 +4548,14 @@ DIOCCHANGEADDR_error: error = pf_keepcounters((struct pfioc_nv *)addr); break; + case DIOCGETSYNCOOKIES: + error = pf_get_syncookies((struct pfioc_nv *)addr); + break; + + case DIOCSETSYNCOOKIES: + error = pf_set_syncookies((struct pfioc_nv *)addr); + break; + case DIOCSETHOSTID: { u_int32_t *hostid = (u_int32_t *)addr; diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c index 0071bab0d7d5..d51f89fb47d4 100644 --- a/sys/netpfil/pf/pf_syncookies.c +++ b/sys/netpfil/pf/pf_syncookies.c @@ -110,6 +110,7 @@ struct pf_syncookie_status { VNET_DEFINE_STATIC(struct pf_syncookie_status, pf_syncookie_status); #define V_pf_syncookie_status VNET(pf_syncookie_status) +static int pf_syncookies_setmode(u_int8_t); void pf_syncookie_rotate(void *); void pf_syncookie_newkey(void); uint32_t pf_syncookie_mac(struct pf_pdesc *, union pf_syncookie, @@ -127,6 +128,89 @@ pf_syncookies_init(void) } int +pf_get_syncookies(struct pfioc_nv *nv) +{ + nvlist_t *nvl = NULL; + void *nvlpacked = NULL; + + nvl = nvlist_create(0); + if (nvl == NULL) + return (ENOMEM); + + nvlist_add_bool(nvl, "enabled", + V_pf_status.syncookies_mode != PF_SYNCOOKIES_NEVER); + nvlist_add_bool(nvl, "adaptive", false); + + nvlpacked = nvlist_pack(nvl, &nv->len); + if (nvlpacked == NULL) { + nvlist_destroy(nvl); + return (ENOMEM); + } + if (nv->size == 0) { + nvlist_destroy(nvl); + free(nvlpacked, M_TEMP); + return (0); + } else if (nv->size < nv->len) { + nvlist_destroy(nvl); + free(nvlpacked, M_TEMP); + return (ENOSPC); + } + + return (copyout(nvlpacked, nv->data, nv->len)); +} + +int +pf_set_syncookies(struct pfioc_nv *nv) +{ + nvlist_t *nvl = NULL; + void *nvlpacked = NULL; + int error; + bool enabled, adaptive; + + if (nv->len > pf_ioctl_maxcount) + return (ENOMEM); + + nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + if (nvlpacked == NULL) + return (ENOMEM); + + error = copyin(nv->data, nvlpacked, nv->len); + if (error) { + free(nvlpacked, M_TEMP); + return (error); + } + + nvl = nvlist_unpack(nvlpacked, nv->len, 0); + if (nvl == NULL) { + free(nvlpacked, M_TEMP); + return (EBADMSG); + } + + if (! nvlist_exists_bool(nvl, "enabled") + || ! nvlist_exists_bool(nvl, "adaptive")) { + nvlist_destroy(nvl); + free(nvlpacked, M_TEMP); + return (EBADMSG); + } + + enabled = nvlist_get_bool(nvl, "enabled"); + adaptive = nvlist_get_bool(nvl, "adaptive"); + + if (adaptive) { + nvlist_destroy(nvl); + free(nvlpacked, M_TEMP); + return (ENOTSUP); + } + + PF_RULES_WLOCK(); + error = pf_syncookies_setmode(enabled ? + PF_SYNCOOKIES_ALWAYS : PF_SYNCOOKIES_NEVER); + PF_RULES_WUNLOCK(); + + return (error); +} + +static int pf_syncookies_setmode(u_int8_t mode) { if (mode > PF_SYNCOOKIES_MODE_MAX) From owner-dev-commits-src-main@freebsd.org Tue Jul 20 08:36:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2038668220; Tue, 20 Jul 2021 08:36: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 4GTXBZ44cQz4f3S; Tue, 20 Jul 2021 08:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E982273E6; Tue, 20 Jul 2021 08:36: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 16K8asXN040893; Tue, 20 Jul 2021 08:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K8asPR040892; Tue, 20 Jul 2021 08:36:54 GMT (envelope-from git) Date: Tue, 20 Jul 2021 08:36:54 GMT Message-Id: <202107200836.16K8asPR040892@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: 8e1864ed0712 - main - pf: syncookie support 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: 8e1864ed07121b479b95d7e3a5931a9e0ffd4713 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 08:36:54 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8e1864ed07121b479b95d7e3a5931a9e0ffd4713 commit 8e1864ed07121b479b95d7e3a5931a9e0ffd4713 Author: Kristof Provost AuthorDate: 2021-05-20 09:54:41 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 08:36:13 +0000 pf: syncookie support Import OpenBSD's syncookie support for pf. This feature help pf resist TCP SYN floods by only creating states once the remote host completes the TCP handshake rather than when the initial SYN packet is received. This is accomplished by using the initial sequence numbers to encode a cookie (hence the name) in the SYN+ACK response and verifying this on receipt of the client ACK. Reviewed by: kbowling Obtained from: OpenBSD MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31138 --- sys/modules/pf/Makefile | 2 +- sys/net/pfvar.h | 34 ++++ sys/netinet/tcp.h | 2 + sys/netpfil/pf/pf.c | 129 +++++++++++---- sys/netpfil/pf/pf.h | 3 +- sys/netpfil/pf/pf_ioctl.c | 3 +- sys/netpfil/pf/pf_mtag.h | 1 + sys/netpfil/pf/pf_syncookies.c | 350 +++++++++++++++++++++++++++++++++++++++++ 8 files changed, 492 insertions(+), 32 deletions(-) diff --git a/sys/modules/pf/Makefile b/sys/modules/pf/Makefile index 7293b30cda9d..d361ea0802fb 100644 --- a/sys/modules/pf/Makefile +++ b/sys/modules/pf/Makefile @@ -4,7 +4,7 @@ KMOD= pf SRCS= pf.c pf_if.c pf_lb.c pf_osfp.c pf_ioctl.c pf_norm.c pf_table.c \ - pf_ruleset.c pf_nv.c in4_cksum.c \ + pf_ruleset.c pf_nv.c pf_syncookies.c in4_cksum.c \ bus_if.h device_if.h \ opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_sctp.h opt_global.h diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 1ed74e0781c9..767c47999940 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1132,6 +1132,12 @@ struct pf_pdesc { counter_u64_add(V_pf_status.counters[x], 1); \ } while (0) +enum pf_syncookies_mode { + PF_SYNCOOKIES_NEVER = 0, + PF_SYNCOOKIES_ALWAYS = 1, + PF_SYNCOOKIES_MODE_MAX = PF_SYNCOOKIES_ALWAYS +}; + struct pf_kstatus { counter_u64_t counters[PFRES_MAX]; /* reason for passing/dropping */ counter_u64_t lcounters[LCNT_MAX]; /* limit counters */ @@ -1146,6 +1152,8 @@ struct pf_kstatus { char ifname[IFNAMSIZ]; uint8_t pf_chksum[PF_MD5_DIGEST_LENGTH]; bool keep_counters; + enum pf_syncookies_mode syncookies_mode; + bool syncookies_active; }; struct pf_divert { @@ -1486,6 +1494,8 @@ struct pfioc_iface { #define DIOCKILLSRCNODES _IOWR('D', 91, struct pfioc_src_node_kill) #define DIOCKEEPCOUNTERS _IOWR('D', 92, struct pfioc_nv) #define DIOCGETSTATESV2 _IOWR('D', 93, struct pfioc_states_v2) +#define DIOCGETSYNCOOKIES _IOWR('D', 94, struct pfioc_nv) +#define DIOCSETSYNCOOKIES _IOWR('D', 95, struct pfioc_nv) struct pf_ifspeed_v0 { char ifname[IFNAMSIZ]; @@ -1816,6 +1826,30 @@ int pf_addr_cmp(struct pf_addr *, struct pf_addr *, sa_family_t); void pf_qid2qname(u_int32_t, char *); +u_int16_t pf_get_mss(struct mbuf *, int, u_int16_t, sa_family_t); +u_int8_t pf_get_wscale(struct mbuf *, int, u_int16_t, sa_family_t); +struct mbuf *pf_build_tcp(const struct pf_krule *, sa_family_t, + const struct pf_addr *, const struct pf_addr *, + u_int16_t, u_int16_t, u_int32_t, u_int32_t, + u_int8_t, u_int16_t, u_int16_t, u_int8_t, int, + u_int16_t); +void pf_send_tcp(const struct pf_krule *, sa_family_t, + const struct pf_addr *, const struct pf_addr *, + u_int16_t, u_int16_t, u_int32_t, u_int32_t, + u_int8_t, u_int16_t, u_int16_t, u_int8_t, int, + u_int16_t); + +void pf_syncookies_init(void); +int pf_syncookies_setmode(u_int8_t); +int pf_get_syncookies(struct pfioc_nv *); +int pf_set_syncookies(struct pfioc_nv *); +int pf_synflood_check(struct pf_pdesc *); +void pf_syncookie_send(struct mbuf *m, int off, + struct pf_pdesc *); +u_int8_t pf_syncookie_validate(struct pf_pdesc *); +struct mbuf * pf_syncookie_recreate_syn(uint8_t, int, + struct pf_pdesc *); + VNET_DECLARE(struct pf_kstatus, pf_status); #define V_pf_status VNET(pf_status) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 45bece9fa9dd..a79dbeaad748 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -105,6 +105,8 @@ struct tcphdr { #define TCPOPT_FAST_OPEN 34 #define TCPOLEN_FAST_OPEN_EMPTY 2 +#define MAX_TCPOPTLEN 40 /* Absolute maximum TCP options len */ + /* Miscellaneous constants */ #define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at receiver side */ #define TCP_MAX_SACK 4 /* MAX # SACKs sent in any segment */ diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ac98fafa3d43..6fdeab517792 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -243,11 +243,6 @@ static void pf_change_icmp(struct pf_addr *, u_int16_t *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t *, u_int16_t *, u_int16_t *, u_int16_t *, u_int8_t, sa_family_t); -static void pf_send_tcp(const struct pf_krule *, sa_family_t, - const struct pf_addr *, const struct pf_addr *, - u_int16_t, u_int16_t, u_int32_t, u_int32_t, - u_int8_t, u_int16_t, u_int16_t, u_int8_t, int, - u_int16_t); static void pf_send_icmp(struct mbuf *, u_int8_t, u_int8_t, sa_family_t, struct pf_krule *); static void pf_detach_state(struct pf_kstate *); @@ -291,10 +286,6 @@ static int pf_test_state_icmp(struct pf_kstate **, int, void *, struct pf_pdesc *, u_short *); static int pf_test_state_other(struct pf_kstate **, int, struct pfi_kkif *, struct mbuf *, struct pf_pdesc *); -static u_int8_t pf_get_wscale(struct mbuf *, int, u_int16_t, - sa_family_t); -static u_int16_t pf_get_mss(struct mbuf *, int, u_int16_t, - sa_family_t); static u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, int, u_int16_t); static int pf_check_proto_cksum(struct mbuf *, int, int, @@ -2453,14 +2444,13 @@ pf_modulate_sack(struct mbuf *m, int off, struct pf_pdesc *pd, return (copyback); } -static void -pf_send_tcp(const struct pf_krule *r, sa_family_t af, +struct mbuf * +pf_build_tcp(const struct pf_krule *r, sa_family_t af, const struct pf_addr *saddr, const struct pf_addr *daddr, u_int16_t sport, u_int16_t dport, u_int32_t seq, u_int32_t ack, u_int8_t flags, u_int16_t win, u_int16_t mss, u_int8_t ttl, int tag, u_int16_t rtag) { - struct pf_send_entry *pfse; struct mbuf *m; int len, tlen; #ifdef INET @@ -2496,22 +2486,16 @@ pf_send_tcp(const struct pf_krule *r, sa_family_t af, panic("%s: unsupported af %d", __func__, af); } - /* Allocate outgoing queue entry, mbuf and mbuf tag. */ - pfse = malloc(sizeof(*pfse), M_PFTEMP, M_NOWAIT); - if (pfse == NULL) - return; m = m_gethdr(M_NOWAIT, MT_DATA); - if (m == NULL) { - free(pfse, M_PFTEMP); - return; - } + if (m == NULL) + return (NULL); + #ifdef MAC mac_netinet_firewall_send(m); #endif if ((pf_mtag = pf_get_mtag(m)) == NULL) { - free(pfse, M_PFTEMP); m_freem(m); - return; + return (NULL); } if (tag) m->m_flags |= M_SKIP_FIREWALL; @@ -2592,8 +2576,6 @@ pf_send_tcp(const struct pf_krule *r, sa_family_t af, h->ip_len = htons(len); h->ip_ttl = ttl ? ttl : V_ip_defttl; h->ip_sum = 0; - - pfse->pfse_type = PFSE_IP; break; #endif /* INET */ #ifdef INET6 @@ -2604,11 +2586,48 @@ pf_send_tcp(const struct pf_krule *r, sa_family_t af, h6->ip6_vfc |= IPV6_VERSION; h6->ip6_hlim = IPV6_DEFHLIM; + break; +#endif /* INET6 */ + } + + return (m); +} + +void +pf_send_tcp(const struct pf_krule *r, sa_family_t af, + const struct pf_addr *saddr, const struct pf_addr *daddr, + u_int16_t sport, u_int16_t dport, u_int32_t seq, u_int32_t ack, + u_int8_t flags, u_int16_t win, u_int16_t mss, u_int8_t ttl, int tag, + u_int16_t rtag) +{ + struct pf_send_entry *pfse; + struct mbuf *m; + + m = pf_build_tcp(r, af, saddr, daddr, sport, dport, seq, ack, flags, + win, mss, ttl, tag, rtag); + if (m == NULL) + return; + + /* Allocate outgoing queue entry, mbuf and mbuf tag. */ + pfse = malloc(sizeof(*pfse), M_PFTEMP, M_NOWAIT); + if (pfse == NULL) { + m_freem(m); + return; + } + switch (af) { +#ifdef INET + case AF_INET: + pfse->pfse_type = PFSE_IP; + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: pfse->pfse_type = PFSE_IP6; break; #endif /* INET6 */ } + pfse->pfse_m = m; pf_send(pfse); } @@ -3192,7 +3211,7 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd, struct mbuf *m) return (1); } -static u_int8_t +u_int8_t pf_get_wscale(struct mbuf *m, int off, u_int16_t th_off, sa_family_t af) { int hlen; @@ -3232,7 +3251,7 @@ pf_get_wscale(struct mbuf *m, int off, u_int16_t th_off, sa_family_t af) return (wscale); } -static u_int16_t +u_int16_t pf_get_mss(struct mbuf *m, int off, u_int16_t th_off, sa_family_t af) { int hlen; @@ -6077,6 +6096,18 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * goto done; } pd.p_len = pd.tot_len - off - (pd.hdr.tcp.th_off << 2); + + pd.sport = &pd.hdr.tcp.th_sport; + pd.dport = &pd.hdr.tcp.th_dport; + + /* Respond to SYN with a syncookie. */ + if ((pd.hdr.tcp.th_flags & (TH_SYN|TH_ACK|TH_RST)) == TH_SYN && + pd.dir == PF_IN && pf_synflood_check(&pd)) { + pf_syncookie_send(m, off, &pd); + action = PF_DROP; + break; + } + if ((pd.hdr.tcp.th_flags & TH_ACK) && pd.p_len == 0) pqid = 1; action = pf_normalize_tcp(dir, kif, m, 0, off, h, &pd); @@ -6090,9 +6121,49 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * r = s->rule.ptr; a = s->anchor.ptr; log = s->log; - } else if (s == NULL) - action = pf_test_rule(&r, &s, dir, kif, m, off, &pd, - &a, &ruleset, inp); + } else if (s == NULL) { + /* Validate remote SYN|ACK, re-create original SYN if + * valid. */ + if ((pd.hdr.tcp.th_flags & (TH_SYN|TH_ACK|TH_RST)) == + TH_ACK && pf_syncookie_validate(&pd) && + pd.dir == PF_IN) { + struct mbuf *msyn; + + msyn = pf_syncookie_recreate_syn(h->ip_ttl, + off,&pd); + if (msyn == NULL) { + action = PF_DROP; + break; + } + + action = pf_test(dir, pflags, ifp, &msyn, inp); + m_freem(msyn); + + if (action == PF_PASS) { + action = pf_test_state_tcp(&s, dir, + kif, m, off, h, &pd, &reason); + if (action != PF_PASS || s == NULL) { + action = PF_DROP; + break; + } + + s->src.seqhi = ntohl(pd.hdr.tcp.th_ack) + - 1; + s->src.seqlo = ntohl(pd.hdr.tcp.th_seq) + - 1; + s->src.state = PF_TCPS_PROXY_DST; + + action = pf_synproxy(&pd, &s, &reason); + if (action != PF_PASS) + break; + } + break; + } + else { + action = pf_test_rule(&r, &s, dir, kif, m, off, + &pd, &a, &ruleset, inp); + } + } break; } diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index d8ee43506d99..c8bf932af9c3 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -160,7 +160,8 @@ enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE, PF_ADDR_DYNIFTL, #define LCNT_SRCCONNRATE 4 /* max-src-conn-rate */ #define LCNT_OVERLOAD_TABLE 5 /* entry added to overload table */ #define LCNT_OVERLOAD_FLUSH 6 /* state entries flushed */ -#define LCNT_MAX 7 /* total+1 */ +#define LCNT_SYNCOOKIES_VALID 7 /* syncookies validated */ /* XXX TODO: Ensure no API breakage! */ +#define LCNT_MAX 8 /* total+1 */ #define LCNT_NAMES { \ "max states per rule", \ diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 45d446697981..f98895da3e77 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -284,6 +284,7 @@ pfattach_vnet(void) pfr_initialize(); pfi_initialize_vnet(); pf_normalize_init(); + pf_syncookies_init(); V_pf_limits[PF_LIMIT_STATES].limit = PFSTATE_HIWAT; V_pf_limits[PF_LIMIT_SRC_NODES].limit = PFSNODE_HIWAT; @@ -5524,7 +5525,7 @@ pf_load(void) { int error; - rm_init(&pf_rules_lock, "pf rulesets"); + rm_init_flags(&pf_rules_lock, "pf rulesets", RM_RECURSE); sx_init(&pf_ioctl_lock, "pf ioctl"); sx_init(&pf_end_lock, "pf end thread"); diff --git a/sys/netpfil/pf/pf_mtag.h b/sys/netpfil/pf/pf_mtag.h index ad28ab7a7c30..2135c9e69dbd 100644 --- a/sys/netpfil/pf/pf_mtag.h +++ b/sys/netpfil/pf/pf_mtag.h @@ -43,6 +43,7 @@ #define PF_FASTFWD_OURS_PRESENT 0x10 #define PF_REASSEMBLED 0x20 #define PF_DUPLICATED 0x40 +#define PF_TAG_SYNCOOKIE_RECREATED 0x80 struct pf_mtag { void *hdr; /* saved hdr pos in mbuf, for ECN */ diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c new file mode 100644 index 000000000000..0071bab0d7d5 --- /dev/null +++ b/sys/netpfil/pf/pf_syncookies.c @@ -0,0 +1,350 @@ +/* $OpenBSD: pf_syncookies.c,v 1.7 2018/09/10 15:54:28 henning Exp $ */ + +/* Copyright (c) 2016,2017 Henning Brauer + * Copyright (c) 2016 Alexandr Nedvedicky + * + * syncookie parts based on FreeBSD sys/netinet/tcp_syncache.c + * + * Copyright (c) 2001 McAfee, Inc. + * Copyright (c) 2006,2013 Andre Oppermann, Internet Business Solutions AG + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Jonathan Lemon + * and McAfee Research, the Security Research Division of McAfee, Inc. under + * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. [2001 McAfee, Inc.] + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * when we're under synflood, we use syncookies to prevent state table + * exhaustion. Trigger for the synflood mode is the number of half-open + * connections in the state table. + * We leave synflood mode when the number of half-open states - including + * in-flight syncookies - drops far enough again + */ + +/* + * syncookie enabled Initial Sequence Number: + * 24 bit MAC + * 3 bit WSCALE index + * 3 bit MSS index + * 1 bit SACK permitted + * 1 bit odd/even secret + * + * References: + * RFC4987 TCP SYN Flooding Attacks and Common Mitigations + * http://cr.yp.to/syncookies.html (overview) + * http://cr.yp.to/syncookies/archive (details) + */ + +//#include "pflog.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x + +union pf_syncookie { + uint8_t cookie; + struct { + uint8_t oddeven:1, + sack_ok:1, + wscale_idx:3, + mss_idx:3; + } flags; +}; + +#define PF_SYNCOOKIE_SECRET_SIZE SIPHASH_KEY_LENGTH +#define PF_SYNCOOKIE_SECRET_LIFETIME 15 /* seconds */ + +/* Protected by PF_RULES_xLOCK. */ +struct pf_syncookie_status { + struct callout keytimeout; + uint8_t oddeven; + uint8_t key[2][SIPHASH_KEY_LENGTH]; +}; +VNET_DEFINE_STATIC(struct pf_syncookie_status, pf_syncookie_status); +#define V_pf_syncookie_status VNET(pf_syncookie_status) + +void pf_syncookie_rotate(void *); +void pf_syncookie_newkey(void); +uint32_t pf_syncookie_mac(struct pf_pdesc *, union pf_syncookie, + uint32_t); +uint32_t pf_syncookie_generate(struct mbuf *m, int off, struct pf_pdesc *, + uint16_t); + +void +pf_syncookies_init(void) +{ + callout_init(&V_pf_syncookie_status.keytimeout, 1); + PF_RULES_WLOCK(); + pf_syncookies_setmode(PF_SYNCOOKIES_NEVER); + PF_RULES_WUNLOCK(); +} + +int +pf_syncookies_setmode(u_int8_t mode) +{ + if (mode > PF_SYNCOOKIES_MODE_MAX) + return (EINVAL); + + if (V_pf_status.syncookies_mode == mode) + return (0); + + V_pf_status.syncookies_mode = mode; + if (V_pf_status.syncookies_mode == PF_SYNCOOKIES_ALWAYS) { + pf_syncookie_newkey(); + V_pf_status.syncookies_active = true; + } + return (0); +} + +int +pf_synflood_check(struct pf_pdesc *pd) +{ + MPASS(pd->proto == IPPROTO_TCP); + PF_RULES_RASSERT(); + + if (pd->pf_mtag && (pd->pf_mtag->tag & PF_TAG_SYNCOOKIE_RECREATED)) + return (0); + + return (V_pf_status.syncookies_mode); +} + +void +pf_syncookie_send(struct mbuf *m, int off, struct pf_pdesc *pd) +{ + uint16_t mss; + uint32_t iss; + + mss = max(V_tcp_mssdflt, pf_get_mss(m, off, pd->hdr.tcp.th_off, pd->af)); + iss = pf_syncookie_generate(m, off, pd, mss); + pf_send_tcp(NULL, pd->af, pd->dst, pd->src, *pd->dport, *pd->sport, + iss, ntohl(pd->hdr.tcp.th_seq) + 1, TH_SYN|TH_ACK, 0, mss, + 0, 1, 0); +} + +uint8_t +pf_syncookie_validate(struct pf_pdesc *pd) +{ + uint32_t hash, ack, seq; + union pf_syncookie cookie; + + MPASS(pd->proto == IPPROTO_TCP); + PF_RULES_RASSERT(); + + seq = ntohl(pd->hdr.tcp.th_seq) - 1; + ack = ntohl(pd->hdr.tcp.th_ack) - 1; + cookie.cookie = (ack & 0xff) ^ (ack >> 24); + + hash = pf_syncookie_mac(pd, cookie, seq); + if ((ack & ~0xff) != (hash & ~0xff)) + return (0); + + counter_u64_add(V_pf_status.lcounters[LCNT_SYNCOOKIES_VALID], 1); + return (1); +} + +/* + * all following functions private + */ +void +pf_syncookie_rotate(void *arg) +{ + CURVNET_SET((struct vnet *)arg); + + /* do we want to disable syncookies? */ + if (V_pf_status.syncookies_active) { + V_pf_status.syncookies_active = false; + DPFPRINTF(PF_DEBUG_MISC, ("syncookies disabled")); + } + + /* nothing in flight any more? delete keys and return */ + if (!V_pf_status.syncookies_active) { + memset(V_pf_syncookie_status.key[0], 0, + PF_SYNCOOKIE_SECRET_SIZE); + memset(V_pf_syncookie_status.key[1], 0, + PF_SYNCOOKIE_SECRET_SIZE); + CURVNET_RESTORE(); + return; + } + + /* new key, including timeout */ + pf_syncookie_newkey(); + + CURVNET_RESTORE(); + printf("KP: %s() return\n", __func__); +} + +void +pf_syncookie_newkey(void) +{ + PF_RULES_WASSERT(); + + V_pf_syncookie_status.oddeven = (V_pf_syncookie_status.oddeven + 1) & 0x1; + arc4random_buf(V_pf_syncookie_status.key[V_pf_syncookie_status.oddeven], + PF_SYNCOOKIE_SECRET_SIZE); + callout_reset(&V_pf_syncookie_status.keytimeout, + PF_SYNCOOKIE_SECRET_LIFETIME, pf_syncookie_rotate, curvnet); +} + +/* + * Distribution and probability of certain MSS values. Those in between are + * rounded down to the next lower one. + * [An Analysis of TCP Maximum Segment Sizes, S. Alcock and R. Nelson, 2011] + * .2% .3% 5% 7% 7% 20% 15% 45% + */ +static int pf_syncookie_msstab[] = + { 216, 536, 1200, 1360, 1400, 1440, 1452, 1460 }; + +/* + * Distribution and probability of certain WSCALE values. + * The absence of the WSCALE option is encoded with index zero. + * [WSCALE values histograms, Allman, 2012] + * X 10 10 35 5 6 14 10% by host + * X 11 4 5 5 18 49 3% by connections + */ +static int pf_syncookie_wstab[] = { 0, 0, 1, 2, 4, 6, 7, 8 }; + +uint32_t +pf_syncookie_mac(struct pf_pdesc *pd, union pf_syncookie cookie, uint32_t seq) +{ + SIPHASH_CTX ctx; + uint32_t siphash[2]; + + PF_RULES_RASSERT(); + MPASS(pd->proto == IPPROTO_TCP); + + SipHash24_Init(&ctx); + SipHash_SetKey(&ctx, V_pf_syncookie_status.key[cookie.flags.oddeven]); + + switch (pd->af) { + case AF_INET: + SipHash_Update(&ctx, pd->src, sizeof(pd->src->v4)); + SipHash_Update(&ctx, pd->dst, sizeof(pd->dst->v4)); + break; + case AF_INET6: + SipHash_Update(&ctx, pd->src, sizeof(pd->src->v6)); + SipHash_Update(&ctx, pd->dst, sizeof(pd->dst->v6)); + break; + default: + panic("unknown address family"); + } + + SipHash_Update(&ctx, pd->sport, sizeof(*pd->sport)); + SipHash_Update(&ctx, pd->dport, sizeof(*pd->dport)); + SipHash_Update(&ctx, &seq, sizeof(seq)); + SipHash_Update(&ctx, &cookie, sizeof(cookie)); + SipHash_Final((uint8_t *)&siphash, &ctx); + + return (siphash[0] ^ siphash[1]); +} + +uint32_t +pf_syncookie_generate(struct mbuf *m, int off, struct pf_pdesc *pd, + uint16_t mss) +{ + uint8_t i, wscale; + uint32_t iss, hash; + union pf_syncookie cookie; + + PF_RULES_RASSERT(); + + cookie.cookie = 0; + + /* map MSS */ + for (i = nitems(pf_syncookie_msstab) - 1; + pf_syncookie_msstab[i] > mss && i > 0; i--) + /* nada */; + cookie.flags.mss_idx = i; + + /* map WSCALE */ + wscale = pf_get_wscale(m, off, pd->hdr.tcp.th_off, pd->af); + for (i = nitems(pf_syncookie_wstab) - 1; + pf_syncookie_wstab[i] > wscale && i > 0; i--) + /* nada */; + cookie.flags.wscale_idx = i; + cookie.flags.sack_ok = 0; /* XXX */ + + cookie.flags.oddeven = V_pf_syncookie_status.oddeven; + hash = pf_syncookie_mac(pd, cookie, ntohl(pd->hdr.tcp.th_seq)); + + /* + * Put the flags into the hash and XOR them to get better ISS number + * variance. This doesn't enhance the cryptographic strength and is + * done to prevent the 8 cookie bits from showing up directly on the + * wire. + */ + iss = hash & ~0xff; + iss |= cookie.cookie ^ (hash >> 24); + + return (iss); +} + +struct mbuf * +pf_syncookie_recreate_syn(uint8_t ttl, int off, struct pf_pdesc *pd) +{ + uint8_t wscale; + uint16_t mss; + uint32_t ack, seq; + union pf_syncookie cookie; + + seq = ntohl(pd->hdr.tcp.th_seq) - 1; + ack = ntohl(pd->hdr.tcp.th_ack) - 1; + cookie.cookie = (ack & 0xff) ^ (ack >> 24); + + if (cookie.flags.mss_idx >= nitems(pf_syncookie_msstab) || + cookie.flags.wscale_idx >= nitems(pf_syncookie_wstab)) + return (NULL); + + mss = pf_syncookie_msstab[cookie.flags.mss_idx]; + wscale = pf_syncookie_wstab[cookie.flags.wscale_idx]; + + return (pf_build_tcp(NULL, pd->af, pd->src, pd->dst, *pd->sport, + *pd->dport, seq, 0, TH_SYN, wscale, mss, ttl, 0, + PF_TAG_SYNCOOKIE_RECREATED)); +} From owner-dev-commits-src-main@freebsd.org Tue Jul 20 08:36:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81948668525; Tue, 20 Jul 2021 08:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTXBc6GPRz4fKF; Tue, 20 Jul 2021 08:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAEB427636; Tue, 20 Jul 2021 08:36: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 16K8au2Q040948; Tue, 20 Jul 2021 08:36:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K8auoZ040947; Tue, 20 Jul 2021 08:36:56 GMT (envelope-from git) Date: Tue, 20 Jul 2021 08:36:56 GMT Message-Id: <202107200836.16K8auoZ040947@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: c69121c473d7 - main - pfctl: syncookie configuration 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: c69121c473d75abab55f9ade8e8138ac09c0942c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 08:36:57 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c69121c473d75abab55f9ade8e8138ac09c0942c commit c69121c473d75abab55f9ade8e8138ac09c0942c Author: Kristof Provost AuthorDate: 2021-05-26 11:41:34 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 08:36:14 +0000 pfctl: syncookie configuration pfctl and libpfctl code required to enable/disable the syncookie feature. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31140 --- lib/libpfctl/libpfctl.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++ lib/libpfctl/libpfctl.h | 11 +++++++++ sbin/pfctl/parse.y | 20 +++++++++++++++-- sbin/pfctl/pfctl.c | 30 +++++++++++++++++++++++-- sbin/pfctl/pfctl_parser.c | 7 +++++- sbin/pfctl/pfctl_parser.h | 3 ++- 6 files changed, 122 insertions(+), 6 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 6421a2c752a8..ced130820d7d 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -816,3 +816,60 @@ pfctl_kill_states(int dev, const struct pfctl_kill *kill, unsigned int *killed) { return (_pfctl_clear_states(dev, kill, killed, DIOCKILLSTATESNV)); } + +int +pfctl_set_syncookies(int dev, const struct pfctl_syncookies *s) +{ + struct pfioc_nv nv; + nvlist_t *nvl; + int ret; + + nvl = nvlist_create(0); + + nvlist_add_bool(nvl, "enabled", s->mode != PFCTL_SYNCOOKIES_NEVER); + nvlist_add_bool(nvl, "adaptive", false); /* XXX TODO */ + + nv.data = nvlist_pack(nvl, &nv.len); + nv.size = nv.len; + nvlist_destroy(nvl); + nvl = NULL; + + ret = ioctl(dev, DIOCSETSYNCOOKIES, &nv); + + free(nv.data); + return (ret); +} + +int +pfctl_get_syncookies(int dev, struct pfctl_syncookies *s) +{ + struct pfioc_nv nv; + nvlist_t *nvl; + bool enabled, adaptive; + + bzero(s, sizeof(*s)); + + nv.data = malloc(128); + nv.len = nv.size = 128; + + if (ioctl(dev, DIOCGETSYNCOOKIES, &nv)) { + free(nv.data); + return (errno); + } + + nvl = nvlist_unpack(nv.data, nv.len, 0); + free(nv.data); + if (nvl == NULL) { + free(nv.data); + return (EIO); + } + + enabled = nvlist_get_bool(nvl, "enabled"); + adaptive = nvlist_get_bool(nvl, "adaptive"); + + s->mode = enabled ? PFCTL_SYNCOOKIES_ALWAYS : PFCTL_SYNCOOKIES_NEVER; + + nvlist_destroy(nvl); + + return (0); +} diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 62866e17f904..d57241dd59fd 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -244,6 +244,15 @@ struct pfctl_states { size_t count; }; +enum pfctl_syncookies_mode { + PFCTL_SYNCOOKIES_NEVER, + PFCTL_SYNCOOKIES_ALWAYS +}; + +struct pfctl_syncookies { + enum pfctl_syncookies_mode mode; +}; + int pfctl_get_rule(int dev, u_int32_t nr, u_int32_t ticket, const char *anchor, u_int32_t ruleset, struct pfctl_rule *rule, char *anchor_call); @@ -260,5 +269,7 @@ int pfctl_clear_states(int dev, const struct pfctl_kill *kill, unsigned int *killed); int pfctl_kill_states(int dev, const struct pfctl_kill *kill, unsigned int *killed); +int pfctl_set_syncookies(int dev, const struct pfctl_syncookies *s); +int pfctl_get_syncookies(int dev, struct pfctl_syncookies *s); #endif diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 74744794370f..dbfe299cf34f 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -464,7 +464,7 @@ int parseport(char *, struct range *r, int); %token REASSEMBLE FRAGDROP FRAGCROP ANCHOR NATANCHOR RDRANCHOR BINATANCHOR %token SET OPTIMIZATION TIMEOUT LIMIT LOGINTERFACE BLOCKPOLICY FAILPOLICY %token RANDOMID REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID -%token ANTISPOOF FOR INCLUDE KEEPCOUNTERS +%token ANTISPOOF FOR INCLUDE KEEPCOUNTERS SYNCOOKIES %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY MAPEPORTSET %token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME %token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET INTERVAL @@ -480,7 +480,7 @@ int parseport(char *, struct range *r, int); %type number icmptype icmp6type uid gid %type tos not yesno %type probability -%type no dir af fragcache optimizer +%type no dir af fragcache optimizer syncookie_val %type sourcetrack flush unaryop statelock %type action nataction natpasslog scrubaction %type flags flag blockspec prio @@ -725,6 +725,21 @@ option : SET OPTIMIZATION STRING { | SET KEEPCOUNTERS { pf->keep_counters = true; } + | SET SYNCOOKIES syncookie_val { + pf->syncookies = $3; + } + ; + +syncookie_val : STRING { + if (!strcmp($1, "never")) + $$ = PFCTL_SYNCOOKIES_NEVER; + else if (!strcmp($1, "always")) + $$ = PFCTL_SYNCOOKIES_ALWAYS; + else { + yyerror("illegal value for syncookies"); + YYERROR; + } + } ; stringall : STRING { $$ = $1; } @@ -5673,6 +5688,7 @@ lookup(char *s) { "state-policy", STATEPOLICY}, { "static-port", STATICPORT}, { "sticky-address", STICKYADDRESS}, + { "syncookies", SYNCOOKIES}, { "synproxy", SYNPROXY}, { "table", TABLE}, { "tag", TAG}, diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 14b7f3a01657..6c689edf7c43 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -93,6 +93,7 @@ int pfctl_load_timeout(struct pfctl *, unsigned int, unsigned int); int pfctl_load_debug(struct pfctl *, unsigned int); int pfctl_load_logif(struct pfctl *, char *); int pfctl_load_hostid(struct pfctl *, u_int32_t); +int pfctl_load_syncookies(struct pfctl *, u_int8_t); int pfctl_get_pool(int, struct pfctl_pool *, u_int32_t, u_int32_t, int, char *); void pfctl_print_rule_counters(struct pfctl_rule *, int); @@ -1307,15 +1308,20 @@ pfctl_show_states(int dev, const char *iface, int opts) int pfctl_show_status(int dev, int opts) { - struct pf_status status; + struct pf_status status; + struct pfctl_syncookies cookies; if (ioctl(dev, DIOCGETSTATUS, &status)) { warn("DIOCGETSTATUS"); return (-1); } + if (pfctl_get_syncookies(dev, &cookies)) { + warn("DIOCGETSYNCOOKIES"); + return (-1); + } if (opts & PF_OPT_SHOWALL) pfctl_print_title("INFO:"); - print_status(&status, opts); + print_status(&status, &cookies, opts); return (0); } @@ -1861,6 +1867,10 @@ pfctl_load_options(struct pfctl *pf) if (pfctl_set_keepcounters(pf->dev, pf->keep_counters)) error = 1; + /* load syncookies settings */ + if (pfctl_load_syncookies(pf, pf->syncookies)) + error = 1; + return (error); } @@ -2047,6 +2057,22 @@ pfctl_load_hostid(struct pfctl *pf, u_int32_t hostid) return (0); } +int +pfctl_load_syncookies(struct pfctl *pf, u_int8_t val) +{ + struct pfctl_syncookies cookies; + + bzero(&cookies, sizeof(cookies)); + + cookies.mode = val ? PFCTL_SYNCOOKIES_ALWAYS : PFCTL_SYNCOOKIES_NEVER; + + if (pfctl_set_syncookies(dev, &cookies)) { + warnx("DIOCSETSYNCOOKIES"); + return (1); + } + return (0); +} + int pfctl_set_debug(struct pfctl *pf, char *d) { diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 62d4b42bd416..8991073ec693 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -497,7 +497,7 @@ const char * const pf_fcounters[FCNT_MAX+1] = FCNT_NAMES; const char * const pf_scounters[FCNT_MAX+1] = FCNT_NAMES; void -print_status(struct pf_status *s, int opts) +print_status(struct pf_status *s, struct pfctl_syncookies *cookies, int opts) { char statline[80], *running; time_t runtime; @@ -627,6 +627,11 @@ print_status(struct pf_status *s, int opts) else printf("%14s\n", ""); } + + printf("Syncookies\n"); + printf(" %-25s %s\n", "mode", + cookies->mode == PFCTL_SYNCOOKIES_NEVER ? + "never" : "always"); } } diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 5353900b380a..0c64238ecefa 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -100,6 +100,7 @@ struct pfctl { u_int32_t hostid; char *ifname; bool keep_counters; + u_int8_t syncookies; u_int8_t timeout_set[PFTM_MAX]; u_int8_t limit_set[PF_LIMIT_MAX]; @@ -278,7 +279,7 @@ void print_pool(struct pfctl_pool *, u_int16_t, u_int16_t, sa_family_t, int); void print_src_node(struct pf_src_node *, int); void print_rule(struct pfctl_rule *, const char *, int, int); void print_tabledef(const char *, int, int, struct node_tinithead *); -void print_status(struct pf_status *, int); +void print_status(struct pf_status *, struct pfctl_syncookies *, int); void print_running(struct pf_status *); int eval_pfaltq(struct pfctl *, struct pf_altq *, struct node_queue_bw *, From owner-dev-commits-src-main@freebsd.org Tue Jul 20 08:37:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC634668224; Tue, 20 Jul 2021 08:37: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 4GTXBh4BmTz4f8X; Tue, 20 Jul 2021 08:36:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09CE1273E7; Tue, 20 Jul 2021 08:36: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 16K8awnO040996; Tue, 20 Jul 2021 08:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K8awZA040995; Tue, 20 Jul 2021 08:36:58 GMT (envelope-from git) Date: Tue, 20 Jul 2021 08:36:58 GMT Message-Id: <202107200836.16K8awZA040995@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: 27ab791a5519 - main - pf tests: ensure syncookie does not create state 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: 27ab791a55191c0b6503391d411303b042b41047 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 08:37:01 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27ab791a55191c0b6503391d411303b042b41047 commit 27ab791a55191c0b6503391d411303b042b41047 Author: Kristof Provost AuthorDate: 2021-06-30 13:27:46 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 08:36:14 +0000 pf tests: ensure syncookie does not create state Test that with syncookies enabled pf does not create state for connections before the remote peer has replied to the SYN|ACK message. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31142 --- tests/sys/netpfil/pf/syncookie.sh | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/sys/netpfil/pf/syncookie.sh b/tests/sys/netpfil/pf/syncookie.sh index 7bd045249be6..49acd9fab11d 100644 --- a/tests/sys/netpfil/pf/syncookie.sh +++ b/tests/sys/netpfil/pf/syncookie.sh @@ -27,6 +27,8 @@ . $(atf_get_srcdir)/utils.subr +common_dir=$(atf_get_srcdir)/../common + atf_test_case "forward" "cleanup" forward_head() { @@ -78,7 +80,54 @@ forward_cleanup() pft_cleanup } +atf_test_case "nostate" "cleanup" +nostate_head() +{ + atf_set descr 'Ensure that we do not create until SYN|ACK' + atf_set require.user root + atf_set require.progs scapy +} + +nostate_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set syncookies always" \ + "pass in" \ + "pass out" + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + # Now syn flood to create many states + ${common_dir}/pft_synflood.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --count 20 + + states=$(jexec alcatraz pfctl -ss | grep tcp) + if [ -n "$states" ]; + then + echo "$states" + atf_fail "Found unexpected state" + fi +} + +nostate_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "forward" + atf_add_test_case "nostate" } From owner-dev-commits-src-main@freebsd.org Tue Jul 20 08:36:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37B9266858B; Tue, 20 Jul 2021 08:36: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 4GTXBf0s4qz4fDR; Tue, 20 Jul 2021 08:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2C9727637; Tue, 20 Jul 2021 08:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K8avUf040972; Tue, 20 Jul 2021 08:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K8avAE040971; Tue, 20 Jul 2021 08:36:57 GMT (envelope-from git) Date: Tue, 20 Jul 2021 08:36:57 GMT Message-Id: <202107200836.16K8avAE040971@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: 3be9301a7e4f - main - pf tests: Forwarding syncookie test 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: 3be9301a7e4fbd630cbde1bd3e1b59ac726e21af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 08:36:59 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3be9301a7e4fbd630cbde1bd3e1b59ac726e21af commit 3be9301a7e4fbd630cbde1bd3e1b59ac726e21af Author: Kristof Provost AuthorDate: 2021-06-02 16:16:03 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 08:36:14 +0000 pf tests: Forwarding syncookie test Test syncookies on a forwarding host. That is, in a setup where the machine (or vnet) running pf is not the same as the machine (or vnet) running the server it's protecting. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31141 --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/syncookie.sh | 84 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 2f92d835772b..2f9ce73f381b 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -26,6 +26,7 @@ ATF_TESTS_SH+= altq \ set_skip \ set_tos \ src_track \ + syncookie \ synproxy \ table \ tos diff --git a/tests/sys/netpfil/pf/syncookie.sh b/tests/sys/netpfil/pf/syncookie.sh new file mode 100644 index 000000000000..7bd045249be6 --- /dev/null +++ b/tests/sys/netpfil/pf/syncookie.sh @@ -0,0 +1,84 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Modirum MDPay +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "forward" "cleanup" +forward_head() +{ + atf_set descr 'Syncookies for forwarded hosts' + atf_set require.user root +} + +forward_body() +{ + pft_init + + epair_in=$(vnet_mkepair) + epair_out=$(vnet_mkepair) + + vnet_mkjail fwd ${epair_in}b ${epair_out}a + vnet_mkjail srv ${epair_out}b + + jexec fwd ifconfig ${epair_in}b 192.0.2.1/24 up + jexec fwd ifconfig ${epair_out}a 198.51.100.1/24 up + jexec fwd sysctl net.inet.ip.forwarding=1 + + jexec srv ifconfig ${epair_out}b 198.51.100.2/24 up + jexec srv route add default 198.51.100.1 + jexec srv /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + ifconfig ${epair_in}a 192.0.2.2/24 up + route add -net 198.51.100.0/24 192.0.2.1 + + jexec fwd pfctl -e + pft_set_rules fwd \ + "set syncookies always" \ + "pass in" \ + "pass out" + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 198.51.100.2 + + reply=$(echo foo | nc -N -w 5 198.51.100.2 7) + if [ "${reply}" != "foo" ]; + then + atf_fail "Failed to connect to syncookie protected echo daemon" + fi +} + +forward_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "forward" +} From owner-dev-commits-src-main@freebsd.org Tue Jul 20 09:29:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5DF76693A1; Tue, 20 Jul 2021 09:29:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTYMl3qF4z4nj3; Tue, 20 Jul 2021 09:29:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 655F727D4B; Tue, 20 Jul 2021 09:29:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16K9Ttmh007772; Tue, 20 Jul 2021 09:29:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16K9Tt6K007771; Tue, 20 Jul 2021 09:29:55 GMT (envelope-from git) Date: Tue, 20 Jul 2021 09:29:55 GMT Message-Id: <202107200929.16K9Tt6K007771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: a40cf4175c90 - main - Implement unprivileged chroot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a40cf4175c90142442d0c6515f6c83956336699b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 09:29:55 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=a40cf4175c90142442d0c6515f6c83956336699b commit a40cf4175c90142442d0c6515f6c83956336699b Author: Edward Tomasz Napierala AuthorDate: 2021-07-20 08:56:04 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-07-20 08:57:53 +0000 Implement unprivileged chroot This builds on recently introduced NO_NEW_PRIVS flag to implement unprivileged chroot, enabled by `security.bsd.unprivileged_chroot`. It allows non-root processes to chroot(2), provided they have the NO_NEW_PRIVS flag set. The chroot(8) utility gets a new flag, -n, which sets NO_NEW_PRIVS before chrooting. Reviewed By: kib Sponsored By: EPSRC Relnotes: yes Differential Revision: https://reviews.freebsd.org/D30130 --- sys/kern/vfs_syscalls.c | 17 +++++++++++++++-- usr.sbin/chroot/chroot.8 | 13 ++++++++++++- usr.sbin/chroot/chroot.c | 20 +++++++++++++++++--- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 0b80faa5a27d..82629a4f5947 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -955,6 +955,10 @@ kern_chdir(struct thread *td, const char *path, enum uio_seg pathseg) return (0); } +static int unprivileged_chroot = 0; +SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_chroot, CTLFLAG_RW, + &unprivileged_chroot, 0, + "Unprivileged processes can use chroot(2)"); /* * Change notion of root (``/'') directory. */ @@ -967,11 +971,20 @@ int sys_chroot(struct thread *td, struct chroot_args *uap) { struct nameidata nd; + struct proc *p; int error; error = priv_check(td, PRIV_VFS_CHROOT); - if (error != 0) - return (error); + if (error != 0) { + p = td->td_proc; + PROC_LOCK(p); + if (unprivileged_chroot == 0 || + (p->p_flag2 & P2_NO_NEW_PRIVS) == 0) { + PROC_UNLOCK(p); + return (error); + } + PROC_UNLOCK(p); + } NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); diff --git a/usr.sbin/chroot/chroot.8 b/usr.sbin/chroot/chroot.8 index 977961abb6ec..9f5b2f380376 100644 --- a/usr.sbin/chroot/chroot.8 +++ b/usr.sbin/chroot/chroot.8 @@ -28,7 +28,7 @@ .\" @(#)chroot.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 27, 2020 +.Dd July 20, 2021 .Dt CHROOT 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Op Fl G Ar group Ns Op Cm \&, Ns Ar group ... .Op Fl g Ar group .Op Fl u Ar user +.Op Fl n .Ar newroot .Op Ar command Op Ar arg ... .Sh DESCRIPTION @@ -61,6 +62,16 @@ Run the command with the permissions of the specified .It Fl u Ar user Run the command as the .Ar user . +.It Fl n +Use the +.Dv PROC_NO_NEW_PRIVS_CTL +.Xr procctl 2 +command before chrooting, effectively disabling SUID/SGID bits +for the calling process and its descendants. +If +.Dv security.bsd.unprivileged_chroot +sysctl is set to 1, it will make it possible to chroot without +superuser privileges. .El .Sh ENVIRONMENT The following environment variable is referenced by diff --git a/usr.sbin/chroot/chroot.c b/usr.sbin/chroot/chroot.c index 60ef631ca875..bb87ae6f0503 100644 --- a/usr.sbin/chroot/chroot.c +++ b/usr.sbin/chroot/chroot.c @@ -44,6 +44,7 @@ static char sccsid[] = "@(#)chroot.c 8.1 (Berkeley) 6/9/93"; __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -67,13 +69,15 @@ main(int argc, char *argv[]) const char *shell; gid_t gid, *gidlist; uid_t uid; - int ch, gids; + int arg, ch, error, gids; long ngroups_max; + bool nonpriviledged; gid = 0; uid = 0; user = group = grouplist = NULL; - while ((ch = getopt(argc, argv, "G:g:u:")) != -1) { + nonpriviledged = false; + while ((ch = getopt(argc, argv, "G:g:u:n")) != -1) { switch(ch) { case 'u': user = optarg; @@ -90,6 +94,9 @@ main(int argc, char *argv[]) if (*grouplist == '\0') usage(); break; + case 'n': + nonpriviledged = true; + break; case '?': default: usage(); @@ -153,6 +160,13 @@ main(int argc, char *argv[]) } } + if (nonpriviledged) { + arg = PROC_NO_NEW_PRIVS_ENABLE; + error = procctl(P_PID, getpid(), PROC_NO_NEW_PRIVS_CTL, &arg); + if (error != 0) + err(1, "procctl"); + } + if (chdir(argv[0]) == -1 || chroot(".") == -1) err(1, "%s", argv[0]); @@ -179,6 +193,6 @@ static void usage(void) { (void)fprintf(stderr, "usage: chroot [-g group] [-G group,group,...] " - "[-u user] newroot [command]\n"); + "[-u user] [-n ] newroot [command]\n"); exit(1); } From owner-dev-commits-src-main@freebsd.org Tue Jul 20 10:40:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B244669E63; Tue, 20 Jul 2021 10:40:38 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [IPv6:2001:19f0:6400:80a1:5054:ff:fe7a:a27d]) (using TLSv1.3 with cipher TLS_AES_256_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 4GTZxL3RJgz3F9R; Tue, 20 Jul 2021 10:40:38 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.16.1/8.16.1) with ESMTP id 16KAeUTD049528; Tue, 20 Jul 2021 13:40:30 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.16.1/8.16.1/Submit) id 16KAeUwd049527; Tue, 20 Jul 2021 13:40:30 +0300 (MSK) (envelope-from dchagin) Date: Tue, 20 Jul 2021 13:40:30 +0300 From: Dmitry Chagin To: Kristof Provost Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8e1864ed0712 - main - pf: syncookie support Message-ID: References: <202107200836.16K8asPR040892@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <202107200836.16K8asPR040892@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4GTZxL3RJgz3F9R X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 10:40:38 -0000 On Tue, Jul 20, 2021 at 08:36:54AM +0000, Kristof Provost wrote: > The branch main has been updated by kp: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D8e1864ed07121b479b95d7e3a5= 931a9e0ffd4713 >=20 > commit 8e1864ed07121b479b95d7e3a5931a9e0ffd4713 > Author: Kristof Provost > AuthorDate: 2021-05-20 09:54:41 +0000 > Commit: Kristof Provost > CommitDate: 2021-07-20 08:36:13 +0000 >=20 > pf: syncookie support > =20 > Import OpenBSD's syncookie support for pf. This feature help pf resist > TCP SYN floods by only creating states once the remote host completes > the TCP handshake rather than when the initial SYN packet is received. > =20 > This is accomplished by using the initial sequence numbers to encode a > cookie (hence the name) in the SYN+ACK response and verifying this on > receipt of the client ACK. > =20 > Reviewed by: kbowling > Obtained from: OpenBSD > MFC after: 1 week > Sponsored by: Modirum MDPay > Differential Revision: https://reviews.freebsd.org/D31138 NOINET6 build fails --- vers.c --- MAKE=3D"make" sh /home/dchagin/freebsd/sys/conf/newvers.sh LINT-NOINET6 --- vers.o --- cc -target i386-unknown-freebsd14.0 --sysroot=3D/home/dchagin/tmp/obj/home/= dchagin/freebsd/i386.i386/tmp -B/home/dchagin/tmp/obj/home/dchagin/freebsd/= i386.i386/tmp/usr/bin -c -O2 -pipe -fno-strict-aliasing -nostdinc -I. -= I/home/dchagin/freebsd/sys -I/home/dchagin/freebsd/sys/contrib/ck/include -= I/home/dchagin/freebsd/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HE= ADERS -include opt_global.h -fno-common -fno-builtin -fdebug-prefix-map= =3D./machine=3D/home/dchagin/freebsd/sys/i386/include -fdebug-prefix-map=3D= =2E/x86=3D/home/dchagin/freebsd/sys/x86/include -mno-mmx -mno-sse -msoft-fl= oat -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnest= ed-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-= qual -Wundef -Wno-pointer-sign -D__printf__=3D__freebsd_kprintf__ -Wmissing= -include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=3Dt= autological-compare -Wno-error=3Dempty-body -Wno-error=3Dparentheses-equali= ty -Wno-error=3Dunused-function -Wno-error=3Dpointer-sign -Wno-error=3Dshif= t-negative-value -Wno-address-of-packed-member -Wno-format-zero-length -m= no-aes -mno-avx -std=3Diso9899:1999 -Werror vers.c --- kernel --- linking kernel ld: warning: common OPENSSL_ia32cap_P is overridden ld: warning: common OPENSSL_ia32cap_P is overridden ld: warning: common OPENSSL_ia32cap_P is overridden ld: warning: common OPENSSL_ia32cap_P is overridden ld: warning: common OPENSSL_ia32cap_P is overridden ld: error: undefined symbol: pf_synflood_check >>> referenced by pf.c >>> pf.o:(pf_test) ld: error: undefined symbol: pf_syncookie_send >>> referenced by pf.c >>> pf.o:(pf_test) ld: error: undefined symbol: pf_syncookie_validate >>> referenced by pf.c >>> pf.o:(pf_test) ld: error: undefined symbol: pf_syncookie_recreate_syn >>> referenced by pf.c >>> pf.o:(pf_test) ld: error: undefined symbol: pf_syncookies_init >>> referenced by pf_ioctl.c >>> pf_ioctl.o:(vnet_pf_init) ld: error: undefined symbol: pf_set_syncookies >>> referenced by pf_ioctl.c >>> pf_ioctl.o:(pfioctl) ld: error: undefined symbol: pf_get_syncookies >>> referenced by pf_ioctl.c >>> pf_ioctl.o:(pfioctl) *** [kernel] Error code 1 make[5]: stopped in /home/dchagin/tmp/obj/home/dchagin/freebsd/i386.i386/sy= s/LINT-NOINET6 1 error make[5]: stopped in /home/dchagin/tmp/obj/home/dchagin/freebsd/i386.i386/sy= s/LINT-NOINET6 make[4]: stopped in /home/dchagin/freebsd make[3]: stopped in /home/dchagin/freebsd From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:21:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 874CD66AB6B; Tue, 20 Jul 2021 11:21: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 4GTbrX3RWCz3M08; Tue, 20 Jul 2021 11:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D8AF1832; Tue, 20 Jul 2021 11:21: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 16KBLWvK067004; Tue, 20 Jul 2021 11:21:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBLW2D067003; Tue, 20 Jul 2021 11:21:32 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:21:32 GMT Message-Id: <202107201121.16KBLW2D067003@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: b7a78d573a56 - main - Start to clean up arm64 address space selection 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: b7a78d573a566c77117af5fe0b259620934a5c7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:21:32 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b7a78d573a566c77117af5fe0b259620934a5c7f commit b7a78d573a566c77117af5fe0b259620934a5c7f Author: Andrew Turner AuthorDate: 2021-07-14 15:19:06 +0000 Commit: Andrew Turner CommitDate: 2021-07-19 21:30:11 +0000 Start to clean up arm64 address space selection On arm64 we should use bit 55 of the address to decide if aan address is a user or kernel address. Add a new macro with this check and a second to ensure the address is in teh canonical form, i.e. the top bits are all zero or all one. This will help with supporting future cpu features, including Top Byte Ignore, Pointer Authentication, and Memory Tagging. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31179 --- sys/arm64/arm64/machdep.c | 10 ++++-- sys/arm64/arm64/pmap.c | 75 ++++++++++++++++++++++++++++++++------------- sys/arm64/arm64/trap.c | 9 +++++- sys/arm64/include/vmparam.h | 7 +++++ 4 files changed, 76 insertions(+), 25 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 25f0a108311e..be9bddf23062 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -377,7 +377,10 @@ set_dbregs(struct thread *td, struct dbreg *regs) addr = regs->db_breakregs[i].dbr_addr; ctrl = regs->db_breakregs[i].dbr_ctrl; - /* Don't let the user set a breakpoint on a kernel address. */ + /* + * Don't let the user set a breakpoint on a kernel or + * non-canonical user address. + */ if (addr >= VM_MAXUSER_ADDRESS) return (EINVAL); @@ -412,7 +415,10 @@ set_dbregs(struct thread *td, struct dbreg *regs) addr = regs->db_watchregs[i].dbw_addr; ctrl = regs->db_watchregs[i].dbw_ctrl; - /* Don't let the user set a watchpoint on a kernel address. */ + /* + * Don't let the user set a watchpoint on a kernel or + * non-canonical user address. + */ if (addr >= VM_MAXUSER_ADDRESS) return (EINVAL); diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 13941f4f61ea..e8a04ee3f2c3 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -466,11 +466,13 @@ pmap_l1_to_l2(pd_entry_t *l1p, vm_offset_t va) l1 = pmap_load(l1p); + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); /* * The valid bit may be clear if pmap_update_entry() is concurrently * modifying the entry, so for KVA only the entry type may be checked. */ - KASSERT(va >= VM_MAX_USER_ADDRESS || (l1 & ATTR_DESCR_VALID) != 0, + KASSERT(ADDR_IS_KERNEL(va) || (l1 & ATTR_DESCR_VALID) != 0, ("%s: L1 entry %#lx for %#lx is invalid", __func__, l1, va)); KASSERT((l1 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE, ("%s: L1 entry %#lx for %#lx is a leaf", __func__, l1, va)); @@ -498,11 +500,13 @@ pmap_l2_to_l3(pd_entry_t *l2p, vm_offset_t va) l2 = pmap_load(l2p); + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); /* * The valid bit may be clear if pmap_update_entry() is concurrently * modifying the entry, so for KVA only the entry type may be checked. */ - KASSERT(va >= VM_MAX_USER_ADDRESS || (l2 & ATTR_DESCR_VALID) != 0, + KASSERT(ADDR_IS_KERNEL(va) || (l2 & ATTR_DESCR_VALID) != 0, ("%s: L2 entry %#lx for %#lx is invalid", __func__, l2, va)); KASSERT((l2 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE, ("%s: L2 entry %#lx for %#lx is a leaf", __func__, l2, va)); @@ -1580,7 +1584,9 @@ pmap_qremove(vm_offset_t sva, int count) vm_offset_t va; int lvl; - KASSERT(sva >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", sva)); + KASSERT(ADDR_IS_CANONICAL(sva), + ("%s: Address not in canonical form: %lx", __func__, sva)); + KASSERT(ADDR_IS_KERNEL(sva), ("usermode va %lx", sva)); va = sva; while (count-- > 0) { @@ -1700,7 +1706,9 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t va, pd_entry_t ptepde, { vm_page_t mpte; - if (va >= VM_MAXUSER_ADDRESS) + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); + if (ADDR_IS_KERNEL(va)) return (0); KASSERT(ptepde != 0, ("pmap_unuse_pt: ptepde != 0")); mpte = PHYS_TO_VM_PAGE(ptepde & ~ATTR_MASK); @@ -1960,17 +1968,20 @@ pmap_alloc_l2(pmap_t pmap, vm_offset_t va, vm_page_t *l2pgp, vm_page_t l2pg; vm_pindex_t l2pindex; + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); + retry: l1 = pmap_l1(pmap, va); if (l1 != NULL && (pmap_load(l1) & ATTR_DESCR_MASK) == L1_TABLE) { l2 = pmap_l1_to_l2(l1, va); - if (va < VM_MAXUSER_ADDRESS) { + if (!ADDR_IS_KERNEL(va)) { /* Add a reference to the L2 page. */ l2pg = PHYS_TO_VM_PAGE(pmap_load(l1) & ~ATTR_MASK); l2pg->ref_count++; } else l2pg = NULL; - } else if (va < VM_MAXUSER_ADDRESS) { + } else if (!ADDR_IS_KERNEL(va)) { /* Allocate a L2 page. */ l2pindex = pmap_l2_pindex(va) >> Ln_ENTRIES_SHIFT; l2pg = _pmap_alloc_l3(pmap, NUL2E + l2pindex, lockp); @@ -2936,11 +2947,15 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_offset_t sva, vm_offset_t va; vm_page_t l3pg, m; + KASSERT(ADDR_IS_CANONICAL(sva), + ("%s: Start address not in canonical form: %lx", __func__, sva)); + KASSERT(ADDR_IS_CANONICAL(eva) || eva == VM_MAX_USER_ADDRESS, + ("%s: End address not in canonical form: %lx", __func__, eva)); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT(rounddown2(sva, L2_SIZE) + L2_SIZE == roundup2(eva, L2_SIZE), ("pmap_remove_l3_range: range crosses an L3 page table boundary")); - l3pg = sva < VM_MAXUSER_ADDRESS ? PHYS_TO_VM_PAGE(l2e & ~ATTR_MASK) : - NULL; + l3pg = !ADDR_IS_KERNEL(sva) ? PHYS_TO_VM_PAGE(l2e & ~ATTR_MASK) : NULL; va = eva; for (l3 = pmap_l2_to_l3(&l2e, sva); sva != eva; l3++, sva += L3_SIZE) { if (!pmap_l3_valid(pmap_load(l3))) { @@ -3701,6 +3716,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, boolean_t nosleep; int lvl, rv; + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); + va = trunc_page(va); if ((m->oflags & VPO_UNMANAGED) == 0) VM_PAGE_OBJECT_BUSY_ASSERT(m); @@ -3712,7 +3730,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, if ((flags & PMAP_ENTER_WIRED) != 0) new_l3 |= ATTR_SW_WIRED; if (pmap->pm_stage == PM_STAGE1) { - if (va < VM_MAXUSER_ADDRESS) + if (!ADDR_IS_KERNEL(va)) new_l3 |= ATTR_S1_AP(ATTR_S1_AP_USER) | ATTR_S1_PXN; else new_l3 |= ATTR_S1_UXN; @@ -3779,7 +3797,7 @@ retry: pde = pmap_pde(pmap, va, &lvl); if (pde != NULL && lvl == 2) { l3 = pmap_l2_to_l3(pde, va); - if (va < VM_MAXUSER_ADDRESS && mpte == NULL) { + if (!ADDR_IS_KERNEL(va) && mpte == NULL) { mpte = PHYS_TO_VM_PAGE(pmap_load(pde) & ~ATTR_MASK); mpte->ref_count++; } @@ -3789,7 +3807,7 @@ retry: if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK && (l3 = pmap_demote_l2_locked(pmap, l2, va, &lock)) != NULL) { l3 = &l3[pmap_l3_index(va)]; - if (va < VM_MAXUSER_ADDRESS) { + if (!ADDR_IS_KERNEL(va)) { mpte = PHYS_TO_VM_PAGE( pmap_load(l2) & ~ATTR_MASK); mpte->ref_count++; @@ -3798,7 +3816,7 @@ retry: } /* We need to allocate an L3 table. */ } - if (va < VM_MAXUSER_ADDRESS) { + if (!ADDR_IS_KERNEL(va)) { nosleep = (flags & PMAP_ENTER_NOSLEEP) != 0; /* @@ -4023,6 +4041,8 @@ pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, PMAP_LOCK_ASSERT(pmap, MA_OWNED); PMAP_ASSERT_STAGE1(pmap); + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); new_l2 = (pd_entry_t)(VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | ATTR_S1_IDX(m->md.pv_memattr) | ATTR_S1_AP(ATTR_S1_AP_RO) | @@ -4034,7 +4054,7 @@ pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == VM_MEMATTR_DEVICE) new_l2 |= ATTR_S1_XN; - if (va < VM_MAXUSER_ADDRESS) + if (!ADDR_IS_KERNEL(va)) new_l2 |= ATTR_S1_AP(ATTR_S1_AP_USER) | ATTR_S1_PXN; else new_l2 |= ATTR_S1_UXN; @@ -4081,6 +4101,8 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, vm_page_t l2pg, mt; PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); if ((l2 = pmap_alloc_l2(pmap, va, &l2pg, (flags & PMAP_ENTER_NOSLEEP) != 0 ? NULL : lockp)) == NULL) { @@ -4095,9 +4117,10 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, if ((old_l2 = pmap_load(l2)) != 0) { KASSERT(l2pg == NULL || l2pg->ref_count > 1, ("pmap_enter_l2: l2pg's ref count is too low")); - if ((flags & PMAP_ENTER_NOREPLACE) != 0 && (va < - VM_MAXUSER_ADDRESS || (old_l2 & ATTR_DESCR_MASK) == - L2_BLOCK || !pmap_every_pte_zero(old_l2 & ~ATTR_MASK))) { + if ((flags & PMAP_ENTER_NOREPLACE) != 0 && + (!ADDR_IS_KERNEL(va) || + (old_l2 & ATTR_DESCR_MASK) == L2_BLOCK || + !pmap_every_pte_zero(old_l2 & ~ATTR_MASK))) { if (l2pg != NULL) l2pg->ref_count--; CTR2(KTR_PMAP, "pmap_enter_l2: failure for va %#lx" @@ -4111,7 +4134,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, else pmap_remove_l3_range(pmap, old_l2, va, va + L2_SIZE, &free, lockp); - if (va < VM_MAXUSER_ADDRESS) { + if (!ADDR_IS_KERNEL(va)) { vm_page_free_pages_toq(&free, true); KASSERT(pmap_load(l2) == 0, ("pmap_enter_l2: non-zero L2 entry %p", l2)); @@ -4260,13 +4283,15 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, ("pmap_enter_quick_locked: managed mapping within the clean submap")); PMAP_LOCK_ASSERT(pmap, MA_OWNED); PMAP_ASSERT_STAGE1(pmap); + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); CTR2(KTR_PMAP, "pmap_enter_quick_locked: %p %lx", pmap, va); /* * In the case that a page table page is not * resident, we are creating it here. */ - if (va < VM_MAXUSER_ADDRESS) { + if (!ADDR_IS_KERNEL(va)) { vm_pindex_t l2pindex; /* @@ -4350,7 +4375,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == VM_MEMATTR_DEVICE) l3_val |= ATTR_S1_XN; - if (va < VM_MAXUSER_ADDRESS) + if (!ADDR_IS_KERNEL(va)) l3_val |= ATTR_S1_AP(ATTR_S1_AP_USER) | ATTR_S1_PXN; else l3_val |= ATTR_S1_UXN; @@ -6110,6 +6135,9 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, PMAP_LOCK_ASSERT(pmap, MA_OWNED); PMAP_ASSERT_STAGE1(pmap); + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); + l3 = NULL; oldl2 = pmap_load(l2); KASSERT((oldl2 & ATTR_DESCR_MASK) == L2_BLOCK, @@ -6149,7 +6177,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, * so the direct map region is the only part of the * kernel address space that must be handled here. */ - KASSERT(va < VM_MAXUSER_ADDRESS || VIRT_IN_DMAP(va), + KASSERT(!ADDR_IS_KERNEL(va) || VIRT_IN_DMAP(va), ("pmap_demote_l2: No saved mpte for va %#lx", va)); /* @@ -6174,7 +6202,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, goto fail; } - if (va < VM_MAXUSER_ADDRESS) { + if (!ADDR_IS_KERNEL(va)) { ml3->ref_count = NL3PG; pmap_resident_count_inc(pmap, 1); } @@ -6537,7 +6565,10 @@ pmap_sync_icache(pmap_t pmap, vm_offset_t va, vm_size_t sz) { PMAP_ASSERT_STAGE1(pmap); - if (va >= VM_MIN_KERNEL_ADDRESS) { + KASSERT(ADDR_IS_CANONICAL(va), + ("%s: Address not in canonical form: %lx", __func__, va)); + + if (ADDR_IS_KERNEL(va)) { cpu_icache_sync_range(va, sz); } else { u_int len, offset; diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index c6dd8c276414..31bdf3e0287f 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -262,8 +262,14 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, else { intr_enable(); + /* We received a TBI/PAC/etc. fault from the kernel */ + if (!ADDR_IS_CANONICAL(far)) { + error = KERN_INVALID_ADDRESS; + goto bad_far; + } + /* The top bit tells us which range to use */ - if (far >= VM_MAXUSER_ADDRESS) { + if (ADDR_IS_KERNEL(far)) { map = kernel_map; } else { map = &p->p_vmspace->vm_map; @@ -307,6 +313,7 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, /* Fault in the page. */ error = vm_fault_trap(map, far, ftype, VM_FAULT_NORMAL, &sig, &ucode); if (error != KERN_SUCCESS) { +bad_far: if (lower) { call_trapsignal(td, sig, ucode, (void *)far, ESR_ELx_EXCEPTION(esr)); diff --git a/sys/arm64/include/vmparam.h b/sys/arm64/include/vmparam.h index a42c68d52887..170fef61b70d 100644 --- a/sys/arm64/include/vmparam.h +++ b/sys/arm64/include/vmparam.h @@ -156,6 +156,13 @@ #define VM_MIN_KERNEL_ADDRESS (0xffff000000000000UL) #define VM_MAX_KERNEL_ADDRESS (0xffff008000000000UL) +/* If true addr is in the kernel address space */ +#define ADDR_IS_KERNEL(addr) (((addr) & (1ul << 55)) == (1ul << 55)) +/* If true addr is in its canonical form (i.e. no TBI, PAC, etc.) */ +#define ADDR_IS_CANONICAL(addr) \ + (((addr) & 0xffff000000000000UL) == 0 || \ + ((addr) & 0xffff000000000000UL) == 0xffff000000000000UL) + /* 95 TiB maximum for the direct map region */ #define DMAP_MIN_ADDRESS (0xffffa00000000000UL) #define DMAP_MAX_ADDRESS (0xffffff0000000000UL) From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:21:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9F0B66A650; Tue, 20 Jul 2021 11:21: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 4GTbrY51LMz3Lmh; Tue, 20 Jul 2021 11:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 818BE1D05; Tue, 20 Jul 2021 11:21: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 16KBLX00067034; Tue, 20 Jul 2021 11:21:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBLXt1067033; Tue, 20 Jul 2021 11:21:33 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:21:33 GMT Message-Id: <202107201121.16KBLXt1067033@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: 04f6015706f7 - main - Split out the arm64 ID field comparison function 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: 04f6015706f73c90ba78699953d0d4d0b0237298 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:21:34 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=04f6015706f73c90ba78699953d0d4d0b0237298 commit 04f6015706f73c90ba78699953d0d4d0b0237298 Author: Andrew Turner AuthorDate: 2021-07-16 12:46:59 +0000 Commit: Andrew Turner CommitDate: 2021-07-19 21:30:11 +0000 Split out the arm64 ID field comparison function This will be useful in an update for finding which HWCAPS to set. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31200 --- sys/arm64/arm64/identcpu.c | 48 ++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index f4ce02791787..f755e004a0a8 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -1147,22 +1147,26 @@ get_kernel_reg(u_int reg, uint64_t *val) return (false); } -static uint64_t -update_lower_register(uint64_t val, uint64_t new_val, u_int shift, - int width, bool sign) +/* + * Compares two field values that may be signed or unsigned. + * Returns: + * < 0 when a is less than b + * = 0 when a equals b + * > 0 when a is greater than b + */ +static int +mrs_field_cmp(uint64_t a, uint64_t b, u_int shift, int width, bool sign) { uint64_t mask; - uint64_t new_field, old_field; - bool update; KASSERT(width > 0 && width < 64, ("%s: Invalid width %d", __func__, width)); mask = (1ul << width) - 1; - new_field = (new_val >> shift) & mask; - old_field = (val >> shift) & mask; + /* Move the field to the lower bits */ + a = (a >> shift) & mask; + b = (b >> shift) & mask; - update = false; if (sign) { /* * The field is signed. Toggle the upper bit so the comparison @@ -1170,17 +1174,29 @@ update_lower_register(uint64_t val, uint64_t new_val, u_int shift, * i.e. those with a 0 bit, larger than negative numbers, * i.e. those with a 1 bit, in an unsigned comparison. */ - if ((new_field ^ (1ul << (width - 1))) < - (old_field ^ (1ul << (width - 1)))) - update = true; - } else { - if (new_field < old_field) - update = true; + a ^= 1ul << (width - 1); + b ^= 1ul << (width - 1); } - if (update) { + return (a - b); +} + +static uint64_t +update_lower_register(uint64_t val, uint64_t new_val, u_int shift, + int width, bool sign) +{ + uint64_t mask; + + KASSERT(width > 0 && width < 64, ("%s: Invalid width %d", __func__, + width)); + + /* + * If the new value is less than the existing value update it. + */ + if (mrs_field_cmp(new_val, val, shift, width, sign) < 0) { + mask = (1ul << width) - 1; val &= ~(mask << shift); - val |= new_field << shift; + val |= new_val & (mask << shift); } return (val); From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:40:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F07366AA53; Tue, 20 Jul 2021 11:40: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 4GTcGt38Glz3PHS; Tue, 20 Jul 2021 11:40:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49EA81E7B; Tue, 20 Jul 2021 11:40: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 16KBesxk089830; Tue, 20 Jul 2021 11:40:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBesDk089829; Tue, 20 Jul 2021 11:40:54 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:40:54 GMT Message-Id: <202107201140.16KBesDk089829@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: 1866eef48435 - main - linux(4): Refactor the struct linux_futex_args. 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: 1866eef48435eda506db32c88ed52605a4cb941a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:40:54 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=1866eef48435eda506db32c88ed52605a4cb941a commit 1866eef48435eda506db32c88ed52605a4cb941a Author: Dmitry Chagin AuthorDate: 2021-07-20 11:37:37 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 11:37:37 +0000 linux(4): Refactor the struct linux_futex_args. Move flags and rtclock to the struct linux_futex_args. This will be used when I split linux_futex() into separate futex op functions. MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index d1fd7725650d..d89b9fd89f3b 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -228,6 +228,8 @@ static int fetch_robust_entry(struct linux_robust_list **, struct linux_futex_args { uint32_t *uaddr; int32_t op; + uint32_t flags; + bool clockrt; uint32_t val; struct timespec *ts; uint32_t *uaddr2; @@ -641,19 +643,19 @@ futex_atomic_op(struct thread *td, int encoded_op, uint32_t *uaddr) static int linux_futex(struct thread *td, struct linux_futex_args *args) { - int clockrt, nrwake, nrrequeue, op_ret, ret; + int nrwake, nrrequeue, op_ret, ret; struct linux_pemuldata *pem; struct waiting_proc *wp; struct futex *f, *f2; struct timespec kts; int error, save; - uint32_t flags, val; + uint32_t val; if (args->op & LINUX_FUTEX_PRIVATE_FLAG) { - flags = 0; + args->flags = 0; args->op &= ~LINUX_FUTEX_PRIVATE_FLAG; } else - flags = FUTEX_SHARED; + args->flags = FUTEX_SHARED; /* * Currently support for switching between CLOCK_MONOTONIC and @@ -661,9 +663,9 @@ linux_futex(struct thread *td, struct linux_futex_args *args) * FUTEX_CLOCK_REALTIME with any op except FUTEX_WAIT_BITSET and * FUTEX_WAIT_REQUEUE_PI. */ - clockrt = args->op & LINUX_FUTEX_CLOCK_REALTIME; + args->clockrt = args->op & LINUX_FUTEX_CLOCK_REALTIME; args->op = args->op & ~LINUX_FUTEX_CLOCK_REALTIME; - if (clockrt && args->op != LINUX_FUTEX_WAIT_BITSET && + if (args->clockrt && args->op != LINUX_FUTEX_WAIT_BITSET && args->op != LINUX_FUTEX_WAIT_REQUEUE_PI) { LIN_SDT_PROBE0(futex, linux_futex, unimplemented_clockswitch); @@ -685,7 +687,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) args->uaddr, args->val, args->val3); if (args->ts != NULL) { - if (clockrt) { + if (args->clockrt) { nanotime(&kts); timespecsub(args->ts, &kts, args->ts); } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { @@ -696,7 +698,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) retry0: error = futex_get(args->uaddr, &wp, &f, - flags | FUTEX_CREATE_WP); + args->flags | FUTEX_CREATE_WP); if (error) return (error); @@ -737,7 +739,7 @@ retry0: args->uaddr, args->val, args->val3); error = futex_get(args->uaddr, NULL, &f, - flags | FUTEX_DONTCREATE); + args->flags | FUTEX_DONTCREATE); if (error) return (error); @@ -778,7 +780,8 @@ retry0: return (EINVAL); retry1: - error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); + error = futex_get(args->uaddr, NULL, &f, + args->flags | FUTEX_DONTLOCK); if (error) return (error); @@ -790,7 +793,7 @@ retry1: * returned by FUTEX_CMP_REQUEUE. */ error = futex_get(args->uaddr2, NULL, &f2, - flags | FUTEX_DONTEXISTS | FUTEX_DONTLOCK); + args->flags | FUTEX_DONTEXISTS | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); return (error); @@ -837,11 +840,13 @@ retry1: return (EINVAL); retry2: - error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); + error = futex_get(args->uaddr, NULL, &f, + args->flags | FUTEX_DONTLOCK); if (error) return (error); - error = futex_get(args->uaddr2, NULL, &f2, flags | FUTEX_DONTLOCK); + error = futex_get(args->uaddr2, NULL, &f2, + args->flags | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); return (error); From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:40:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BC9D66AE38; Tue, 20 Jul 2021 11:40:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTcGv3c8Wz3PZv; Tue, 20 Jul 2021 11:40:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 643581CF9; Tue, 20 Jul 2021 11:40:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KBetGX089854; Tue, 20 Jul 2021 11:40:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBetGZ089853; Tue, 20 Jul 2021 11:40:55 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:40:55 GMT Message-Id: <202107201140.16KBetGZ089853@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: f6b0d275eb9e - main - linux(4): Factor out the FUTEX_WAIT op into linux_futex_wait(). 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: f6b0d275eb9eb89b9719ca835b34116257f6a236 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:40:55 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=f6b0d275eb9eb89b9719ca835b34116257f6a236 commit f6b0d275eb9eb89b9719ca835b34116257f6a236 Author: Dmitry Chagin AuthorDate: 2021-07-20 11:37:51 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 11:37:51 +0000 linux(4): Factor out the FUTEX_WAIT op into linux_futex_wait(). MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 94 +++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 43 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index d89b9fd89f3b..15357e75c8af 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -238,6 +238,7 @@ struct linux_futex_args { }; static int linux_futex(struct thread *, struct linux_futex_args *); +static int linux_futex_wait(struct thread *, struct linux_futex_args *); static void futex_put(struct futex *f, struct waiting_proc *wp) @@ -645,9 +646,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) { int nrwake, nrrequeue, op_ret, ret; struct linux_pemuldata *pem; - struct waiting_proc *wp; struct futex *f, *f2; - struct timespec kts; int error, save; uint32_t val; @@ -686,47 +685,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) LINUX_CTR3(sys_futex, "WAIT uaddr %p val 0x%x bitset 0x%x", args->uaddr, args->val, args->val3); - if (args->ts != NULL) { - if (args->clockrt) { - nanotime(&kts); - timespecsub(args->ts, &kts, args->ts); - } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { - nanouptime(&kts); - timespecsub(args->ts, &kts, args->ts); - } - } - -retry0: - error = futex_get(args->uaddr, &wp, &f, - args->flags | FUTEX_CREATE_WP); - if (error) - return (error); - - error = copyin_nofault(args->uaddr, &val, sizeof(val)); - if (error) { - futex_put(f, wp); - error = copyin(args->uaddr, &val, sizeof(val)); - if (error == 0) - goto retry0; - LIN_SDT_PROBE1(futex, linux_futex, copyin_error, - error); - LINUX_CTR1(sys_futex, "WAIT copyin failed %d", - error); - return (error); - } - if (val != args->val) { - LIN_SDT_PROBE4(futex, linux_futex, - debug_wait_value_neq, args->uaddr, args->val, val, - args->val3); - LINUX_CTR3(sys_futex, - "WAIT uaddr %p val 0x%x != uval 0x%x", - args->uaddr, args->val, val); - futex_put(f, wp); - return (EWOULDBLOCK); - } - - error = futex_wait(f, wp, args->ts, args->val3); - break; + return (linux_futex_wait(td, args)); case LINUX_FUTEX_WAKE: args->val3 = FUTEX_BITSET_MATCH_ANY; @@ -974,6 +933,55 @@ retry2: return (error); } +static int +linux_futex_wait(struct thread *td, struct linux_futex_args *args) +{ + struct waiting_proc *wp; + struct timespec kts; + struct futex *f; + int error; + uint32_t val; + + if (args->ts != NULL) { + if (args->clockrt) { + nanotime(&kts); + timespecsub(args->ts, &kts, args->ts); + } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { + nanouptime(&kts); + timespecsub(args->ts, &kts, args->ts); + } + } + +retry: + f = NULL; + error = futex_get(args->uaddr, &wp, &f, args->flags | FUTEX_CREATE_WP); + if (error != 0) + return (error); + + error = copyin_nofault(args->uaddr, &val, sizeof(val)); + if (error != 0) { + futex_put(f, wp); + error = copyin(args->uaddr, &val, sizeof(val)); + if (error == 0) + goto retry; + LIN_SDT_PROBE1(futex, linux_futex, copyin_error, error); + LINUX_CTR1(sys_futex, "WAIT copyin failed %d", error); + return (error); + } + if (val != args->val) { + LIN_SDT_PROBE4(futex, linux_futex, + debug_wait_value_neq, args->uaddr, args->val, val, + args->val3); + LINUX_CTR3(sys_futex, + "WAIT uaddr %p val 0x%x != uval 0x%x", + args->uaddr, args->val, val); + futex_put(f, wp); + return (EWOULDBLOCK); + } + + return (futex_wait(f, wp, args->ts, args->val3)); +} + int linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) { From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:40:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B19966AD24; Tue, 20 Jul 2021 11:40: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 4GTcGw70MFz3PDx; Tue, 20 Jul 2021 11:40:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 939C01CFB; Tue, 20 Jul 2021 11:40: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 16KBeuPj089884; Tue, 20 Jul 2021 11:40:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBeuLI089883; Tue, 20 Jul 2021 11:40:56 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:40:56 GMT Message-Id: <202107201140.16KBeuLI089883@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: 19f7e2c2fb44 - main - linux(4): Factor out the FUTEX_WAKE op into linux_futex_wake(). 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: 19f7e2c2fb443c1964dcfbd19ca01e2ba37a8c50 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:40:57 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=19f7e2c2fb443c1964dcfbd19ca01e2ba37a8c50 commit 19f7e2c2fb443c1964dcfbd19ca01e2ba37a8c50 Author: Dmitry Chagin AuthorDate: 2021-07-20 11:38:05 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 11:38:05 +0000 linux(4): Factor out the FUTEX_WAKE op into linux_futex_wake(). MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 15357e75c8af..04f767b8aed0 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -239,6 +239,7 @@ struct linux_futex_args { static int linux_futex(struct thread *, struct linux_futex_args *); static int linux_futex_wait(struct thread *, struct linux_futex_args *); +static int linux_futex_wake(struct thread *, struct linux_futex_args *); static void futex_put(struct futex *f, struct waiting_proc *wp) @@ -697,18 +698,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) LINUX_CTR3(sys_futex, "WAKE uaddr %p nrwake 0x%x bitset 0x%x", args->uaddr, args->val, args->val3); - error = futex_get(args->uaddr, NULL, &f, - args->flags | FUTEX_DONTCREATE); - if (error) - return (error); - - if (f == NULL) { - td->td_retval[0] = 0; - return (error); - } - td->td_retval[0] = futex_wake(f, args->val, args->val3); - futex_put(f, NULL); - break; + return (linux_futex_wake(td, args)); case LINUX_FUTEX_CMP_REQUEUE: LIN_SDT_PROBE5(futex, linux_futex, debug_cmp_requeue, @@ -933,6 +923,26 @@ retry2: return (error); } +static int +linux_futex_wake(struct thread *td, struct linux_futex_args *args) +{ + struct futex *f; + int error; + + f = NULL; + error = futex_get(args->uaddr, NULL, &f, args->flags | FUTEX_DONTCREATE); + if (error != 0) + return (error); + + if (f == NULL) { + td->td_retval[0] = 0; + return (error); + } + td->td_retval[0] = futex_wake(f, args->val, args->val3); + futex_put(f, NULL); + return (0); +} + static int linux_futex_wait(struct thread *td, struct linux_futex_args *args) { From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:40:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A05D66A944; Tue, 20 Jul 2021 11:40: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 4GTcGx6YPyz3PSP; Tue, 20 Jul 2021 11:40:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7EDB1B4F; Tue, 20 Jul 2021 11:40: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 16KBevLS089909; Tue, 20 Jul 2021 11:40:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBevTn089908; Tue, 20 Jul 2021 11:40:57 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:40:57 GMT Message-Id: <202107201140.16KBevTn089908@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: bb62a91944fa - main - linux(4): Factor out the FUTEX_CMP_REQUEUE op into linux_futex_requeue(). 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: bb62a91944fa7985ebea29063721c633e28d0752 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:40:58 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=bb62a91944fa7985ebea29063721c633e28d0752 commit bb62a91944fa7985ebea29063721c633e28d0752 Author: Dmitry Chagin AuthorDate: 2021-07-20 11:38:27 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 11:38:27 +0000 linux(4): Factor out the FUTEX_CMP_REQUEUE op into linux_futex_requeue(). MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 148 ++++++++++++++++++++++------------------- 1 file changed, 80 insertions(+), 68 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 04f767b8aed0..71ea8e320d73 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -240,6 +240,7 @@ struct linux_futex_args { static int linux_futex(struct thread *, struct linux_futex_args *); static int linux_futex_wait(struct thread *, struct linux_futex_args *); static int linux_futex_wake(struct thread *, struct linux_futex_args *); +static int linux_futex_requeue(struct thread *, struct linux_futex_args *); static void futex_put(struct futex *f, struct waiting_proc *wp) @@ -645,7 +646,7 @@ futex_atomic_op(struct thread *td, int encoded_op, uint32_t *uaddr) static int linux_futex(struct thread *td, struct linux_futex_args *args) { - int nrwake, nrrequeue, op_ret, ret; + int nrwake, op_ret, ret; struct linux_pemuldata *pem; struct futex *f, *f2; int error, save; @@ -709,73 +710,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) args->uaddr, args->val, args->val3, args->uaddr2, args->ts); - /* - * Linux allows this, we would not, it is an incorrect - * usage of declared ABI, so return EINVAL. - */ - if (args->uaddr == args->uaddr2) { - LIN_SDT_PROBE0(futex, linux_futex, - invalid_cmp_requeue_use); - return (EINVAL); - } - - nrrequeue = (int)(unsigned long)args->ts; - nrwake = args->val; - /* - * Sanity check to prevent signed integer overflow, - * see Linux CVE-2018-6927 - */ - if (nrwake < 0 || nrrequeue < 0) - return (EINVAL); - -retry1: - error = futex_get(args->uaddr, NULL, &f, - args->flags | FUTEX_DONTLOCK); - if (error) - return (error); - - /* - * To avoid deadlocks return EINVAL if second futex - * exists at this time. - * - * Glibc fall back to FUTEX_WAKE in case of any error - * returned by FUTEX_CMP_REQUEUE. - */ - error = futex_get(args->uaddr2, NULL, &f2, - args->flags | FUTEX_DONTEXISTS | FUTEX_DONTLOCK); - if (error) { - futex_put(f, NULL); - return (error); - } - futex_lock(f); - futex_lock(f2); - error = copyin_nofault(args->uaddr, &val, sizeof(val)); - if (error) { - futex_put(f2, NULL); - futex_put(f, NULL); - error = copyin(args->uaddr, &val, sizeof(val)); - if (error == 0) - goto retry1; - LIN_SDT_PROBE1(futex, linux_futex, copyin_error, - error); - LINUX_CTR1(sys_futex, "CMP_REQUEUE copyin failed %d", - error); - return (error); - } - if (val != args->val3) { - LIN_SDT_PROBE2(futex, linux_futex, - debug_cmp_requeue_value_neq, args->val, val); - LINUX_CTR2(sys_futex, "CMP_REQUEUE val 0x%x != uval 0x%x", - args->val, val); - futex_put(f2, NULL); - futex_put(f, NULL); - return (EAGAIN); - } - - td->td_retval[0] = futex_requeue(f, nrwake, f2, nrrequeue); - futex_put(f2, NULL); - futex_put(f, NULL); - break; + return (linux_futex_requeue(td, args)); case LINUX_FUTEX_WAKE_OP: LIN_SDT_PROBE5(futex, linux_futex, debug_wake_op, @@ -923,6 +858,83 @@ retry2: return (error); } +static int +linux_futex_requeue(struct thread *td, struct linux_futex_args *args) +{ + int nrwake, nrrequeue; + struct futex *f, *f2; + int error; + uint32_t val; + + /* + * Linux allows this, we would not, it is an incorrect + * usage of declared ABI, so return EINVAL. + */ + if (args->uaddr == args->uaddr2) { + LIN_SDT_PROBE0(futex, linux_futex, + invalid_cmp_requeue_use); + return (EINVAL); + } + + nrrequeue = (int)(unsigned long)args->ts; + nrwake = args->val; + /* + * Sanity check to prevent signed integer overflow, + * see Linux CVE-2018-6927 + */ + if (nrwake < 0 || nrrequeue < 0) + return (EINVAL); + +retry: + f = f2 = NULL; + error = futex_get(args->uaddr, NULL, &f, args->flags | FUTEX_DONTLOCK); + if (error != 0) + return (error); + + /* + * To avoid deadlocks return EINVAL if second futex + * exists at this time. + * + * Glibc fall back to FUTEX_WAKE in case of any error + * returned by FUTEX_CMP_REQUEUE. + */ + error = futex_get(args->uaddr2, NULL, &f2, + args->flags | FUTEX_DONTEXISTS | FUTEX_DONTLOCK); + if (error != 0) { + futex_put(f, NULL); + return (error); + } + futex_lock(f); + futex_lock(f2); + error = copyin_nofault(args->uaddr, &val, sizeof(val)); + if (error != 0) { + futex_put(f2, NULL); + futex_put(f, NULL); + error = copyin(args->uaddr, &val, sizeof(val)); + if (error == 0) + goto retry; + LIN_SDT_PROBE1(futex, linux_futex, copyin_error, + error); + LINUX_CTR1(sys_futex, "CMP_REQUEUE copyin failed %d", + error); + return (error); + } + if (val != args->val3) { + LIN_SDT_PROBE2(futex, linux_futex, + debug_cmp_requeue_value_neq, args->val, val); + LINUX_CTR2(sys_futex, "CMP_REQUEUE val 0x%x != uval 0x%x", + args->val, val); + futex_put(f2, NULL); + futex_put(f, NULL); + return (EAGAIN); + } + + td->td_retval[0] = futex_requeue(f, nrwake, f2, nrrequeue); + futex_put(f2, NULL); + futex_put(f, NULL); + return (0); +} + static int linux_futex_wake(struct thread *td, struct linux_futex_args *args) { From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:40:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ED5366AE98; Tue, 20 Jul 2021 11:40: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 4GTcGy6m47z3PKL; Tue, 20 Jul 2021 11:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE0641DB3; Tue, 20 Jul 2021 11:40: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 16KBewdh089933; Tue, 20 Jul 2021 11:40:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBewg3089932; Tue, 20 Jul 2021 11:40:58 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:40:58 GMT Message-Id: <202107201140.16KBewg3089932@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: 4c361d7a5acc - main - linux(4): Factor out the FUTEX_WAKE_OP op into linux_futex_wakeop(). 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: 4c361d7a5acc04f3da304a605855e23774449204 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:40:59 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=4c361d7a5acc04f3da304a605855e23774449204 commit 4c361d7a5acc04f3da304a605855e23774449204 Author: Dmitry Chagin AuthorDate: 2021-07-20 11:38:44 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 11:38:44 +0000 linux(4): Factor out the FUTEX_WAKE_OP op into linux_futex_wakeop(). MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 130 +++++++++++++++++++++-------------------- 1 file changed, 66 insertions(+), 64 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 71ea8e320d73..1ba11ed3fc57 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -241,6 +241,7 @@ static int linux_futex(struct thread *, struct linux_futex_args *); static int linux_futex_wait(struct thread *, struct linux_futex_args *); static int linux_futex_wake(struct thread *, struct linux_futex_args *); static int linux_futex_requeue(struct thread *, struct linux_futex_args *); +static int linux_futex_wakeop(struct thread *, struct linux_futex_args *); static void futex_put(struct futex *f, struct waiting_proc *wp) @@ -646,11 +647,7 @@ futex_atomic_op(struct thread *td, int encoded_op, uint32_t *uaddr) static int linux_futex(struct thread *td, struct linux_futex_args *args) { - int nrwake, op_ret, ret; struct linux_pemuldata *pem; - struct futex *f, *f2; - int error, save; - uint32_t val; if (args->op & LINUX_FUTEX_PRIVATE_FLAG) { args->flags = 0; @@ -673,9 +670,6 @@ linux_futex(struct thread *td, struct linux_futex_args *args) return (ENOSYS); } - error = 0; - f = f2 = NULL; - switch (args->op) { case LINUX_FUTEX_WAIT: args->val3 = FUTEX_BITSET_MATCH_ANY; @@ -720,62 +714,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) args->uaddr, args->val, args->uaddr2, args->val3, args->ts); - if (args->uaddr == args->uaddr2) - return (EINVAL); - -retry2: - error = futex_get(args->uaddr, NULL, &f, - args->flags | FUTEX_DONTLOCK); - if (error) - return (error); - - error = futex_get(args->uaddr2, NULL, &f2, - args->flags | FUTEX_DONTLOCK); - if (error) { - futex_put(f, NULL); - return (error); - } - futex_lock(f); - futex_lock(f2); - - /* - * This function returns positive number as results and - * negative as errors - */ - save = vm_fault_disable_pagefaults(); - op_ret = futex_atomic_op(td, args->val3, args->uaddr2); - vm_fault_enable_pagefaults(save); - - LINUX_CTR2(sys_futex, "WAKE_OP atomic_op uaddr %p ret 0x%x", - args->uaddr, op_ret); - - if (op_ret < 0) { - if (f2 != NULL) - futex_put(f2, NULL); - futex_put(f, NULL); - error = copyin(args->uaddr2, &val, sizeof(val)); - if (error == 0) - goto retry2; - return (error); - } - - ret = futex_wake(f, args->val, args->val3); - - if (op_ret > 0) { - op_ret = 0; - nrwake = (int)(unsigned long)args->ts; - - if (f2 != NULL) - op_ret += futex_wake(f2, nrwake, args->val3); - else - op_ret += futex_wake(f, nrwake, args->val3); - ret += op_ret; - } - if (f2 != NULL) - futex_put(f2, NULL); - futex_put(f, NULL); - td->td_retval[0] = ret; - break; + return (linux_futex_wakeop(td, args)); case LINUX_FUTEX_LOCK_PI: /* not yet implemented */ @@ -854,8 +793,71 @@ retry2: args->op); return (ENOSYS); } +} - return (error); +static int +linux_futex_wakeop(struct thread *td, struct linux_futex_args *args) +{ + int nrwake, op_ret, ret; + struct futex *f, *f2; + int error, save; + uint32_t val; + + if (args->uaddr == args->uaddr2) + return (EINVAL); + +retry: + f = f2 = NULL; + error = futex_get(args->uaddr, NULL, &f, args->flags | FUTEX_DONTLOCK); + if (error != 0) + return (error); + + error = futex_get(args->uaddr2, NULL, &f2, args->flags | FUTEX_DONTLOCK); + if (error != 0) { + futex_put(f, NULL); + return (error); + } + futex_lock(f); + futex_lock(f2); + + /* + * This function returns positive number as results and + * negative as errors + */ + save = vm_fault_disable_pagefaults(); + op_ret = futex_atomic_op(td, args->val3, args->uaddr2); + vm_fault_enable_pagefaults(save); + + LINUX_CTR2(sys_futex, "WAKE_OP atomic_op uaddr %p ret 0x%x", + args->uaddr, op_ret); + + if (op_ret < 0) { + if (f2 != NULL) + futex_put(f2, NULL); + futex_put(f, NULL); + error = copyin(args->uaddr2, &val, sizeof(val)); + if (error == 0) + goto retry; + return (error); + } + + ret = futex_wake(f, args->val, args->val3); + + if (op_ret > 0) { + op_ret = 0; + nrwake = (int)(unsigned long)args->ts; + + if (f2 != NULL) + op_ret += futex_wake(f2, nrwake, args->val3); + else + op_ret += futex_wake(f, nrwake, args->val3); + ret += op_ret; + } + if (f2 != NULL) + futex_put(f2, NULL); + futex_put(f, NULL); + td->td_retval[0] = ret; + return (0); } static int From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:41:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B80666AF00; Tue, 20 Jul 2021 11:41: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 4GTcH14Z1wz3PXp; Tue, 20 Jul 2021 11:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18A171EEF; Tue, 20 Jul 2021 11:41: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 16KBf1ID089985; Tue, 20 Jul 2021 11:41:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBf1Ll089984; Tue, 20 Jul 2021 11:41:01 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:41:01 GMT Message-Id: <202107201141.16KBf1Ll089984@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: 80b8d6b144c2 - main - linux(4): Eliminate bogus comment. 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: 80b8d6b144c2f22dda252efe0d9fc70a1c8e15b7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:41:02 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=80b8d6b144c2f22dda252efe0d9fc70a1c8e15b7 commit 80b8d6b144c2f22dda252efe0d9fc70a1c8e15b7 Author: Dmitry Chagin AuthorDate: 2021-07-20 11:39:56 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 11:39:56 +0000 linux(4): Eliminate bogus comment. For the caller is no need for access checking here, as the caller must take care of EFAULT handling. Moreover, this check would be superfluous, since EFAULT is extremily rare, and we prefer the fast path. MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 2ee18c26cf24..f69b13585022 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -115,7 +115,6 @@ LIN_SDT_PROBE_DEFINE3(futex, futex_requeue, requeue, "uint32_t *", LIN_SDT_PROBE_DEFINE1(futex, futex_wait, sleep_error, "int"); LIN_SDT_PROBE_DEFINE4(futex, futex_atomic_op, decoded_op, "int", "int", "int", "int"); -LIN_SDT_PROBE_DEFINE0(futex, futex_atomic_op, missing_access_check); LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, unimplemented_op, "int"); LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, unimplemented_cmp, "int"); LIN_SDT_PROBE_DEFINE0(futex, linux_futex, unimplemented_clockswitch); @@ -591,9 +590,6 @@ futex_atomic_op(struct thread *td, int encoded_op, uint32_t *uaddr) LIN_SDT_PROBE4(futex, futex_atomic_op, decoded_op, op, cmp, oparg, cmparg); - /* XXX: Linux verifies access here and returns EFAULT */ - LIN_SDT_PROBE0(futex, futex_atomic_op, missing_access_check); - switch (op) { case FUTEX_OP_SET: ret = futex_xchgl(oparg, uaddr, &oldval); From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:41:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEDD366AB99; Tue, 20 Jul 2021 11:41: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 4GTcH01fSBz3PKP; Tue, 20 Jul 2021 11:41:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 048F21DB5; Tue, 20 Jul 2021 11:41: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 16KBexCX089961; Tue, 20 Jul 2021 11:40:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBexRo089960; Tue, 20 Jul 2021 11:40:59 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:40:59 GMT Message-Id: <202107201140.16KBexRo089960@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: cf8d74e3fe63 - main - linux(4): Allow musl brand to use FUTEX_REQUEUE op. 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: cf8d74e3fe63da7359d6ca7e0b4b57c5684c2845 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:41:00 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=cf8d74e3fe63da7359d6ca7e0b4b57c5684c2845 commit cf8d74e3fe63da7359d6ca7e0b4b57c5684c2845 Author: Dmitry Chagin AuthorDate: 2021-07-20 11:39:20 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 11:39:20 +0000 linux(4): Allow musl brand to use FUTEX_REQUEUE op. Initial patch from submitter was adapted by me to prevent unconditional FUTEX_REQUEUE use. PR: 255947 Submitted by: Philippe Michaud-Boudreault Differential Revision: https://reviews.freebsd.org/D30332 --- sys/amd64/linux/linux_sysvec.c | 3 ++- sys/amd64/linux32/linux32_sysvec.c | 3 ++- sys/compat/linux/linux.h | 5 ++++ sys/compat/linux/linux_futex.c | 49 +++++++++++++++++++++++++------------- sys/i386/linux/linux_sysvec.c | 3 ++- 5 files changed, 43 insertions(+), 20 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index dc9a77093bcd..fede294ce706 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -991,7 +991,8 @@ static Elf64_Brandinfo linux_muslbrand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux64_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | + LINUX_BI_FUTEX_REQUEUE }; Elf64_Brandinfo *linux_brandlist[] = { diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 5176029605bf..901c79fcdda8 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -1154,7 +1154,8 @@ static Elf32_Brandinfo linux_muslbrand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | + LINUX_BI_FUTEX_REQUEUE }; Elf32_Brandinfo *linux_brandlist[] = { diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index 15830b5b387e..730aece66a6a 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -30,6 +30,11 @@ #include +/* + * Private Brandinfo flags + */ +#define LINUX_BI_FUTEX_REQUEUE 0x01000000 + /* * poll() */ diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 1ba11ed3fc57..2ee18c26cf24 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -46,6 +46,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.7 2006/07/24 19:01:49 manu Exp $") #include #include #include +#include #include #include #include @@ -234,6 +235,7 @@ struct linux_futex_args { struct timespec *ts; uint32_t *uaddr2; uint32_t val3; + bool val3_compare; struct timespec kts; }; @@ -648,6 +650,7 @@ static int linux_futex(struct thread *td, struct linux_futex_args *args) { struct linux_pemuldata *pem; + struct proc *p; if (args->op & LINUX_FUTEX_PRIVATE_FLAG) { args->flags = 0; @@ -695,6 +698,33 @@ linux_futex(struct thread *td, struct linux_futex_args *args) return (linux_futex_wake(td, args)); + case LINUX_FUTEX_REQUEUE: + /* + * Glibc does not use this operation since version 2.3.3, + * as it is racy and replaced by FUTEX_CMP_REQUEUE operation. + * Glibc versions prior to 2.3.3 fall back to FUTEX_WAKE when + * FUTEX_REQUEUE returned EINVAL. + */ + pem = pem_find(td->td_proc); + if ((pem->flags & LINUX_XDEPR_REQUEUEOP) == 0) { + linux_msg(td, "unsupported FUTEX_REQUEUE"); + pem->flags |= LINUX_XDEPR_REQUEUEOP; + LIN_SDT_PROBE0(futex, linux_futex, + deprecated_requeue); + } + + /* + * The above is true, however musl libc does make use of the + * futex requeue operation, allow operation for brands which + * set LINUX_BI_FUTEX_REQUEUE bit of Brandinfo flags. + */ + p = td->td_proc; + Elf_Brandinfo *bi = p->p_elf_brandinfo; + if (bi == NULL || ((bi->flags & LINUX_BI_FUTEX_REQUEUE)) == 0) + return (EINVAL); + args->val3_compare = false; + /* FALLTHROUGH */ + case LINUX_FUTEX_CMP_REQUEUE: LIN_SDT_PROBE5(futex, linux_futex, debug_cmp_requeue, args->uaddr, args->val, args->val3, args->uaddr2, @@ -749,22 +779,6 @@ linux_futex(struct thread *td, struct linux_futex_args *args) } return (ENOSYS); - case LINUX_FUTEX_REQUEUE: - /* - * Glibc does not use this operation since version 2.3.3, - * as it is racy and replaced by FUTEX_CMP_REQUEUE operation. - * Glibc versions prior to 2.3.3 fall back to FUTEX_WAKE when - * FUTEX_REQUEUE returned EINVAL. - */ - pem = pem_find(td->td_proc); - if ((pem->flags & LINUX_XDEPR_REQUEUEOP) == 0) { - linux_msg(td, "unsupported FUTEX_REQUEUE"); - pem->flags |= LINUX_XDEPR_REQUEUEOP; - LIN_SDT_PROBE0(futex, linux_futex, - deprecated_requeue); - } - return (EINVAL); - case LINUX_FUTEX_WAIT_REQUEUE_PI: /* not yet implemented */ pem = pem_find(td->td_proc); @@ -921,7 +935,7 @@ retry: error); return (error); } - if (val != args->val3) { + if (args->val3_compare == true && val != args->val3) { LIN_SDT_PROBE2(futex, linux_futex, debug_cmp_requeue_value_neq, args->val, val); LINUX_CTR2(sys_futex, "CMP_REQUEUE val 0x%x != uval 0x%x", @@ -1016,6 +1030,7 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) .ts = NULL, .uaddr2 = args->uaddr2, .val3 = args->val3, + .val3_compare = true, }; struct l_timespec lts; int error; diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index f3101db96d41..1fcc1b6eb5a0 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -1099,7 +1099,8 @@ static Elf32_Brandinfo linux_muslbrand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | + LINUX_BI_FUTEX_REQUEUE }; Elf32_Brandinfo *linux_brandlist[] = { From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:41:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F85066AC3C; Tue, 20 Jul 2021 11:41: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 4GTcH23v2Pz3PbQ; Tue, 20 Jul 2021 11:41:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AD0D1D32; Tue, 20 Jul 2021 11:41: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 16KBf2eF090013; Tue, 20 Jul 2021 11:41:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBf2Ge090012; Tue, 20 Jul 2021 11:41:02 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:41:02 GMT Message-Id: <202107201141.16KBf2Ge090012@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: ef4251e27148 - main - linux(4): Prevent an endless loop. 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: ef4251e271486227f577494b8cc48623772a74ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:41:03 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=ef4251e271486227f577494b8cc48623772a74ab commit ef4251e271486227f577494b8cc48623772a74ab Author: Dmitry Chagin AuthorDate: 2021-07-20 11:40:08 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 11:40:08 +0000 linux(4): Prevent an endless loop. In the futex_atomic_op() the encoded_op is a user-supplied parameter. If the user specifies an incorrect value for this parameter paired with a valid *uaddr parameter the caller will go into the endless loop. To prevent this check futex_atomic_op() result and break the loop in case of ENOSYS. MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index f69b13585022..a32542b16a8a 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -845,6 +845,8 @@ retry: if (f2 != NULL) futex_put(f2, NULL); futex_put(f, NULL); + if (op_ret == -ENOSYS) + return (ENOSYS); error = copyin(args->uaddr2, &val, sizeof(val)); if (error == 0) goto retry; From owner-dev-commits-src-main@freebsd.org Tue Jul 20 11:41:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3556466AC8F; Tue, 20 Jul 2021 11:41: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 4GTcH34klWz3PbY; Tue, 20 Jul 2021 11:41:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AD23186A; Tue, 20 Jul 2021 11:41: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 16KBf3vw090039; Tue, 20 Jul 2021 11:41:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KBf3gp090038; Tue, 20 Jul 2021 11:41:03 GMT (envelope-from git) Date: Tue, 20 Jul 2021 11:41:03 GMT Message-Id: <202107201141.16KBf3gp090038@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: 75cb2382b84d - main - linux(4): Factor out the futex_wait() op into linux_futex_wait(). 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: 75cb2382b84d2a7c385e98a18da209236701494e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 11:41:04 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=75cb2382b84d2a7c385e98a18da209236701494e commit 75cb2382b84d2a7c385e98a18da209236701494e Author: Dmitry Chagin AuthorDate: 2021-07-20 11:40:24 +0000 Commit: Dmitry Chagin CommitDate: 2021-07-20 11:40:24 +0000 linux(4): Factor out the futex_wait() op into linux_futex_wait(). MFC after: 2 weeks --- sys/compat/linux/linux_futex.c | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index a32542b16a8a..1858c573a576 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -215,8 +215,6 @@ static int futex_get(uint32_t *, struct waiting_proc **, struct futex **, static int futex_sleep(struct futex *, struct waiting_proc *, struct timespec *); static int futex_wake(struct futex *, int, uint32_t); static int futex_requeue(struct futex *, int, struct futex *, int); -static int futex_wait(struct futex *, struct waiting_proc *, struct timespec *, - uint32_t); static void futex_lock(struct futex *); static void futex_unlock(struct futex *); static int futex_atomic_op(struct thread *, int, uint32_t *); @@ -554,27 +552,6 @@ futex_requeue(struct futex *f, int nrwake, struct futex *f2, return (count); } -static int -futex_wait(struct futex *f, struct waiting_proc *wp, struct timespec *ts, - uint32_t bitset) -{ - int error; - - if (bitset == 0) { - futex_put(f, wp); - return (EINVAL); - } - - f->f_bitset = bitset; - error = futex_sleep(f, wp, ts); - if (error) - LIN_SDT_PROBE1(futex, futex_wait, sleep_error, error); - if (error == EWOULDBLOCK) - error = ETIMEDOUT; - - return (error); -} - static int futex_atomic_op(struct thread *td, int encoded_op, uint32_t *uaddr) { @@ -1015,7 +992,18 @@ retry: return (EWOULDBLOCK); } - return (futex_wait(f, wp, args->ts, args->val3)); + if (args->val3 == 0) { + futex_put(f, wp); + return (EINVAL); + } + + f->f_bitset = args->val3; + error = futex_sleep(f, wp, args->ts); + if (error != 0) + LIN_SDT_PROBE1(futex, futex_wait, sleep_error, error); + if (error == EWOULDBLOCK) + error = ETIMEDOUT; + return (error); } int From owner-dev-commits-src-main@freebsd.org Tue Jul 20 15:10:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F39066DDE7; Tue, 20 Jul 2021 15:10: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 4GThwx6Tp1z4jM9; Tue, 20 Jul 2021 15:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3BD14DAF; Tue, 20 Jul 2021 15:10: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 16KFAfkr070255; Tue, 20 Jul 2021 15:10:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KFAfG6070254; Tue, 20 Jul 2021 15:10:41 GMT (envelope-from git) Date: Tue, 20 Jul 2021 15:10:41 GMT Message-Id: <202107201510.16KFAfG6070254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: f8147dad44f1 - main - bsd.linker.mk: Detect LLD when built with PACKAGE_VENDOR MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8147dad44f1036160a413bb00b4e8b41f7a4a84 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 15:10:42 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=f8147dad44f1036160a413bb00b4e8b41f7a4a84 commit f8147dad44f1036160a413bb00b4e8b41f7a4a84 Author: Alex Richardson AuthorDate: 2021-07-20 15:04:56 +0000 Commit: Alex Richardson CommitDate: 2021-07-20 15:10:22 +0000 bsd.linker.mk: Detect LLD when built with PACKAGE_VENDOR Recent versions of homebrew's LLD are built with PACKAGE_VENDOR (since https://github.com/Homebrew/homebrew-core/commit/e7c972b6062af753e564104e58d1fa20c0d1ad7a). This means that the -v output is now `Homebrew LLD 12.0.1 (compatible with GNU linkers)` and bsd.linker.mk no longer detects it as LLD since it only checks whether the first word is LLD. This change allow me to build on macOS again and should unbreak the GitHub actions CI. Reviewed By: imp, uqs MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D31224 --- share/mk/bsd.linker.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.linker.mk b/share/mk/bsd.linker.mk index 344a5b937380..7209d7f173ae 100644 --- a/share/mk/bsd.linker.mk +++ b/share/mk/bsd.linker.mk @@ -69,7 +69,9 @@ _ld_version!= (${${ld}} -v 2>&1 || echo none) | sed -n 1p ${X_}LINKER_TYPE= bfd ${X_}LINKER_FREEBSD_VERSION= 0 _v= ${_ld_version:M[1-9]*.[0-9]*:[1]} -.elif ${_ld_version:[1]} == "LLD" +.elif ${_ld_version:MLLD} +# Strip any leading PACKAGE_VENDOR string (e.g. "Homebrew") +_ld_version:=${_ld_version:[*]:C/^.* LLD /LLD /:[@]} ${X_}LINKER_TYPE= lld _v= ${_ld_version:[2]} .if ${_ld_version:[3]} == "(FreeBSD" From owner-dev-commits-src-main@freebsd.org Tue Jul 20 15:52:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C59A966E78C; Tue, 20 Jul 2021 15:52: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 4GTjrf56vKz4t2l; Tue, 20 Jul 2021 15:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 963CB56CC; Tue, 20 Jul 2021 15:52: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 16KFq2CX027046; Tue, 20 Jul 2021 15:52:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KFq27F027045; Tue, 20 Jul 2021 15:52:02 GMT (envelope-from git) Date: Tue, 20 Jul 2021 15:52:02 GMT Message-Id: <202107201552.16KFq27F027045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Ulrich Sp=C3=B6rlein?= Subject: git: 2f677dcedf3b - main - Make it clear we're running clang-12 for the GH actions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: uqs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f677dcedf3b70bf97a51c2b0fd9927b67c666ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 15:52:02 -0000 The branch main has been updated by uqs: URL: https://cgit.FreeBSD.org/src/commit/?id=2f677dcedf3b70bf97a51c2b0fd9927b67c666ff commit 2f677dcedf3b70bf97a51c2b0fd9927b67c666ff Author: Ulrich Spörlein AuthorDate: 2021-07-19 08:25:58 +0000 Commit: Ulrich Spörlein CommitDate: 2021-07-20 15:49:25 +0000 Make it clear we're running clang-12 for the GH actions This chases a homebrew change in the default clang version. Reviewed by: arichardson Differential Revision: https://reviews.freebsd.org/D31231 --- .github/workflows/cross-bootstrap-tools.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index 22aa1065d44b..7666dfdcf2c7 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -23,10 +23,10 @@ jobs: compiler: clang-10 cross-bindir: /usr/lib/llvm-10/bin pkgs: bmake libarchive-dev clang-10 lld-10 - - os: macOS-latest - compiler: clang-11 + - os: macos-latest + compiler: clang-12 + cross-bindir: /usr/local/opt/llvm/bin pkgs: bmake libarchive - steps: - uses: actions/checkout@v2 - name: install packages (Ubuntu) From owner-dev-commits-src-main@freebsd.org Tue Jul 20 16:09:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40DA266EE13; Tue, 20 Jul 2021 16:09: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 4GTkDS0vJzz4xDp; Tue, 20 Jul 2021 16:09:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 065145A4C; Tue, 20 Jul 2021 16:09: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 16KG9BaA042449; Tue, 20 Jul 2021 16:09:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KG9BHk042448; Tue, 20 Jul 2021 16:09:11 GMT (envelope-from git) Date: Tue, 20 Jul 2021 16:09:11 GMT Message-Id: <202107201609.16KG9BHk042448@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: b972a7fa9e1e - main - pf: fix LINT build 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: b972a7fa9e1e01367435a5699b71cc7b5e494fee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 16:09:12 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b972a7fa9e1e01367435a5699b71cc7b5e494fee commit b972a7fa9e1e01367435a5699b71cc7b5e494fee Author: Kristof Provost AuthorDate: 2021-07-20 14:48:35 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 16:08:30 +0000 pf: fix LINT build We failed to list the new pf_syncookies.c file in sys/conf/files. This worked for the usual configurations, where pf is a module, but not for LINT builds. Reported by: lwhsu MFC after: 1 week Sponsored by: Modirum MDPay --- sys/conf/files | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/conf/files b/sys/conf/files index ee1e356d9f61..5e47c907e793 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4536,6 +4536,7 @@ netpfil/pf/pf_norm.c optional pf inet netpfil/pf/pf_nv.c optional pf inet netpfil/pf/pf_osfp.c optional pf inet netpfil/pf/pf_ruleset.c optional pf inet +netpfil/pf/pf_syncookies.c optional pf inet netpfil/pf/pf_table.c optional pf inet netpfil/pf/in4_cksum.c optional pf inet netsmb/smb_conn.c optional netsmb From owner-dev-commits-src-main@freebsd.org Tue Jul 20 16:10:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A8C066EF87; Tue, 20 Jul 2021 16:10:17 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTkFg5kdqz4xSX; Tue, 20 Jul 2021 16:10:15 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-qv1-f46.google.com with SMTP id ay16so10309599qvb.12; Tue, 20 Jul 2021 09:10:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=B78Ad2q6YPBOo/RdtkDPjcKLFJxbrn1bxJZvPPdApso=; b=gH/VOkgGdMHvc6RNvA/53uUnG9xkmMsLpMqS5IA3mkTBotPbfQ/1U6tofgmRzwz5SX BxbAiIJPwVR6agxQs+2oQKijVVqdusqSyxGULif6w4nMROqbxc0mb+ppCbi84tOfzG+6 HRXvTsLU+SqtYROXALA1e3bZOJ7hfNZzujhLz9S9zea49cZ6sPwJWsyU01uB61mhLp30 6E8Su6K+ciH9dDNe5b0rHfKRNp7OGtZkvBg2faq0xDnj9GYuD5o9+W85jAnLQhsrSeno H5+nqR11ggdauy4XwkdAQWSOr9fCT5hKT+7+UXADSPT50wWUlDwmJN1Xm9t3hbW0hJg6 XIxw== X-Gm-Message-State: AOAM5301RERG8pINHJ5eLOBJHvrhrL9R98iz/65aXd+gCXYJNv6Rlr0I GtrL47u8t3cAi7k5q9Ju9UUfTtY59FQ= X-Google-Smtp-Source: ABdhPJznjzPsOqKA0sB/c6UxGQT26HdBIfINN8uElpD8SsoCegLJdIrBoPoD7NE1SyRTBnYfpj23MA== X-Received: by 2002:a0c:ec02:: with SMTP id y2mr31064206qvo.61.1626797414512; Tue, 20 Jul 2021 09:10:14 -0700 (PDT) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com. [209.85.219.178]) by smtp.gmail.com with ESMTPSA id e2sm10010019qkn.69.2021.07.20.09.10.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Jul 2021 09:10:14 -0700 (PDT) Received: by mail-yb1-f178.google.com with SMTP id b13so33466602ybk.4; Tue, 20 Jul 2021 09:10:14 -0700 (PDT) X-Received: by 2002:a25:db85:: with SMTP id g127mr38201731ybf.418.1626797414030; Tue, 20 Jul 2021 09:10:14 -0700 (PDT) MIME-Version: 1.0 References: <202107072012.167KC1IL065912@gitrepo.freebsd.org> In-Reply-To: From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Tue, 20 Jul 2021 16:09:59 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: f6043a672135 - main - ObsoleteFiles.inc: Remove manpages from OLD_FILES To: Wolfram Schneider Cc: Mark Millard , 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" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4GTkFg5kdqz4xSX X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of fernandoapesteguia@gmail.com designates 209.85.219.46 as permitted sender) smtp.mailfrom=fernandoapesteguia@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[fernape@freebsd.org,fernandoapesteguia@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TAGGED_FROM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.219.46:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_NEQ_ENVFROM(0.00)[fernape@freebsd.org,fernandoapesteguia@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.219.46:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.219.46:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.219.46:from]; FREEMAIL_CC(0.00)[yahoo.com,freebsd.org]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 16:10:17 -0000 On Mon, Jul 19, 2021 at 3:37 PM Wolfram Schneider wrote= : > > How about apm.8.gz and apmconf.8.gz? > > $ git grep -E '(apm|apmconf|nvram|apmd|sconfig)\.8' | grep OLD_FILES > ObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/apm.8.gz > ObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/apmconf.8.gz > tools/build/mk/OptionalObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/= amd64/apm.8.gz > tools/build/mk/OptionalObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/= amd64/apmconf.8.gz > Is it needed? Those files were not affected by the original commit and are, at this point, installed only for amd64, arm64 and i386. apmd.8.gz and sconfig.8.gz were affected though in 0a0f7486413c and they needed to be removed from OLD_FILES. Cheers. > -Wolfram > > > On Wed, 7 Jul 2021 at 22:12, Fernando Apestegu=C3=ADa wrote: > > > > The branch main has been updated by fernape (doc, ports committer): > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Df6043a672135da8ec090d887= 8cc844b8aace54f9 > > > > commit f6043a672135da8ec090d8878cc844b8aace54f9 > > Author: Fernando Apestegu=C3=ADa > > AuthorDate: 2021-07-07 13:15:02 +0000 > > Commit: Fernando Apestegu=C3=ADa > > CommitDate: 2021-07-07 18:09:02 +0000 > > > > ObsoleteFiles.inc: Remove manpages from OLD_FILES > > > > In 0a0f7486413c147d56808b38055c40c64cff61f5 sconfig.8.gz and apmd.8= .gz > > were moved back to the parent directory share/man/man8. > > > > This conflicts with a previous entry in OLD_FILES so running 'make > > delete-old' would delete the new installed files. > > > > Reported by: marklmi@yahoo.com > > Approved by: emaste@ > > Fixes: 0a0f7486413c - Build manpages for all architectures > > MFH: 4 weeks > > Differential Revision: https://reviews.freebsd.org/D31092 > > --- > > ObsoleteFiles.inc | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc > > index 60707faebefc..d72aea5e8efc 100644 > > --- a/ObsoleteFiles.inc > > +++ b/ObsoleteFiles.inc > > @@ -14840,11 +14840,9 @@ OLD_FILES+=3Dusr/share/man/man7/mmroff.7.gz > > OLD_FILES+=3Dusr/share/man/man7/mwww.7.gz > > OLD_FILES+=3Dusr/share/man/man8/apm.8.gz > > OLD_FILES+=3Dusr/share/man/man8/apmconf.8.gz > > -OLD_FILES+=3Dusr/share/man/man8/apmd.8.gz > > OLD_FILES+=3Dusr/share/man/man8/dm.8.gz > > OLD_FILES+=3Dusr/share/man/man8/pam_ftp.8.gz > > OLD_FILES+=3Dusr/share/man/man8/pam_wheel.8.gz > > -OLD_FILES+=3Dusr/share/man/man8/sconfig.8.gz > > OLD_FILES+=3Dusr/share/man/man8/ssl.8.gz > > OLD_FILES+=3Dusr/share/man/man8/wlconfig.8.gz > > OLD_FILES+=3Dusr/share/man/man9/CURSIG.9.gz > > > > -- > Wolfram Schneider https://wolfram.schneider.org From owner-dev-commits-src-main@freebsd.org Tue Jul 20 16:44:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F19C66F64E; Tue, 20 Jul 2021 16:44:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTl1R3nglz56Ll; Tue, 20 Jul 2021 16:44:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4E80EE8B5; Tue, 20 Jul 2021 16:44:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 9B18536318; Tue, 20 Jul 2021 18:44:41 +0200 (CEST) From: "Kristof Provost" To: "Dmitry Chagin" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8e1864ed0712 - main - pf: syncookie support Date: Tue, 20 Jul 2021 18:44:40 +0200 X-Mailer: MailMate (1.13.2r5673) Message-ID: <33541515-8306-4BEB-9C1E-27C2CEB68941@FreeBSD.org> In-Reply-To: References: <202107200836.16K8asPR040892@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 16:44:44 -0000 On 20 Jul 2021, at 12:40, Dmitry Chagin wrote: > On Tue, Jul 20, 2021 at 08:36:54AM +0000, Kristof Provost wrote: >> The branch main has been updated by kp: >> >> URL: = >> https://cgit.FreeBSD.org/src/commit/?id=3D8e1864ed07121b479b95d7e3a593= 1a9e0ffd4713 >> >> commit 8e1864ed07121b479b95d7e3a5931a9e0ffd4713 >> Author: Kristof Provost >> AuthorDate: 2021-05-20 09:54:41 +0000 >> Commit: Kristof Provost >> CommitDate: 2021-07-20 08:36:13 +0000 >> >> pf: syncookie support >> >> Import OpenBSD's syncookie support for pf. This feature help pf = >> resist >> TCP SYN floods by only creating states once the remote host = >> completes >> the TCP handshake rather than when the initial SYN packet is = >> received. >> >> This is accomplished by using the initial sequence numbers to = >> encode a >> cookie (hence the name) in the SYN+ACK response and verifying = >> this on >> receipt of the client ACK. >> >> Reviewed by: kbowling >> Obtained from: OpenBSD >> MFC after: 1 week >> Sponsored by: Modirum MDPay >> Differential Revision: https://reviews.freebsd.org/D31138 > > NOINET6 build fails > LINT did too. It should be fixed in = b972a7fa9e1e01367435a5699b71cc7b5e494fee Best regards, Kristof From owner-dev-commits-src-main@freebsd.org Tue Jul 20 16:53:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6660566F9C6; Tue, 20 Jul 2021 16:53: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 4GTlCx2JGpz57N5; Tue, 20 Jul 2021 16:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BE7B651F; Tue, 20 Jul 2021 16:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KGrnnP008617; Tue, 20 Jul 2021 16:53:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KGrnJ3008616; Tue, 20 Jul 2021 16:53:49 GMT (envelope-from git) Date: Tue, 20 Jul 2021 16:53:49 GMT Message-Id: <202107201653.16KGrnJ3008616@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: 907257d6967d - main - pf: embed a pointer to the lock in struct pf_kstate 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: 907257d6967dd23506e69042c55bb1edc983c0ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 16:53:49 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=907257d6967dd23506e69042c55bb1edc983c0ba commit 907257d6967dd23506e69042c55bb1edc983c0ba Author: Mateusz Guzik AuthorDate: 2021-07-19 12:40:25 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-20 16:11:31 +0000 pf: embed a pointer to the lock in struct pf_kstate This shaves calculation which in particular helps on arm. Note using the & hack instead would still be more work. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 23 +++++++++++++++++------ sys/netpfil/pf/pf.c | 3 +++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 35f906a8cbb2..70fde0aa7380 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -99,22 +99,32 @@ struct pfi_dynaddr { #define PF_HASHROW_LOCK(h) mtx_lock(&(h)->lock) #define PF_HASHROW_UNLOCK(h) mtx_unlock(&(h)->lock) +#ifdef INVARIANTS #define PF_STATE_LOCK(s) \ do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(s)]; \ - PF_HASHROW_LOCK(_ih); \ + struct pf_kstate *_s = (s); \ + struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(_s)]; \ + MPASS(_s->lock == &_ih->lock); \ + mtx_lock(_s->lock); \ } while (0) - #define PF_STATE_UNLOCK(s) \ do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH((s))]; \ - PF_HASHROW_UNLOCK(_ih); \ + struct pf_kstate *_s = (s); \ + struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(_s)]; \ + MPASS(_s->lock == &_ih->lock); \ + mtx_unlock(_s->lock); \ } while (0) +#else +#define PF_STATE_LOCK(s) mtx_lock(s->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#endif #ifdef INVARIANTS #define PF_STATE_LOCK_ASSERT(s) \ do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(s)]; \ + struct pf_kstate *_s = (s); \ + struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(_s)]; \ + MPASS(_s->lock == &_ih->lock); \ PF_HASHROW_ASSERT(_ih); \ } while (0) #else /* !INVARIANTS */ @@ -602,6 +612,7 @@ struct pf_kstate { u_int8_t sync_state; /* PFSYNC_S_x */ u_int8_t sync_updates; /* XXX */ u_int refs; + struct mtx *lock; TAILQ_ENTRY(pf_kstate) sync_list; TAILQ_ENTRY(pf_kstate) key_list[2]; LIST_ENTRY(pf_kstate) entry; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 6fdeab517792..4729e7a5c19f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1045,6 +1045,9 @@ pf_state_key_attach(struct pf_state_key *skw, struct pf_state_key *sks, kh = khw; idx = PF_SK_WIRE; + MPASS(s->lock == NULL); + s->lock = &V_pf_idhash[PF_IDHASH(s)].lock; + keyattach: LIST_FOREACH(cur, &kh->keys, entry) if (bcmp(cur, sk, sizeof(struct pf_state_key_cmp)) == 0) From owner-dev-commits-src-main@freebsd.org Tue Jul 20 17:11:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D75A66FF12; Tue, 20 Jul 2021 17:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTlbs1Q59z3Bx6; Tue, 20 Jul 2021 17:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18E38679D; Tue, 20 Jul 2021 17:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KHB5Du032252; Tue, 20 Jul 2021 17:11:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KHB5Tb032251; Tue, 20 Jul 2021 17:11:05 GMT (envelope-from git) Date: Tue, 20 Jul 2021 17:11:05 GMT Message-Id: <202107201711.16KHB5Tb032251@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: 570b31f61009 - main - df: remove the unused fstype var 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: 570b31f61009fb60591cf5fcc26f0f5c12ff5752 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 17:11:05 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=570b31f61009fb60591cf5fcc26f0f5c12ff5752 commit 570b31f61009fb60591cf5fcc26f0f5c12ff5752 Author: Mateusz Guzik AuthorDate: 2021-07-20 17:00:50 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-20 17:00:50 +0000 df: remove the unused fstype var Found with cc --analyze Sponsored by: Rubicon Communications, LLC ("Netgate") --- bin/df/df.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/df/df.c b/bin/df/df.c index a0d43fca5789..5a96eb9d58c4 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -114,13 +114,11 @@ main(int argc, char *argv[]) struct statfs statfsbuf, totalbuf; struct maxwidths maxwidths; struct statfs *mntbuf; - const char *fstype; char *mntpt; const char **vfslist; int i, mntsize; int ch, rv; - fstype = "ufs"; (void)setlocale(LC_ALL, ""); memset(&maxwidths, 0, sizeof(maxwidths)); memset(&totalbuf, 0, sizeof(totalbuf)); @@ -194,7 +192,6 @@ main(int argc, char *argv[]) xo_errx(1, "-l and -t are mutually exclusive."); if (vfslist != NULL) xo_errx(1, "only one -t option may be specified"); - fstype = optarg; vfslist = makevfslist(optarg); break; case 'T': From owner-dev-commits-src-main@freebsd.org Tue Jul 20 17:11:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8327866FF32; Tue, 20 Jul 2021 17:11: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 4GTlcr3BkRz3CRv; Tue, 20 Jul 2021 17:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 570E06AAE; Tue, 20 Jul 2021 17:11: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 16KHBuOM032457; Tue, 20 Jul 2021 17:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KHBuKF032456; Tue, 20 Jul 2021 17:11:56 GMT (envelope-from git) Date: Tue, 20 Jul 2021 17:11:56 GMT Message-Id: <202107201711.16KHBuKF032456@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: 5a9e5a5111af - main - nanobsd: fix typo in NANO_WORLDDIR 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: 5a9e5a5111af59dbc96383fcd73129e31648e017 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 17:11:56 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5a9e5a5111af59dbc96383fcd73129e31648e017 commit 5a9e5a5111af59dbc96383fcd73129e31648e017 Author: Yann Kerherve AuthorDate: 2021-07-20 17:10:28 +0000 Commit: Warner Losh CommitDate: 2021-07-20 17:11:44 +0000 nanobsd: fix typo in NANO_WORLDDIR Reviewed by: imp PR: 257299 --- tools/tools/nanobsd/embedded/common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/nanobsd/embedded/common b/tools/tools/nanobsd/embedded/common index 013495997554..7186aa5ba4b5 100644 --- a/tools/tools/nanobsd/embedded/common +++ b/tools/tools/nanobsd/embedded/common @@ -297,7 +297,7 @@ create_diskimage_mbr ( ) ( # and p5 is alt-root (after resize) mkimg -a 2 ${fmtarg} ${bootmbr} -s gpt \ -p efi:=${NANO_WORLDDIR}/boot/efiboot.img \ - -p freebsd-boot:=${NAANO_WORLDDIR}/boot/gptboot \ + -p freebsd-boot:=${NANO_WORLDDIR}/boot/gptboot \ -p ${p3}:=${NANO_LOG}/_.p3 \ -p ${p4}:=${NANO_LOG}/_.p4 \ -o ${out} From owner-dev-commits-src-main@freebsd.org Tue Jul 20 17:30:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05561650421; Tue, 20 Jul 2021 17:30: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 4GTm2K6VCKz3HjF; Tue, 20 Jul 2021 17:30:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3E1967CF; Tue, 20 Jul 2021 17:30: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 16KHUX6E057551; Tue, 20 Jul 2021 17:30:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KHUXPM057550; Tue, 20 Jul 2021 17:30:33 GMT (envelope-from git) Date: Tue, 20 Jul 2021 17:30:33 GMT Message-Id: <202107201730.16KHUXPM057550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 28d70deaafa6 - main - Fix race between first rand(3) calls. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28d70deaafa62c5d1602de5272c0aad0fcca8aff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 17:30:34 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=28d70deaafa62c5d1602de5272c0aad0fcca8aff commit 28d70deaafa62c5d1602de5272c0aad0fcca8aff Author: Alexander Motin AuthorDate: 2021-07-20 17:15:08 +0000 Commit: Alexander Motin CommitDate: 2021-07-20 17:30:28 +0000 Fix race between first rand(3) calls. Before this patch there was a chance for thread that called rand(3) slightly later to see rand3_state already allocated, but not yet initialized. While this API is not expected to be thread-safe, it is not expected to crash. ztest on 64-thread system reproduced it reliably for me. MFC after: 1 month --- lib/libc/stdlib/rand.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c index bddb0f040302..353f59349e1d 100644 --- a/lib/libc/stdlib/rand.c +++ b/lib/libc/stdlib/rand.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "un-namespace.h" #include "random.h" @@ -68,11 +69,15 @@ static struct __random_state *rand3_state; static void initialize_rand3(void) { + struct __random_state *state; int error; - rand3_state = allocatestate(TYPE_3); - error = initstate_r(rand3_state, 1, rand3_state->rst_randtbl, BREAK_3); + state = allocatestate(TYPE_3); + error = initstate_r(state, 1, state->rst_randtbl, BREAK_3); assert(error == 0); + if (!atomic_cmpset_rel_ptr((volatile uintptr_t *)&rand3_state, + (uintptr_t)NULL, (uintptr_t)state)) + free(state); } int From owner-dev-commits-src-main@freebsd.org Tue Jul 20 19:18:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E6E1651902; Tue, 20 Jul 2021 19:18: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 4GTpR60B8Sz3s4l; Tue, 20 Jul 2021 19:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF1711071B; Tue, 20 Jul 2021 19:18: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 16KJIf7b097293; Tue, 20 Jul 2021 19:18:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KJIfEX097292; Tue, 20 Jul 2021 19:18:41 GMT (envelope-from git) Date: Tue, 20 Jul 2021 19:18:41 GMT Message-Id: <202107201918.16KJIfEX097292@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: 84db87b8dafd - main - pf: remove stray debug line 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: 84db87b8dafd9e9970fd36ac48c11ffdc89d31d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 19:18:42 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=84db87b8dafd9e9970fd36ac48c11ffdc89d31d0 commit 84db87b8dafd9e9970fd36ac48c11ffdc89d31d0 Author: Kristof Provost AuthorDate: 2021-07-20 19:02:33 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 19:13:22 +0000 pf: remove stray debug line MFC after: 1 week Sponsored by: Modirum MDPay --- sys/netpfil/pf/pf_syncookies.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c index d51f89fb47d4..0313b817ad6d 100644 --- a/sys/netpfil/pf/pf_syncookies.c +++ b/sys/netpfil/pf/pf_syncookies.c @@ -301,7 +301,6 @@ pf_syncookie_rotate(void *arg) pf_syncookie_newkey(); CURVNET_RESTORE(); - printf("KP: %s() return\n", __func__); } void From owner-dev-commits-src-main@freebsd.org Tue Jul 20 19:18:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24726651980; Tue, 20 Jul 2021 19:18: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 4GTpR70QxKz3s2L; Tue, 20 Jul 2021 19:18:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA6BC1071C; Tue, 20 Jul 2021 19:18: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 16KJIgo2097319; Tue, 20 Jul 2021 19:18:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KJIgTq097318; Tue, 20 Jul 2021 19:18:42 GMT (envelope-from git) Date: Tue, 20 Jul 2021 19:18:42 GMT Message-Id: <202107201918.16KJIgTq097318@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: 32271c4d383e - main - pf: clean up syncookie callout on vnet shutdown 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: 32271c4d383effeac7878201ef5cbdfaeedc3755 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 19:18:43 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=32271c4d383effeac7878201ef5cbdfaeedc3755 commit 32271c4d383effeac7878201ef5cbdfaeedc3755 Author: Kristof Provost AuthorDate: 2021-07-20 19:03:08 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 19:13:25 +0000 pf: clean up syncookie callout on vnet shutdown Ensure that we cancel any outstanding callouts for syncookies when we terminate the vnet. MFC after: 1 week Sponsored by: Modirum MDPay --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf_ioctl.c | 1 + sys/netpfil/pf/pf_syncookies.c | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 70fde0aa7380..1dfc769b197d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1852,6 +1852,7 @@ void pf_send_tcp(const struct pf_krule *, sa_family_t, u_int16_t); void pf_syncookies_init(void); +void pf_syncookies_cleanup(void); int pf_get_syncookies(struct pfioc_nv *); int pf_set_syncookies(struct pfioc_nv *); int pf_synflood_check(struct pf_pdesc *); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index a9f5b2c18041..27e1a145f3ec 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -5573,6 +5573,7 @@ pf_unload_vnet(void) dehook_pf(); PF_RULES_WLOCK(); + pf_syncookies_cleanup(); shutdown_pf(); PF_RULES_WUNLOCK(); diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c index 0313b817ad6d..8699ae855ec8 100644 --- a/sys/netpfil/pf/pf_syncookies.c +++ b/sys/netpfil/pf/pf_syncookies.c @@ -127,6 +127,12 @@ pf_syncookies_init(void) PF_RULES_WUNLOCK(); } +void +pf_syncookies_cleanup(void) +{ + callout_stop(&V_pf_syncookie_status.keytimeout); +} + int pf_get_syncookies(struct pfioc_nv *nv) { From owner-dev-commits-src-main@freebsd.org Tue Jul 20 19:41:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF10A651CF1; Tue, 20 Jul 2021 19:41:00 +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 4GTpwr2yCNz3vc3; Tue, 20 Jul 2021 19:41:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 16KJekis041037 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 20 Jul 2021 22:40:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 16KJekis041037 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 16KJekP9041036; Tue, 20 Jul 2021 22:40:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Jul 2021 22:40:46 +0300 From: Konstantin Belousov To: Alexander Motin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 28d70deaafa6 - main - Fix race between first rand(3) calls. Message-ID: References: <202107201730.16KHUXPM057550@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202107201730.16KHUXPM057550@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=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4GTpwr2yCNz3vc3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 19:41:00 -0000 On Tue, Jul 20, 2021 at 05:30:33PM +0000, Alexander Motin wrote: > The branch main has been updated by mav: > > URL: https://cgit.FreeBSD.org/src/commit/?id=28d70deaafa62c5d1602de5272c0aad0fcca8aff > > commit 28d70deaafa62c5d1602de5272c0aad0fcca8aff > Author: Alexander Motin > AuthorDate: 2021-07-20 17:15:08 +0000 > Commit: Alexander Motin > CommitDate: 2021-07-20 17:30:28 +0000 > > Fix race between first rand(3) calls. > > Before this patch there was a chance for thread that called rand(3) > slightly later to see rand3_state already allocated, but not yet > initialized. While this API is not expected to be thread-safe, it > is not expected to crash. ztest on 64-thread system reproduced it > reliably for me. > > MFC after: 1 month > --- > lib/libc/stdlib/rand.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c > index bddb0f040302..353f59349e1d 100644 > --- a/lib/libc/stdlib/rand.c > +++ b/lib/libc/stdlib/rand.c > @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include "un-namespace.h" > > #include "random.h" > @@ -68,11 +69,15 @@ static struct __random_state *rand3_state; > static void > initialize_rand3(void) > { > + struct __random_state *state; > int error; > > - rand3_state = allocatestate(TYPE_3); > - error = initstate_r(rand3_state, 1, rand3_state->rst_randtbl, BREAK_3); > + state = allocatestate(TYPE_3); > + error = initstate_r(state, 1, state->rst_randtbl, BREAK_3); > assert(error == 0); > + if (!atomic_cmpset_rel_ptr((volatile uintptr_t *)&rand3_state, > + (uintptr_t)NULL, (uintptr_t)state)) > + free(state); For this to have effect on less ordered architectures (AKA non-x86), at least reads of rand3_state should be atomic_load_acq(). But consider using _once() in libc, which takes care about ordering/threads. > } > > int From owner-dev-commits-src-main@freebsd.org Tue Jul 20 21:10:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 132816530D5; Tue, 20 Jul 2021 21:10:33 +0000 (UTC) (envelope-from avg@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 4GTrw85gYrz4fyv; Tue, 20 Jul 2021 21:10:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from [192.168.0.88] (unknown [195.64.148.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 05DDA20818; Tue, 20 Jul 2021 21:10:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) To: Konstantin Belousov , Alexander Motin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202107201730.16KHUXPM057550@gitrepo.freebsd.org> From: Andriy Gapon Subject: Re: git: 28d70deaafa6 - main - Fix race between first rand(3) calls. Message-ID: Date: Wed, 21 Jul 2021 00:10:29 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 21:10:33 -0000 On 20/07/2021 22:40, Konstantin Belousov wrote: > On Tue, Jul 20, 2021 at 05:30:33PM +0000, Alexander Motin wrote: >> The branch main has been updated by mav: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=28d70deaafa62c5d1602de5272c0aad0fcca8aff >> >> commit 28d70deaafa62c5d1602de5272c0aad0fcca8aff >> Author: Alexander Motin >> AuthorDate: 2021-07-20 17:15:08 +0000 >> Commit: Alexander Motin >> CommitDate: 2021-07-20 17:30:28 +0000 >> >> Fix race between first rand(3) calls. >> >> Before this patch there was a chance for thread that called rand(3) >> slightly later to see rand3_state already allocated, but not yet >> initialized. While this API is not expected to be thread-safe, it >> is not expected to crash. ztest on 64-thread system reproduced it >> reliably for me. >> >> MFC after: 1 month >> --- >> lib/libc/stdlib/rand.c | 9 +++++++-- >> 1 file changed, 7 insertions(+), 2 deletions(-) >> >> diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c >> index bddb0f040302..353f59349e1d 100644 >> --- a/lib/libc/stdlib/rand.c >> +++ b/lib/libc/stdlib/rand.c >> @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include "un-namespace.h" >> >> #include "random.h" >> @@ -68,11 +69,15 @@ static struct __random_state *rand3_state; >> static void >> initialize_rand3(void) >> { >> + struct __random_state *state; >> int error; >> >> - rand3_state = allocatestate(TYPE_3); >> - error = initstate_r(rand3_state, 1, rand3_state->rst_randtbl, BREAK_3); >> + state = allocatestate(TYPE_3); >> + error = initstate_r(state, 1, state->rst_randtbl, BREAK_3); >> assert(error == 0); >> + if (!atomic_cmpset_rel_ptr((volatile uintptr_t *)&rand3_state, >> + (uintptr_t)NULL, (uintptr_t)state)) >> + free(state); > For this to have effect on less ordered architectures (AKA non-x86), at > least reads of rand3_state should be atomic_load_acq(). > > But consider using _once() in libc, which takes care about ordering/threads. FWIW, I've been using the following patch locally. And the reason for the patched is discussed here: https://www.mail-archive.com/freebsd-current@freebsd.org/msg182365.html commit cc38290d14a5bbab64e419a2d6d8c34f61840829 Author: Andriy Gapon AuthorDate: Mon Apr 5 17:33:07 2021 +0300 Commit: Andriy Gapon CommitDate: Tue Jun 8 10:34:28 2021 +0300 [tmp?] make rand/srand initialization thread safe But rand(3) still remains non-thread-safe in general. This is only to prevent an initialization time crash in ztest. Probably should be fixed there, e.g. by using a different random number API or by adding some locking. diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c index bddb0f040302..0d3ed2230e10 100644 --- a/lib/libc/stdlib/rand.c +++ b/lib/libc/stdlib/rand.c @@ -41,11 +41,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include "un-namespace.h" +#include "libc_private.h" #include "random.h" /* @@ -64,6 +66,7 @@ __FBSDID("$FreeBSD$"); * the advantage of being the one already in the tree. */ static struct __random_state *rand3_state; +static pthread_once_t __random_state_once = PTHREAD_ONCE_INIT; static void initialize_rand3(void) @@ -78,16 +81,14 @@ initialize_rand3(void) int rand(void) { - if (rand3_state == NULL) - initialize_rand3(); + _once(&__random_state_once, initialize_rand3); return ((int)random_r(rand3_state)); } void srand(unsigned seed) { - if (rand3_state == NULL) - initialize_rand3(); + _once(&__random_state_once, initialize_rand3); srandom_r(rand3_state, seed); } -- Andriy Gapon From owner-dev-commits-src-main@freebsd.org Tue Jul 20 21:26:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C76A56531F5; Tue, 20 Jul 2021 21:26:11 +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 4GTsGC3dHkz4jP1; Tue, 20 Jul 2021 21:26:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 16KLQ2iV066872 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 21 Jul 2021 00:26:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 16KLQ2iV066872 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 16KLQ2Xi066871; Wed, 21 Jul 2021 00:26:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 21 Jul 2021 00:26:02 +0300 From: Konstantin Belousov To: Andriy Gapon Cc: Alexander Motin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 28d70deaafa6 - main - Fix race between first rand(3) calls. Message-ID: References: <202107201730.16KHUXPM057550@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4GTsGC3dHkz4jP1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 21:26:11 -0000 On Wed, Jul 21, 2021 at 12:10:29AM +0300, Andriy Gapon wrote: > On 20/07/2021 22:40, Konstantin Belousov wrote: > > On Tue, Jul 20, 2021 at 05:30:33PM +0000, Alexander Motin wrote: > > > The branch main has been updated by mav: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=28d70deaafa62c5d1602de5272c0aad0fcca8aff > > > > > > commit 28d70deaafa62c5d1602de5272c0aad0fcca8aff > > > Author: Alexander Motin > > > AuthorDate: 2021-07-20 17:15:08 +0000 > > > Commit: Alexander Motin > > > CommitDate: 2021-07-20 17:30:28 +0000 > > > > > > Fix race between first rand(3) calls. > > > Before this patch there was a chance for thread that called rand(3) > > > slightly later to see rand3_state already allocated, but not yet > > > initialized. While this API is not expected to be thread-safe, it > > > is not expected to crash. ztest on 64-thread system reproduced it > > > reliably for me. > > > MFC after: 1 month > > > --- > > > lib/libc/stdlib/rand.c | 9 +++++++-- > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c > > > index bddb0f040302..353f59349e1d 100644 > > > --- a/lib/libc/stdlib/rand.c > > > +++ b/lib/libc/stdlib/rand.c > > > @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > #include > > > +#include > > > #include "un-namespace.h" > > > #include "random.h" > > > @@ -68,11 +69,15 @@ static struct __random_state *rand3_state; > > > static void > > > initialize_rand3(void) > > > { > > > + struct __random_state *state; > > > int error; > > > - rand3_state = allocatestate(TYPE_3); > > > - error = initstate_r(rand3_state, 1, rand3_state->rst_randtbl, BREAK_3); > > > + state = allocatestate(TYPE_3); > > > + error = initstate_r(state, 1, state->rst_randtbl, BREAK_3); > > > assert(error == 0); > > > + if (!atomic_cmpset_rel_ptr((volatile uintptr_t *)&rand3_state, > > > + (uintptr_t)NULL, (uintptr_t)state)) > > > + free(state); > > For this to have effect on less ordered architectures (AKA non-x86), at > > least reads of rand3_state should be atomic_load_acq(). > > > > But consider using _once() in libc, which takes care about ordering/threads. > > FWIW, I've been using the following patch locally. > And the reason for the patched is discussed here: > https://www.mail-archive.com/freebsd-current@freebsd.org/msg182365.html > > commit cc38290d14a5bbab64e419a2d6d8c34f61840829 > Author: Andriy Gapon > AuthorDate: Mon Apr 5 17:33:07 2021 +0300 > Commit: Andriy Gapon > CommitDate: Tue Jun 8 10:34:28 2021 +0300 > > [tmp?] make rand/srand initialization thread safe > > But rand(3) still remains non-thread-safe in general. > This is only to prevent an initialization time crash in ztest. > Probably should be fixed there, e.g. by using a different random number > API or by adding some locking. > > diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c > index bddb0f040302..0d3ed2230e10 100644 > --- a/lib/libc/stdlib/rand.c > +++ b/lib/libc/stdlib/rand.c > @@ -41,11 +41,13 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > #include "un-namespace.h" > > +#include "libc_private.h" > #include "random.h" > > /* > @@ -64,6 +66,7 @@ __FBSDID("$FreeBSD$"); > * the advantage of being the one already in the tree. > */ > static struct __random_state *rand3_state; > +static pthread_once_t __random_state_once = PTHREAD_ONCE_INIT; > > static void > initialize_rand3(void) > @@ -78,16 +81,14 @@ initialize_rand3(void) > int > rand(void) > { > - if (rand3_state == NULL) > - initialize_rand3(); > + _once(&__random_state_once, initialize_rand3); > return ((int)random_r(rand3_state)); > } > > void > srand(unsigned seed) > { > - if (rand3_state == NULL) > - initialize_rand3(); > + _once(&__random_state_once, initialize_rand3); > srandom_r(rand3_state, seed); > } > Right, this should be it. From owner-dev-commits-src-main@freebsd.org Tue Jul 20 21:28:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A94636537A2; Tue, 20 Jul 2021 21:28: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 4GTsK34HNHz4jgK; Tue, 20 Jul 2021 21:28:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 767931211C; Tue, 20 Jul 2021 21:28:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KLSdZL068972; Tue, 20 Jul 2021 21:28:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KLSd1M068971; Tue, 20 Jul 2021 21:28:39 GMT (envelope-from git) Date: Tue, 20 Jul 2021 21:28:39 GMT Message-Id: <202107202128.16KLSd1M068971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 986bbba9a699 - main - arm/mv: Don't rely on firmware MSI mapping in ICU MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 986bbba9a6994155ee651ce2df2f6fd9a67e13ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 21:28:39 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=986bbba9a6994155ee651ce2df2f6fd9a67e13ea commit 986bbba9a6994155ee651ce2df2f6fd9a67e13ea Author: Kornel Duleba AuthorDate: 2021-02-17 15:28:46 +0000 Commit: Marcin Wojtas CommitDate: 2021-07-20 21:24:42 +0000 arm/mv: Don't rely on firmware MSI mapping in ICU On Armada8k boards various peripherals (e.g. USB) have interrupt lines connected to on of the ICU interrupt controllers. After an interrupt is detected it triggers MSI to a given address, with a programmed value. This in turn triggers an SPI interrupt. Normally MSI vector should be allocated by ICUs parent and set during interrupt allocation. Instead of doing that we relied on the ICU being pre-configured in firmware. This worked with EDK2 and older versions of U-Boot, but in the newer ones that is no longer the case. Extend ICU msi-parents - GICP and SEI to support MSI interface and use it during interrupt allocation. This allows us to boot on Armada 7k/8k SoCs independent from the firmware configuration and successfully use modern U-Boot + device tree. For SATA interrupts we need to apply a WA previously done in firmware. We have two SATA ports connected to one controller. Each ports gets its own interrupt, but only one of them is described in dts, also ahci_generic driver expects only one irq too. Fix it by mapping both interrupts to the same MSI when one of them is allocated, which allows us to use both SATA ports. Reviewed by: mmel, mw Obtained from: Semihalf Sponsored by: Marvell Differential Revision: https://reviews.freebsd.org/D28803 --- sys/arm/mv/mv_ap806_gicp.c | 184 ++++++++++++++++++++++++++++++++++++++------- sys/arm/mv/mv_ap806_sei.c | 104 ++++++++++++++++++++++++- sys/arm/mv/mv_cp110_icu.c | 145 +++++++++++++++++++++++++++++++---- 3 files changed, 386 insertions(+), 47 deletions(-) diff --git a/sys/arm/mv/mv_ap806_gicp.c b/sys/arm/mv/mv_ap806_gicp.c index 0a1a69707956..ab0c540bf3f8 100644 --- a/sys/arm/mv/mv_ap806_gicp.c +++ b/sys/arm/mv/mv_ap806_gicp.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -49,10 +50,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include + +#include "msi_if.h" #include "pic_if.h" #define MV_AP806_GICP_MAX_NIRQS 207 +MALLOC_DECLARE(M_GICP); +MALLOC_DEFINE(M_GICP, "gicp", "Marvell gicp driver"); + struct mv_ap806_gicp_softc { device_t dev; device_t parent; @@ -61,6 +70,9 @@ struct mv_ap806_gicp_softc { ssize_t spi_ranges_cnt; uint32_t *spi_ranges; struct intr_map_data_fdt *parent_map_data; + + ssize_t msi_bitmap_size; /* Nr of bits in the bitmap. */ + BITSET_DEFINE_VAR() *msi_bitmap; }; static struct ofw_compat_data compat_data[] = { @@ -71,6 +83,10 @@ static struct ofw_compat_data compat_data[] = { #define RD4(sc, reg) bus_read_4((sc)->res, (reg)) #define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) +static msi_alloc_msi_t mv_ap806_gicp_alloc_msi; +static msi_release_msi_t mv_ap806_gicp_release_msi; +static msi_map_msi_t mv_ap806_gicp_map_msi; + static int mv_ap806_gicp_probe(device_t dev) { @@ -90,6 +106,7 @@ mv_ap806_gicp_attach(device_t dev) { struct mv_ap806_gicp_softc *sc; phandle_t node, xref, intr_parent; + int i, rid; sc = device_get_softc(dev); sc->dev = dev; @@ -107,9 +124,28 @@ mv_ap806_gicp_attach(device_t dev) return (ENXIO); } + rid = 0; + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + sc->spi_ranges_cnt = OF_getencprop_alloc_multi(node, "marvell,spi-ranges", sizeof(*sc->spi_ranges), (void **)&sc->spi_ranges); + sc->msi_bitmap_size = 0; + for (i = 0; i < sc->spi_ranges_cnt; i += 2) + sc->msi_bitmap_size += sc->spi_ranges[i + 1]; + + /* + * Create a bitmap of all MSIs that we have. + * Each has a correspoding SPI in the GIC. + * It will be used to dynamically allocate IRQs when requested. + */ + sc->msi_bitmap = BITSET_ALLOC(sc->msi_bitmap_size, M_GICP, M_WAITOK); + BIT_FILL(sc->msi_bitmap_size, sc->msi_bitmap); /* 1 - available, 0 - used. */ + xref = OF_xref_from_node(node); if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "Cannot register GICP\n"); @@ -131,38 +167,58 @@ mv_ap806_gicp_detach(device_t dev) return (EBUSY); } +static uint32_t +mv_ap806_gicp_msi_to_spi(struct mv_ap806_gicp_softc *sc, int irq) +{ + int i; + + for (i = 0; i < sc->spi_ranges_cnt; i += 2) { + if (irq < sc->spi_ranges[i + 1]) { + irq += sc->spi_ranges[i]; + break; + } + irq -= sc->spi_ranges[i + 1]; + } + + return (irq - GIC_FIRST_SPI); +} + +static uint32_t +mv_ap806_gicp_irq_to_msi(struct mv_ap806_gicp_softc *sc, int irq) +{ + int i; + + for (i = 0; i < sc->spi_ranges_cnt; i += 2) { + if (irq >= sc->spi_ranges[i] && + irq - sc->spi_ranges[i] < sc->spi_ranges[i + 1]) { + irq -= sc->spi_ranges[i]; + break; + } + } + + return (irq); +} + static struct intr_map_data * mv_ap806_gicp_convert_map_data(struct mv_ap806_gicp_softc *sc, struct intr_map_data *data) { struct intr_map_data_fdt *daf; - uint32_t i, irq_num, irq_type; + uint32_t irq_num; daf = (struct intr_map_data_fdt *)data; if (daf->ncells != 2) return (NULL); irq_num = daf->cells[0]; - irq_type = daf->cells[1]; if (irq_num >= MV_AP806_GICP_MAX_NIRQS) return (NULL); /* Construct GIC compatible mapping. */ sc->parent_map_data->ncells = 3; sc->parent_map_data->cells[0] = 0; /* SPI */ - sc->parent_map_data->cells[2] = irq_type; - - /* Map the interrupt number to SPI number */ - for (i = 0; i < sc->spi_ranges_cnt; i += 2) { - if (irq_num < sc->spi_ranges[i + 1]) { - irq_num += sc->spi_ranges[i]; - break; - } - - irq_num -= sc->spi_ranges[i]; - } - - sc->parent_map_data->cells[1] = irq_num - 32; + sc->parent_map_data->cells[1] = mv_ap806_gicp_msi_to_spi(sc, irq_num); + sc->parent_map_data->cells[2] = IRQ_TYPE_LEVEL_HIGH; return ((struct intr_map_data *)sc->parent_map_data); } @@ -205,21 +261,9 @@ static int mv_ap806_gicp_map_intr(device_t dev, struct intr_map_data *data, struct intr_irqsrc **isrcp) { - struct mv_ap806_gicp_softc *sc; - int ret; - - sc = device_get_softc(dev); - - if (data->type != INTR_MAP_DATA_FDT) - return (ENOTSUP); - data = mv_ap806_gicp_convert_map_data(sc, data); - if (data == NULL) - return (EINVAL); - - ret = PIC_MAP_INTR(sc->parent, data, isrcp); - (*isrcp)->isrc_dev = sc->dev; - return(ret); + panic("%s: MSI interface has to be used to map an interrupt.\n", + __func__); } static int @@ -295,6 +339,83 @@ mv_ap806_gicp_post_filter(device_t dev, struct intr_irqsrc *isrc) PIC_POST_FILTER(sc->parent, isrc); } +static int +mv_ap806_gicp_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **srcs) +{ + struct mv_ap806_gicp_softc *sc; + int i, ret, vector; + + sc = device_get_softc(dev); + + for (i = 0; i < count; i++) { + /* + * Find first available vector represented by first set bit + * in the bitmap. BIT_FFS starts the count from 1, 0 means + * that nothing was found. + */ + vector = BIT_FFS(sc->msi_bitmap_size, sc->msi_bitmap); + if (vector == 0) { + ret = ENOMEM; + i--; + goto fail; + } + vector--; + BIT_CLR(sc->msi_bitmap_size, vector, sc->msi_bitmap); + + /* Create GIC compatible SPI interrupt description. */ + sc->parent_map_data->ncells = 3; + sc->parent_map_data->cells[0] = 0; /* SPI */ + sc->parent_map_data->cells[1] = mv_ap806_gicp_msi_to_spi(sc, vector); + sc->parent_map_data->cells[2] = IRQ_TYPE_LEVEL_HIGH; + + ret = PIC_MAP_INTR(sc->parent, + (struct intr_map_data *)sc->parent_map_data, + &srcs[i]); + if (ret != 0) + goto fail; + + srcs[i]->isrc_dev = dev; + } + + return (0); +fail: + mv_ap806_gicp_release_msi(dev, child, i + 1, srcs); + return (ret); +} + +static int +mv_ap806_gicp_release_msi(device_t dev, device_t child, int count, + struct intr_irqsrc **srcs) +{ + struct mv_ap806_gicp_softc *sc; + int i; + + sc = device_get_softc(dev); + + for (i = 0; i < count; i++) { + BIT_SET(sc->msi_bitmap_size, + mv_ap806_gicp_irq_to_msi(sc, srcs[i]->isrc_irq), + sc->msi_bitmap); + } + + return (0); +} + +static int +mv_ap806_gicp_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, + uint64_t *addr, uint32_t *data) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + *addr = rman_get_start(sc->res); + *data = mv_ap806_gicp_irq_to_msi(sc, isrc->isrc_irq); + + return (0); +} + static device_method_t mv_ap806_gicp_methods[] = { /* Device interface */ DEVMETHOD(device_probe, mv_ap806_gicp_probe), @@ -313,6 +434,11 @@ static device_method_t mv_ap806_gicp_methods[] = { DEVMETHOD(pic_post_ithread, mv_ap806_gicp_post_ithread), DEVMETHOD(pic_pre_ithread, mv_ap806_gicp_pre_ithread), + /* MSI interface */ + DEVMETHOD(msi_alloc_msi, mv_ap806_gicp_alloc_msi), + DEVMETHOD(msi_release_msi, mv_ap806_gicp_release_msi), + DEVMETHOD(msi_map_msi, mv_ap806_gicp_map_msi), + DEVMETHOD_END }; diff --git a/sys/arm/mv/mv_ap806_sei.c b/sys/arm/mv/mv_ap806_sei.c index 5022e6765d0a..fad57dcad17f 100644 --- a/sys/arm/mv/mv_ap806_sei.c +++ b/sys/arm/mv/mv_ap806_sei.c @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include #include #include #include @@ -48,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "msi_if.h" #include "pic_if.h" #define MV_AP806_SEI_LOCK(_sc) mtx_lock(&(_sc)->mtx) @@ -58,7 +61,6 @@ __FBSDID("$FreeBSD$"); #define MV_AP806_SEI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED); #define MV_AP806_SEI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->mtx, MA_NOTOWNED); -#define MV_AP806_SEI_MAX_NIRQS 64 #define GICP_SECR0 0x00 #define GICP_SECR1 0x04 #define GICP_SECR(i) (0x00 + (((i)/32) * 0x4)) @@ -68,6 +70,16 @@ __FBSDID("$FreeBSD$"); #define GICP_SEMR(i) (0x20 + (((i)/32) * 0x4)) #define GICP_SEMR_BIT(i) ((i) % 32) +#define MV_AP806_SEI_AP_FIRST 0 +#define MV_AP806_SEI_AP_SIZE 21 +#define MV_AP806_SEI_CP_FIRST 21 +#define MV_AP806_SEI_CP_SIZE 43 +#define MV_AP806_SEI_MAX_NIRQS (MV_AP806_SEI_AP_SIZE + MV_AP806_SEI_CP_SIZE) + +#define MV_AP806_SEI_SETSPI_OFFSET 0x30 + +BITSET_DEFINE(sei_msi_bitmap, MV_AP806_SEI_CP_SIZE); + struct mv_ap806_sei_irqsrc { struct intr_irqsrc isrc; u_int irq; @@ -81,6 +93,8 @@ struct mv_ap806_sei_softc { struct mtx mtx; struct mv_ap806_sei_irqsrc *isrcs; + + struct sei_msi_bitmap msi_bitmap; }; static struct ofw_compat_data compat_data[] = { @@ -91,6 +105,10 @@ static struct ofw_compat_data compat_data[] = { #define RD4(sc, reg) bus_read_4((sc)->mem_res, (reg)) #define WR4(sc, reg, val) bus_write_4((sc)->mem_res, (reg), (val)) +static msi_alloc_msi_t mv_ap806_sei_alloc_msi; +static msi_release_msi_t mv_ap806_sei_release_msi; +static msi_map_msi_t mv_ap806_sei_map_msi; + static inline void mv_ap806_sei_isrc_mask(struct mv_ap806_sei_softc *sc, struct mv_ap806_sei_irqsrc *sisrc, uint32_t val) @@ -152,8 +170,13 @@ mv_ap806_sei_map(device_t dev, struct intr_map_data *data, u_int *irqp) return (ENOTSUP); daf = (struct intr_map_data_fdt *)data; - if (daf->ncells != 1 || daf->cells[0] >= MV_AP806_SEI_MAX_NIRQS) + if (daf->ncells != 1) return (EINVAL); + + if (daf->cells[0] < MV_AP806_SEI_AP_FIRST || + daf->cells[0] >= MV_AP806_SEI_AP_FIRST + MV_AP806_SEI_AP_SIZE) + return (EINVAL); + irq = daf->cells[0]; if (irqp != NULL) *irqp = irq; @@ -361,6 +384,12 @@ mv_ap806_sei_attach(device_t dev) goto fail; } + /* + * Bitmap of all IRQs. + * 1 - available, 0 - used. + */ + BIT_FILL(MV_AP806_SEI_CP_SIZE, &sc->msi_bitmap); + OF_device_register_xref(xref, dev); return (0); @@ -382,6 +411,72 @@ mv_ap806_sei_detach(device_t dev) return (EBUSY); } +static int +mv_ap806_sei_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **srcs) +{ + struct mv_ap806_sei_softc *sc; + int i, ret = 0, vector; + + sc = device_get_softc(dev); + + for (i = 0; i < count; i++) { + /* + * Find first available MSI vector represented by first set bit + * in the bitmap. BIT_FFS starts the count from 1, + * 0 means that nothing was found. + */ + vector = BIT_FFS_AT(MV_AP806_SEI_CP_SIZE, &sc->msi_bitmap, 0); + if (vector == 0) { + ret = ENOMEM; + i--; + goto fail; + } + + vector--; + BIT_CLR(MV_AP806_SEI_CP_SIZE, vector, &sc->msi_bitmap); + vector += MV_AP806_SEI_CP_FIRST; + + srcs[i] = &sc->isrcs[vector].isrc; + } + + return (ret); +fail: + mv_ap806_sei_release_msi(dev, child, i + 1, srcs); + return (ret); +} + +static int +mv_ap806_sei_release_msi(device_t dev, device_t child, int count, struct intr_irqsrc **srcs) +{ + struct mv_ap806_sei_softc *sc; + int i; + + sc = device_get_softc(dev); + + for (i = 0; i < count; i++) { + BIT_SET(MV_AP806_SEI_CP_SIZE, + srcs[i]->isrc_irq - MV_AP806_SEI_CP_FIRST, + &sc->msi_bitmap); + } + + return (0); +} + +static int +mv_ap806_sei_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, + uint64_t *addr, uint32_t *data) +{ + struct mv_ap806_sei_softc *sc; + + sc = device_get_softc(dev); + + *addr = rman_get_start(sc->mem_res) + MV_AP806_SEI_SETSPI_OFFSET; + *data = isrc->isrc_irq; + + return (0); +} + static device_method_t mv_ap806_sei_methods[] = { /* Device interface */ DEVMETHOD(device_probe, mv_ap806_sei_probe), @@ -398,6 +493,11 @@ static device_method_t mv_ap806_sei_methods[] = { DEVMETHOD(pic_post_ithread, mv_ap806_sei_post_ithread), DEVMETHOD(pic_pre_ithread, mv_ap806_sei_pre_ithread), + /* MSI interface */ + DEVMETHOD(msi_alloc_msi, mv_ap806_sei_alloc_msi), + DEVMETHOD(msi_release_msi, mv_ap806_sei_release_msi), + DEVMETHOD(msi_map_msi, mv_ap806_sei_map_msi), + DEVMETHOD_END }; diff --git a/sys/arm/mv/mv_cp110_icu.c b/sys/arm/mv/mv_cp110_icu.c index 12dd6989e339..c783043ab1df 100644 --- a/sys/arm/mv/mv_cp110_icu.c +++ b/sys/arm/mv/mv_cp110_icu.c @@ -50,7 +50,12 @@ __FBSDID("$FreeBSD$"); #include #include + #include "pic_if.h" +#include "msi_if.h" + +#define ICU_TYPE_NSR 1 +#define ICU_TYPE_SEI 2 #define ICU_GRP_NSR 0x0 #define ICU_GRP_SR 0x1 @@ -61,19 +66,28 @@ __FBSDID("$FreeBSD$"); #define ICU_SETSPI_NSR_AH 0x14 #define ICU_CLRSPI_NSR_AL 0x18 #define ICU_CLRSPI_NSR_AH 0x1c +#define ICU_SETSPI_SEI_AL 0x50 +#define ICU_SETSPI_SEI_AH 0x54 #define ICU_INT_CFG(x) (0x100 + (x) * 4) #define ICU_INT_ENABLE (1 << 24) #define ICU_INT_EDGE (1 << 28) #define ICU_INT_GROUP_SHIFT 29 #define ICU_INT_MASK 0x3ff +#define ICU_INT_SATA0 109 +#define ICU_INT_SATA1 107 + #define MV_CP110_ICU_MAX_NIRQS 207 +#define MV_CP110_ICU_CLRSPI_OFFSET 0x8 + struct mv_cp110_icu_softc { device_t dev; device_t parent; struct resource *res; struct intr_map_data_fdt *parent_map_data; + bool initialized; + int type; }; static struct resource_spec mv_cp110_icu_res_spec[] = { @@ -82,8 +96,8 @@ static struct resource_spec mv_cp110_icu_res_spec[] = { }; static struct ofw_compat_data compat_data[] = { - {"marvell,cp110-icu-nsr", 1}, - {"marvell,cp110-icu-sei", 2}, + {"marvell,cp110-icu-nsr", ICU_TYPE_NSR}, + {"marvell,cp110-icu-sei", ICU_TYPE_SEI}, {NULL, 0} }; @@ -109,10 +123,14 @@ mv_cp110_icu_attach(device_t dev) { struct mv_cp110_icu_softc *sc; phandle_t node, msi_parent; + uint32_t reg, icu_grp; + int i; sc = device_get_softc(dev); sc->dev = dev; node = ofw_bus_get_node(dev); + sc->type = (int)ofw_bus_search_compatible(dev, compat_data)->ocd_data; + sc->initialized = false; if (OF_getencprop(node, "msi-parent", &msi_parent, sizeof(phandle_t)) <= 0) { @@ -134,10 +152,20 @@ mv_cp110_icu_attach(device_t dev) goto fail; } - /* Allocate GICP compatible mapping entry (2 cells) */ + /* Allocate GICP/SEI compatible mapping entry (2 cells) */ sc->parent_map_data = (struct intr_map_data_fdt *)intr_alloc_map_data( INTR_MAP_DATA_FDT, sizeof(struct intr_map_data_fdt) + + 3 * sizeof(phandle_t), M_WAITOK | M_ZERO); + + /* Clear any previous mapping done by firmware. */ + for (i = 0; i < MV_CP110_ICU_MAX_NIRQS; i++) { + reg = RD4(sc, ICU_INT_CFG(i)); + icu_grp = reg >> ICU_INT_GROUP_SHIFT; + + if (icu_grp == ICU_GRP_NSR || icu_grp == ICU_GRP_SEI) + WR4(sc, ICU_INT_CFG(i), 0); + } + return (0); fail: @@ -154,15 +182,17 @@ mv_cp110_icu_convert_map_data(struct mv_cp110_icu_softc *sc, struct intr_map_dat daf = (struct intr_map_data_fdt *)data; if (daf->ncells != 2) return (NULL); + irq_no = daf->cells[0]; - irq_type = daf->cells[1]; if (irq_no >= MV_CP110_ICU_MAX_NIRQS) return (NULL); + + irq_type = daf->cells[1]; if (irq_type != IRQ_TYPE_LEVEL_HIGH && irq_type != IRQ_TYPE_EDGE_RISING) return (NULL); - /* We rely on fact that ICU->GIC mapping is preset by bootstrap. */ + /* ICU -> GICP/SEI mapping is set in mv_cp110_icu_map_intr. */ reg = RD4(sc, ICU_INT_CFG(irq_no)); /* Construct GICP compatible mapping. */ @@ -212,13 +242,40 @@ mv_cp110_icu_disable_intr(device_t dev, struct intr_irqsrc *isrc) PIC_DISABLE_INTR(sc->parent, isrc); } +static void +mv_cp110_icu_init(struct mv_cp110_icu_softc *sc, uint64_t addr) +{ + + if (sc->initialized) + return; + + switch (sc->type) { + case ICU_TYPE_NSR: + WR4(sc, ICU_SETSPI_NSR_AL, addr & UINT32_MAX); + WR4(sc, ICU_SETSPI_NSR_AH, (addr >> 32) & UINT32_MAX); + addr += MV_CP110_ICU_CLRSPI_OFFSET; + WR4(sc, ICU_CLRSPI_NSR_AL, addr & UINT32_MAX); + WR4(sc, ICU_CLRSPI_NSR_AH, (addr >> 32) & UINT32_MAX); + break; + case ICU_TYPE_SEI: + WR4(sc, ICU_SETSPI_SEI_AL, addr & UINT32_MAX); + WR4(sc, ICU_SETSPI_SEI_AH, (addr >> 32) & UINT32_MAX); + break; + default: + panic("Unkown ICU type."); + } + + sc->initialized = true; +} + static int mv_cp110_icu_map_intr(device_t dev, struct intr_map_data *data, struct intr_irqsrc **isrcp) { struct mv_cp110_icu_softc *sc; struct intr_map_data_fdt *daf; - uint32_t reg, irq_no, irq_type; + uint32_t vector, irq_no, irq_type; + uint64_t addr; int ret; sc = device_get_softc(dev); @@ -230,23 +287,62 @@ mv_cp110_icu_map_intr(device_t dev, struct intr_map_data *data, daf = (struct intr_map_data_fdt *)data; if (daf->ncells != 2) return (EINVAL); + irq_no = daf->cells[0]; + if (irq_no >= MV_CP110_ICU_MAX_NIRQS) + return (EINVAL); + irq_type = daf->cells[1]; - data = mv_cp110_icu_convert_map_data(sc, data); - if (data == NULL) + if (irq_type != IRQ_TYPE_LEVEL_HIGH && + irq_type != IRQ_TYPE_EDGE_RISING) return (EINVAL); - reg = RD4(sc, ICU_INT_CFG(irq_no)); - reg |= ICU_INT_ENABLE; - if (irq_type == IRQ_TYPE_LEVEL_HIGH) - reg &= ~ICU_INT_EDGE; + /* + * Allocate MSI vector. + * We don't use intr_alloc_msi wrapper, since it registers a new irq + * in the kernel. In our case irq was already added by the ofw code. + */ + ret = MSI_ALLOC_MSI(sc->parent, dev, 1, 1, NULL, isrcp); + if (ret != 0) + return (ret); + + ret = MSI_MAP_MSI(sc->parent, dev, *isrcp, &addr, &vector); + if (ret != 0) + goto fail; + + mv_cp110_icu_init(sc, addr); + vector |= ICU_INT_ENABLE; + + if (sc->type == ICU_TYPE_NSR) + vector |= ICU_GRP_NSR << ICU_INT_GROUP_SHIFT; else - reg |= ICU_INT_EDGE; - WR4(sc, ICU_INT_CFG(irq_no), reg); + vector |= ICU_GRP_SEI << ICU_INT_GROUP_SHIFT; + + if (irq_type & IRQ_TYPE_EDGE_BOTH) + vector |= ICU_INT_EDGE; + + WR4(sc, ICU_INT_CFG(irq_no), vector); + + /* + * SATA controller has two ports, each gets its own interrupt. + * The problem is that only one irq is described in dts. + * Also ahci_generic driver supports only one irq per controller. + * As a workaround map both interrupts when one of them is allocated. + * This allows us to use both SATA ports. + */ + if (irq_no == ICU_INT_SATA0) + WR4(sc, ICU_INT_CFG(ICU_INT_SATA1), vector); + if (irq_no == ICU_INT_SATA1) + WR4(sc, ICU_INT_CFG(ICU_INT_SATA0), vector); - ret = PIC_MAP_INTR(sc->parent, data, isrcp); (*isrcp)->isrc_dev = sc->dev; return (ret); + +fail: + if (*isrcp != NULL) + MSI_RELEASE_MSI(sc->parent, dev, 1, isrcp); + + return (ret); } static int @@ -254,13 +350,30 @@ mv_cp110_icu_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct mv_cp110_icu_softc *sc; + struct intr_map_data_fdt *daf; + int irq_no, ret; + + if (data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); sc = device_get_softc(dev); + daf = (struct intr_map_data_fdt *)data; + if (daf->ncells != 2) + return (EINVAL); + + irq_no = daf->cells[0]; data = mv_cp110_icu_convert_map_data(sc, data); if (data == NULL) return (EINVAL); - return (PIC_DEACTIVATE_INTR(sc->parent, isrc, res, data)); + /* Clear the mapping. */ + WR4(sc, ICU_INT_CFG(irq_no), 0); + + ret = PIC_DEACTIVATE_INTR(sc->parent, isrc, res, data); + if (ret != 0) + return (ret); + + return (MSI_RELEASE_MSI(sc->parent, dev, 1, &isrc)); } static int From owner-dev-commits-src-main@freebsd.org Wed Jul 21 01:38:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 170F36579BF; Wed, 21 Jul 2021 01:38: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 4GTys10BWxz4RCP; Wed, 21 Jul 2021 01:38:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2F6E155B1; Wed, 21 Jul 2021 01:38: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 16L1cCrs001496; Wed, 21 Jul 2021 01:38:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1cCKu001495; Wed, 21 Jul 2021 01:38:12 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:38:12 GMT Message-Id: <202107210138.16L1cCKu001495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: b684d812fcb0 - main - arm: Bump KSTACK_PAGES default to match i386/amd64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b684d812fcb04b2997fd755405a92c36b9f6e30e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:38:13 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b684d812fcb04b2997fd755405a92c36b9f6e30e commit b684d812fcb04b2997fd755405a92c36b9f6e30e Author: Kevin Bowling AuthorDate: 2021-07-21 01:35:54 +0000 Commit: Kevin Bowling CommitDate: 2021-07-21 01:35:54 +0000 arm: Bump KSTACK_PAGES default to match i386/amd64 See 3f6867ef6386 for additional context. It is also needed for OpenZFS performance and stability. Reviewed by: ian (arm), imp Differential Revision: https://reviews.freebsd.org/D31244 --- sys/arm/include/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h index 807b492324fa..45dc0f270c50 100644 --- a/sys/arm/include/param.h +++ b/sys/arm/include/param.h @@ -114,7 +114,7 @@ #define MAXPAGESIZES 2 /* maximum number of supported page sizes */ #ifndef KSTACK_PAGES -#define KSTACK_PAGES 2 +#define KSTACK_PAGES 4 #endif /* !KSTACK_PAGES */ #ifndef FPCONTEXTSIZE From owner-dev-commits-src-main@freebsd.org Wed Jul 21 01:51:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17D356579EF; Wed, 21 Jul 2021 01:51: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 4GTz8h73LRz4Srs; Wed, 21 Jul 2021 01:51:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAD6515A41; Wed, 21 Jul 2021 01:51: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 16L1pmSF027186; Wed, 21 Jul 2021 01:51:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1pmsT027185; Wed, 21 Jul 2021 01:51:48 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:51:48 GMT Message-Id: <202107210151.16L1pmsT027185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: e77ef47d3649 - main - geom_label: Partially reinstate old sysinstall(8) workaround MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e77ef47d3649090904e36a6ffa42486a435ba127 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:51:49 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=e77ef47d3649090904e36a6ffa42486a435ba127 commit e77ef47d3649090904e36a6ffa42486a435ba127 Author: Jessica Clarke AuthorDate: 2021-07-21 01:24:55 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 01:51:25 +0000 geom_label: Partially reinstate old sysinstall(8) workaround This partially reverts commit af433832f7520840c22edd1fe1266c1a5cb781ad. Since such bogus disklabels still exist in the wild, we now probe for a disklabel to decide whether to ignore the UFS partition or not; if there is a label then we use the old behaviour, and if there isn't one then we use the new behaviour. Reviewed by: cy, mckusick Differential Revision: https://reviews.freebsd.org/D31068 --- sys/geom/label/g_label_ufs.c | 79 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/sys/geom/label/g_label_ufs.c b/sys/geom/label/g_label_ufs.c index 70d59488d7b6..b29a04c9f348 100644 --- a/sys/geom/label/g_label_ufs.c +++ b/sys/geom/label/g_label_ufs.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -48,6 +49,81 @@ __FBSDID("$FreeBSD$"); #define G_LABEL_UFS_VOLUME 0 #define G_LABEL_UFS_ID 1 +/* + * G_LABEL_UFS_CMP returns true if difference between provider mediasize + * and filesystem size is less than G_LABEL_UFS_MAXDIFF sectors + */ +#define G_LABEL_UFS_CMP(prov, fsys, size) \ + ( abs( ((fsys)->size) - ( (prov)->mediasize / (fsys)->fs_fsize )) \ + < G_LABEL_UFS_MAXDIFF ) +#define G_LABEL_UFS_MAXDIFF 0x100 + +/* + * For providers that look like disklabels we need to check if the file system + * size is almost equal to the provider's size, because sysinstall(8) used to + * bogusly put the first partition at offset 0 instead of 16, and glabel/ufs + * would find a file system on the slice instead of the partition. + * + * In addition, media size can be a bit bigger than file system size. For + * instance, mkuzip can append bytes to align data to large sector size (it + * improves compression rates). + */ +static bool +g_label_ufs_ignore_bsdlabel_slice(struct g_consumer *cp, + struct fs *fs) +{ + struct g_provider *pp; + u_char *buf; + uint32_t magic1, magic2; + int error; + + pp = cp->provider; + + /* + * If the expected provider size for the filesystem matches the + * real provider size then don't ignore this filesystem. + */ + if (G_LABEL_UFS_CMP(pp, fs, fs_providersize)) + return (false); + + /* + * If the filesystem size matches the real provider size then + * don't ignore this filesystem. + */ + if (fs->fs_magic == FS_UFS1_MAGIC ? + G_LABEL_UFS_CMP(pp, fs, fs_old_size) : + G_LABEL_UFS_CMP(pp, fs, fs_size)) + return (false); + + /* + * Provider is bigger than expected; probe to see if there's a + * disklabel. Adapted from g_part_bsd_probe. + */ + + /* Check if the superblock overlaps where the disklabel lives. */ + if (fs->fs_sblockloc < pp->sectorsize * 2) + return (false); + + /* Sanity-check the provider. */ + if (pp->sectorsize < sizeof(struct disklabel) || + pp->mediasize < BBSIZE) + return (false); + if (BBSIZE % pp->sectorsize) + return (false); + + /* Check that there's a disklabel. */ + buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error); + if (buf == NULL) + return (false); + magic1 = le32dec(buf + 0); + magic2 = le32dec(buf + 132); + g_free(buf); + if (magic1 == DISKMAGIC && magic2 == DISKMAGIC) + return (true); + + return (false); +} + /* * Try to find a superblock on the provider. If successful, look for a volume * label and create an appropriate provider based on that. @@ -78,6 +154,9 @@ g_label_ufs_taste_common(struct g_consumer *cp, char *label, size_t size, int wh } else { goto out; } + /* Check if this should be ignored for compatibility. */ + if (g_label_ufs_ignore_bsdlabel_slice(cp, fs)) + goto out; G_LABEL_DEBUG(1, "%s file system detected on %s.", fs->fs_magic == FS_UFS1_MAGIC ? "UFS1" : "UFS2", pp->name); switch (what) { From owner-dev-commits-src-main@freebsd.org Wed Jul 21 01:51:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 564EE657D02; Wed, 21 Jul 2021 01:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTz8k1Tg9z4TD1; Wed, 21 Jul 2021 01:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E741151FC; Wed, 21 Jul 2021 01:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L1pnXS027210; Wed, 21 Jul 2021 01:51:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1pnUE027209; Wed, 21 Jul 2021 01:51:49 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:51:49 GMT Message-Id: <202107210151.16L1pnUE027209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: d9e85f2c6f77 - main - riscv: Implement missing nexus methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9e85f2c6f77418864a7531ffaa0e42061c0c7da Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:51:50 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d9e85f2c6f77418864a7531ffaa0e42061c0c7da commit d9e85f2c6f77418864a7531ffaa0e42061c0c7da Author: Jessica Clarke AuthorDate: 2021-07-21 01:28:20 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 01:51:25 +0000 riscv: Implement missing nexus methods This is required for the SiFive FU740's PCIe controller. Copied from arm64 with the only difference being changing pmap_mapdev_attr to pmap_mapdev as riscv only has the latter. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31032 --- sys/riscv/riscv/nexus.c | 116 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 97 insertions(+), 19 deletions(-) diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c index 4a459e3e1016..b56cf29aa3ee 100644 --- a/sys/riscv/riscv/nexus.c +++ b/sys/riscv/riscv/nexus.c @@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include #include @@ -81,19 +84,25 @@ static int nexus_attach(device_t); static int nexus_print_child(device_t, device_t); static device_t nexus_add_child(device_t, u_int, const char *, int); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, - u_long, u_long, u_long, u_int); + rman_res_t, rman_res_t, rman_res_t, u_int); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_map_resource(device_t, device_t, int, struct resource *, + struct resource_map_request *, struct resource_map *); static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol); static struct resource_list *nexus_get_reslist(device_t, device_t); -static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long); +static int nexus_set_resource(device_t, device_t, int, int, + rman_res_t, rman_res_t); static int nexus_deactivate_resource(device_t, device_t, int, int, struct resource *); +static int nexus_release_resource(device_t, device_t, int, int, + struct resource *); static int nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); +static bus_space_tag_t nexus_get_bus_tag(device_t, device_t); static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr); @@ -111,12 +120,15 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_map_resource, nexus_map_resource), DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_set_resource, nexus_set_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), + DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), { 0, 0 } }; @@ -199,7 +211,7 @@ nexus_add_child(device_t bus, u_int order, const char *name, int unit) */ static struct resource * nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { struct nexus_device *ndev = DEVTONX(child); struct resource *rv; @@ -255,6 +267,20 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, return (rv); } +static int +nexus_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + int error; + + if (rman_get_flags(res) & RF_ACTIVE) { + error = bus_deactivate_resource(child, type, rid, res); + if (error) + return (error); + } + return (rman_release_resource(res)); +} + static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) @@ -289,14 +315,19 @@ nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) return (intr_teardown_irq(child, r, ih)); } +static bus_space_tag_t +nexus_get_bus_tag(device_t bus __unused, device_t child __unused) +{ + + return (&memmap_bus); +} + static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + struct resource_map map; int err; - bus_addr_t paddr; - bus_size_t psize; - bus_space_handle_t vaddr; if ((err = rman_activate_resource(r)) != 0) return (err); @@ -304,25 +335,27 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, /* * If this is a memory resource, map it into the kernel. */ - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - paddr = (bus_addr_t)rman_get_start(r); - psize = (bus_size_t)rman_get_size(r); - err = bus_space_map(&memmap_bus, paddr, psize, 0, &vaddr); - if (err != 0) { - rman_deactivate_resource(r); - return (err); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + if ((rman_get_flags(r) & RF_UNMAPPED) == 0) { + err = nexus_map_resource(bus, child, type, r, NULL, + &map); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } + + rman_set_mapping(r, &map); } - rman_set_bustag(r, &memmap_bus); - rman_set_virtual(r, (void *)vaddr); - rman_set_bushandle(r, vaddr); - } else if (type == SYS_RES_IRQ) { + break; + case SYS_RES_IRQ: err = intr_activate_irq(child, r); if (err != 0) { rman_deactivate_resource(r); return (err); } } - return (0); } @@ -336,7 +369,7 @@ nexus_get_reslist(device_t dev, device_t child) static int nexus_set_resource(device_t dev, device_t child, int type, int rid, - u_long start, u_long count) + rman_res_t start, rman_res_t count) { struct nexus_device *ndev = DEVTONX(child); struct resource_list *rl = &ndev->nx_resources; @@ -370,6 +403,51 @@ nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, return (rman_deactivate_resource(r)); } +static int +nexus_map_resource(device_t bus, device_t child, int type, struct resource *r, + struct resource_map_request *argsp, struct resource_map *map) +{ + struct resource_map_request args; + rman_res_t end, length, start; + + /* Resources must be active to be mapped. */ + if ((rman_get_flags(r) & RF_ACTIVE) == 0) + return (ENXIO); + + /* Mappings are only supported on I/O and memory resources. */ + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + break; + default: + return (EINVAL); + } + + resource_init_map_request(&args); + if (argsp != NULL) + bcopy(argsp, &args, imin(argsp->size, args.size)); + start = rman_get_start(r) + args.offset; + if (args.length == 0) + length = rman_get_size(r); + else + length = args.length; + end = start + length - 1; + if (start > rman_get_end(r) || start < rman_get_start(r)) + return (EINVAL); + if (end > rman_get_end(r) || end < start) + return (EINVAL); + + map->r_vaddr = pmap_mapdev(start, length); + map->r_bustag = &memmap_bus; + map->r_size = length; + + /* + * The handle is the virtual address. + */ + map->r_bushandle = (bus_space_handle_t)map->r_vaddr; + return (0); +} + static devclass_t nexus_fdt_devclass; EARLY_DRIVER_MODULE(nexus_fdt, root, nexus_fdt_driver, nexus_fdt_devclass, From owner-dev-commits-src-main@freebsd.org Wed Jul 21 01:51:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D96B3657C62; Wed, 21 Jul 2021 01:51: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 4GTz8l2QpMz4TDF; Wed, 21 Jul 2021 01:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C4DA158E0; Wed, 21 Jul 2021 01:51: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 16L1ppLI027241; Wed, 21 Jul 2021 01:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1pp0V027240; Wed, 21 Jul 2021 01:51:51 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:51:51 GMT Message-Id: <202107210151.16L1pp0V027240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 4c4a6884ad7f - main - cgem: Add support for the SiFive FU740 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c4a6884ad7fb18b0777597a4f6c2cdb235dccb6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:51:52 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4c4a6884ad7fb18b0777597a4f6c2cdb235dccb6 commit 4c4a6884ad7fb18b0777597a4f6c2cdb235dccb6 Author: Jessica Clarke AuthorDate: 2021-07-21 01:44:38 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 01:51:25 +0000 cgem: Add support for the SiFive FU740 Note that currently Linux's device tree uses the FU540's compatible string, as does upstream U-Boot, but the U-Boot shipped with the board based on an older patch series has the correct FU740 name. Thankfully they are the same, at least as far as software is concerned. Whilst here, fix a style(9) nit. Reviewed by: philip, kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31034 --- sys/dev/cadence/if_cgem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/cadence/if_cgem.c b/sys/dev/cadence/if_cgem.c index 0583e846458a..6001c5ba74a5 100644 --- a/sys/dev/cadence/if_cgem.c +++ b/sys/dev/cadence/if_cgem.c @@ -105,12 +105,13 @@ __FBSDID("$FreeBSD$"); #define HWTYPE_GENERIC_GEM 1 #define HWTYPE_ZYNQ 2 #define HWTYPE_ZYNQMP 3 -#define HWTYPE_SIFIVE_FU540 4 +#define HWTYPE_SIFIVE 4 static struct ofw_compat_data compat_data[] = { { "cdns,zynq-gem", HWTYPE_ZYNQ }, { "cdns,zynqmp-gem", HWTYPE_ZYNQMP }, - { "sifive,fu540-c000-gem", HWTYPE_SIFIVE_FU540 }, + { "sifive,fu540-c000-gem", HWTYPE_SIFIVE }, + { "sifive,fu740-c000-gem", HWTYPE_SIFIVE }, { "cdns,gem", HWTYPE_GENERIC_GEM }, { "cadence,gem", HWTYPE_GENERIC_GEM }, { NULL, 0 } @@ -1762,8 +1763,7 @@ cgem_attach(device_t dev) "could not retrieve reference clock.\n"); else if (clk_enable(sc->ref_clk) != 0) device_printf(dev, "could not enable clock.\n"); - } - else if (hwtype == HWTYPE_SIFIVE_FU540) { + } else if (hwtype == HWTYPE_SIFIVE) { if (clk_get_by_ofw_name(dev, 0, "pclk", &sc->ref_clk) != 0) device_printf(dev, "could not retrieve reference clock.\n"); From owner-dev-commits-src-main@freebsd.org Wed Jul 21 01:51:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E05A0657774; Wed, 21 Jul 2021 01:51: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 4GTz8m3Zbpz4T74; Wed, 21 Jul 2021 01:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56FAF159D0; Wed, 21 Jul 2021 01:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L1pqea027265; Wed, 21 Jul 2021 01:51:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1pqfB027264; Wed, 21 Jul 2021 01:51:52 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:51:52 GMT Message-Id: <202107210151.16L1pqfB027264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: a1f9cdb1abf7 - main - sifive_uart: Fix input character dropping in ddb and at a mountroot prompt MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1f9cdb1abf792cb1e1adcaaba0fb84cd56e80f1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:51:53 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a1f9cdb1abf792cb1e1adcaaba0fb84cd56e80f1 commit a1f9cdb1abf792cb1e1adcaaba0fb84cd56e80f1 Author: Jessica Clarke AuthorDate: 2021-07-21 01:45:48 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 01:51:25 +0000 sifive_uart: Fix input character dropping in ddb and at a mountroot prompt These use the raw console interface and poll. Unfortunately, the SiFive UART puts the FIFO empty bit inside the FIFO data register, which means that the act of checking whether a character is available also dequeues any character from the FIFO, requiring the user to press each key twice. However, since we configure the watermark to be 0 and, when the UART has been grabbed for the console, we have interrupts off, we can abuse the interrupt pending register to act as a substitute for the FIFO empty bit. This perhaps suggests that the console interface should move from having rxready and getc to having getc_nonblock and getc (or make getc take a bool), as all the places that call rxready do so to avoid blocking on getc when there is no character available. Reviewed by: kp, philip MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31025 --- sys/riscv/sifive/sifive_uart.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/riscv/sifive/sifive_uart.c b/sys/riscv/sifive/sifive_uart.c index cee9ddd0bc25..9a952e940120 100644 --- a/sys/riscv/sifive/sifive_uart.c +++ b/sys/riscv/sifive/sifive_uart.c @@ -137,9 +137,15 @@ sfuart_putc(struct uart_bas *bas, int c) static int sfuart_rxready(struct uart_bas *bas) { - - return ((uart_getreg(bas, SFUART_RXDATA) & - SFUART_RXDATA_EMPTY) == 0); + /* + * Unfortunately the FIFO empty flag is in the FIFO data register so + * reading it would dequeue the character. Instead, rely on the fact + * we've configured the watermark to be 0 and that interrupts are off + * when using the low-level console function, and read the interrupt + * pending state instead. + */ + return ((uart_getreg(bas, SFUART_IRQ_PENDING) & + SFUART_IRQ_PENDING_RXQM) != 0); } static int From owner-dev-commits-src-main@freebsd.org Wed Jul 21 01:51:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AF5F6577E4; Wed, 21 Jul 2021 01:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTz8p5vrWz4TBG; Wed, 21 Jul 2021 01:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 983A71556E; Wed, 21 Jul 2021 01:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L1psvC027313; Wed, 21 Jul 2021 01:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1pspx027312; Wed, 21 Jul 2021 01:51:54 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:51:54 GMT Message-Id: <202107210151.16L1pspx027312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: d0c737e18454 - main - Makefile: Fix MAKEOBJDIRPREFIX command-line variable check for bmake MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0c737e18454868447f731fe2b10d04f50d9d53b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:51:55 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d0c737e18454868447f731fe2b10d04f50d9d53b commit d0c737e18454868447f731fe2b10d04f50d9d53b Author: Jessica Clarke AuthorDate: 2021-07-21 01:48:10 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 01:51:26 +0000 Makefile: Fix MAKEOBJDIRPREFIX command-line variable check for bmake Unlike the old fmake, running make FOO=bar when using bmake doesn't put FOO=bar in .MAKEFLAGS at the top level, it instead just puts FOO in .MAKEOVERRIDES and the full MAKEFLAGS will be formed for sub-makes. Moreover, this only applies for sub-makes in rules, so this doesn't apply to those in shell assignments. This means that the current check does not catch make MAKEOBJDIRPREFIX=..., only those defined in config files. Thus we must also check .MAKEOVERRIDES explicitly. Reviewed by: sjg MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31015 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 711854f4693c..c64873fb241b 100644 --- a/Makefile +++ b/Makefile @@ -218,7 +218,7 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \ ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ SRCCONF=${SRCCONF} SRC_ENV_CONF= \ -f /dev/null -V MAKEOBJDIRPREFIX dummy -.if !empty(_MAKEOBJDIRPREFIX) +.if !empty(_MAKEOBJDIRPREFIX) || !empty(.MAKEOVERRIDES:MMAKEOBJDIRPREFIX) .error MAKEOBJDIRPREFIX can only be set in environment or src-env.conf(5),\ not as a global (in make.conf(5) or src.conf(5)) or command-line variable. .endif From owner-dev-commits-src-main@freebsd.org Wed Jul 21 01:51:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA404657C65; Wed, 21 Jul 2021 01:51: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 4GTz8n4X8Tz4TGG; Wed, 21 Jul 2021 01:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7411B15774; Wed, 21 Jul 2021 01:51: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 16L1prFN027289; Wed, 21 Jul 2021 01:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1pr5m027288; Wed, 21 Jul 2021 01:51:53 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:51:53 GMT Message-Id: <202107210151.16L1pr5m027288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: ade2ea3c459a - main - riscv: Fix pindex level confusion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ade2ea3c459ac1c2a7f44ce56b8999e6ffef08bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:51:54 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=ade2ea3c459ac1c2a7f44ce56b8999e6ffef08bf commit ade2ea3c459ac1c2a7f44ce56b8999e6ffef08bf Author: Jessica Clarke AuthorDate: 2021-07-21 01:47:01 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 01:51:26 +0000 riscv: Fix pindex level confusion The pindex values are assigned from the L3 leaves upwards, meaning there are NUL2E L3 tables and then NUL1E L2 tables (with a futher NUL0E L1 tables in future when we implement Sv48 support). Therefore anything below NUL2E is an L3 table's page and anything above or equal to NUL2E is an L2 table's page (with the threshold of NUL2E + NUL1E marking the start of the L1 tables' pages in Sv48). Thus all the comparisons and arithmetic operations must use NUL2E to handle the L3/L2 allocation (and thus L2/L1 entry) transition point, not NUL1E as all but pmap_alloc_l2 were doing. To make matters confusing, the NUL1E and NUL2E definitions in the RISC-V pmap are based on a 4-level page hierarchy but we currently use the 3-level Sv39 format (as that's the only required one, and hardware support for the 4-level Sv48 is not widespread). This means that, in effect, the above bug cancels out with the bloated NULxE definitions such that things "work" (but are still technically wrong, and thus would break when adding Sv48 support), with one exception. pmap_enter_l2 is currently the only function to use the correct constant, but since _pmap_alloc_l3 uses the incorrect constant, it will do complete nonsense when it needs to allocate a new L2 table (which is rather rare). In this instance, _pmap_alloc_l3, whilst it would correctly determine the pindex was for an L2 table, would only subtract NUL1E when computing l1index and thus go way out of bounds (by 511*512*512 bytes, or 127.75 GiB) of its own L1 table and, thanks to pmap_distribute_l1, of every other pmap's L1 table in the whole system. This has likely never been hit as it would presumably instantly fault and panic. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31087 --- sys/riscv/riscv/pmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 924e1aefc82f..39595b10d7b2 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -1132,7 +1132,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) vm_paddr_t phys; PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if (m->pindex >= NUL1E) { + if (m->pindex >= NUL2E) { pd_entry_t *l1; l1 = pmap_l1(pmap, va); pmap_clear(l1); @@ -1143,7 +1143,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) pmap_clear(l2); } pmap_resident_count_dec(pmap, 1); - if (m->pindex < NUL1E) { + if (m->pindex < NUL2E) { pd_entry_t *l1; vm_page_t pdpg; @@ -1279,11 +1279,11 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) * it isn't already there. */ - if (ptepindex >= NUL1E) { + if (ptepindex >= NUL2E) { pd_entry_t *l1; vm_pindex_t l1index; - l1index = ptepindex - NUL1E; + l1index = ptepindex - NUL2E; l1 = &pmap->pm_l1[l1index]; KASSERT((pmap_load(l1) & PTE_V) == 0, ("%s: L1 entry %#lx is valid", __func__, pmap_load(l1))); @@ -1301,7 +1301,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) l1 = &pmap->pm_l1[l1index]; if (pmap_load(l1) == 0) { /* recurse for allocating page dir */ - if (_pmap_alloc_l3(pmap, NUL1E + l1index, + if (_pmap_alloc_l3(pmap, NUL2E + l1index, lockp) == NULL) { vm_page_unwire_noq(m); vm_page_free_zero(m); From owner-dev-commits-src-main@freebsd.org Wed Jul 21 04:43:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F0D165A800 for ; Wed, 21 Jul 2021 04:43:41 +0000 (UTC) (envelope-from giffunip@yahoo.com) Received: from sonic307-10.consmr.mail.ne1.yahoo.com (sonic307-10.consmr.mail.ne1.yahoo.com [66.163.190.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GV2yz6ckDz3GjL for ; Wed, 21 Jul 2021 04:43:39 +0000 (UTC) (envelope-from giffunip@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1626842616; bh=VSOrfSX3ekFZyZbFFWJWzqofl++eFZrRTQ87TUemnXU=; h=X-Sonic-MF:Subject:To:From:Date:From:Subject; b=rT7iAsNJm0aRnP9Dgcr+3AJRsQA6s9cwrlktF07yJP6a8i0pHsXMAJWRoOm3A88pVK/05YJat16/iSDQe1r5BIr0I7cAGysgc/tf43B7U1WRl4DqZ6qM2yfcWWBaDghkedyFaRYz8IB7PDEFzNoOGrMxVVaz2i8xSFxnxbU5kcaQMxvGvdrHqQXK46y9S0IP0qaq7X6EhtyYu2UUffCsezS1nAvIqjnxLJFeFs9+uNr1CbjSJ7a9a/TgpxGUEGfRhCeMTMx2hLi6yh26M4G3cRMi8dPksWt72f8QG+eG20Q6yH7udFjt5cPAbIW3OExHMULBS14NRKu1iyBgpVfbbg== X-YMail-OSG: SLtAAJcVM1nOlGKMfJ86BZey4sQiuoRpBhcomNTYO9HrgKRnbfG_dsWBK2RaStQ 0mMeW2yh7HSsrNlo7OW9H8jyzUli8GraUkiU3KwaNx2Qm0tu.kScKhHK9fC0maIv49eDZcQ2rUTc vtWjn4rmNJuiD38O8Bzi0PCKjxM_Yst23dCKJxnOw4NENmuWZGvl1DAjIOnKIshyXBTZYPzREBYo 43YmsUOpXqLxUacEuhzohAoJutFwCAKTOB1WkJdugDd01tfn75B5b4RHlX8n9Q5.Xp_c0XHUNhfb qME3xDuU0qkZAclXlSp2m01RQB0K0Zw0IWMtvxyQx8M2fyLhqtKk83JlpIbkEDnupVC7AlDr4wbZ Fck12W8uq3QXlvhrSLxTPUFrp7gN6sP_cDbTL9OBpjoxqC_eYuubhBUD_t5Qm5ZEYcXVcHwqNfor pinyH1NMzkB.8s_m6F0dN1e6MH_WJG51.I35ibF9BzvxzPCaX1uY1KnNt3OzXDriD4msJ6RlHYvE 7zupeQbuZaX1zxRAR0Cdo2iTuk1NalAlBjI53G7eNwvKRobwhEfoqwkhfXdEHPJzalnd4wCGfvCI svbAdi2AWwuAZdp.FyKGLJ.FJwF0LTrnQGcNRfW6a8f8MN0_WBf71kf7Z29nIZA9YkkySkEJ7lIy eeHiKB4ta8JAr2gZDz1AdAugBFJ7m3LqQ1wkVuglNYiq_DqYCmfPhOX0VIHf9759Vt2FNPdPe1bZ 9YfFwkErvyWqca5YqECDNF1FOWocTpU_O65wiTqhuYGOgLX9bzcdF7w0gw47LiGlqZeIJcft5mnr SRLm0yMvw_.sll6lVs8qraTzKrhesFepWN.iK70O5FTmiNu85WsYfoYCk6jvPSsT46AfGihubw0y ySWFP1QPSy62D.laF9FxHR98m9StNsTIJMAZI0N_8f86maATTq0Nsr9.6WIktT6ebcW7gxe2nkDG rWRVmmPaunt04mePbbgoSaTc0qj9FcyLgP1RJlLKovJ2DyDTPswGj8K.M2TKmZB95_mY5pwUnvu4 G1cZ5YnXMEuD0Dl49o3RNPWK0ck8Cs6GDZyZ_sQ4t1iWn..WriBrpeeblItD63pv3c6F3WmeD9Wq FwR6ApghOER7xD85u7I_FElxMZZEVF6R5IBpLQLTbPnI33EnzQpf.EjEJzsli__fIPLrOK8azA2x iC4YnSMomiVwuvuJhKYjKvX4KO3HAmmXZr2Mg3jo3WY9IQTYCsyghUaj1UORyEznesZ_0FXqUPqL a.svjT2FbQD2.VcpVG.y8CISyY1pXlV9VFJhIRaspPFsjsz0R99zgNvYeeZT4EdMz4rWeILDE9fi o6eNzjuqRtRwU3XtNdd3an1P3TUH98fSFivR8.cWY8K.aoAeyKA4NYh5lHm9xhb0yX9dGgcQTHLd Gd_XcGQUwARm1LnoHUSSnxytxxZQ.uqh9z7KUrP_9B8RAPvwTmh3x5YYtBHy66WJ9O0CsoOPZ1z2 okZkyNUEyfnsAEM5_sR492lx872oyQY28YnU1aNEyL_Zgc1ZYrgWxHCjSl8dCSWZSVIyD4Owby.B 681vnASHkoxnZWuEJTV387ByInpw9mMFfkTSmzEkW2CPqb4MbmNNqQ3RLHVTxt58vc4fHL4i1EuV o.GGnyajZv5A19lkH73I2d7B0JFWyzsyHgAprJqapPUMLVpLSPB6dbqVdmxHOrXc.ansCitoS4ay KR3xCXxV.WywdBAPqgBFILmcZ7iWMK8nRYtgH8NH8VnO6D_jhDRwSKu0XJCl96V8qToeKW_NbuXN tRcAlM910MXw.WS7_Xa6T8b_fjoQ21tcT7iZZ7O9OWce7UjpIFu5Fkb8XU.cm641lBuCM57F0DGJ dclQLqpYkEEp1MbeSLi83fi.tBF_blJ.lFJTYCeJPfMBRHiO0ykZ413UZUOl5qDMhR.t4V0qjUjV SGAh9IcKCzFaqu5PTCCjm4qXTKC0IXOCVFihWyg8jyYnPJibzsOI.IaDG.Jd7_LkKC.bQXY9LVQO DvL1xM5OFqg99Imm5TY3oKdi7TYwaVuEDpB.1PoMxdOTmMPIEQDkTEM3_cUv6DL1j1dmz5oHyce0 IYzPJLQn9iUlQeN7NFVLptSZTZqSTgP1dr1kSvG5yjgXfvg_DRY4nFb3eFpVEb_ZHdKyj3aocOha zchXv9SbWskTeMKZ5JZB8UiskJE2cmdB_vNudCfsmAkWgQYGhY.g1Smj6AL..3epmZOQ78piq9_l yxDxkssTUIqaCMwtF1k4y1KkVwfPcmK7_PrVx1szswJGdoLb8OeJNLP.Vfss9fBaOWwdu85znQHb 8FYxG34guz8XpXqSy6RnsNGy4RA61olM.rsQp_GEs1PQimzmASH2xYQzqJOvtpg6snk_R.oH3H9w A5GO1tiHoclXJZIeai4DaMcsvqtiKFsFe44sc.lTlOmSVr6r_WJ_vIvBhxLRFukVQJXDxQwJvgAY V5AJRg7JUgNHO6Fklqx8JJ3cRfgRGirAn7U2KCjrAIJLAiTLlEnlrEWuQ2WQVVzKSGa6MY01t7IX UTf_6QiaEFJTVVMiex5NXBHY- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Wed, 21 Jul 2021 04:43:36 +0000 Received: by kubenode545.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID ea453a4f68006a8c249ab8f7479ad9ae; Wed, 21 Jul 2021 04:43:35 +0000 (UTC) Subject: Re: git: 0c92d88c9180 - main - awk: remove proctab.c To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202107200435.16K4Z9v8022286@gitrepo.freebsd.org> From: Pedro Giffuni Message-ID: <85563899-9e17-5197-d940-434d577f473e@yahoo.com> Date: Tue, 20 Jul 2021 23:43:34 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <202107200435.16K4Z9v8022286@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Mailer: WebService/1.1.18469 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Rspamd-Queue-Id: 4GV2yz6ckDz3GjL X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[66.163.190.33:from]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[66.163.190.33:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.163.190.33:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[66.163.190.33:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 04:43:41 -0000 On 19/07/2021 23:35, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=0c92d88c9180bf25187f01f1d7e419edea9a0fef > > commit 0c92d88c9180bf25187f01f1d7e419edea9a0fef > Author: Warner Losh > AuthorDate: 2021-07-12 03:26:08 +0000 > Commit: Warner Losh > CommitDate: 2021-07-20 04:34:37 +0000 > > awk: remove proctab.c > > proctab.c is a generated file and never should have been committed to > the tree. This file has been added and removed a couple of times, most > recently added by me in my 2019 updates. > Sounds like material for .gitignore ;). Pedro. From owner-dev-commits-src-main@freebsd.org Wed Jul 21 04:51:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40E7665A77F; Wed, 21 Jul 2021 04:51: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 4GV38S1KrQz3HQN; Wed, 21 Jul 2021 04:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1723817CDD; Wed, 21 Jul 2021 04:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L4ppH4065910; Wed, 21 Jul 2021 04:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L4pphl065909; Wed, 21 Jul 2021 04:51:51 GMT (envelope-from git) Date: Wed, 21 Jul 2021 04:51:51 GMT Message-Id: <202107210451.16L4pphl065909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: f8c1701f23b5 - main - pci_dw: Support multiple memory windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8c1701f23b5b99365ffab2a067e4676b905ab57 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 04:51:52 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f8c1701f23b5b99365ffab2a067e4676b905ab57 commit f8c1701f23b5b99365ffab2a067e4676b905ab57 Author: Jessica Clarke AuthorDate: 2021-07-21 04:50:24 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 04:50:24 +0000 pci_dw: Support multiple memory windows Currently we assume there is only one memory and one prefetch memory window, and ignore the latter. However, the SiFive FU740 has two normal memory windows. As part of this, the viewports are rearranged. Previously the viewports were memory, config then optionally I/O. Both to simplify the config index calculation and to ensure it can always be mapped even if we have too many memory windows for the number of viewports, config is moved to being the first viewport. This generalisation now also naturally supports mapping prefetch memory windows. Reviewed by: mmel MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31028 --- sys/dev/pci/pci_dw.c | 108 +++++++++++++++++++++++++++++---------------------- sys/dev/pci/pci_dw.h | 4 +- 2 files changed, 63 insertions(+), 49 deletions(-) diff --git a/sys/dev/pci/pci_dw.c b/sys/dev/pci/pci_dw.c index 47324eb70c8a..3aa6c4326d67 100644 --- a/sys/dev/pci/pci_dw.c +++ b/sys/dev/pci/pci_dw.c @@ -204,7 +204,7 @@ static int pci_dw_setup_hw(struct pci_dw_softc *sc) { uint32_t reg; - int rv; + int rv, i; pci_dw_dbi_protect(sc, false); @@ -222,21 +222,25 @@ pci_dw_setup_hw(struct pci_dw_softc *sc) PCIM_CMD_BUSMASTEREN | PCIM_CMD_SERRESPEN); pci_dw_dbi_protect(sc, true); - /* Setup outbound memory window */ - rv = pci_dw_map_out_atu(sc, 0, IATU_CTRL1_TYPE_MEM, - sc->mem_range.host, sc->mem_range.pci, sc->mem_range.size); - if (rv != 0) - return (rv); + /* Setup outbound memory windows */ + for (i = 0; i < min(sc->num_mem_ranges, sc->num_viewport - 1); ++i) { + rv = pci_dw_map_out_atu(sc, i + 1, IATU_CTRL1_TYPE_MEM, + sc->mem_ranges[i].host, sc->mem_ranges[i].pci, + sc->mem_ranges[i].size); + if (rv != 0) + return (rv); + } - /* If we have enouht viewports ..*/ - if (sc->num_viewport >= 3 && sc->io_range.size != 0) { + /* If we have enough viewports ..*/ + if (sc->num_mem_ranges + 1 < sc->num_viewport && + sc->io_range.size != 0) { /* Setup outbound I/O window */ - rv = pci_dw_map_out_atu(sc, 2, IATU_CTRL1_TYPE_IO, - sc->io_range.host, sc->io_range.pci, sc->io_range.size); + rv = pci_dw_map_out_atu(sc, sc->num_mem_ranges + 1, + IATU_CTRL1_TYPE_IO, sc->io_range.host, sc->io_range.pci, + sc->io_range.size); if (rv != 0) return (rv); } - /* XXX Should we handle also prefetch memory? */ /* Adjust number of lanes */ reg = DBI_RD4(sc, DW_PORT_LINK_CTRL); @@ -304,57 +308,67 @@ static int pci_dw_decode_ranges(struct pci_dw_softc *sc, struct ofw_pci_range *ranges, int nranges) { - int i; + int i, nmem, rv; + nmem = 0; + for (i = 0; i < nranges; i++) { + if ((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == + OFW_PCI_PHYS_HI_SPACE_MEM32) + ++nmem; + } + + sc->mem_ranges = malloc(nmem * sizeof(*sc->mem_ranges), M_DEVBUF, + M_WAITOK); + sc->num_mem_ranges = nmem; + + nmem = 0; for (i = 0; i < nranges; i++) { if ((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == OFW_PCI_PHYS_HI_SPACE_IO) { if (sc->io_range.size != 0) { device_printf(sc->dev, "Duplicated IO range found in DT\n"); - return (ENXIO); + rv = ENXIO; + goto out; } + sc->io_range = ranges[i]; + if (sc->io_range.size > UINT32_MAX) { + device_printf(sc->dev, + "ATU IO window size is too large. " + "Up to 4GB windows are supported, " + "trimming window size to 4GB\n"); + sc->io_range.size = UINT32_MAX; + } } - if (((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == - OFW_PCI_PHYS_HI_SPACE_MEM32)) { - if (ranges[i].pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) { - if (sc->pref_mem_range.size != 0) { - device_printf(sc->dev, - "Duplicated memory range found " - "in DT\n"); - return (ENXIO); - } - sc->pref_mem_range = ranges[i]; - } else { - if (sc->mem_range.size != 0) { - device_printf(sc->dev, - "Duplicated memory range found " - "in DT\n"); - return (ENXIO); - } - sc->mem_range = ranges[i]; + if ((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == + OFW_PCI_PHYS_HI_SPACE_MEM32) { + MPASS(nmem < sc->num_mem_ranges); + sc->mem_ranges[nmem] = ranges[i]; + if (sc->mem_ranges[nmem].size > UINT32_MAX) { + device_printf(sc->dev, + "ATU MEM window size is too large. " + "Up to 4GB windows are supported, " + "trimming window size to 4GB\n"); + sc->mem_ranges[nmem].size = UINT32_MAX; } + ++nmem; } } - if (sc->mem_range.size == 0) { + + MPASS(nmem == sc->num_mem_ranges); + + if (nmem == 0) { device_printf(sc->dev, - " Not all required ranges are found in DT\n"); + "Missing required memory range in DT\n"); return (ENXIO); } - if (sc->io_range.size > UINT32_MAX) { - device_printf(sc->dev, - "ATU IO window size is too large. Up to 4GB windows " - "are supported, trimming window size to 4GB\n"); - sc->io_range.size = UINT32_MAX; - } - if (sc->mem_range.size > UINT32_MAX) { - device_printf(sc->dev, - "ATU MEM window size is too large. Up to 4GB windows " - "are supported, trimming window size to 4GB\n"); - sc->mem_range.size = UINT32_MAX; - } + return (0); + +out: + free(sc->mem_ranges, M_DEVBUF); + return (rv); } /*----------------------------------------------------------------------------- @@ -386,7 +400,7 @@ pci_dw_read_config(device_t dev, u_int bus, u_int slot, type = IATU_CTRL1_TYPE_CFG0; else type = IATU_CTRL1_TYPE_CFG1; - rv = pci_dw_map_out_atu(sc, 1, type, + rv = pci_dw_map_out_atu(sc, 0, type, sc->cfg_pa, addr, sc->cfg_size); if (rv != 0) return (0xFFFFFFFFU); @@ -433,7 +447,7 @@ pci_dw_write_config(device_t dev, u_int bus, u_int slot, type = IATU_CTRL1_TYPE_CFG0; else type = IATU_CTRL1_TYPE_CFG1; - rv = pci_dw_map_out_atu(sc, 1, type, + rv = pci_dw_map_out_atu(sc, 0, type, sc->cfg_pa, addr, sc->cfg_size); if (rv != 0) return ; diff --git a/sys/dev/pci/pci_dw.h b/sys/dev/pci/pci_dw.h index d6248cf87298..c2c9249449bb 100644 --- a/sys/dev/pci/pci_dw.h +++ b/sys/dev/pci/pci_dw.h @@ -92,9 +92,9 @@ struct pci_dw_softc { struct mtx mtx; struct resource *cfg_res; - struct ofw_pci_range mem_range; - struct ofw_pci_range pref_mem_range; struct ofw_pci_range io_range; + struct ofw_pci_range *mem_ranges; + int num_mem_ranges; bool coherent; bus_dma_tag_t dmat; From owner-dev-commits-src-main@freebsd.org Wed Jul 21 04:51:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CA6365A972; Wed, 21 Jul 2021 04:51: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 4GV38T2SW2z3Hbk; Wed, 21 Jul 2021 04:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38F8817A63; Wed, 21 Jul 2021 04:51: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 16L4prnI065934; Wed, 21 Jul 2021 04:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L4pr5E065933; Wed, 21 Jul 2021 04:51:53 GMT (envelope-from git) Date: Wed, 21 Jul 2021 04:51:53 GMT Message-Id: <202107210451.16L4pr5E065933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: f240dfff229d - main - pci_dw: Support modern "unroll" iATU mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f240dfff229d1f1ff502f59901ef2b9364ca55d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 04:51:53 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f240dfff229d1f1ff502f59901ef2b9364ca55d9 commit f240dfff229d1f1ff502f59901ef2b9364ca55d9 Author: Jessica Clarke AuthorDate: 2021-07-21 04:50:50 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 04:50:50 +0000 pci_dw: Support modern "unroll" iATU mode This supersedes the old legacy mode where a viewport register was used to mux multiple regions behind a single set of registers, and is used on the SiFive FU740. Reviewed by: mmel MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31029 --- sys/dev/pci/pci_dw.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++-- sys/dev/pci/pci_dw.h | 18 ++++++++++ 2 files changed, 114 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/pci_dw.c b/sys/dev/pci/pci_dw.c index 3aa6c4326d67..90f992e83fce 100644 --- a/sys/dev/pci/pci_dw.c +++ b/sys/dev/pci/pci_dw.c @@ -73,6 +73,11 @@ __FBSDID("$FreeBSD$"); #define DBI_RD2(sc, reg) pci_dw_dbi_rd2((sc)->dev, reg) #define DBI_RD4(sc, reg) pci_dw_dbi_rd4((sc)->dev, reg) +#define IATU_UR_WR4(sc, reg, val) \ + bus_write_4((sc)->iatu_ur_res, (sc)->iatu_ur_offset + (reg), (val)) +#define IATU_UR_RD4(sc, reg) \ + bus_read_4((sc)->iatu_ur_res, (sc)->iatu_ur_offset + (reg)) + #define PCI_BUS_SHIFT 20 #define PCI_SLOT_SHIFT 15 #define PCI_FUNC_SHIFT 12 @@ -168,9 +173,52 @@ pci_dw_check_dev(struct pci_dw_softc *sc, u_int bus, u_int slot, u_int func, return (true); } -/* Map one uoutbound ATU region */ +static bool +pci_dw_detect_atu_unroll(struct pci_dw_softc *sc) +{ + return (DBI_RD4(sc, DW_IATU_VIEWPORT) == 0xFFFFFFFFU); +} + static int -pci_dw_map_out_atu(struct pci_dw_softc *sc, int idx, int type, +pci_dw_map_out_atu_unroll(struct pci_dw_softc *sc, int idx, int type, + uint64_t pa, uint64_t pci_addr, uint32_t size) +{ + uint32_t reg; + int i; + + if (size == 0) + return (0); + + IATU_UR_WR4(sc, DW_IATU_UR_REG(idx, LWR_BASE_ADDR), + pa & 0xFFFFFFFF); + IATU_UR_WR4(sc, DW_IATU_UR_REG(idx, UPPER_BASE_ADDR), + (pa >> 32) & 0xFFFFFFFF); + IATU_UR_WR4(sc, DW_IATU_UR_REG(idx, LIMIT_ADDR), + (pa + size - 1) & 0xFFFFFFFF); + IATU_UR_WR4(sc, DW_IATU_UR_REG(idx, LWR_TARGET_ADDR), + pci_addr & 0xFFFFFFFF); + IATU_UR_WR4(sc, DW_IATU_UR_REG(idx, UPPER_TARGET_ADDR), + (pci_addr >> 32) & 0xFFFFFFFF); + IATU_UR_WR4(sc, DW_IATU_UR_REG(idx, CTRL1), + IATU_CTRL1_TYPE(type)); + IATU_UR_WR4(sc, DW_IATU_UR_REG(idx, CTRL2), + IATU_CTRL2_REGION_EN); + + /* Wait until setup becomes valid */ + for (i = 10; i > 0; i--) { + reg = IATU_UR_RD4(sc, DW_IATU_UR_REG(idx, CTRL2)); + if (reg & IATU_CTRL2_REGION_EN) + return (0); + DELAY(5); + } + + device_printf(sc->dev, + "Cannot map outbound region %d in unroll mode iATU\n", idx); + return (ETIMEDOUT); +} + +static int +pci_dw_map_out_atu_legacy(struct pci_dw_softc *sc, int idx, int type, uint64_t pa, uint64_t pci_addr, uint32_t size) { uint32_t reg; @@ -195,11 +243,25 @@ pci_dw_map_out_atu(struct pci_dw_softc *sc, int idx, int type, return (0); DELAY(5); } + device_printf(sc->dev, - "Cannot map outbound region(%d) in iATU\n", idx); + "Cannot map outbound region %d in legacy mode iATU\n", idx); return (ETIMEDOUT); } +/* Map one outbound ATU region */ +static int +pci_dw_map_out_atu(struct pci_dw_softc *sc, int idx, int type, + uint64_t pa, uint64_t pci_addr, uint32_t size) +{ + if (sc->iatu_ur_res) + return (pci_dw_map_out_atu_unroll(sc, idx, type, pa, + pci_addr, size)); + else + return (pci_dw_map_out_atu_legacy(sc, idx, type, pa, + pci_addr, size)); +} + static int pci_dw_setup_hw(struct pci_dw_softc *sc) { @@ -580,6 +642,7 @@ pci_dw_init(device_t dev) { struct pci_dw_softc *sc; int rv, rid; + bool unroll_mode; sc = device_get_softc(dev); sc->dev = dev; @@ -660,6 +723,36 @@ pci_dw_init(device_t dev) if (rv != 0) goto out; + unroll_mode = pci_dw_detect_atu_unroll(sc); + if (bootverbose) + device_printf(dev, "Using iATU %s mode\n", + unroll_mode ? "unroll" : "legacy"); + if (unroll_mode) { + rid = 0; + rv = ofw_bus_find_string_index(sc->node, "reg-names", "atu", &rid); + if (rv == 0) { + sc->iatu_ur_res = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->iatu_ur_res == NULL) { + device_printf(dev, + "Cannot allocate iATU space (rid: %d)\n", + rid); + rv = ENXIO; + goto out; + } + sc->iatu_ur_offset = 0; + sc->iatu_ur_size = rman_get_size(sc->iatu_ur_res); + } else if (rv == ENOENT) { + sc->iatu_ur_res = sc->dbi_res; + sc->iatu_ur_offset = DW_DEFAULT_IATU_UR_DBI_OFFSET; + sc->iatu_ur_size = DW_DEFAULT_IATU_UR_DBI_SIZE; + } else { + device_printf(dev, "Cannot get iATU space memory\n"); + rv = ENXIO; + goto out; + } + } + rv = pci_dw_setup_hw(sc); if (rv != 0) goto out; diff --git a/sys/dev/pci/pci_dw.h b/sys/dev/pci/pci_dw.h index c2c9249449bb..51c4169f74d2 100644 --- a/sys/dev/pci/pci_dw.h +++ b/sys/dev/pci/pci_dw.h @@ -63,6 +63,7 @@ #define DW_MISC_CONTROL_1 0x8BC #define DBI_RO_WR_EN (1 << 0) +/* Legacy (pre-4.80) iATU mode */ #define DW_IATU_VIEWPORT 0x900 #define IATU_REGION_INBOUND (1U << 31) #define IATU_REGION_INDEX(x) ((x) & 0x7) @@ -80,6 +81,20 @@ #define DW_IATU_LWR_TARGET_ADDR 0x918 #define DW_IATU_UPPER_TARGET_ADDR 0x91C +/* Modern (4.80+) "unroll" iATU mode */ +#define DW_IATU_UR_STEP 0x200 +#define DW_IATU_UR_REG(r, n) (r) * DW_IATU_UR_STEP + IATU_UR_##n +#define IATU_UR_CTRL1 0x00 +#define IATU_UR_CTRL2 0x04 +#define IATU_UR_LWR_BASE_ADDR 0x08 +#define IATU_UR_UPPER_BASE_ADDR 0x0C +#define IATU_UR_LIMIT_ADDR 0x10 +#define IATU_UR_LWR_TARGET_ADDR 0x14 +#define IATU_UR_UPPER_TARGET_ADDR 0x18 + +#define DW_DEFAULT_IATU_UR_DBI_OFFSET 0x300000 +#define DW_DEFAULT_IATU_UR_DBI_SIZE 0x1000 + struct pci_dw_softc { struct ofw_pci_softc ofw_pci; /* Must be first */ @@ -101,6 +116,9 @@ struct pci_dw_softc { int num_lanes; int num_viewport; + struct resource *iatu_ur_res; /* NB: May be dbi_res */ + bus_addr_t iatu_ur_offset; + bus_size_t iatu_ur_size; bus_addr_t cfg_pa; /* PA of config memoty */ bus_size_t cfg_size; /* size of config region */ From owner-dev-commits-src-main@freebsd.org Wed Jul 21 04:51:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59DED65A8C8; Wed, 21 Jul 2021 04:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GV38V4WlJz3HVc; Wed, 21 Jul 2021 04:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B01A18118; Wed, 21 Jul 2021 04:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L4psq6065958; Wed, 21 Jul 2021 04:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L4psri065957; Wed, 21 Jul 2021 04:51:54 GMT (envelope-from git) Date: Wed, 21 Jul 2021 04:51:54 GMT Message-Id: <202107210451.16L4psri065957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 4707bb0430e6 - main - pci_dw: Detect number of outbound regions automatically MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4707bb0430e6ca3935ef8196e30830b3cdaf3514 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 04:51:55 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4707bb0430e6ca3935ef8196e30830b3cdaf3514 commit 4707bb0430e6ca3935ef8196e30830b3cdaf3514 Author: Jessica Clarke AuthorDate: 2021-07-21 04:51:20 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 04:51:20 +0000 pci_dw: Detect number of outbound regions automatically Currently we use the num-viewports property to decide how many outbound regions there are we can use, defaulting to 2. However, Linux has stopped using that and so it no longer appears in new device trees, such as for the SiFive FU740. Instead, it's possible to just probe the hardware directly. Reviewed by: mmel MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31030 --- sys/dev/pci/pci_dw.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++------ sys/dev/pci/pci_dw.h | 2 +- 2 files changed, 78 insertions(+), 10 deletions(-) diff --git a/sys/dev/pci/pci_dw.c b/sys/dev/pci/pci_dw.c index 90f992e83fce..9eb7b04dfd28 100644 --- a/sys/dev/pci/pci_dw.c +++ b/sys/dev/pci/pci_dw.c @@ -179,6 +179,71 @@ pci_dw_detect_atu_unroll(struct pci_dw_softc *sc) return (DBI_RD4(sc, DW_IATU_VIEWPORT) == 0xFFFFFFFFU); } +static int +pci_dw_detect_out_atu_regions_unroll(struct pci_dw_softc *sc) +{ + int num_regions, i; + uint32_t reg; + + num_regions = sc->iatu_ur_size / DW_IATU_UR_STEP; + + for (i = 0; i < num_regions; ++i) { + IATU_UR_WR4(sc, DW_IATU_UR_REG(i, LWR_TARGET_ADDR), + 0x12340000); + reg = IATU_UR_RD4(sc, DW_IATU_UR_REG(i, LWR_TARGET_ADDR)); + if (reg != 0x12340000) + break; + } + + sc->num_out_regions = i; + + return (0); +} + +static int +pci_dw_detect_out_atu_regions_legacy(struct pci_dw_softc *sc) +{ + int num_viewports, i; + uint32_t reg; + + /* Find out how many viewports there are in total */ + DBI_WR4(sc, DW_IATU_VIEWPORT, IATU_REGION_INDEX(~0U)); + reg = DBI_RD4(sc, DW_IATU_VIEWPORT); + if (reg > IATU_REGION_INDEX(~0U)) { + device_printf(sc->dev, + "Cannot detect number of output iATU regions; read %#x\n", + reg); + return (ENXIO); + } + + num_viewports = reg + 1; + + /* + * Find out how many of them are outbound by seeing whether a dummy + * page-aligned address sticks. + */ + for (i = 0; i < num_viewports; ++i) { + DBI_WR4(sc, DW_IATU_VIEWPORT, IATU_REGION_INDEX(i)); + DBI_WR4(sc, DW_IATU_LWR_TARGET_ADDR, 0x12340000); + reg = DBI_RD4(sc, DW_IATU_LWR_TARGET_ADDR); + if (reg != 0x12340000) + break; + } + + sc->num_out_regions = i; + + return (0); +} + +static int +pci_dw_detect_out_atu_regions(struct pci_dw_softc *sc) +{ + if (sc->iatu_ur_res) + return (pci_dw_detect_out_atu_regions_unroll(sc)); + else + return (pci_dw_detect_out_atu_regions_legacy(sc)); +} + static int pci_dw_map_out_atu_unroll(struct pci_dw_softc *sc, int idx, int type, uint64_t pa, uint64_t pci_addr, uint32_t size) @@ -285,7 +350,7 @@ pci_dw_setup_hw(struct pci_dw_softc *sc) pci_dw_dbi_protect(sc, true); /* Setup outbound memory windows */ - for (i = 0; i < min(sc->num_mem_ranges, sc->num_viewport - 1); ++i) { + for (i = 0; i < min(sc->num_mem_ranges, sc->num_out_regions - 1); ++i) { rv = pci_dw_map_out_atu(sc, i + 1, IATU_CTRL1_TYPE_MEM, sc->mem_ranges[i].host, sc->mem_ranges[i].pci, sc->mem_ranges[i].size); @@ -293,8 +358,8 @@ pci_dw_setup_hw(struct pci_dw_softc *sc) return (rv); } - /* If we have enough viewports ..*/ - if (sc->num_mem_ranges + 1 < sc->num_viewport && + /* If we have enough regions ... */ + if (sc->num_mem_ranges + 1 < sc->num_out_regions && sc->io_range.size != 0) { /* Setup outbound I/O window */ rv = pci_dw_map_out_atu(sc, sc->num_mem_ranges + 1, @@ -660,13 +725,8 @@ pci_dw_init(device_t dev) if (!sc->coherent) sc->coherent = OF_hasprop(sc->node, "dma-coherent"); - rv = OF_getencprop(sc->node, "num-viewport", &sc->num_viewport, - sizeof(sc->num_viewport)); - if (rv != sizeof(sc->num_viewport)) - sc->num_viewport = 2; - rv = OF_getencprop(sc->node, "num-lanes", &sc->num_lanes, - sizeof(sc->num_viewport)); + sizeof(sc->num_lanes)); if (rv != sizeof(sc->num_lanes)) sc->num_lanes = 1; if (sc->num_lanes != 1 && sc->num_lanes != 2 && @@ -753,6 +813,14 @@ pci_dw_init(device_t dev) } } + rv = pci_dw_detect_out_atu_regions(sc); + if (rv != 0) + goto out; + + if (bootverbose) + device_printf(sc->dev, "Detected outbound iATU regions: %d\n", + sc->num_out_regions); + rv = pci_dw_setup_hw(sc); if (rv != 0) goto out; diff --git a/sys/dev/pci/pci_dw.h b/sys/dev/pci/pci_dw.h index 51c4169f74d2..6f2248344f44 100644 --- a/sys/dev/pci/pci_dw.h +++ b/sys/dev/pci/pci_dw.h @@ -115,7 +115,7 @@ struct pci_dw_softc { bus_dma_tag_t dmat; int num_lanes; - int num_viewport; + int num_out_regions; struct resource *iatu_ur_res; /* NB: May be dbi_res */ bus_addr_t iatu_ur_offset; bus_size_t iatu_ur_size; From owner-dev-commits-src-main@freebsd.org Wed Jul 21 05:46:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61B8165AA66; Wed, 21 Jul 2021 05:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GV4MN2Clrz3hpD; Wed, 21 Jul 2021 05:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3460318E00; Wed, 21 Jul 2021 05:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L5kOWo035025; Wed, 21 Jul 2021 05:46:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L5kO8g035024; Wed, 21 Jul 2021 05:46:24 GMT (envelope-from git) Date: Wed, 21 Jul 2021 05:46:24 GMT Message-Id: <202107210546.16L5kO8g035024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 8c439847f0d3 - main - riscv: Include spibus and spigen in GENERIC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c439847f0d33fdb79f2bbdced4c300a620d74f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 05:46:24 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8c439847f0d33fdb79f2bbdced4c300a620d74f5 commit 8c439847f0d33fdb79f2bbdced4c300a620d74f5 Author: Jessica Clarke AuthorDate: 2021-07-21 05:46:09 +0000 Commit: Jessica Clarke CommitDate: 2021-07-21 05:46:09 +0000 riscv: Include spibus and spigen in GENERIC We already attempt to enable the SiFive SPI controller, but since spibus isn't enabled it isn't actually built. Reviewed by: kp, philip MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31027 --- sys/riscv/conf/GENERIC | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 4c31e5dcf31d..c6cd8e0fdedb 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -122,6 +122,10 @@ device xae # Xilinx AXI Ethernet MAC device xdma # DMA interface device axidma # Xilinx AXI DMA Controller +# SPI +device spibus +device spigen + # Uncomment for memory disk # options MD_ROOT # options MD_ROOT_SIZE=32768 # 32MB ram disk From owner-dev-commits-src-main@freebsd.org Wed Jul 21 09:12:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74C01660326; Wed, 21 Jul 2021 09:12: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 4GV8wf2m9Hz4mY2; Wed, 21 Jul 2021 09:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46F0B1B838; Wed, 21 Jul 2021 09:12: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 16L9C2Qt014835; Wed, 21 Jul 2021 09:12:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L9C2Ab014834; Wed, 21 Jul 2021 09:12:02 GMT (envelope-from git) Date: Wed, 21 Jul 2021 09:12:02 GMT Message-Id: <202107210912.16L9C2Ab014834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 0f8dafb45859 - main - Implement the SOUND_MIXER_WRITE_MUTE and SOUND_MIXER_READ_MUTE ioctl(9)s. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f8dafb45859569aa36b63ca2bb4a1c35c970d1e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 09:12:02 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=0f8dafb45859569aa36b63ca2bb4a1c35c970d1e commit 0f8dafb45859569aa36b63ca2bb4a1c35c970d1e Author: Hans Petter Selasky AuthorDate: 2021-07-20 17:02:41 +0000 Commit: Hans Petter Selasky CommitDate: 2021-07-21 09:10:30 +0000 Implement the SOUND_MIXER_WRITE_MUTE and SOUND_MIXER_READ_MUTE ioctl(9)s. These two ioctls are not part of the current version of OSS and were considered obsolete. However, their behaviour is not the same as their old one, so this implementation is specific to FreeBSD. Older OSS versions had the MUTE ioctls take and return an integer with a value of 0 or 1, which meant that the _whole_ mixer is unmuted or muted respectively. In my implementation, the ioctl takes and returns a bitmask that tells us which devices are muted. This allows us to mute and unmute only the devices we want, instead of the whole mixer. The bitmask works the same way as in DEVMASK, RECMASK and RECSRC. Integrated the hardware volume feature with the new mute system. Submitted by: Christos Margiolis Differential Revision: https://reviews.freebsd.org/D31130 MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/sound/pcm/mixer.c | 122 +++++++++++++++++++++++++++++++--------------- sys/dev/sound/pcm/mixer.h | 2 + 2 files changed, 84 insertions(+), 40 deletions(-) diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 09b0bb8ab148..89e78b036e94 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -51,16 +51,16 @@ struct snd_mixer { KOBJ_FIELDS; void *devinfo; int busy; - int hwvol_muted; int hwvol_mixer; int hwvol_step; int type; device_t dev; - u_int32_t hwvol_mute_level; u_int32_t devs; + u_int32_t mutedevs; u_int32_t recdevs; u_int32_t recsrc; u_int16_t level[32]; + u_int16_t level_muted[32]; u_int8_t parent[32]; u_int32_t child[32]; u_int8_t realdev[32]; @@ -244,7 +244,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *d, } static int -mixer_set(struct snd_mixer *m, u_int dev, u_int lev) +mixer_set(struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev) { struct snddev_info *d; u_int l, r, tl, tr; @@ -254,7 +254,7 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) if (m == NULL || dev >= SOUND_MIXER_NRDEVICES || (0 == (m->devs & (1 << dev)))) - return -1; + return (-1); l = min((lev & 0x00ff), 100); r = min(((lev & 0xff00) >> 8), 100); @@ -262,7 +262,7 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) d = device_get_softc(m->dev); if (d == NULL) - return -1; + return (-1); /* It is safe to drop this mutex due to Giant. */ if (!(d->flags & SD_F_MPSAFE) && mtx_owned(m->lock) != 0) @@ -270,6 +270,11 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) else dropmtx = 0; + /* Allow the volume to be "changed" while muted. */ + if (muted & (1 << dev)) { + m->level_muted[dev] = l | (r << 8); + return (0); + } MIXER_SET_UNLOCK(m, dropmtx); /* TODO: recursive handling */ @@ -287,7 +292,7 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) else if (realdev != SOUND_MIXER_NONE && MIXER_SET(m, realdev, tl, tr) < 0) { MIXER_SET_LOCK(m, dropmtx); - return -1; + return (-1); } } else if (child != 0) { for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { @@ -305,8 +310,8 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) realdev = m->realdev[dev]; if (realdev != SOUND_MIXER_NONE && MIXER_SET(m, realdev, l, r) < 0) { - MIXER_SET_LOCK(m, dropmtx); - return -1; + MIXER_SET_LOCK(m, dropmtx); + return (-1); } } else { if (dev == SOUND_MIXER_PCM && (d->flags & SD_F_SOFTPCMVOL)) @@ -317,7 +322,7 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) else if (realdev != SOUND_MIXER_NONE && MIXER_SET(m, realdev, l, r) < 0) { MIXER_SET_LOCK(m, dropmtx); - return -1; + return (-1); } } @@ -326,16 +331,42 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int lev) m->level[dev] = l | (r << 8); m->modify_counter++; - return 0; + return (0); } static int mixer_get(struct snd_mixer *mixer, int dev) { - if ((dev < SOUND_MIXER_NRDEVICES) && (mixer->devs & (1 << dev))) - return mixer->level[dev]; - else - return -1; + if ((dev < SOUND_MIXER_NRDEVICES) && (mixer->devs & (1 << dev))) { + if (mixer->mutedevs & (1 << dev)) + return (mixer->level_muted[dev]); + else + return (mixer->level[dev]); + } else { + return (-1); + } +} + +void +mix_setmutedevs(struct snd_mixer *mixer, u_int32_t mutedevs) +{ + u_int32_t delta; + + /* Filter out invalid values. */ + mutedevs &= mixer->devs; + delta = (mixer->mutedevs ^ mutedevs) & mixer->devs; + mixer->mutedevs = mutedevs; + + for (int i = 0; i < SOUND_MIXER_NRDEVICES; i++) { + if (!(delta & (1 << i))) + continue; + if (mutedevs & (1 << i)) { + mixer->level_muted[i] = mixer->level[i]; + mixer_set(mixer, i, 0, 0); + } else { + mixer_set(mixer, i, 0, mixer->level_muted[i]); + } + } } static int @@ -598,6 +629,12 @@ mix_getdevs(struct snd_mixer *m) return m->devs; } +u_int32_t +mix_getmutedevs(struct snd_mixer *m) +{ + return m->mutedevs; +} + u_int32_t mix_getrecdevs(struct snd_mixer *m) { @@ -721,7 +758,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) } } - mixer_set(m, i, v | (v << 8)); + mixer_set(m, i, 0, v | (v << 8)); } mixer_setrecsrc(m, 0); /* Set default input. */ @@ -799,7 +836,7 @@ mixer_uninit(device_t dev) snd_mtxlock(m->lock); for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - mixer_set(m, i, 0); + mixer_set(m, i, 0, 0); mixer_setrecsrc(m, SOUND_MASK_MIC); @@ -836,8 +873,12 @@ mixer_reinit(device_t dev) return i; } - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - mixer_set(m, i, m->level[i]); + for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { + if (m->mutedevs & (1 << i)) + mixer_set(m, i, 0, 0); + else + mixer_set(m, i, 0, m->level[i]); + } mixer_setrecsrc(m, m->recsrc); snd_mtxunlock(m->lock); @@ -863,10 +904,8 @@ sysctl_hw_snd_hwvol_mixer(SYSCTL_HANDLER_ARGS) if (dev == -1) { snd_mtxunlock(m->lock); return EINVAL; - } - else if (dev != m->hwvol_mixer) { + } else { m->hwvol_mixer = dev; - m->hwvol_muted = 0; } } snd_mtxunlock(m->lock); @@ -897,14 +936,7 @@ mixer_hwvol_init(device_t dev) void mixer_hwvol_mute_locked(struct snd_mixer *m) { - if (m->hwvol_muted) { - m->hwvol_muted = 0; - mixer_set(m, m->hwvol_mixer, m->hwvol_mute_level); - } else { - m->hwvol_muted++; - m->hwvol_mute_level = mixer_get(m, m->hwvol_mixer); - mixer_set(m, m->hwvol_mixer, 0); - } + mix_setmutedevs(m, m->mutedevs ^ (1 << m->hwvol_mixer)); } void @@ -925,11 +957,8 @@ mixer_hwvol_step_locked(struct snd_mixer *m, int left_step, int right_step) { int level, left, right; - if (m->hwvol_muted) { - m->hwvol_muted = 0; - level = m->hwvol_mute_level; - } else - level = mixer_get(m, m->hwvol_mixer); + level = mixer_get(m, m->hwvol_mixer); + if (level != -1) { left = level & 0xff; right = (level >> 8) & 0xff; @@ -943,7 +972,8 @@ mixer_hwvol_step_locked(struct snd_mixer *m, int left_step, int right_step) right = 0; else if (right > 100) right = 100; - mixer_set(m, m->hwvol_mixer, left | right << 8); + + mixer_set(m, m->hwvol_mixer, m->mutedevs, left | right << 8); } } @@ -976,7 +1006,7 @@ mix_set(struct snd_mixer *m, u_int dev, u_int left, u_int right) KASSERT(m != NULL, ("NULL snd_mixer")); snd_mtxlock(m->lock); - ret = mixer_set(m, dev, left | (right << 8)); + ret = mixer_set(m, dev, m->mutedevs, left | (right << 8)); snd_mtxunlock(m->lock); return ((ret != 0) ? ENXIO : 0); @@ -1304,10 +1334,18 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, goto done; } if ((cmd & ~0xff) == MIXER_WRITE(0)) { - if (j == SOUND_MIXER_RECSRC) + switch (j) { + case SOUND_MIXER_RECSRC: ret = mixer_setrecsrc(m, *arg_i); - else - ret = mixer_set(m, j, *arg_i); + break; + case SOUND_MIXER_MUTE: + mix_setmutedevs(m, *arg_i); + ret = 0; + break; + default: + ret = mixer_set(m, j, m->mutedevs, *arg_i); + break; + } snd_mtxunlock(m->lock); return ((ret == 0) ? 0 : ENXIO); } @@ -1318,6 +1356,9 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, case SOUND_MIXER_STEREODEVS: v = mix_getdevs(m); break; + case SOUND_MIXER_MUTE: + v = mix_getmutedevs(m); + break; case SOUND_MIXER_RECMASK: v = mix_getrecdevs(m); break; @@ -1326,6 +1367,7 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, break; default: v = mixer_get(m, j); + break; } *arg_i = v; snd_mtxunlock(m->lock); @@ -1554,5 +1596,5 @@ mix_set_locked(struct snd_mixer *m, u_int dev, int left, int right) level = (left & 0xFF) | ((right & 0xFF) << 8); - return (mixer_set(m, dev, level)); + return (mixer_set(m, dev, m->mutedevs, level)); } diff --git a/sys/dev/sound/pcm/mixer.h b/sys/dev/sound/pcm/mixer.h index 8e11d553a3e4..7857609b2895 100644 --- a/sys/dev/sound/pcm/mixer.h +++ b/sys/dev/sound/pcm/mixer.h @@ -60,8 +60,10 @@ device_t mix_get_dev(struct snd_mixer *m); void mix_setdevs(struct snd_mixer *m, u_int32_t v); void mix_setrecdevs(struct snd_mixer *m, u_int32_t v); +void mix_setmutedevs(struct snd_mixer *m, u_int32_t v); u_int32_t mix_getdevs(struct snd_mixer *m); u_int32_t mix_getrecdevs(struct snd_mixer *m); +u_int32_t mix_getmutedevs(struct snd_mixer *m); void mix_setparentchild(struct snd_mixer *m, u_int32_t parent, u_int32_t childs); void mix_setrealdev(struct snd_mixer *m, u_int32_t dev, u_int32_t realdev); u_int32_t mix_getparent(struct snd_mixer *m, u_int32_t dev); From owner-dev-commits-src-main@freebsd.org Wed Jul 21 09:12:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9AC6660271; Wed, 21 Jul 2021 09:12: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 4GV8wg3Fcyz4mvP; Wed, 21 Jul 2021 09:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 587511B88D; Wed, 21 Jul 2021 09:12: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 16L9C3nD014859; Wed, 21 Jul 2021 09:12:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L9C3xA014858; Wed, 21 Jul 2021 09:12:03 GMT (envelope-from git) Date: Wed, 21 Jul 2021 09:12:03 GMT Message-Id: <202107210912.16L9C3xA014858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 575945f10b9e - main - Update the mlx5en(4) manual page. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 575945f10b9e11be0f217117c86dd480de6c5f30 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 09:12:04 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=575945f10b9e11be0f217117c86dd480de6c5f30 commit 575945f10b9e11be0f217117c86dd480de6c5f30 Author: Hans Petter Selasky AuthorDate: 2021-07-20 16:00:13 +0000 Commit: Hans Petter Selasky CommitDate: 2021-07-21 09:10:31 +0000 Update the mlx5en(4) manual page. Differential Revision: https://reviews.freebsd.org/D31228 Reviewed by: kib@ MFC after: 1 week Sponsored by: NVIDIA Networking --- share/man/man4/mlx5en.4 | 98 ++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/share/man/man4/mlx5en.4 b/share/man/man4/mlx5en.4 index f05b74adb0b3..31dcdb4657d4 100644 --- a/share/man/man4/mlx5en.4 +++ b/share/man/man4/mlx5en.4 @@ -1,4 +1,5 @@ .\" Copyright (c) 2015 Mellanox Technologies +.\" Copyright (c) 2021 NVIDIA corporation & affiliates .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2019 +.Dd July 20, 2021 .Dt MLX5EN 4 .Os .Sh NAME .Nm mlx5en -.Nd "Mellanox ConnectX-4, ConnectX-4 LX and ConnectX-5 based 100Gb, 50Gb, 40Gb, 25Gb and 10Gb Ethernet adapter driver" +.Nd "NVIDIA Mellanox ConnectX-4/5/6 [Dx/Ex/Lx] based 200Gb, 100Gb, 50Gb, 40Gb, 25Gb and 10Gb ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -37,6 +38,7 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "options COMPAT_LINUXKPI" .Cd "options RATELIMIT" +.Cd "options KERN_TLS" .Cd "device xz" .Cd "device mlxfw" .Cd "device firmware" @@ -60,67 +62,63 @@ mlx5en_load="YES" The .Nm driver provides support for PCI Express Ethernet adapters based on -ConnectX-4, ConnectX-4 LX and ConnectX-5. -The driver supports Jumbo Frames, Transmit/Receive checksum offload, +ConnectX-4/5/6 [Dx, Ex and Lx variants]. +The driver supports Jumbo Frames, Transmit and Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), -HW Large Receive Offload (HW LRO), VLAN tag insertion/extraction, -VLAN checksum offload, VLAN TSO, hardware rate limiting (TXRTLMT) -and Receive Side Steering (RSS). -.br -The network interface is named mce. -.br -For further hardware information and questions related to hardware -requirements, see -.Pa http://www.mellanox.com/ . +HW Large Receive Offload (HW LRO), VLAN tag insertion and extraction, +VLAN checksum offload, VLAN TSO, hardware rate limiting (TXRTLMT), +stateless VxLAN hardware offload for receive and transmit, +HW TLS offload for transmit, Receive Side Steering (RSS) and +.Xr NUMA 4 +awareness. +.Pp +The network interface name is +.Dv mce +which corresponds to a PCI function, +.Dv mlx_core , +where +.Dv +is a number starting at zero. +There is at most one network interface per PCI function. .Pp -For more information on configuring this device, see -.Xr ifconfig 8 . +For further information and questions related to hardware +requirements, see +.Pa https://www.mellanox.com . .Sh HARDWARE The .Nm -driver supports 100Gb, 50Gb, 40Gb, 25Gb and 10Gb Ethernet adapters. -ConnectX-5 supports:10/20/25/40/50/56/100Gb/s speeds. -ConnectX-4 supports:10/20/25/40/50/56/100Gb/s speeds. -ConnectX-4 LX supports:10/25/40/50Gb/s speeds (and reduced power consumption) : -.Pp +driver supports 200Gb, 100Gb, 50Gb, 40Gb, 25Gb and 10Gb ethernet adapters. .Bl -bullet -compact +.Pp .It -Mellanox MCX455A-ECAT -.It -Mellanox MCX456A-ECAT -.It -Mellanox MCX415A-CCAT -.It -Mellanox MCX416A-CCAT -.It -Mellanox MCX455A-FCAT -.It -Mellanox MCX456A-FCAT -.It -Mellanox MCX415A-BCAT -.It -Mellanox MCX416A-BCAT -.It -Mellanox MCX4131A-GCAT -.It -Mellanox MCX4131A-BCAT -.It -Mellanox MCX4121A-ACAT +ConnectX-6 supports 10/20/25/40/50/56/100Gb/200Gb/s speeds. .It -Mellanox MCX4111A-ACAT +ConnectX-5 supports 10/20/25/40/50/56/100Gb/s speeds. .It -Mellanox MCX4121A-XCAT +ConnectX-4 supports 10/20/25/40/50/56/100Gb/s speeds. .It -Mellanox MCX4111A-XCAT +ConnectX-4 LX supports 10/25/40/50Gb/s speeds and reduced power consumption. .El +.Sh CONFIGURATION +The +.Nm +network interface is configured using +.Xr ifconfig 8 +and the +.Xr sysctl 8 +tree at +.Dv dev.mce. . +All configurable entries are also tunables, and can be put directly into the +.Xr loader.conf 5 +for persistent configuration. .Sh SUPPORT For general information and support, -go to the Mellanox support website at: -.Pa http://www.mellanox.com/ . +go to the NVIDIA Mellanox networking support website at: +.Pa https://www.mellanox.com . .Pp -If an issue is identified with this driver with a supported adapter, -email all the specific information related to the issue to -.Aq Mt freebsd-drivers@mellanox.com . +If an issue is identified with this driver using a supported adapter, +e-mail all the specific information related to the issue to +.Aq Mt nbu-freebsd-drivers@nvidia.com . .Sh SEE ALSO .Xr ifconfig 8 .Sh HISTORY @@ -133,4 +131,4 @@ device driver first appeared in The .Nm driver was written by -.An Mellanox Technologies . +.An NVIDIA Mellanox networking . From owner-dev-commits-src-main@freebsd.org Wed Jul 21 09:17:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57DDA6603CB; Wed, 21 Jul 2021 09:17: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 4GV92d1ZxJz4nHw; Wed, 21 Jul 2021 09:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ABB51B84E; Wed, 21 Jul 2021 09:17: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 16L9HD4M016426; Wed, 21 Jul 2021 09:17:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L9HDsY016425; Wed, 21 Jul 2021 09:17:13 GMT (envelope-from git) Date: Wed, 21 Jul 2021 09:17:13 GMT Message-Id: <202107210917.16L9HDsY016425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 0634390572b2 - main - chroot: fix typo in usage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0634390572b2390cfa8e2a3fd83359a944461f34 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 09:17:13 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=0634390572b2390cfa8e2a3fd83359a944461f34 commit 0634390572b2390cfa8e2a3fd83359a944461f34 Author: Edward Tomasz Napierala AuthorDate: 2021-07-21 09:16:11 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-07-21 09:16:11 +0000 chroot: fix typo in usage While here also fix typo in a variable name. Reported By: oshogbo --- usr.sbin/chroot/chroot.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/chroot/chroot.c b/usr.sbin/chroot/chroot.c index bb87ae6f0503..b14e1cbf4597 100644 --- a/usr.sbin/chroot/chroot.c +++ b/usr.sbin/chroot/chroot.c @@ -71,12 +71,12 @@ main(int argc, char *argv[]) uid_t uid; int arg, ch, error, gids; long ngroups_max; - bool nonpriviledged; + bool nonprivileged; gid = 0; uid = 0; user = group = grouplist = NULL; - nonpriviledged = false; + nonprivileged = false; while ((ch = getopt(argc, argv, "G:g:u:n")) != -1) { switch(ch) { case 'u': @@ -95,7 +95,7 @@ main(int argc, char *argv[]) usage(); break; case 'n': - nonpriviledged = true; + nonprivileged = true; break; case '?': default: @@ -160,7 +160,7 @@ main(int argc, char *argv[]) } } - if (nonpriviledged) { + if (nonprivileged) { arg = PROC_NO_NEW_PRIVS_ENABLE; error = procctl(P_PID, getpid(), PROC_NO_NEW_PRIVS_CTL, &arg); if (error != 0) @@ -193,6 +193,6 @@ static void usage(void) { (void)fprintf(stderr, "usage: chroot [-g group] [-G group,group,...] " - "[-u user] [-n ] newroot [command]\n"); + "[-u user] [-n] newroot [command]\n"); exit(1); } From owner-dev-commits-src-main@freebsd.org Wed Jul 21 09:32:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7132660998; Wed, 21 Jul 2021 09:32:49 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GV9Nd0Fhlz4qfQ; Wed, 21 Jul 2021 09:32:48 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-qt1-f169.google.com with SMTP id v14so1462765qtc.8; Wed, 21 Jul 2021 02:32:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=f8XSQ6o5ZCCB5CiKyfdwlJUR3MvsBFFUwt26x0ya9iM=; b=h1AmOHrLlW84uM8DUK7RX4Kv7fZhOWY/slpuWhVZpb07KfaxT4WRMIgdz6hrAAJifV XiUKgBmvSamvcr0l/0idmmBz8XLw47jKwm3IaP3aFsbPp0URz6q6aelrWj1IcRPeMa8m HoPkLOlZOysZwMqBUYiql/bu4yGssW0zFI7aI6uFEgOvgQ5uEvuMzlFmClLejLuRuR13 kIiGSHBNChnH3CzqpRzLkXCzm1h4NQAOOimW8dZtFAYLZ0Tg+tqZL3U/gxa8dJR9Mc1N KUM0G/T1V36qpkvlgqscQP30u2s5jpiLMujK8tYn71am/9QTkKr2RsbVqD2Fr6JGFeqj a8/A== X-Gm-Message-State: AOAM530IKjSpdQ6QJeLgp6vl0/nToESax3XCLiYSj93AlGmEQEkMvKuy +uxYISmJKys6bqh+Fp7R99THgXRqDLSVHA== X-Google-Smtp-Source: ABdhPJwvVhZRNd0CZov/uM/3gIFs3PI+kP0l6LtzVuasMEEEWQpX8kF6dxrTEPqgtALXut1wnp4mcQ== X-Received: by 2002:ac8:1347:: with SMTP id f7mr29875492qtj.70.1626859968173; Wed, 21 Jul 2021 02:32:48 -0700 (PDT) Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com. [209.85.219.170]) by smtp.gmail.com with ESMTPSA id x21sm11307107qkn.0.2021.07.21.02.32.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Jul 2021 02:32:47 -0700 (PDT) Received: by mail-yb1-f170.google.com with SMTP id g5so2385864ybu.10; Wed, 21 Jul 2021 02:32:47 -0700 (PDT) X-Received: by 2002:a25:73d1:: with SMTP id o200mr45304348ybc.377.1626859967574; Wed, 21 Jul 2021 02:32:47 -0700 (PDT) MIME-Version: 1.0 References: <202107072012.167KC1IL065912@gitrepo.freebsd.org> In-Reply-To: From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Wed, 21 Jul 2021 11:28:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: f6043a672135 - main - ObsoleteFiles.inc: Remove manpages from OLD_FILES To: Wolfram Schneider Cc: Mark Millard , 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" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4GV9Nd0Fhlz4qfQ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of fernandoapesteguia@gmail.com designates 209.85.160.169 as permitted sender) smtp.mailfrom=fernandoapesteguia@gmail.com X-Spamd-Result: default: False [-1.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RWL_MAILSPIKE_GOOD(0.00)[209.85.160.169:from]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; FORGED_SENDER(0.30)[fernape@freebsd.org,fernandoapesteguia@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[fernape@freebsd.org,fernandoapesteguia@gmail.com]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.160.169:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.160.169:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.160.169:from]; FREEMAIL_CC(0.00)[yahoo.com,freebsd.org]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 09:32:49 -0000 On Tue, Jul 20, 2021 at 4:09 PM Fernando Apestegu=C3=ADa wrote: > > On Mon, Jul 19, 2021 at 3:37 PM Wolfram Schneider wro= te: > > > > How about apm.8.gz and apmconf.8.gz? > > > > $ git grep -E '(apm|apmconf|nvram|apmd|sconfig)\.8' | grep OLD_FILES > > ObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/apm.8.gz > > ObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man8/apmconf.8.gz > > tools/build/mk/OptionalObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man= 8/amd64/apm.8.gz > > tools/build/mk/OptionalObsoleteFiles.inc:OLD_FILES+=3Dusr/share/man/man= 8/amd64/apmconf.8.gz > > > > Is it needed? > Those files were not affected by the original commit and are, at this > point, installed only for amd64, arm64 and i386. > apmd.8.gz and sconfig.8.gz were affected though in 0a0f7486413c and > they needed to be removed from OLD_FILES. Forget what I said. Yes, those files were affected by 0a0f7486413 and should be deleted from OLD_FILES too. https://reviews.freebsd.org/D31256 Thanks! > > Cheers. > > > -Wolfram > > > > > > On Wed, 7 Jul 2021 at 22:12, Fernando Apestegu=C3=ADa wrote: > > > > > > The branch main has been updated by fernape (doc, ports committer): > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Df6043a672135da8ec090d8= 878cc844b8aace54f9 > > > > > > commit f6043a672135da8ec090d8878cc844b8aace54f9 > > > Author: Fernando Apestegu=C3=ADa > > > AuthorDate: 2021-07-07 13:15:02 +0000 > > > Commit: Fernando Apestegu=C3=ADa > > > CommitDate: 2021-07-07 18:09:02 +0000 > > > > > > ObsoleteFiles.inc: Remove manpages from OLD_FILES > > > > > > In 0a0f7486413c147d56808b38055c40c64cff61f5 sconfig.8.gz and apmd= .8.gz > > > were moved back to the parent directory share/man/man8. > > > > > > This conflicts with a previous entry in OLD_FILES so running 'mak= e > > > delete-old' would delete the new installed files. > > > > > > Reported by: marklmi@yahoo.com > > > Approved by: emaste@ > > > Fixes: 0a0f7486413c - Build manpages for all architectures > > > MFH: 4 weeks > > > Differential Revision: https://reviews.freebsd.org/D31092 > > > --- > > > ObsoleteFiles.inc | 2 -- > > > 1 file changed, 2 deletions(-) > > > > > > diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc > > > index 60707faebefc..d72aea5e8efc 100644 > > > --- a/ObsoleteFiles.inc > > > +++ b/ObsoleteFiles.inc > > > @@ -14840,11 +14840,9 @@ OLD_FILES+=3Dusr/share/man/man7/mmroff.7.gz > > > OLD_FILES+=3Dusr/share/man/man7/mwww.7.gz > > > OLD_FILES+=3Dusr/share/man/man8/apm.8.gz > > > OLD_FILES+=3Dusr/share/man/man8/apmconf.8.gz > > > -OLD_FILES+=3Dusr/share/man/man8/apmd.8.gz > > > OLD_FILES+=3Dusr/share/man/man8/dm.8.gz > > > OLD_FILES+=3Dusr/share/man/man8/pam_ftp.8.gz > > > OLD_FILES+=3Dusr/share/man/man8/pam_wheel.8.gz > > > -OLD_FILES+=3Dusr/share/man/man8/sconfig.8.gz > > > OLD_FILES+=3Dusr/share/man/man8/ssl.8.gz > > > OLD_FILES+=3Dusr/share/man/man8/wlconfig.8.gz > > > OLD_FILES+=3Dusr/share/man/man9/CURSIG.9.gz > > > > > > > > -- > > Wolfram Schneider https://wolfram.schneider.org From owner-dev-commits-src-main@freebsd.org Wed Jul 21 09:53:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67E4D660FDF; Wed, 21 Jul 2021 09: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 4GV9rP2N6Dz4tW8; Wed, 21 Jul 2021 09:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 389491B7F9; Wed, 21 Jul 2021 09: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 16L9rPDk069504; Wed, 21 Jul 2021 09:53:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L9rPdj069503; Wed, 21 Jul 2021 09:53:25 GMT (envelope-from git) Date: Wed, 21 Jul 2021 09:53:25 GMT Message-Id: <202107210953.16L9rPdj069503@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 616a676a0535 - main - cam: clear stack-allocated CCB in the target layer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 616a676a0535eca78ce6b02a6226d0bcb69d7d4e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 09:53:25 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=616a676a0535eca78ce6b02a6226d0bcb69d7d4e commit 616a676a0535eca78ce6b02a6226d0bcb69d7d4e Author: Edward Tomasz Napierala AuthorDate: 2021-07-21 09:18:15 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-07-21 09:18:28 +0000 cam: clear stack-allocated CCB in the target layer Note that, as pointed out by scottl@, this code should really look a bit different, in that the stack allocations should be replaced with dynamic allocation, and the periph creation should be moved to a context where one can use M_WAITOK. See the review for more details. For now let's go with a minimal fix until we're done with UMA CCBs. Reviewed By: mav, imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D30298 --- sys/cam/ctl/scsi_ctl.c | 3 +++ sys/cam/scsi/scsi_targ_bh.c | 7 +++++-- sys/cam/scsi/scsi_target.c | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c index d3023f9a6c8c..8c141a88e155 100644 --- a/sys/cam/ctl/scsi_ctl.c +++ b/sys/cam/ctl/scsi_ctl.c @@ -479,6 +479,7 @@ ctlferegister(struct cam_periph *periph, void *arg) /*getcount_only*/1); } + memset(&ccb, 0, sizeof(ccb)); xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); ccb.ccb_h.func_code = XPT_EN_LUN; ccb.cel.grp6_len = 0; @@ -613,6 +614,7 @@ ctlfeoninvalidate(struct cam_periph *periph) cam_status status; /* Abort all ATIOs and INOTs queued to SIM. */ + memset(&ccb, 0, sizeof(ccb)); xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); ccb.ccb_h.func_code = XPT_ABORT; LIST_FOREACH(hdr, &softc->atio_list, periph_links.le) { @@ -1852,6 +1854,7 @@ ctlfe_dump_queue(struct ctlfe_lun_softc *softc) struct ccb_getdevstats cgds; int num_items; + memset(&cgds, 0, sizeof(cgds)); xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgds.ccb_h.func_code = XPT_GDEV_STATS; xpt_action((union ccb *)&cgds); diff --git a/sys/cam/scsi/scsi_targ_bh.c b/sys/cam/scsi/scsi_targ_bh.c index 84aa16aa05f4..14edb254a0e5 100644 --- a/sys/cam/scsi/scsi_targ_bh.c +++ b/sys/cam/scsi/scsi_targ_bh.c @@ -241,6 +241,7 @@ targbhenlun(struct cam_periph *periph) if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) != 0) return (CAM_REQ_CMP); + memset(&immed_ccb, 0, sizeof(immed_ccb)); xpt_setup_ccb(&immed_ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); immed_ccb.ccb_h.func_code = XPT_EN_LUN; @@ -267,7 +268,7 @@ targbhenlun(struct cam_periph *periph) struct ccb_accept_tio *atio; atio = (struct ccb_accept_tio*)malloc(sizeof(*atio), M_SCSIBH, - M_NOWAIT); + M_ZERO | M_NOWAIT); if (atio == NULL) { status = CAM_RESRC_UNAVAIL; break; @@ -309,7 +310,7 @@ targbhenlun(struct cam_periph *periph) struct ccb_immediate_notify *inot; inot = (struct ccb_immediate_notify*)malloc(sizeof(*inot), - M_SCSIBH, M_NOWAIT); + M_SCSIBH, M_ZERO | M_NOWAIT); if (inot == NULL) { status = CAM_RESRC_UNAVAIL; @@ -350,6 +351,8 @@ targbhdislun(struct cam_periph *periph) if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) == 0) return CAM_REQ_CMP; + memset(&ccb, 0, sizeof(ccb)); + /* XXX Block for Continue I/O completion */ /* Kill off all ACCECPT and IMMEDIATE CCBs */ diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index b2874f49f13f..b3d0461c1d24 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -363,6 +363,7 @@ targendislun(struct cam_path *path, int enable, int grp6_len, int grp7_len) cam_status status; /* Tell the lun to begin answering selects */ + memset(&en_ccb, 0, sizeof(en_ccb)); xpt_setup_ccb(&en_ccb.ccb_h, path, CAM_PRIORITY_NORMAL); en_ccb.ccb_h.func_code = XPT_EN_LUN; /* Don't need support for any vendor specific commands */ @@ -936,7 +937,7 @@ targgetccb(struct targ_softc *softc, xpt_opcode type, int priority) int ccb_len; ccb_len = targccblen(type); - ccb = malloc(ccb_len, M_TARG, M_NOWAIT); + ccb = malloc(ccb_len, M_TARG, M_NOWAIT | M_ZERO); CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("getccb %p\n", ccb)); if (ccb == NULL) { return (ccb); @@ -1033,6 +1034,7 @@ abort_all_pending(struct targ_softc *softc) * Then abort all pending CCBs. * targdone() will return the aborted CCB via user_ccb_queue */ + memset(&cab, 0, sizeof(cab)); xpt_setup_ccb(&cab.ccb_h, softc->path, CAM_PRIORITY_NORMAL); cab.ccb_h.func_code = XPT_ABORT; cab.ccb_h.status = CAM_REQ_CMP_ERR; From owner-dev-commits-src-main@freebsd.org Wed Jul 21 12:25:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20496662E7C; Wed, 21 Jul 2021 12:25: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 4GVFDK0LJjz4RJF; Wed, 21 Jul 2021 12:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E99161E27A; Wed, 21 Jul 2021 12:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LCPqrw070796; Wed, 21 Jul 2021 12:25:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LCPqZZ070795; Wed, 21 Jul 2021 12:25:52 GMT (envelope-from git) Date: Wed, 21 Jul 2021 12:25:52 GMT Message-Id: <202107211225.16LCPqZZ070795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 2561da0636c1 - main - linux: Fix declaration of rt_sigreturn() on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2561da0636c1b8504d05246258a5333b621a2433 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 12:25:53 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=2561da0636c1b8504d05246258a5333b621a2433 commit 2561da0636c1b8504d05246258a5333b621a2433 Author: Edward Tomasz Napierala AuthorDate: 2021-07-21 12:20:45 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-07-21 12:21:28 +0000 linux: Fix declaration of rt_sigreturn() on arm64 On Linux, this syscall doesn't take any arguments; instead it assumes the context was put on the stack. Reviewed By: dchagin Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D31251 --- sys/arm64/linux/syscalls.master | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/arm64/linux/syscalls.master b/sys/arm64/linux/syscalls.master index dcb43553e469..ca45e33d4190 100644 --- a/sys/arm64/linux/syscalls.master +++ b/sys/arm64/linux/syscalls.master @@ -842,9 +842,7 @@ ); } 139 AUE_NULL STD { - int linux_rt_sigreturn( - struct l_ucontext *ucp - ); + int linux_rt_sigreturn(void); } 140 AUE_SETPRIORITY NOPROTO { int setpriority( From owner-dev-commits-src-main@freebsd.org Wed Jul 21 12:27:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD996663145; Wed, 21 Jul 2021 12:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVFGZ60HWz4RQY; Wed, 21 Jul 2021 12:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6FC11DEB9; Wed, 21 Jul 2021 12:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LCRoeP071158; Wed, 21 Jul 2021 12:27:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LCRoa4071157; Wed, 21 Jul 2021 12:27:50 GMT (envelope-from git) Date: Wed, 21 Jul 2021 12:27:50 GMT Message-Id: <202107211227.16LCRoa4071157@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 8bc3dc01005e - main - Regen after 2561da0636c. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8bc3dc01005e56035be8807d2a559c1a86960519 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 12:27:50 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=8bc3dc01005e56035be8807d2a559c1a86960519 commit 8bc3dc01005e56035be8807d2a559c1a86960519 Author: Edward Tomasz Napierala AuthorDate: 2021-07-21 12:26:31 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-07-21 12:26:31 +0000 Regen after 2561da0636c. --- sys/arm64/linux/linux_proto.h | 2 +- sys/arm64/linux/linux_sysent.c | 2 +- sys/arm64/linux/linux_systrace_args.c | 14 +------------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/sys/arm64/linux/linux_proto.h b/sys/arm64/linux/linux_proto.h index 768a0b8be28f..47d4c812364f 100644 --- a/sys/arm64/linux/linux_proto.h +++ b/sys/arm64/linux/linux_proto.h @@ -581,7 +581,7 @@ struct linux_rt_sigqueueinfo_args { char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; }; struct linux_rt_sigreturn_args { - char ucp_l_[PADL_(struct l_ucontext *)]; struct l_ucontext * ucp; char ucp_r_[PADR_(struct l_ucontext *)]; + register_t dummy; }; struct linux_getpriority_args { char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; diff --git a/sys/arm64/linux/linux_sysent.c b/sys/arm64/linux/linux_sysent.c index 03fb3e7343d3..2943071d4e1f 100644 --- a/sys/arm64/linux/linux_sysent.c +++ b/sys/arm64/linux/linux_sysent.c @@ -156,7 +156,7 @@ struct sysent linux_sysent[] = { { .sy_narg = AS(linux_rt_sigpending_args), .sy_call = (sy_call_t *)linux_rt_sigpending, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 136 = linux_rt_sigpending */ { .sy_narg = AS(linux_rt_sigtimedwait_args), .sy_call = (sy_call_t *)linux_rt_sigtimedwait, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 137 = linux_rt_sigtimedwait */ { .sy_narg = AS(linux_rt_sigqueueinfo_args), .sy_call = (sy_call_t *)linux_rt_sigqueueinfo, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 138 = linux_rt_sigqueueinfo */ - { .sy_narg = AS(linux_rt_sigreturn_args), .sy_call = (sy_call_t *)linux_rt_sigreturn, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 139 = linux_rt_sigreturn */ + { .sy_narg = 0, .sy_call = (sy_call_t *)linux_rt_sigreturn, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 139 = linux_rt_sigreturn */ { .sy_narg = AS(setpriority_args), .sy_call = (sy_call_t *)sys_setpriority, .sy_auevent = AUE_SETPRIORITY, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 140 = setpriority */ { .sy_narg = AS(linux_getpriority_args), .sy_call = (sy_call_t *)linux_getpriority, .sy_auevent = AUE_GETPRIORITY, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 141 = linux_getpriority */ { .sy_narg = AS(linux_reboot_args), .sy_call = (sy_call_t *)linux_reboot, .sy_auevent = AUE_REBOOT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 142 = linux_reboot */ diff --git a/sys/arm64/linux/linux_systrace_args.c b/sys/arm64/linux/linux_systrace_args.c index 34e6185180f3..929b70270045 100644 --- a/sys/arm64/linux/linux_systrace_args.c +++ b/sys/arm64/linux/linux_systrace_args.c @@ -1099,9 +1099,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) } /* linux_rt_sigreturn */ case 139: { - struct linux_rt_sigreturn_args *p = params; - uarg[0] = (intptr_t)p->ucp; /* struct l_ucontext * */ - *n_args = 1; + *n_args = 0; break; } /* setpriority */ @@ -4173,13 +4171,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_rt_sigreturn */ case 139: - switch (ndx) { - case 0: - p = "userland struct l_ucontext *"; - break; - default: - break; - }; break; /* setpriority */ case 140: @@ -6727,9 +6718,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_rt_sigreturn */ case 139: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* setpriority */ case 140: if (ndx == 0 || ndx == 1) From owner-dev-commits-src-main@freebsd.org Wed Jul 21 13:02:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB6D66634E7; Wed, 21 Jul 2021 13:02: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 4GVG2T5BwPz4Xcd; Wed, 21 Jul 2021 13:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A41F1EB98; Wed, 21 Jul 2021 13:02: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 16LD2Pfp025302; Wed, 21 Jul 2021 13:02:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LD2PVN025301; Wed, 21 Jul 2021 13:02:25 GMT (envelope-from git) Date: Wed, 21 Jul 2021 13:02:25 GMT Message-Id: <202107211302.16LD2PVN025301@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: fa46a46a8249 - main - arm64: Print CPU features slightly earlier 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: fa46a46a82498532f547be5f6b5a94d05f53b0be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 13:02:25 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fa46a46a82498532f547be5f6b5a94d05f53b0be commit fa46a46a82498532f547be5f6b5a94d05f53b0be Author: Mark Johnston AuthorDate: 2021-07-20 16:06:01 +0000 Commit: Mark Johnston CommitDate: 2021-07-21 13:00:55 +0000 arm64: Print CPU features slightly earlier In particular, print them before we release APs. Otherwise they tend to get mixed with other kernel messages. Reviewed by: andrew, manu MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31242 --- sys/arm64/arm64/identcpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index f755e004a0a8..2afad3ea8a81 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -1316,7 +1316,8 @@ cpu_features_sysinit(void *dummy __unused) CPU_FOREACH(cpu) print_cpu_features(cpu); } -SYSINIT(cpu_features, SI_SUB_SMP, SI_ORDER_ANY, cpu_features_sysinit, NULL); +/* Log features before APs are released and start printing to the dmesg. */ +SYSINIT(cpu_features, SI_SUB_SMP - 1, SI_ORDER_ANY, cpu_features_sysinit, NULL); static u_long parse_cpu_features_hwcap(void) From owner-dev-commits-src-main@freebsd.org Wed Jul 21 15:18:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45D4E664DED; Wed, 21 Jul 2021 15: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 4GVK3Y1Fttz3Btg; Wed, 21 Jul 2021 15:18:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E51320373; Wed, 21 Jul 2021 15: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 16LFIWrZ099860; Wed, 21 Jul 2021 15: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 16LFIWrf099859; Wed, 21 Jul 2021 15:18:32 GMT (envelope-from git) Date: Wed, 21 Jul 2021 15:18:32 GMT Message-Id: <202107211518.16LFIWrf099859@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: 23ecfa9d5bc4 - main - kern: mountroot: avoid fd leak in .md parsing 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: 23ecfa9d5bc4f04eb58e26018c2d15f032d5d742 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 15:18:33 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=23ecfa9d5bc4f04eb58e26018c2d15f032d5d742 commit 23ecfa9d5bc4f04eb58e26018c2d15f032d5d742 Author: Kyle Evans AuthorDate: 2021-07-20 10:23:11 +0000 Commit: Kyle Evans CommitDate: 2021-07-21 15:18:09 +0000 kern: mountroot: avoid fd leak in .md parsing parse_dir_md() opens /dev/mdctl but only closes the resulting fd on success, not upon failure of the ioctl or when we exceed the md unit max. Reviewed by: kib (slightly previous version) Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #62 Differential Revision: https://reviews.freebsd.org/D31229 --- sys/kern/vfs_mountroot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index 65d52cc68bcd..48753b8c6a96 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -580,6 +580,7 @@ parse_dir_md(char **conf) int error, fd, len; td = curthread; + fd = -1; error = parse_token(conf, &tok); if (error) @@ -635,9 +636,9 @@ parse_dir_md(char **conf) root_mount_mddev = mdio->md_unit; printf(MD_NAME "%u attached to %s\n", root_mount_mddev, mdio->md_file); - error = kern_close(td, fd); - out: + if (fd >= 0) + (void)kern_close(td, fd); free(mdio, M_TEMP); return (error); } From owner-dev-commits-src-main@freebsd.org Wed Jul 21 15:32:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4321E665649; Wed, 21 Jul 2021 15:32: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 4GVKMb17D0z3FFs; Wed, 21 Jul 2021 15:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DBB320B9B; Wed, 21 Jul 2021 15:32: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 16LFWQ0n025292; Wed, 21 Jul 2021 15:32:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LFWQjo025280; Wed, 21 Jul 2021 15:32:26 GMT (envelope-from git) Date: Wed, 21 Jul 2021 15:32:26 GMT Message-Id: <202107211532.16LFWQjo025280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 2ae65d449fec - main - Revert "Fix race between first rand(3) calls." MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ae65d449fecf22f493ce2dcb9e293bb8d95c8ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 15:32:27 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2ae65d449fecf22f493ce2dcb9e293bb8d95c8ef commit 2ae65d449fecf22f493ce2dcb9e293bb8d95c8ef Author: Alexander Motin AuthorDate: 2021-07-21 14:50:14 +0000 Commit: Alexander Motin CommitDate: 2021-07-21 15:32:22 +0000 Revert "Fix race between first rand(3) calls." It is going to be reimplemented with _once(). This reverts commit 28d70deaafa62c5d1602de5272c0aad0fcca8aff. MFC after: 1 month --- lib/libc/stdlib/rand.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c index 353f59349e1d..bddb0f040302 100644 --- a/lib/libc/stdlib/rand.c +++ b/lib/libc/stdlib/rand.c @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "un-namespace.h" #include "random.h" @@ -69,15 +68,11 @@ static struct __random_state *rand3_state; static void initialize_rand3(void) { - struct __random_state *state; int error; - state = allocatestate(TYPE_3); - error = initstate_r(state, 1, state->rst_randtbl, BREAK_3); + rand3_state = allocatestate(TYPE_3); + error = initstate_r(rand3_state, 1, rand3_state->rst_randtbl, BREAK_3); assert(error == 0); - if (!atomic_cmpset_rel_ptr((volatile uintptr_t *)&rand3_state, - (uintptr_t)NULL, (uintptr_t)state)) - free(state); } int From owner-dev-commits-src-main@freebsd.org Wed Jul 21 15:32:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8556665273; Wed, 21 Jul 2021 15:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVKMc3MT2z3F2x; Wed, 21 Jul 2021 15:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A96920B9C; Wed, 21 Jul 2021 15:32: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 16LFWSQJ025501; Wed, 21 Jul 2021 15:32:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LFWS55025500; Wed, 21 Jul 2021 15:32:28 GMT (envelope-from git) Date: Wed, 21 Jul 2021 15:32:28 GMT Message-Id: <202107211532.16LFWS55025500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 3a57f08b5042 - main - Fix race between first rand(3) calls with _once(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a57f08b5042f15bb8ffb2fcce99d082d225d4cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 15:32:28 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=3a57f08b5042f15bb8ffb2fcce99d082d225d4cf commit 3a57f08b5042f15bb8ffb2fcce99d082d225d4cf Author: Alexander Motin AuthorDate: 2021-07-21 15:25:46 +0000 Commit: Alexander Motin CommitDate: 2021-07-21 15:32:22 +0000 Fix race between first rand(3) calls with _once(). Before this patch there was a chance for thread that called rand(3) slightly later to see rand3_state already allocated, but not yet initialized. While this API is not expected to be thread-safe, it is not expected to crash. ztest on 64-thread system reproduced it reliably for me. Submitted by: avg@ MFC after: 1 month --- lib/libc/stdlib/rand.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c index bddb0f040302..e448d1b1fd14 100644 --- a/lib/libc/stdlib/rand.c +++ b/lib/libc/stdlib/rand.c @@ -41,11 +41,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include "un-namespace.h" +#include "libc_private.h" #include "random.h" /* @@ -64,6 +66,7 @@ __FBSDID("$FreeBSD$"); * the advantage of being the one already in the tree. */ static struct __random_state *rand3_state; +static pthread_once_t rand3_state_once = PTHREAD_ONCE_INIT; static void initialize_rand3(void) @@ -78,16 +81,14 @@ initialize_rand3(void) int rand(void) { - if (rand3_state == NULL) - initialize_rand3(); + _once(&rand3_state_once, initialize_rand3); return ((int)random_r(rand3_state)); } void srand(unsigned seed) { - if (rand3_state == NULL) - initialize_rand3(); + _once(&rand3_state_once, initialize_rand3); srandom_r(rand3_state, seed); } From owner-dev-commits-src-main@freebsd.org Wed Jul 21 23:18:40 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A5BF66E868; Wed, 21 Jul 2021 23:18: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 4GVWjX0qQGz3s9p; Wed, 21 Jul 2021 23:18:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F407B26B37; Wed, 21 Jul 2021 23:18:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LNIdZb047849; Wed, 21 Jul 2021 23:18:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LNIdcB047848; Wed, 21 Jul 2021 23:18:39 GMT (envelope-from git) Date: Wed, 21 Jul 2021 23:18:39 GMT Message-Id: <202107212318.16LNIdcB047848@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: 27ea55fc655b - main - libpmc/hwpmc: fix issues with arm64 pmu-events support 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: 27ea55fc655b0081f760a34ff5dd5526ba02a0fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 23:18:40 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=27ea55fc655b0081f760a34ff5dd5526ba02a0fb commit 27ea55fc655b0081f760a34ff5dd5526ba02a0fb Author: Mitchell Horne AuthorDate: 2021-07-21 22:59:27 +0000 Commit: Mitchell Horne CommitDate: 2021-07-21 23:18:00 +0000 libpmc/hwpmc: fix issues with arm64 pmu-events support Due to a mis-merge, the changes committed to libpmc never called pmu_parse_event(), or set pm->pm_ev. However, this field shouldn't be used to carry the actual pmc event code anyway, as it is expected to contain the index into the pmu event array (otherwise, it breaks event name lookup in pmclog_get_event()). Add a new MD field, pm_md.pm_md_config, to pass the raw event code to arm64_allocate_pmc(). Additionally, the change made to pmc_md_op_pmcallocate was incorrect, as this is a union, not a struct. Restore the proper padding size. Reviewed by: luporl, ray, andrew Fixes: 28dd6730a5d6 ("libpmc: enable pmu_utils on arm64") Fixes: 8cc3815f02be ("hwpmc_arm64: accept raw event codes...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31221 --- lib/libpmc/libpmc_pmu_util.c | 5 +++++ sys/arm64/include/pmc_mdep.h | 8 +++++--- sys/dev/hwpmc/hwpmc_arm64.c | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c index d33abdb50acc..e6f74e6abe81 100644 --- a/lib/libpmc/libpmc_pmu_util.c +++ b/lib/libpmc/libpmc_pmu_util.c @@ -577,6 +577,7 @@ int pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm) { const struct pmu_event *pe; + struct pmu_event_desc ped; int idx = -1; event_name = pmu_alias_get(event_name); @@ -584,8 +585,12 @@ pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm) return (ENOENT); if (pe->event == NULL) return (ENOENT); + if (pmu_parse_event(&ped, pe->event)) + return (ENOENT); assert(idx >= 0); + pm->pm_ev = idx; + pm->pm_md.pm_md_config = ped.ped_event; pm->pm_md.pm_md_flags |= PM_MD_RAW_EVENT; pm->pm_class = PMC_CLASS_ARMV8; pm->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); diff --git a/sys/arm64/include/pmc_mdep.h b/sys/arm64/include/pmc_mdep.h index f4f31aba6305..dec90b386b13 100644 --- a/sys/arm64/include/pmc_mdep.h +++ b/sys/arm64/include/pmc_mdep.h @@ -38,10 +38,12 @@ #include union pmc_md_op_pmcallocate { - uint32_t pm_md_flags; + struct { + uint32_t pm_md_config; + uint32_t pm_md_flags; #define PM_MD_RAW_EVENT 0x1 - uint32_t __pad32; - uint64_t __pad[3]; + }; + uint64_t __pad[4]; }; /* Logging */ diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c index 84a8791287f7..8a149f5f508f 100644 --- a/sys/dev/hwpmc/hwpmc_arm64.c +++ b/sys/dev/hwpmc/hwpmc_arm64.c @@ -182,9 +182,9 @@ arm64_allocate_pmc(int cpu, int ri, struct pmc *pm, pe = a->pm_ev; /* Adjust the config value if needed. */ - config = (uint32_t)pe; + config = a->pm_md.pm_md_config; if ((a->pm_md.pm_md_flags & PM_MD_RAW_EVENT) == 0) { - config -= PMC_EV_ARMV8_FIRST; + config = (uint32_t)pe - PMC_EV_ARMV8_FIRST; if (config > (PMC_EV_ARMV8_LAST - PMC_EV_ARMV8_FIRST)) return (EINVAL); } From owner-dev-commits-src-main@freebsd.org Thu Jul 22 00:15:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8D4866F74D; Thu, 22 Jul 2021 00:15: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 4GVXyY5wrrz4X9h; Thu, 22 Jul 2021 00:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD43227AEF; Thu, 22 Jul 2021 00:15: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 16M0F14W026899; Thu, 22 Jul 2021 00:15:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M0F1nW026898; Thu, 22 Jul 2021 00:15:01 GMT (envelope-from git) Date: Thu, 22 Jul 2021 00:15:01 GMT Message-Id: <202107220015.16M0F1nW026898@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: 51221b68fb55 - main - tuntap: clean up cc --analyze 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: 51221b68fb5578be90b266fbb53d2848acaee045 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 00:15:02 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=51221b68fb5578be90b266fbb53d2848acaee045 commit 51221b68fb5578be90b266fbb53d2848acaee045 Author: Kyle Evans AuthorDate: 2021-07-22 00:13:48 +0000 Commit: Kyle Evans CommitDate: 2021-07-22 00:14:43 +0000 tuntap: clean up cc --analyze One complaint of a dead-store, smack it with a __diagused. --- sys/net/if_tuntap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 0c0a0dd66339..b4b1b77ddc7c 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1042,7 +1042,7 @@ tunopen(struct cdev *dev, int flag, int mode, struct thread *td) { struct ifnet *ifp; struct tuntap_softc *tp; - int error, tunflags; + int error __diagused, tunflags; tunflags = 0; CURVNET_SET(TD_TO_VNET(td)); From owner-dev-commits-src-main@freebsd.org Thu Jul 22 02:04:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD12A650A66; Thu, 22 Jul 2021 02:04: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 4GVbNl4BKzz4rts; Thu, 22 Jul 2021 02:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78005128B; Thu, 22 Jul 2021 02:04: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 16M24NbO072871; Thu, 22 Jul 2021 02:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M24NS1072870; Thu, 22 Jul 2021 02:04:23 GMT (envelope-from git) Date: Thu, 22 Jul 2021 02:04:23 GMT Message-Id: <202107220204.16M24NS1072870@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: acf9cf323f8d - main - awk: Issue a warning for old hex behavior. 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: acf9cf323f8d0c844ea4a0fedeb596871794a078 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 02:04:23 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=acf9cf323f8d0c844ea4a0fedeb596871794a078 commit acf9cf323f8d0c844ea4a0fedeb596871794a078 Author: Warner Losh AuthorDate: 2021-07-20 04:39:26 +0000 Commit: Warner Losh CommitDate: 2021-07-22 02:03:35 +0000 awk: Issue a warning for old hex behavior. Since FreeBSD has allowed "0x" hex strings to be converted to integers for a long time, and since upstream has killed that behavior, warn about this issue. This will allow us to deprecate this behavior for 14.0 while giving our users of 12.x and 13.x fair warning. Sponsored by: Netflix --- contrib/one-true-awk/lib.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/contrib/one-true-awk/lib.c b/contrib/one-true-awk/lib.c index 6bfe5e8eaad9..c2da07a7ba62 100644 --- a/contrib/one-true-awk/lib.c +++ b/contrib/one-true-awk/lib.c @@ -798,11 +798,16 @@ bool is_valid_number(const char *s, bool trailing_stuff_ok, * where hex strings were treated as numbers in nawk the whole time it has been * in FreeBSD (since 2001). The POSIX 2001 through 2004 standards mandated this * behavior and the current standard allows it. Deviate from upstream by restoring - * the prior FreeBSD behavior. + * the prior FreeBSD behavior, but warning that it differs. */ -#if 0 // no hex floating point, sorry if (s[0] == '0' && tolower(s[1]) == 'x') +#ifdef __FreeBSD__ + { static int warned = 0; /* Only warn the first time */ + if (warned++ == 0) + WARNING("Script depends on old '0x' hex conversion behavior"); + } +#else return false; #endif From owner-dev-commits-src-main@freebsd.org Thu Jul 22 02:04:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C095F651061; Thu, 22 Jul 2021 02:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVbNm51Dwz4rrW; Thu, 22 Jul 2021 02:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 939B4111C; Thu, 22 Jul 2021 02:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16M24OOU072895; Thu, 22 Jul 2021 02:04:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M24OiS072894; Thu, 22 Jul 2021 02:04:24 GMT (envelope-from git) Date: Thu, 22 Jul 2021 02:04:24 GMT Message-Id: <202107220204.16M24OiS072894@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: 2b720db8d409 - main - type: becauce -> because 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: 2b720db8d409f6fcdffa7f06b1d8c1b981435a83 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 02:04:24 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2b720db8d409f6fcdffa7f06b1d8c1b981435a83 commit 2b720db8d409f6fcdffa7f06b1d8c1b981435a83 Author: Warner Losh AuthorDate: 2021-07-22 02:02:44 +0000 Commit: Warner Losh CommitDate: 2021-07-22 02:03:35 +0000 type: becauce -> because Noticed by: Piotr P. Stefaniak Sponsored by: Netflix --- stand/i386/loader/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index dcae7bd67a14..0abf6120c1e3 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -95,7 +95,7 @@ FILESMODE_${LOADER}= ${BINMODE} -b # that pxeloader provides has none of that flexibility because it lacks access # to the a.out/elf headers and assumes an entry point of 0. # -# We must add it to the LDFLAGS instead of the OBJS becauce the former won't try +# We must add it to the LDFLAGS instead of the OBJS because the former won't try # to clean it. When it is in OBJS, this cleaning can lead to races where # btxcrt.o is rebuilt, but boot2 isn't, leading to errors at installation time. # LDFLAGS does not have this baggage and will be included first in the list of From owner-dev-commits-src-main@freebsd.org Thu Jul 22 02:18:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C86465115A; Thu, 22 Jul 2021 02:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVbjR0PYRz4vDr; Thu, 22 Jul 2021 02:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAC881427; Thu, 22 Jul 2021 02:18:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16M2IohK086192; Thu, 22 Jul 2021 02:18:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M2IoXd086191; Thu, 22 Jul 2021 02:18:50 GMT (envelope-from git) Date: Thu, 22 Jul 2021 02:18:50 GMT Message-Id: <202107220218.16M2IoXd086191@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: 2929813c4f89 - main - Revert "awk: Issue a warning for old hex behavior." 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: 2929813c4f89388272a8bc034b09e72c5bf4e9c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 02:18:51 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2929813c4f89388272a8bc034b09e72c5bf4e9c7 commit 2929813c4f89388272a8bc034b09e72c5bf4e9c7 Author: Warner Losh AuthorDate: 2021-07-22 02:17:50 +0000 Commit: Warner Losh CommitDate: 2021-07-22 02:17:50 +0000 Revert "awk: Issue a warning for old hex behavior." This reverts commit acf9cf323f8d0c844ea4a0fedeb596871794a078. It warns about too many false positive cases. Sponsored by: Netflix --- contrib/one-true-awk/lib.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/contrib/one-true-awk/lib.c b/contrib/one-true-awk/lib.c index c2da07a7ba62..6bfe5e8eaad9 100644 --- a/contrib/one-true-awk/lib.c +++ b/contrib/one-true-awk/lib.c @@ -798,16 +798,11 @@ bool is_valid_number(const char *s, bool trailing_stuff_ok, * where hex strings were treated as numbers in nawk the whole time it has been * in FreeBSD (since 2001). The POSIX 2001 through 2004 standards mandated this * behavior and the current standard allows it. Deviate from upstream by restoring - * the prior FreeBSD behavior, but warning that it differs. + * the prior FreeBSD behavior. */ +#if 0 // no hex floating point, sorry if (s[0] == '0' && tolower(s[1]) == 'x') -#ifdef __FreeBSD__ - { static int warned = 0; /* Only warn the first time */ - if (warned++ == 0) - WARNING("Script depends on old '0x' hex conversion behavior"); - } -#else return false; #endif From owner-dev-commits-src-main@freebsd.org Thu Jul 22 02:26:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92483651260; Thu, 22 Jul 2021 02:26:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVbss3NNxz3CDT; Thu, 22 Jul 2021 02:26:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C37F1477; Thu, 22 Jul 2021 02:26: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 16M2Q98h099109; Thu, 22 Jul 2021 02:26:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M2Q9n8099108; Thu, 22 Jul 2021 02:26:09 GMT (envelope-from git) Date: Thu, 22 Jul 2021 02:26:09 GMT Message-Id: <202107220226.16M2Q9n8099108@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: 628bd30ab5a4 - main - awk: revert to upstream behavior for ranges for gawk compatibility 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: 628bd30ab5a492839b84dbf2aaf25848dae3866a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 02:26:09 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=628bd30ab5a492839b84dbf2aaf25848dae3866a commit 628bd30ab5a492839b84dbf2aaf25848dae3866a Author: Warner Losh AuthorDate: 2021-07-22 02:22:43 +0000 Commit: Warner Losh CommitDate: 2021-07-22 02:22:43 +0000 awk: revert to upstream behavior for ranges for gawk compatibility In 2005, FreeBSD changed one-true-awk to honor the locale's collating order. This was billed as a temporary patch. It was also compatible with the then-current behavior of gawk. That temporary patch has lasted 16 years now. However, IEEE Std 1003.1-2008 changed the behaivor of ranges in regular expressions outside of the "C" and "POSIX" locales to be undefined. Starting in 2011, gawk 4.0 stopped using the locale for the range regular expressions and used the traditional behavior only. The maintainer had grown weary of answering why '[A-Z]' would sometimes match lower-case expressions. The details about are explained here: https://www.gnu.org/software/gawk/manual/html_node/Ranges-and-Locales.html To restore compatibility with other implementaitons of awk, revert this patch. FreeBSD is the odd-system out. It also has the nice side effect of eliminating the last of our differences with upstream one-true-awk. Reviewed by: cy, rgrimes MFC After: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31114 --- contrib/one-true-awk/b.c | 22 ++++------------------ contrib/one-true-awk/main.c | 1 - contrib/one-true-awk/run.c | 2 +- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/contrib/one-true-awk/b.c b/contrib/one-true-awk/b.c index dd64f09647b0..01119470de05 100644 --- a/contrib/one-true-awk/b.c +++ b/contrib/one-true-awk/b.c @@ -361,20 +361,9 @@ int quoted(const uschar **pp) /* pick up next thing after a \\ */ return c; } -static int collate_range_cmp(int a, int b) -{ - static char s[2][2]; - - if ((uschar)a == (uschar)b) - return 0; - s[0][0] = a; - s[1][0] = b; - return (strcoll(s[0], s[1])); -} - char *cclenter(const char *argp) /* add a character class */ { - int i, c, c2, j; + int i, c, c2; const uschar *op, *p = (const uschar *) argp; uschar *bp; static uschar *buf = NULL; @@ -393,18 +382,15 @@ char *cclenter(const char *argp) /* add a character class */ c2 = *p++; if (c2 == '\\') c2 = quoted(&p); - if (collate_range_cmp(c, c2) > 0) { + if (c > c2) { /* empty; ignore */ bp--; i--; continue; } - for (j = 0; j < NCHARS; j++) { - if ((collate_range_cmp(c, j) > 0) || - collate_range_cmp(j, c2) > 0) - continue; + while (c < c2) { if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1")) FATAL("out of space for character class [%.10s...] 2", p); - *bp++ = j; + *bp++ = ++c; i++; } continue; diff --git a/contrib/one-true-awk/main.c b/contrib/one-true-awk/main.c index cfe3fafaf7fe..95eeba00d9ca 100644 --- a/contrib/one-true-awk/main.c +++ b/contrib/one-true-awk/main.c @@ -117,7 +117,6 @@ int main(int argc, char *argv[]) char *fn, *vn; setlocale(LC_CTYPE, ""); - setlocale(LC_COLLATE, ""); setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ cmdname = argv[0]; if (argc == 1) { diff --git a/contrib/one-true-awk/run.c b/contrib/one-true-awk/run.c index 9752cd773630..3342eb274e3a 100644 --- a/contrib/one-true-awk/run.c +++ b/contrib/one-true-awk/run.c @@ -665,7 +665,7 @@ Cell *relop(Node **a, int n) /* a[0 < a[1], etc. */ j = x->fval - y->fval; i = j<0? -1: (j>0? 1: 0); } else { - i = strcoll(getsval(x), getsval(y)); + i = strcmp(getsval(x), getsval(y)); } tempfree(x); tempfree(y); From owner-dev-commits-src-main@freebsd.org Thu Jul 22 02:26:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDF256511F2; Thu, 22 Jul 2021 02:26: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 4GVbst4Nj2z3CDY; Thu, 22 Jul 2021 02:26:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C26B1522; Thu, 22 Jul 2021 02:26: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 16M2QA4n099133; Thu, 22 Jul 2021 02:26:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M2QAHH099132; Thu, 22 Jul 2021 02:26:10 GMT (envelope-from git) Date: Thu, 22 Jul 2021 02:26:10 GMT Message-Id: <202107220226.16M2QAHH099132@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: 5ab82b00cca7 - main - awk: Remove last markings we have on awk 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: 5ab82b00cca74feb9d047e9c8aa29e5118810edc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 02:26:10 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5ab82b00cca74feb9d047e9c8aa29e5118810edc commit 5ab82b00cca74feb9d047e9c8aa29e5118810edc Author: Warner Losh AuthorDate: 2021-07-22 02:24:57 +0000 Commit: Warner Losh CommitDate: 2021-07-22 02:24:57 +0000 awk: Remove last markings we have on awk We normally don't add $FreeBSD$ to contrib software. However, these changes date back to the CVS era of source code management and have been overlooked. Now that all these files are back to the same as the upstream bsd-features branch, remove the FreeBSD specific changes, which are now just $FreeBSD$ and the (FreeBSD) in the version string. MFC After: 2 weeks Sponsored by: Netflix --- contrib/one-true-awk/b.c | 3 --- contrib/one-true-awk/main.c | 4 +--- contrib/one-true-awk/run.c | 3 --- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/contrib/one-true-awk/b.c b/contrib/one-true-awk/b.c index 01119470de05..f889ee57b3fb 100644 --- a/contrib/one-true-awk/b.c +++ b/contrib/one-true-awk/b.c @@ -24,9 +24,6 @@ THIS SOFTWARE. /* lasciate ogne speranza, voi ch'intrate. */ -#include -__FBSDID("$FreeBSD$"); - #define DEBUG #include diff --git a/contrib/one-true-awk/main.c b/contrib/one-true-awk/main.c index 95eeba00d9ca..f3936341ae75 100644 --- a/contrib/one-true-awk/main.c +++ b/contrib/one-true-awk/main.c @@ -22,9 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ -#include -__FBSDID("$FreeBSD$"); -const char *version = "version 20210215 (FreeBSD)"; +const char *version = "version 20210215"; #define DEBUG #include diff --git a/contrib/one-true-awk/run.c b/contrib/one-true-awk/run.c index 3342eb274e3a..117fb0748bd8 100644 --- a/contrib/one-true-awk/run.c +++ b/contrib/one-true-awk/run.c @@ -22,9 +22,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ -#include -__FBSDID("$FreeBSD$"); - #define DEBUG #include #include From owner-dev-commits-src-main@freebsd.org Thu Jul 22 06:16:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7078654028; Thu, 22 Jul 2021 06:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVj074Hcdz4YLM; Thu, 22 Jul 2021 06:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A3114C82; Thu, 22 Jul 2021 06:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16M6Gtqb006219; Thu, 22 Jul 2021 06:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M6GtmX006218; Thu, 22 Jul 2021 06:16:55 GMT (envelope-from git) Date: Thu, 22 Jul 2021 06:16:55 GMT Message-Id: <202107220616.16M6GtmX006218@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 Apestegu=C3=ADa?= Subject: git: 8539518055d0 - main - Remove manpages from OLD_FILES 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: 8539518055d01ad786ac925a22452c98017c75fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 06:16:55 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8539518055d01ad786ac925a22452c98017c75fd commit 8539518055d01ad786ac925a22452c98017c75fd Author: Fernando Apesteguía AuthorDate: 2021-07-21 09:21:14 +0000 Commit: Fernando Apesteguía CommitDate: 2021-07-22 06:09:45 +0000 Remove manpages from OLD_FILES Remove apm.8 and apmconf.8 from OLD_FILES in the relevant Makefiles. These pages are now installed unconditionally as per 0a0f7486413c PR: 257228 Reported by: yasu@utahime.org, wosch@ Approved by: imp@, wosch@ Fixes: 0a0f7486413c - Build manpages for all architectures MFH: 4 weeks Differential Revision: https://reviews.freebsd.org/D31256 --- ObsoleteFiles.inc | 2 -- tools/build/mk/OptionalObsoleteFiles.inc | 2 -- 2 files changed, 4 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index d72aea5e8efc..d23562072214 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -14838,8 +14838,6 @@ OLD_FILES+=usr/share/man/man5/utf2.5.gz OLD_FILES+=usr/share/man/man7/groff_mwww.7.gz OLD_FILES+=usr/share/man/man7/mmroff.7.gz OLD_FILES+=usr/share/man/man7/mwww.7.gz -OLD_FILES+=usr/share/man/man8/apm.8.gz -OLD_FILES+=usr/share/man/man8/apmconf.8.gz OLD_FILES+=usr/share/man/man8/dm.8.gz OLD_FILES+=usr/share/man/man8/pam_ftp.8.gz OLD_FILES+=usr/share/man/man8/pam_wheel.8.gz diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 89e09dac2255..f1febd18dd4c 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -64,8 +64,6 @@ OLD_FILES+=etc/rc.d/apmd OLD_FILES+=etc/apmd.conf OLD_FILES+=usr/sbin/apm OLD_FILES+=usr/share/examples/etc/apmd.conf -OLD_FILES+=usr/share/man/man8/amd64/apm.8.gz -OLD_FILES+=usr/share/man/man8/amd64/apmconf.8.gz .endif .if ${MK_AT} == no From owner-dev-commits-src-main@freebsd.org Thu Jul 22 08:19:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EEAF656199; Thu, 22 Jul 2021 08:19: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 4GVljV0Hg2z4v40; Thu, 22 Jul 2021 08:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D79FA5E64; Thu, 22 Jul 2021 08:19: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 16M8JPuu067022; Thu, 22 Jul 2021 08:19:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M8JPqQ067021; Thu, 22 Jul 2021 08:19:25 GMT (envelope-from git) Date: Thu, 22 Jul 2021 08:19:25 GMT Message-Id: <202107220819.16M8JPqQ067021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 6cafdee71d2b - main - pkgbase: Track pkg 1.17 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6cafdee71d2b23e8ec95d1f128b0e11f103491bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 08:19:26 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=6cafdee71d2b23e8ec95d1f128b0e11f103491bb commit 6cafdee71d2b23e8ec95d1f128b0e11f103491bb Author: Emmanuel Vadot AuthorDate: 2021-05-04 13:39:55 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 08:19:02 +0000 pkgbase: Track pkg 1.17 With pkg 1.17 the extention is always .pkg, packing_format is also now deprecated. --- Makefile.inc1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index c2e34a0b02dc..f7e8f9c41d2f 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1899,14 +1899,14 @@ real-update-packages: stage-packages .PHONY @echo "==> Checking for new packages (comparing ${PKG_VERSION} to ${PKG_VERSION_FROM})" @for pkg in ${PKG_VERSION_FROM_DIR}/${PKG_NAME_PREFIX}-*; do \ pkgname=$$(pkg query -F $${pkg} '%n' | sed 's/${PKG_NAME_PREFIX}-\(.*\)/\1/') ; \ - newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.${PKG_FORMAT} ; \ + newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.pkg ; \ oldsum=$$(pkg query -F $${pkg} '%X') ; \ if [ ! -f ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ]; then \ continue; \ fi ; \ newsum=$$(pkg query -F ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} '%X') ; \ if [ "$${oldsum}" == "$${newsum}" ]; then \ - echo "==> Keeping old ${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.${PKG_FORMAT}" ; \ + echo "==> Keeping old ${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.pkg" ; \ rm ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ; \ cp $${pkg} ${REPODIR}/${PKG_ABI}/${PKG_VERSION} ; \ else \ @@ -2063,7 +2063,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne .endif sign-packages: _pkgbootstrap .PHONY - printf "version = 2;\npacking_format = \"${PKG_FORMAT}\";\n" > ${WSTAGEDIR}/meta + printf "version = 2;\n" > ${WSTAGEDIR}/meta @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \ unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \ ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \ From owner-dev-commits-src-main@freebsd.org Thu Jul 22 08:56:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B69A656927; Thu, 22 Jul 2021 08:56:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVmWp0JnRz3HFN; Thu, 22 Jul 2021 08:56:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7ABF696B; Thu, 22 Jul 2021 08:56:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16M8u5JS020879; Thu, 22 Jul 2021 08:56:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M8u5gF020878; Thu, 22 Jul 2021 08:56:05 GMT (envelope-from git) Date: Thu, 22 Jul 2021 08:56:05 GMT Message-Id: <202107220856.16M8u5gF020878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: d6ed0d3d3106 - main - ports.7: catchup with the package extension name since pkg 1.17 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6ed0d3d310633ecf9294bc332e93f2766b24ded Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 08:56:06 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d6ed0d3d310633ecf9294bc332e93f2766b24ded commit d6ed0d3d310633ecf9294bc332e93f2766b24ded Author: Baptiste Daroussin AuthorDate: 2021-07-22 08:49:45 +0000 Commit: Baptiste Daroussin CommitDate: 2021-07-22 08:50:19 +0000 ports.7: catchup with the package extension name since pkg 1.17 MFC After: 3 days --- share/man/man7/ports.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7 index c6f3d4b8c977..6e382140f106 100644 --- a/share/man/man7/ports.7 +++ b/share/man/man7/ports.7 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 10, 2021 +.Dd July 22, 2021 .Dt PORTS 7 .Os .Sh NAME @@ -298,7 +298,7 @@ from the system. Make a binary package for the port. The port will be installed if it has not already been. The package is a -.Pa .txz +.Pa .pkg file that you can use to install the port on other machines with .Xr pkg-add 8 . From owner-dev-commits-src-main@freebsd.org Thu Jul 22 12:35:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A266E65A01B; Thu, 22 Jul 2021 12:35: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 4GVsNc40mrz4fxd; Thu, 22 Jul 2021 12:35:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 700DC11D7F; Thu, 22 Jul 2021 12:35: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 16MCZC1A014960; Thu, 22 Jul 2021 12:35:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MCZCfw014959; Thu, 22 Jul 2021 12:35:12 GMT (envelope-from git) Date: Thu, 22 Jul 2021 12:35:12 GMT Message-Id: <202107221235.16MCZCfw014959@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: 1db1e58d9384 - main - mlx5en: vxlan: do not report TCP inner packet as UDP for software parser 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: 1db1e58d9384ff9171c248abbef71cf7aea5ebbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 12:35:12 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1db1e58d9384ff9171c248abbef71cf7aea5ebbe commit 1db1e58d9384ff9171c248abbef71cf7aea5ebbe Author: Konstantin Belousov AuthorDate: 2021-07-22 11:53:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-22 12:34:24 +0000 mlx5en: vxlan: do not report TCP inner packet as UDP for software parser Reviewed by: hselasky Sponsored by: Mellanox Technologies // NVIDIA Networking MFC after: 1 week --- sys/dev/mlx5/mlx5_en/mlx5_en_tx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c index 753b7ea20e5b..e85522bdfad7 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c @@ -516,7 +516,6 @@ mlx5e_get_vxlan_header_size(const struct mbuf *mb, struct mlx5e_tx_wqe *wqe, return (0); wqe->eth.swp_inner_l4_offset = eth_hdr_len / 2; wqe->eth.cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM; - wqe->eth.swp_flags |= MLX5_ETH_WQE_SWP_INNER_L4_TYPE; tcp_hlen = th->th_off << 2; eth_hdr_len += tcp_hlen; break; From owner-dev-commits-src-main@freebsd.org Thu Jul 22 12:54:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 370F765A240; Thu, 22 Jul 2021 12:54: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 4GVspv117jz4k1F; Thu, 22 Jul 2021 12:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A8BF1217D; Thu, 22 Jul 2021 12:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MCsUbl041865; Thu, 22 Jul 2021 12:54:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MCsUsf041864; Thu, 22 Jul 2021 12:54:30 GMT (envelope-from git) Date: Thu, 22 Jul 2021 12:54:30 GMT Message-Id: <202107221254.16MCsUsf041864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 50e0dc0c4b46 - main - fdt: Expose the model, compatible and freebsd dts brandind as sysctl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50e0dc0c4b46ee62b898ce2d92e52be4f77383d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 12:54:31 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=50e0dc0c4b46ee62b898ce2d92e52be4f77383d9 commit 50e0dc0c4b46ee62b898ce2d92e52be4f77383d9 Author: Emmanuel Vadot AuthorDate: 2021-07-17 15:19:22 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 12:53:32 +0000 fdt: Expose the model, compatible and freebsd dts brandind as sysctl This make it easier for script to get the hardware on which they are running. MFC after: 1 month Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D31205 Reviewed by: imp Should be ok on powerpc: jhibbits (over irc) --- sys/dev/ofw/ofw_fdt.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/sys/dev/ofw/ofw_fdt.c b/sys/dev/ofw/ofw_fdt.c index 30b02bac2fc4..304ffb6b1436 100644 --- a/sys/dev/ofw/ofw_fdt.c +++ b/sys/dev/ofw/ofw_fdt.c @@ -105,7 +105,14 @@ static ofw_def_t ofw_fdt = { }; OFW_DEF(ofw_fdt); +#define FDT_FBSDVER_LEN 16 +#define FDT_MODEL_LEN 80 +#define FDT_COMPAT_LEN 255 + static void *fdtp = NULL; +static char fdt_model[FDT_MODEL_LEN]; +static char fdt_compatible[FDT_COMPAT_LEN]; +static char fdt_fbsd_version[FDT_FBSDVER_LEN]; static int sysctl_handle_dtb(SYSCTL_HANDLER_ARGS) @@ -125,19 +132,50 @@ sysctl_register_fdt_oid(void *arg) SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_fdt), OID_AUTO, "dtb", CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_handle_dtb, "", "Device Tree Blob"); + if (fdt_model[0] != '\0') + SYSCTL_ADD_STRING(NULL, SYSCTL_STATIC_CHILDREN(_hw_fdt), + OID_AUTO, "model", CTLFLAG_RD, fdt_model, + FDT_MODEL_LEN, "System board model"); + if (fdt_compatible[0] != '\0') + SYSCTL_ADD_STRING(NULL, SYSCTL_STATIC_CHILDREN(_hw_fdt), + OID_AUTO, "compatible", CTLFLAG_RD, fdt_compatible, + FDT_COMPAT_LEN, "Compatible platforms"); + if (fdt_fbsd_version[0] != '\0') + SYSCTL_ADD_STRING(NULL, SYSCTL_STATIC_CHILDREN(_hw_fdt), + OID_AUTO, "freebsd-version", CTLFLAG_RD, fdt_fbsd_version, + FDT_FBSDVER_LEN, "FreeBSD DTS branding version"); } SYSINIT(dtb_oid, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_register_fdt_oid, NULL); static int ofw_fdt_init(ofw_t ofw, void *data) { + phandle_t root; + ssize_t len; int err; + int i; /* Check FDT blob integrity */ if ((err = fdt_check_header(data)) != 0) return (err); fdtp = data; + root = ofw_fdt_finddevice(NULL, "/"); + len = ofw_fdt_getproplen(NULL, root, "model"); + bzero(fdt_model, FDT_MODEL_LEN); + ofw_fdt_getprop(NULL, root, "model", fdt_model, FDT_MODEL_LEN); + len = ofw_fdt_getproplen(NULL, root, "compatible"); + bzero(fdt_compatible, FDT_COMPAT_LEN); + ofw_fdt_getprop(NULL, root, "compatible", fdt_compatible, FDT_COMPAT_LEN); + /* Replace the middle '\0' with ' ' */ + for (i = 0; i < len - 1; i++) + if (fdt_compatible[i] == '\0') + fdt_compatible[i] = ' '; + if ((len = ofw_fdt_getproplen(NULL, root, "freebsd,dts-version")) > 0) { + bzero(fdt_fbsd_version, FDT_FBSDVER_LEN); + ofw_fdt_getprop(NULL, root, "freebsd,dts-version", + fdt_fbsd_version, FDT_FBSDVER_LEN); + } return (0); } @@ -411,7 +449,6 @@ ofw_fdt_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len) static int ofw_fdt_fixup(ofw_t ofw) { -#define FDT_MODEL_LEN 80 char model[FDT_MODEL_LEN]; phandle_t root; ssize_t len; From owner-dev-commits-src-main@freebsd.org Thu Jul 22 12:55:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1483065A5AC; Thu, 22 Jul 2021 12:55: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 4GVsr807b6z4k4h; Thu, 22 Jul 2021 12:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF381121C1; Thu, 22 Jul 2021 12:55: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 16MCtZNc042073; Thu, 22 Jul 2021 12:55:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MCtZes042072; Thu, 22 Jul 2021 12:55:35 GMT (envelope-from git) Date: Thu, 22 Jul 2021 12:55:35 GMT Message-Id: <202107221255.16MCtZes042072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: bce17068ac5b - main - arm: allwinner: cir: Reduce verbosity MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bce17068ac5b00799c221b4d114f7a3ff7086727 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 12:55:36 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=bce17068ac5b00799c221b4d114f7a3ff7086727 commit bce17068ac5b00799c221b4d114f7a3ff7086727 Author: Emmanuel Vadot AuthorDate: 2021-07-01 08:24:26 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 12:55:03 +0000 arm: allwinner: cir: Reduce verbosity IR can be noisy in dmesg if it "receive" some unwanted data. Add a tunable hw.aw_cir.debug to enable those message that are only useful if one wants to debug the driver. Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30972 Reviewed by: ganbold MFC after: 1 month --- sys/arm/allwinner/aw_cir.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sys/arm/allwinner/aw_cir.c b/sys/arm/allwinner/aw_cir.c index eabab4cba8f2..855769a7456e 100644 --- a/sys/arm/allwinner/aw_cir.c +++ b/sys/arm/allwinner/aw_cir.c @@ -144,6 +144,13 @@ enum { #define AW_IR_RAW_BUF_SIZE 128 +SYSCTL_NODE(_hw, OID_AUTO, aw_cir, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "aw_cir driver"); + +static int aw_cir_debug = 0; +SYSCTL_INT(_hw_aw_cir, OID_AUTO, debug, CTLFLAG_RWTUN, &aw_cir_debug, 0, + "Debug 1=on 0=off"); + struct aw_ir_softc { device_t dev; struct resource *res[2]; @@ -207,14 +214,14 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) unsigned char val, last; int i, bitcount; - if (bootverbose) + if (bootverbose && __predict_false(aw_cir_debug) != 0) device_printf(sc->dev, "sc->dcnt = %d\n", sc->dcnt); /* Find Lead 1 (bit separator) */ active_delay = AW_IR_ACTIVE_T_VAL * (AW_IR_ACTIVE_T_C_VAL != 0 ? 128 : 1); len = active_delay; - if (bootverbose) + if (bootverbose && __predict_false(aw_cir_debug) != 0) device_printf(sc->dev, "Initial len: %d\n", len); for (i = 0; i < sc->dcnt; i++) { val = sc->buf[i]; @@ -226,10 +233,10 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) len = 0; } } - if (bootverbose) + if (bootverbose && __predict_false(aw_cir_debug) != 0) device_printf(sc->dev, "len = %d\n", len); if ((val & VAL_MASK) || (len <= AW_IR_L1_MIN)) { - if (bootverbose) + if (bootverbose && __predict_false(aw_cir_debug) != 0) device_printf(sc->dev, "Bit separator error\n"); goto error_code; } @@ -246,7 +253,7 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) len += (val & PERIOD_MASK) + 1; } if ((!(val & VAL_MASK)) || (len <= AW_IR_L0_MIN)) { - if (bootverbose) + if (bootverbose && __predict_false(aw_cir_debug) != 0) device_printf(sc->dev, "Bit length error\n"); goto error_code; } @@ -330,7 +337,7 @@ aw_ir_intr(void *arg) /* Read RX interrupt status */ val = READ(sc, AW_IR_RXSTA); - if (bootverbose) + if (bootverbose && __predict_false(aw_cir_debug) != 0) device_printf(sc->dev, "RX interrupt status: %x\n", val); /* Clean all pending interrupt statuses */ @@ -338,7 +345,7 @@ aw_ir_intr(void *arg) /* When Rx FIFO Data available or Packet end */ if (val & (AW_IR_RXINT_RAI_EN | AW_IR_RXINT_RPEI_EN)) { - if (bootverbose) + if (bootverbose && __predict_false(aw_cir_debug) != 0) device_printf(sc->dev, "RX FIFO Data available or Packet end\n"); /* Get available message count in RX FIFO */ @@ -357,7 +364,7 @@ aw_ir_intr(void *arg) if (val & AW_IR_RXINT_RPEI_EN) { /* RX Packet end */ - if (bootverbose) + if (bootverbose && __predict_false(aw_cir_debug) != 0) device_printf(sc->dev, "RX Packet end\n"); ir_code = aw_ir_decode_packets(sc); stat = aw_ir_validate_code(ir_code); @@ -366,7 +373,7 @@ aw_ir_intr(void *arg) EV_MSC, MSC_SCAN, ir_code); evdev_sync(sc->sc_evdev); } - if (bootverbose) { + if (bootverbose && __predict_false(aw_cir_debug) != 0) { device_printf(sc->dev, "Final IR code: %lx\n", ir_code); device_printf(sc->dev, "IR code status: %d\n", From owner-dev-commits-src-main@freebsd.org Thu Jul 22 15:03:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46EA865E999; Thu, 22 Jul 2021 15:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVwgl1L1Wz3MZt; Thu, 22 Jul 2021 15:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 164F514119; Thu, 22 Jul 2021 15:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MF3VZE016662; Thu, 22 Jul 2021 15:03:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MF3VL1016661; Thu, 22 Jul 2021 15:03:31 GMT (envelope-from git) Date: Thu, 22 Jul 2021 15:03:31 GMT Message-Id: <202107221503.16MF3VL1016661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 990a1dbf6fe1 - main - dwmmc: Fix MMCCAM block size support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 990a1dbf6fe1a9f4dc491d3e4e276034919b94f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 15:03:31 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=990a1dbf6fe1a9f4dc491d3e4e276034919b94f3 commit 990a1dbf6fe1a9f4dc491d3e4e276034919b94f3 Author: Emmanuel Vadot AuthorDate: 2021-07-14 15:25:05 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 15:03:14 +0000 dwmmc: Fix MMCCAM block size support When using SDIO the block size if per function and most of the time not equal to MMC_SECTOR_SIZE, fix sdio on dwmmc by setting the correct block size in the mmc registers. MFC after: 1 month Sponsored by: Diablotin Systems --- sys/dev/mmc/host/dwmmc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index b0e13719928a..dce684ed8c7b 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -1153,10 +1153,18 @@ dwmmc_start_cmd(struct dwmmc_softc *sc, struct mmc_command *cmd) cmdr |= SDMMC_CMD_DATA_WRITE; WRITE4(sc, SDMMC_TMOUT, 0xffffffff); - WRITE4(sc, SDMMC_BYTCNT, data->len); - blksz = (data->len < MMC_SECTOR_SIZE) ? \ - data->len : MMC_SECTOR_SIZE; - WRITE4(sc, SDMMC_BLKSIZ, blksz); +#ifdef MMCCAM + if (cmd->data->flags & MMC_DATA_BLOCK_SIZE) { + WRITE4(sc, SDMMC_BLKSIZ, cmd->data->block_size); + WRITE4(sc, SDMMC_BYTCNT, cmd->data->len); + } else +#endif + { + WRITE4(sc, SDMMC_BYTCNT, data->len); + blksz = (data->len < MMC_SECTOR_SIZE) ? \ + data->len : MMC_SECTOR_SIZE; + WRITE4(sc, SDMMC_BLKSIZ, blksz); + } if (sc->use_pio) { pio_prepare(sc, cmd); From owner-dev-commits-src-main@freebsd.org Thu Jul 22 15:44:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DF6265F310; Thu, 22 Jul 2021 15:44: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 4GVxZs1hSfz3kJd; Thu, 22 Jul 2021 15:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2225814743; Thu, 22 Jul 2021 15:44: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 16MFiL2k069806; Thu, 22 Jul 2021 15:44:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MFiLRh069805; Thu, 22 Jul 2021 15:44:21 GMT (envelope-from git) Date: Thu, 22 Jul 2021 15:44:21 GMT Message-Id: <202107221544.16MFiLRh069805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ceri Davies Subject: git: b578d2a77eac - main - man/man7/development.7: correct typo in manpage. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ceri X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b578d2a77eaca6c3b2c76bd90161e32433892723 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 15:44:21 -0000 The branch main has been updated by ceri (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b578d2a77eaca6c3b2c76bd90161e32433892723 commit b578d2a77eaca6c3b2c76bd90161e32433892723 Author: Ceri Davies AuthorDate: 2021-07-22 15:16:43 +0000 Commit: Ceri Davies CommitDate: 2021-07-22 15:43:46 +0000 man/man7/development.7: correct typo in manpage. --- share/man/man7/development.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index a0459ccfad72..805e3c948df9 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -33,7 +33,7 @@ development process .Sh DESCRIPTION .Fx -development is split into three major suprojects: doc, ports, and src. +development is split into three major subprojects: doc, ports, and src. Doc is the documentation, such as the .Fx Handbook. From owner-dev-commits-src-main@freebsd.org Thu Jul 22 15:44:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A46B965F610; Thu, 22 Jul 2021 15:44: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 4GVxZt39XWz3kWD; Thu, 22 Jul 2021 15:44:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BF2414826; Thu, 22 Jul 2021 15:44: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 16MFiMNg069830; Thu, 22 Jul 2021 15:44:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MFiMD2069829; Thu, 22 Jul 2021 15:44:22 GMT (envelope-from git) Date: Thu, 22 Jul 2021 15:44:22 GMT Message-Id: <202107221544.16MFiMD2069829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ceri Davies Subject: git: a52936f1d5d5 - main - man9/VOP_LISTEXTATTR.9: correct grammar in .Nd MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ceri X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a52936f1d5d533dec2e849c1ca001f5ec55d8106 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 15:44:22 -0000 The branch main has been updated by ceri (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a52936f1d5d533dec2e849c1ca001f5ec55d8106 commit a52936f1d5d533dec2e849c1ca001f5ec55d8106 Author: Ceri Davies AuthorDate: 2021-07-22 15:22:05 +0000 Commit: Ceri Davies CommitDate: 2021-07-22 15:43:46 +0000 man9/VOP_LISTEXTATTR.9: correct grammar in .Nd --- share/man/man9/VOP_LISTEXTATTR.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/VOP_LISTEXTATTR.9 b/share/man/man9/VOP_LISTEXTATTR.9 index 0900099b1d6c..40fa880e80c0 100644 --- a/share/man/man9/VOP_LISTEXTATTR.9 +++ b/share/man/man9/VOP_LISTEXTATTR.9 @@ -35,7 +35,7 @@ .Os .Sh NAME .Nm VOP_LISTEXTATTR -.Nd retrieve a list of named extended attribute from a vnode +.Nd retrieve a list of named extended attributes from a vnode .Sh SYNOPSIS .In sys/param.h .In sys/vnode.h From owner-dev-commits-src-main@freebsd.org Thu Jul 22 16:23:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8C4965FFDF; Thu, 22 Jul 2021 16: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 4GVyS75qY3z3qln; Thu, 22 Jul 2021 16:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3D7915303; Thu, 22 Jul 2021 16: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 16MGNZYf023291; Thu, 22 Jul 2021 16: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 16MGNZDu023290; Thu, 22 Jul 2021 16:23:35 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:23:35 GMT Message-Id: <202107221623.16MGNZDu023290@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: 6c9506559080 - main - Escape any '.' characters in sysctl node names 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: 6c9506559080da2914749bf611225d7c0a153609 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:23:35 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=6c9506559080da2914749bf611225d7c0a153609 commit 6c9506559080da2914749bf611225d7c0a153609 Author: Alan Somers AuthorDate: 2021-07-21 21:11:00 +0000 Commit: Alan Somers CommitDate: 2021-07-22 16:22:48 +0000 Escape any '.' characters in sysctl node names ZFS creates some sysctl nodes that include a pool name, and '.' is an allowed character in pool names. But it's the separator in the sysctl tree, so it can't be included in a sysctl name. Replace it with "%25". Handily, "%" is illegal in ZFS pool names, so there's no ambiguity there. PR: 257316 MFC after: 3 weeks Sponsored by: Axcient Reviewed by: freqlabs Differential Revision: https://reviews.freebsd.org/D31265 --- sys/kern/kern_sysctl.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index e46584758c9b..c472db18aac7 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -122,6 +122,7 @@ static int sysctl_root(SYSCTL_HANDLER_ARGS); /* Root list */ struct sysctl_oid_list sysctl__children = SLIST_HEAD_INITIALIZER(&sysctl__children); +static char* sysctl_escape_name(const char*); static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse); static int sysctl_old_kernel(struct sysctl_req *, const void *, size_t); @@ -747,6 +748,46 @@ sysctl_remove_name(struct sysctl_oid *parent, const char *name, return (error); } +/* + * Duplicate the provided string, escaping any illegal characters. The result + * must be freed when no longer in use. + * + * The list of illegal characters is ".". + */ +static char* +sysctl_escape_name(const char* orig) +{ + int i, s = 0, d = 0, nillegals = 0; + char *new; + + /* First count the number of illegal characters */ + for (i = 0; orig[i] != '\0'; i++) { + if (orig[i] == '.') + nillegals++; + } + + /* Allocate storage for new string */ + new = malloc(i + 2 * nillegals + 1, M_SYSCTLOID, M_WAITOK); + + /* Copy the name, escaping characters as we go */ + while (orig[s] != '\0') { + if (orig[s] == '.') { + /* %25 is the hexadecimal representation of '.' */ + new[d++] = '%'; + new[d++] = '2'; + new[d++] = '5'; + s++; + } else { + new[d++] = orig[s++]; + } + } + + /* Finally, nul-terminate */ + new[d] = '\0'; + + return (new); +} + static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse) { @@ -828,14 +869,17 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, const char *label) { struct sysctl_oid *oidp; + char *escaped; /* You have to hook up somewhere.. */ if (parent == NULL) return(NULL); + escaped = sysctl_escape_name(name); /* Check if the node already exists, otherwise create it */ SYSCTL_WLOCK(); - oidp = sysctl_find_oidname(name, parent); + oidp = sysctl_find_oidname(escaped, parent); if (oidp != NULL) { + free(escaped, M_SYSCTLOID); if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_NODE) { oidp->oid_refcnt++; /* Update the context */ @@ -854,7 +898,7 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, SLIST_INIT(&oidp->oid_children); oidp->oid_number = number; oidp->oid_refcnt = 1; - oidp->oid_name = strdup(name, M_SYSCTLOID); + oidp->oid_name = escaped; oidp->oid_handler = handler; oidp->oid_kind = CTLFLAG_DYN | kind; oidp->oid_arg1 = arg1; From owner-dev-commits-src-main@freebsd.org Thu Jul 22 16:32:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13DE365FE3F; Thu, 22 Jul 2021 16:32:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_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 4GVyfD6MZHz3smW; Thu, 22 Jul 2021 16:32:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5A60A2600F3; Thu, 22 Jul 2021 18:32:12 +0200 (CEST) Subject: Re: git: 6c9506559080 - main - Escape any '.' characters in sysctl node names To: Alan Somers , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202107221623.16MGNZDu023290@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <9fe74162-d1f9-623c-3a9e-d41139729aab@selasky.org> Date: Thu, 22 Jul 2021 18:32:00 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <202107221623.16MGNZDu023290@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GVyfD6MZHz3smW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:32:21 -0000 On 7/22/21 6:23 PM, Alan Somers wrote: > commit 6c9506559080da2914749bf611225d7c0a153609 > Author: Alan Somers > AuthorDate: 2021-07-21 21:11:00 +0000 > Commit: Alan Somers > CommitDate: 2021-07-22 16:22:48 +0000 If the strings come from user-input or hardware, why not just allow a-z and 0-9 and a few other characters? There are surely more illegal characters than just '.', like \n \r \t that we don't want to see in sysctl names. --HPS From owner-dev-commits-src-main@freebsd.org Thu Jul 22 16:39:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77F51660339; Thu, 22 Jul 2021 16:39:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVyny2qc0z3tlK; Thu, 22 Jul 2021 16:39:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f178.google.com with SMTP id t143so7212556oie.8; Thu, 22 Jul 2021 09:39:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n+b48HCVQXeviP+aZbekddzrhWxCh7RQHAFW2uBmutY=; b=OfXuUz+CM1n0cBfEX0dqdTWwGv8EffMJquj4KM/UIc31vrYkpIEuD0za5xbHoax7RH eXObTmERUYNGwlTUI6z3uS4UvUIQwQVNCIgR6kbARqGRsJat4iadqhEK7QmGmpdV/zQ/ hBEwWot9G/HWqyeXFE89E86Kbe9qtVLOv9WMRLkdAC+YGAOP96ql7+i9f2NhVugUChTT dShRvm3JMWS6w62EXmUjDC2aXL7rwIc9bP9KCa3VP7n7DMSUiCZWHKt6CjjvcBCL2TWi E1jUsFg7otEmT6UU14/y1ICLHPzGi1l+xJYr+78WeJbUEMxTBPzrm3NMEkVzl5Db8zWi yi3w== X-Gm-Message-State: AOAM531mjUP0wRug5BToFokGD5fOYyjgau1TvKgqZxu3E0WukHSiG6c3 o4dqNiOuEpx9UvOUnsWDPGv9P/bcjNp2Y+wxIEyvKt3Jpz4= X-Google-Smtp-Source: ABdhPJwQbCT7A1HD0tDaprOELh22EqJXIISS8+KNUDQvM+M5e3t5XIdRTdlldi+fE2Cr1NbHnrnMmS7WnovA0qylwuk= X-Received: by 2002:aca:4814:: with SMTP id v20mr595268oia.73.1626971941209; Thu, 22 Jul 2021 09:39:01 -0700 (PDT) MIME-Version: 1.0 References: <202107221623.16MGNZDu023290@gitrepo.freebsd.org> <9fe74162-d1f9-623c-3a9e-d41139729aab@selasky.org> In-Reply-To: <9fe74162-d1f9-623c-3a9e-d41139729aab@selasky.org> From: Alan Somers Date: Thu, 22 Jul 2021 10:38:50 -0600 Message-ID: Subject: Re: git: 6c9506559080 - main - Escape any '.' characters in sysctl node names To: Hans Petter Selasky Cc: src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4GVyny2qc0z3tlK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:39:02 -0000 Because if we reject invalid sysctl names, then we'll have to perform the escaping in (potentially many) more places. The only source of invalid sysctl names that I know of are ZFS pools. ZFS does allow space in pool names, and sysctl(8) works with spaces as long as you quote them on the command line. It does not allow tabs or newlines. I didn't check any other nonprintable characters. We can certainly add other characters to the escape list if needed. -Alan On Thu, Jul 22, 2021 at 10:32 AM Hans Petter Selasky wrote: > On 7/22/21 6:23 PM, Alan Somers wrote: > > commit 6c9506559080da2914749bf611225d7c0a153609 > > Author: Alan Somers > > AuthorDate: 2021-07-21 21:11:00 +0000 > > Commit: Alan Somers > > CommitDate: 2021-07-22 16:22:48 +0000 > > If the strings come from user-input or hardware, why not just allow a-z > and 0-9 and a few other characters? > > There are surely more illegal characters than just '.', like \n \r \t > that we don't want to see in sysctl names. > > --HPS > From owner-dev-commits-src-main@freebsd.org Thu Jul 22 16:57:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDA5F661523; Thu, 22 Jul 2021 16:57: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 4GVzCF5yQXz4S14; Thu, 22 Jul 2021 16:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4B85156EA; Thu, 22 Jul 2021 16:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGvTJl063188; Thu, 22 Jul 2021 16:57:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGvTn5063187; Thu, 22 Jul 2021 16:57:29 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:57:29 GMT Message-Id: <202107221657.16MGvTn5063187@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: 18c696c00159 - main - man9: Remove stray .In macros 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: 18c696c00159d1071ed17e3bed1863e412dd5cb5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:57:30 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=18c696c00159d1071ed17e3bed1863e412dd5cb5 commit 18c696c00159d1071ed17e3bed1863e412dd5cb5 Author: Mark Johnston AuthorDate: 2021-07-22 16:47:43 +0000 Commit: Mark Johnston CommitDate: 2021-07-22 16:47:43 +0000 man9: Remove stray .In macros Fixes: 9c11d8d483c4 MFC after: 1 week --- share/man/man9/fetch.9 | 1 - share/man/man9/store.9 | 1 - 2 files changed, 2 deletions(-) diff --git a/share/man/man9/fetch.9 b/share/man/man9/fetch.9 index 5384c4f9204e..53927eb82584 100644 --- a/share/man/man9/fetch.9 +++ b/share/man/man9/fetch.9 @@ -67,7 +67,6 @@ .Fn fueword32 "volatile const void *base" "int32_t *val" .Ft int .Fn fueword64 "volatile const void *base" "int64_t *val" -.In sys/resourcevar.h .Sh DESCRIPTION The .Nm diff --git a/share/man/man9/store.9 b/share/man/man9/store.9 index 40a6d7e2b216..089949e53938 100644 --- a/share/man/man9/store.9 +++ b/share/man/man9/store.9 @@ -56,7 +56,6 @@ .Fn suword32 "volatile void *base" "int32_t word" .Ft int .Fn suword64 "volatile void *base" "int64_t word" -.In sys/resourcevar.h .Sh DESCRIPTION The .Nm From owner-dev-commits-src-main@freebsd.org Thu Jul 22 16:59:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EF78661680; Thu, 22 Jul 2021 16:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzG30rHtz4S78; Thu, 22 Jul 2021 16:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F386A152DB; Thu, 22 Jul 2021 16:59: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 16MGxsAk063453; Thu, 22 Jul 2021 16:59:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGxsUH063452; Thu, 22 Jul 2021 16:59:54 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:59:54 GMT Message-Id: <202107221659.16MGxsUH063452@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: 4f831830fa07 - main - [skip ci] fix syntax in CODEOWNERS 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: 4f831830fa07cbede2601501d5055b3252587d32 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:59:55 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4f831830fa07cbede2601501d5055b3252587d32 commit 4f831830fa07cbede2601501d5055b3252587d32 Author: Alan Somers AuthorDate: 2021-06-21 18:20:51 +0000 Commit: Alan Somers CommitDate: 2021-07-22 16:58:54 +0000 [skip ci] fix syntax in CODEOWNERS * Fix invalid usernames - Fix spelling of ngie-eign - Delete users who aren't members of the FreeBSD org * Fix spelling of usr.bin/fetch in CODEOWNERS * rm "a directory anywhere in the repo" patterns from CODEOWNERS Even though they're documented as working, in practice they don't. https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#codeowners-file-location MFC after: 2 weeks Sponsored by: Axcient Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D30849 --- .github/CODEOWNERS | 62 ++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index de6f0c72f471..f64ce9d91d15 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -31,73 +31,71 @@ # revision or makes a commit to the specified subtree. # *** -autofs/ @trasz -iscsi/ @trasz -kqueue/ @jmgurney -libpam/ @dag-erling -linprocfs/ @dag-erling -opencrypto/ @jmgurney -openssl/ @juikim -procfs/ @dag-erling -pseudofs/ @dag-erling -rctl/ @trasz -vmm/ @bsdjhb @grehan-freebsd /bin/sh @jillest -/contrib/atf @ngie -/contrib/capsicum-test @ngie -/contrib/googletest @ngie +/contrib/atf @ngie-eign +/contrib/capsicum-test @ngie-eign +/contrib/googletest @ngie-eign /contrib/ipfilter @cschuber /contrib/libcxxrt @DimitryAndric @emaste /contrib/llvm-project @DimitryAndric /contrib/llvm-project/libunwind @DimitryAndric @emaste @bsdjhb /contrib/llvm-project/lldb @DimitryAndric @emaste /contrib/llvm-project/openmp @DimitryAndric @emaste -/contrib/netbsd-tests @ngie -/contrib/pjdfstest @ngie @asomers +/contrib/netbsd-tests @ngie-eign +/contrib/netbsd-tests/crypto/opencrypto/ @jmgurney +/contrib/netbsd-tests/kernel/kqueue/ @jmgurney +/contrib/openpam/lib/libpam/ @dag-erling +/contrib/pjdfstest @ngie-eign @asomers /crypto/openssh @dag-erling +/crypto/openssl/ @juikim /etc/mail @gshapiro /etc/sendmail @gshapiro /lib/libc/sys/kevent.c @jmgurney -/lib/libdpv @devinteske /lib/libfetch @dag-erling /lib/libfigpar @dag-erling +/lib/libpam/ @dag-erling /lib/libvmmapi @bsdjhb @grehan-freebsd +/libexec/rc/rc.d/rctl/ @trasz /sbin/mount_fusefs @asomers -/share/mk @bsdimp @bapt @bdrewery @emaste @sgerraty -/stand/forth @devinteske +/secure/usr.bin/openssl/ @juikim +/share/mk @bsdimp @bapt @bdrewery @emaste /stand/lua @kevans91 /sys/amd64/pci @bsdimp @bsdjhb +/sys/amd64/vmm/ @bsdjhb @grehan-freebsd /sys/arm/allwinner @evadot /sys/arm64/rockchip @evadot +/sys/compat/linprocfs/ @dag-erling /sys/compat/linuxkpi @hselasky -/sys/contrib/dev/ice @ricera /sys/contrib/ipfilter @cschuber +/sys/crypto/openssl/ @juikim /sys/dev/drm2 @bsdimp -/sys/dev/e1000 @ricera -/sys/dev/ice @ricera -/sys/dev/ixgbe @ricera -/sys/dev/ixl @ricera -/sys/dev/ofw @nwhitehorn +/sys/dev/iscsi/ @trasz /sys/dev/pci @bsdimp @bsdjhb /sys/dev/sound/usb @hselasky /sys/dev/usb @hselasky +/sys/fs/autofs/ @trasz /sys/fs/fuse/ @asomers +/sys/fs/procfs/ @dag-erling +/sys/fs/pseudofs/ @dag-erling /sys/kern/vfs_aio.c @asomers /sys/netinet/ip_carp.c @glebius -/sys/netinet/sctp_* @tuexen -/sys/netpfil/pf @kprovost @glebius +/sys/netpfil/pf @glebius +/sys/opencrypto/ @jmgurney /sys/x86/pci @bsdimp @bsdjhb -/tests @ngie +/tests @ngie-eign /tests/sys/aio/ @asomers /tests/sys/fs/fusefs/ @asomers +/tests/sys/kqueue/ @jmgurney +/tests/sys/opencrypto/ @jmgurney /tools/build @bsdimp +/tools/regression/iscsi/ @trasz +/tools/regression/sockets/kqueue/ @jmgurney /tools/tools/nanobsd @bsdimp -/usr.bin/dpv @devinteske +/usr.bin/fetch @dag-erling +/usr.bin/rctl/ @trasz /usr.bin/top @grimreaper +/usr.sbin/autofs/ @trasz /usr.sbin/bhyve @bsdjhb @grehan-freebsd /usr.sbin/bhyvectl @bsdjhb @grehan-freebsd /usr.sbin/bhyveload @bsdjhb @grehan-freebsd -/usr.sbin/bsdconfig @devinteske /usr.sbin/lpr @gbergling -/usr.sbin/sysrc @devinteske -/usr/bin/fetch @dag-erling From owner-dev-commits-src-main@freebsd.org Thu Jul 22 17:02:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DD3D661828; Thu, 22 Jul 2021 17:02: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 4GVzK06nBxz4T03; Thu, 22 Jul 2021 17:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D035815C02; Thu, 22 Jul 2021 17:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MH2SCU077548; Thu, 22 Jul 2021 17:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MH2Sqs077547; Thu, 22 Jul 2021 17:02:28 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:02:28 GMT Message-Id: <202107221702.16MH2Sqs077547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: ab38c12b4a48 - main - vmci(4): Shorten interrupt descriptions. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab38c12b4a488c011ea85252621430ded6e87139 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:02:29 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=ab38c12b4a488c011ea85252621430ded6e87139 commit ab38c12b4a488c011ea85252621430ded6e87139 Author: Alexander Motin AuthorDate: 2021-07-22 16:58:10 +0000 Commit: Alexander Motin CommitDate: 2021-07-22 17:02:23 +0000 vmci(4): Shorten interrupt descriptions. We have no space there for such a long strings. Also it makes no sense to set description if there is only one interrupt. MFC after: 2 weeks --- sys/dev/vmware/vmci/vmci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/vmware/vmci/vmci.c b/sys/dev/vmware/vmci/vmci.c index 91fcb39ed6ed..bbf17bbe7e41 100644 --- a/sys/dev/vmware/vmci/vmci.c +++ b/sys/dev/vmware/vmci/vmci.c @@ -845,17 +845,17 @@ vmci_setup_interrupts(struct vmci_softc *sc) vmci_interrupt, NULL, &intr->vmci_handler); if (error) return (error); - bus_describe_intr(sc->vmci_dev, intr->vmci_irq, intr->vmci_handler, - "vmci_interrupt"); if (sc->vmci_num_intr == 2) { + bus_describe_intr(sc->vmci_dev, intr->vmci_irq, + intr->vmci_handler, "dg"); intr = &sc->vmci_intrs[1]; error = bus_setup_intr(sc->vmci_dev, intr->vmci_irq, flags, NULL, vmci_interrupt_bm, NULL, &intr->vmci_handler); if (error) return (error); bus_describe_intr(sc->vmci_dev, intr->vmci_irq, - intr->vmci_handler, "vmci_interrupt_bm"); + intr->vmci_handler, "bm"); } return (0); From owner-dev-commits-src-main@freebsd.org Thu Jul 22 17:51:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 542E5663405; Thu, 22 Jul 2021 17:51: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 4GW0Q61gvSz4cTt; Thu, 22 Jul 2021 17:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21013165A0; Thu, 22 Jul 2021 17:51: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 16MHpwKr045395; Thu, 22 Jul 2021 17:51:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHpw6h045394; Thu, 22 Jul 2021 17:51:58 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:51:58 GMT Message-Id: <202107221751.16MHpw6h045394@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: fd5827b1785a - main - man9: Update guarantees for userspace fetch/store operations 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: fd5827b1785a9363abe601cbd9d8558b0fc8d3e8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:51:58 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fd5827b1785a9363abe601cbd9d8558b0fc8d3e8 commit fd5827b1785a9363abe601cbd9d8558b0fc8d3e8 Author: Mark Johnston AuthorDate: 2021-07-22 17:08:42 +0000 Commit: Mark Johnston CommitDate: 2021-07-22 17:40:39 +0000 man9: Update guarantees for userspace fetch/store operations Platforms may either silently handle unaligned accesses or return an error. Atomicity is not guaranteed in this case, however. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31282 --- share/man/man9/fetch.9 | 8 +++++--- share/man/man9/store.9 | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/share/man/man9/fetch.9 b/share/man/man9/fetch.9 index 53927eb82584..16acb542c625 100644 --- a/share/man/man9/fetch.9 +++ b/share/man/man9/fetch.9 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2020 +.Dd July 22, 2021 .Dt FETCH 9 .Os .Sh NAME @@ -72,8 +72,10 @@ The .Nm functions are designed to copy small amounts of data from user-space of the current process. -If read is successful, it is performed atomically. -The data read must be naturally aligned. +If the user address is naturally aligned, then the operation will be +performed atomically. +Otherwise it may fail or be performed non-atomically, depending on +the platform. .Pp The .Nm diff --git a/share/man/man9/store.9 b/share/man/man9/store.9 index 089949e53938..6492fdbc3924 100644 --- a/share/man/man9/store.9 +++ b/share/man/man9/store.9 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2018 +.Dd July 22, 2021 .Dt STORE 9 .Os .Sh NAME @@ -60,8 +60,10 @@ The .Nm functions are designed to copy small amounts of data to user-space. -If write is successful, it is performed atomically. -The data written must be naturally aligned. +If the user address is naturally aligned, then the operation will be +performed atomically. +Otherwise it may fail or be performed non-atomically, depending on +the platform. .Pp The .Nm From owner-dev-commits-src-main@freebsd.org Thu Jul 22 17:51:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 846BA66329E; Thu, 22 Jul 2021 17:51: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 4GW0Q72tMkz4ctJ; Thu, 22 Jul 2021 17:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AFD715EE4; Thu, 22 Jul 2021 17:51: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 16MHpx6P045426; Thu, 22 Jul 2021 17:51:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHpxSV045425; Thu, 22 Jul 2021 17:51:59 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:51:59 GMT Message-Id: <202107221751.16MHpxSV045425@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: d5341d72a11b - main - mmc: Drain the intrhook in mmc_detach() 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: d5341d72a11be200e536ac7d8967449a3f521792 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:51:59 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d5341d72a11be200e536ac7d8967449a3f521792 commit d5341d72a11be200e536ac7d8967449a3f521792 Author: Yang Zhong AuthorDate: 2021-07-22 17:16:01 +0000 Commit: Mark Johnston CommitDate: 2021-07-22 17:50:10 +0000 mmc: Drain the intrhook in mmc_detach() Buggy SD card drivers may attach and detach a mmc(4) driver instance in quick succession. In this case mmc(4) must disestablish its intrhook callback during detach. Thus, this change adds a call to config_intrhook_drain(), which blocks or does nothing if the intrhook is running or has already ran (the SD card was plugged in), and disestablishes the hook if it hasn't ran yet (the SD card was not plugged in). PR: 254373 Reviewed by: imp, manu, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31262 --- sys/dev/mmc/mmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c index a55ec671bdb0..29b3645beadd 100644 --- a/sys/dev/mmc/mmc.c +++ b/sys/dev/mmc/mmc.c @@ -271,6 +271,7 @@ mmc_detach(device_t dev) struct mmc_softc *sc = device_get_softc(dev); int err; + config_intrhook_drain(&sc->config_intrhook); err = mmc_delete_cards(sc, true); if (err != 0) return (err); From owner-dev-commits-src-main@freebsd.org Thu Jul 22 19:04:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 019A166440A; Thu, 22 Jul 2021 19:04: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 4GW21f6Dc3z4q9C; Thu, 22 Jul 2021 19:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDA4717581; Thu, 22 Jul 2021 19:04: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 16MJ4MeI039773; Thu, 22 Jul 2021 19:04:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MJ4M6S039772; Thu, 22 Jul 2021 19:04:22 GMT (envelope-from git) Date: Thu, 22 Jul 2021 19:04:22 GMT Message-Id: <202107221904.16MJ4M6S039772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 4a235049082e - main - riscv: Fix pmap_kextract racing with concurrent superpage promotion/demotion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a235049082ee1cb044873ad9aff12cf73d0fd3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 19:04:23 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=4a235049082ee1cb044873ad9aff12cf73d0fd3b commit 4a235049082ee1cb044873ad9aff12cf73d0fd3b Author: Jessica Clarke AuthorDate: 2021-07-22 19:02:14 +0000 Commit: Jessica Clarke CommitDate: 2021-07-22 19:02:14 +0000 riscv: Fix pmap_kextract racing with concurrent superpage promotion/demotion This repeats amd64's cfcbf8c6fd3b (r180498) and i386's cf3508519c5e (r202894) but for riscv; pmap_kextract must be lock-free and so it can race with superpage promotion and demotion, thus the L2 entry must only be loaded once to avoid using inconsistent state. PR: 250866 Reviewed by: markj, mhorne Tested by: David Gilbert MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31253 --- sys/riscv/riscv/pmap.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 39595b10d7b2..0bb22bd13bbe 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -872,7 +872,7 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) vm_paddr_t pmap_kextract(vm_offset_t va) { - pd_entry_t *l2; + pd_entry_t *l2, l2e; pt_entry_t *l3; vm_paddr_t pa; @@ -882,14 +882,23 @@ pmap_kextract(vm_offset_t va) l2 = pmap_l2(kernel_pmap, va); if (l2 == NULL) panic("pmap_kextract: No l2"); - if ((pmap_load(l2) & PTE_RX) != 0) { + l2e = pmap_load(l2); + /* + * Beware of concurrent promotion and demotion! We must + * use l2e rather than loading from l2 multiple times to + * ensure we see a consistent state, including the + * implicit load in pmap_l2_to_l3. It is, however, safe + * to use an old l2e because the L3 page is preserved by + * promotion. + */ + if ((l2e & PTE_RX) != 0) { /* superpages */ - pa = L2PTE_TO_PHYS(pmap_load(l2)); + pa = L2PTE_TO_PHYS(l2e); pa |= (va & L2_OFFSET); return (pa); } - l3 = pmap_l2_to_l3(l2, va); + l3 = pmap_l2_to_l3(&l2e, va); if (l3 == NULL) panic("pmap_kextract: No l3..."); pa = PTE_TO_PHYS(pmap_load(l3)); From owner-dev-commits-src-main@freebsd.org Thu Jul 22 19:23:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6CE1664985; Thu, 22 Jul 2021 19:23: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 4GW2Rv4Jbpz4srH; Thu, 22 Jul 2021 19:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C768178A1; Thu, 22 Jul 2021 19:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MJNd6A066420; Thu, 22 Jul 2021 19:23:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MJNdAw066419; Thu, 22 Jul 2021 19:23:39 GMT (envelope-from git) Date: Thu, 22 Jul 2021 19:23:39 GMT Message-Id: <202107221923.16MJNdAw066419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Pedro F. Giffuni" Subject: git: c384a27805a6 - main - patch: cleanup variable initialization a bit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pfg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c384a27805a630ae45ca3d97614a07ebfce5515d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 19:23:39 -0000 The branch main has been updated by pfg: URL: https://cgit.FreeBSD.org/src/commit/?id=c384a27805a630ae45ca3d97614a07ebfce5515d commit c384a27805a630ae45ca3d97614a07ebfce5515d Author: Pedro F. Giffuni AuthorDate: 2021-07-22 19:09:17 +0000 Commit: Pedro F. Giffuni CommitDate: 2021-07-22 19:23:22 +0000 patch: cleanup variable initialization a bit. musl libc fgetln is a bit more pickier. Hinted by: chimera-linux (git 31491e1de2e1241885984cd9e4b978965f14eda4) --- usr.bin/patch/inp.c | 4 +++- usr.bin/patch/pch.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c index 6a01f782ce62..99be70957f06 100644 --- a/usr.bin/patch/inp.c +++ b/usr.bin/patch/inp.c @@ -284,7 +284,7 @@ static void plan_b(const char *filename) { FILE *ifp; - size_t i = 0, j, len, maxlen = 1; + size_t i, j, len, maxlen; char *lbuf = NULL, *p; bool found_revision = (revision == NULL); @@ -294,6 +294,8 @@ plan_b(const char *filename) unlink(TMPINNAME); if ((tifd = open(TMPINNAME, O_EXCL | O_CREAT | O_WRONLY, 0666)) < 0) pfatal("can't open file %s", TMPINNAME); + len = 0; + maxlen = 1; while ((p = fgetln(ifp, &len)) != NULL) { if (p[len - 1] == '\n') p[len - 1] = '\0'; diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c index 70051640cf0c..d1d71f95644c 100644 --- a/usr.bin/patch/pch.c +++ b/usr.bin/patch/pch.c @@ -1215,7 +1215,7 @@ size_t pgets(bool do_indent) { char *line; - size_t len; + size_t len = 0; int indent = 0, skipped = 0; line = fgetln(pfp, &len); From owner-dev-commits-src-main@freebsd.org Thu Jul 22 20:03:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50E74664E06; Thu, 22 Jul 2021 20:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GW3Kr1cgTz3G6V; Thu, 22 Jul 2021 20:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EA6A18245; Thu, 22 Jul 2021 20:03: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 16MK3S0V019675; Thu, 22 Jul 2021 20:03:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MK3SLO019674; Thu, 22 Jul 2021 20:03:28 GMT (envelope-from git) Date: Thu, 22 Jul 2021 20:03:28 GMT Message-Id: <202107222003.16MK3SLO019674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: 95f0da5be1e3 - main - bsdinstall: Only show menu if there are more items to be installed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95f0da5be1e3456c930f5f9538cbc099c65f2014 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 20:03:28 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=95f0da5be1e3456c930f5f9538cbc099c65f2014 commit 95f0da5be1e3456c930f5f9538cbc099c65f2014 Author: Renato Botelho AuthorDate: 2021-07-22 20:02:34 +0000 Commit: Glen Barber CommitDate: 2021-07-22 20:02:34 +0000 bsdinstall: Only show menu if there are more items to be installed MFC after: 3 days Obtained from: Rubicon Communications, LLC ("Netgate") Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.sbin/bsdinstall/scripts/auto | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index 68809a22671b..9f8946880f61 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -157,16 +157,18 @@ if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST` DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')" - exec 3>&1 - EXTRA_DISTS=$( eval dialog \ - --backtitle \"FreeBSD Installer\" \ - --title \"Distribution Select\" --nocancel --separate-output \ - --checklist \"Choose optional system components to install:\" \ - 0 0 0 $DISTMENU \ - 2>&1 1>&3 ) - for dist in $EXTRA_DISTS; do - export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" - done + if [ -n "$DISTMENU" ]; then + exec 3>&1 + EXTRA_DISTS=$( eval dialog \ + --backtitle \"FreeBSD Installer\" \ + --title \"Distribution Select\" --nocancel --separate-output \ + --checklist \"Choose optional system components to install:\" \ + 0 0 0 $DISTMENU \ + 2>&1 1>&3 ) + for dist in $EXTRA_DISTS; do + export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz" + done + fi fi FETCH_DISTRIBUTIONS="" From owner-dev-commits-src-main@freebsd.org Fri Jul 23 01:17:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49749669580; Fri, 23 Jul 2021 01:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWBHk162Jz4rF9; Fri, 23 Jul 2021 01:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A88E1C0FE; Fri, 23 Jul 2021 01:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16N1H5uI034261; Fri, 23 Jul 2021 01:17:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16N1H5Oc034260; Fri, 23 Jul 2021 01:17:05 GMT (envelope-from git) Date: Fri, 23 Jul 2021 01:17:05 GMT Message-Id: <202107230117.16N1H5Oc034260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 3f9d360c82e0 - main - zfs: merge openzfs/zfs@14b43fbd9 (master) into main MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f9d360c82e0724bfb61346038236bf15c5d4d84 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 01:17:06 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=3f9d360c82e0724bfb61346038236bf15c5d4d84 commit 3f9d360c82e0724bfb61346038236bf15c5d4d84 Merge: 95f0da5be1e3 14b43fbd9c13 Author: Martin Matuska AuthorDate: 2021-07-23 00:50:13 +0000 Commit: Martin Matuska CommitDate: 2021-07-23 00:50:13 +0000 zfs: merge openzfs/zfs@14b43fbd9 (master) into main Notable upstream pull request merges: #12271 Tinker with slop space accounting with dedup #12279 Fix ARC ghost states eviction accounting #12284 Add Module Parameter Regarding Log Size Limit #12300 Introduce dsl_dir_diduse_transfer_space() #12314 Optimize allocation throttling #12348 Minor ARC optimizations #12350 Detect HAVE_LARGE_STACKS at compile time #12356 Use SET_ERROR for more errors in FreeBSD vnops #12375 FreeBSD: Ignore make_dev_s() errors #12378 FreeBSD: Switch from MAXPHYS to maxphys on FreeBSD 13+ Obtained from: OpenZFS OpenZFS commit: 14b43fbd9c13d802409ed886bb6b66fd528fb209 .../openzfs/.github/workflows/checkstyle.yaml | 14 ++ sys/contrib/openzfs/.github/workflows/zloop.yml | 2 +- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 2 +- .../openzfs/cmd/zpool_influxdb/zpool_influxdb.c | 3 +- sys/contrib/openzfs/config/Rules.am | 1 - .../openzfs/config/kernel-config-defined.m4 | 31 --- sys/contrib/openzfs/config/user-libatomic.m4 | 34 ++-- .../include/os/freebsd/zfs/sys/zfs_context_os.h | 4 + .../include/os/linux/zfs/sys/zfs_context_os.h | 5 + sys/contrib/openzfs/include/sys/arc.h | 2 +- sys/contrib/openzfs/include/sys/arc_impl.h | 12 +- sys/contrib/openzfs/include/sys/dmu_tx.h | 1 + sys/contrib/openzfs/include/sys/dsl_dir.h | 3 + sys/contrib/openzfs/include/sys/dsl_pool.h | 7 + sys/contrib/openzfs/include/sys/metaslab_impl.h | 2 +- sys/contrib/openzfs/include/sys/spa_impl.h | 15 +- sys/contrib/openzfs/include/sys/zio.h | 4 +- .../libspl/include/os/freebsd/sys/zfs_context_os.h | 1 + .../libspl/include/os/linux/sys/zfs_context_os.h | 3 + sys/contrib/openzfs/lib/libzfs/libzfs_impl.h | 3 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 73 ++++---- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 3 +- .../openzfs/lib/libzfs/os/freebsd/libzfs_zmount.c | 2 +- .../openzfs/lib/libzfs/os/linux/libzfs_mount_os.c | 2 +- sys/contrib/openzfs/man/man4/zfs.4 | 36 ++-- sys/contrib/openzfs/man/man8/zfs-send.8 | 10 +- sys/contrib/openzfs/module/nvpair/nvpair.c | 64 ++++++- sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c | 2 - .../openzfs/module/os/freebsd/zfs/vdev_geom.c | 4 + .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 45 +++-- .../openzfs/module/os/freebsd/zfs/zvol_os.c | 31 +-- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 8 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 19 +- sys/contrib/openzfs/module/zfs/arc.c | 207 ++++++++++++--------- sys/contrib/openzfs/module/zfs/ddt.c | 2 +- sys/contrib/openzfs/module/zfs/dmu_redact.c | 2 + sys/contrib/openzfs/module/zfs/dmu_tx.c | 7 + sys/contrib/openzfs/module/zfs/dsl_dataset.c | 10 +- sys/contrib/openzfs/module/zfs/dsl_dir.c | 112 +++++++---- sys/contrib/openzfs/module/zfs/dsl_pool.c | 57 ++++++ sys/contrib/openzfs/module/zfs/metaslab.c | 20 +- sys/contrib/openzfs/module/zfs/spa.c | 12 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 39 ++-- sys/contrib/openzfs/module/zfs/zcp_synctask.c | 15 +- sys/contrib/openzfs/module/zfs/zfs_log.c | 5 + sys/contrib/openzfs/module/zfs/zil.c | 5 +- sys/contrib/openzfs/module/zfs/zio.c | 51 +++-- sys/contrib/openzfs/module/zfs/zvol.c | 22 ++- sys/contrib/openzfs/scripts/zloop.sh | 60 +++--- sys/modules/zfs/zfs_config.h | 7 +- 50 files changed, 670 insertions(+), 411 deletions(-) diff --cc sys/modules/zfs/zfs_config.h index 87b0ae33fb81,000000000000..f3b53d243ae3 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,846 -1,0 +1,843 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAPPED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + - /* kernel has large stacks */ - /* #undef HAVE_LARGE_STACKS */ - +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* ->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->getattr() takes a vfsmount */ +/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */ + +/* aops->direct_IO() uses iovec */ +/* #undef HAVE_VFS_DIRECT_IO_IOVEC */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* aops->direct_IO() uses iov_iter with rw and offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + +/* fops->iterate() is available */ +/* #undef HAVE_VFS_ITERATE */ + +/* fops->iterate_shared() is available */ +/* #undef HAVE_VFS_ITERATE_SHARED */ + +/* fops->readdir() is available */ +/* #undef HAVE_VFS_READDIR */ + +/* fops->read/write_iter() are available */ +/* #undef HAVE_VFS_RW_ITERATE */ + +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* yes */ +/* #undef HAVE_WAIT_ON_BIT_ACTION */ + +/* wait_queue_entry_t exists */ +/* #undef HAVE_WAIT_QUEUE_ENTRY_T */ + +/* wq_head->head and wq_entry->entry exist */ +/* #undef HAVE_WAIT_QUEUE_HEAD_ENTRY */ + +/* xattr_handler->get() wants dentry */ +/* #undef HAVE_XATTR_GET_DENTRY */ + +/* xattr_handler->get() wants both dentry and inode */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE */ + +/* xattr_handler->get() wants xattr_handler */ +/* #undef HAVE_XATTR_GET_HANDLER */ + +/* xattr_handler has name */ +/* #undef HAVE_XATTR_HANDLER_NAME */ + +/* xattr_handler->list() wants dentry */ +/* #undef HAVE_XATTR_LIST_DENTRY */ + +/* xattr_handler->list() wants xattr_handler */ +/* #undef HAVE_XATTR_LIST_HANDLER */ + +/* xattr_handler->list() wants simple */ +/* #undef HAVE_XATTR_LIST_SIMPLE */ + +/* xattr_handler->set() wants dentry */ +/* #undef HAVE_XATTR_SET_DENTRY */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() wants xattr_handler */ +/* #undef HAVE_XATTR_SET_HANDLER */ + +/* xattr_handler->set() takes user_namespace */ +/* #undef HAVE_XATTR_SET_USERNS */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* __posix_acl_chmod() exists */ +/* #undef HAVE___POSIX_ACL_CHMOD */ + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* TBD: fetch(3) support */ +#if 0 +/* whether the chosen libfetch is to be loaded at run-time */ +#define LIBFETCH_DYNAMIC 1 + +/* libfetch is fetch(3) */ +#define LIBFETCH_IS_FETCH 1 + +/* libfetch is libcurl */ +#define LIBFETCH_IS_LIBCURL 0 + +/* soname of chosen libfetch */ +#define LIBFETCH_SONAME "libfetch.so.6" +#endif + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* hardened module_param_call */ +/* #undef MODULE_PARAM_CALL_CONST */ + +/* struct shrink_control has nid */ +/* #undef SHRINK_CONTROL_HAS_NID */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE + +/* Defined for legacy compatibility. */ +#define SPL_META_VERSION ZFS_META_VERSION + +/* True if ZFS is to be compiled for a FreeBSD system */ +#define SYSTEM_FREEBSD 1 + +/* True if ZFS is to be compiled for a Linux system */ +/* #undef SYSTEM_LINUX */ + +/* zfs debugging enabled */ +/* #undef ZFS_DEBUG */ + +/* /dev/zfs minor */ +/* #undef ZFS_DEVICE_MINOR */ + +/* enum node_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum node_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum node_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* enum zone_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum zone_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum zone_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* global_node_page_state() exists */ +/* #undef ZFS_GLOBAL_NODE_PAGE_STATE */ + +/* global_zone_page_state() exists */ +/* #undef ZFS_GLOBAL_ZONE_PAGE_STATE */ + +/* Define to 1 if GPL-only symbols can be used */ +/* #undef ZFS_IS_GPL_COMPATIBLE */ + +/* Define the project alias string. */ - #define ZFS_META_ALIAS "zfs-2.1.99-FreeBSD_g07a4c76e9" ++#define ZFS_META_ALIAS "zfs-2.1.99-FreeBSD_g14b43fbd9" + +/* Define the project author. */ +#define ZFS_META_AUTHOR "OpenZFS" + +/* Define the project release date. */ +/* #undef ZFS_META_DATA */ + +/* Define the maximum compatible kernel version. */ +#define ZFS_META_KVER_MAX "5.13" + +/* Define the minimum compatible kernel version. */ +#define ZFS_META_KVER_MIN "3.10" + +/* Define the project license. */ +#define ZFS_META_LICENSE "CDDL" + +/* Define the libtool library 'age' version information. */ +/* #undef ZFS_META_LT_AGE */ + +/* Define the libtool library 'current' version information. */ +/* #undef ZFS_META_LT_CURRENT */ + +/* Define the libtool library 'revision' version information. */ +/* #undef ZFS_META_LT_REVISION */ + +/* Define the project name. */ +#define ZFS_META_NAME "zfs" + +/* Define the project release. */ - #define ZFS_META_RELEASE "FreeBSD_g07a4c76e9" ++#define ZFS_META_RELEASE "FreeBSD_g14b43fbd9" + +/* Define the project version. */ +#define ZFS_META_VERSION "2.1.99" + +/* count is located in percpu_ref.data */ +/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ + From owner-dev-commits-src-main@freebsd.org Fri Jul 23 01:25:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4029C66907B; Fri, 23 Jul 2021 01:25: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 4GWBSs0m6Sz4sWd; Fri, 23 Jul 2021 01:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00EB31C47C; Fri, 23 Jul 2021 01:25: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 16N1P0LZ047064; Fri, 23 Jul 2021 01:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16N1P0oR047063; Fri, 23 Jul 2021 01:25:00 GMT (envelope-from git) Date: Fri, 23 Jul 2021 01:25:00 GMT Message-Id: <202107230125.16N1P0oR047063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 67a51854e8f2 - main - zfs: update zfs_gitrev.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67a51854e8f2e048a1fb3fce7048e1281830f22d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 01:25:01 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=67a51854e8f2e048a1fb3fce7048e1281830f22d commit 67a51854e8f2e048a1fb3fce7048e1281830f22d Author: Martin Matuska AuthorDate: 2021-07-23 01:22:30 +0000 Commit: Martin Matuska CommitDate: 2021-07-23 01:24:30 +0000 zfs: update zfs_gitrev.h From now on, every merge from vendor/openzfs/master should come with an updated zfs_config.h and zfs_gitrev.h --- sys/modules/zfs/zfs_gitrev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/zfs/zfs_gitrev.h b/sys/modules/zfs/zfs_gitrev.h index 6709f54ffa7b..52424eeffc9b 100644 --- a/sys/modules/zfs/zfs_gitrev.h +++ b/sys/modules/zfs/zfs_gitrev.h @@ -2,4 +2,4 @@ * $FreeBSD$ */ -#define ZFS_META_GITREV "zfs-0.7.0-3175-g184df27ee" +#define ZFS_META_GITREV "zfs-2.1.99-375-g14b43fbd9" From owner-dev-commits-src-main@freebsd.org Fri Jul 23 04:26:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B138D66B6B7; Fri, 23 Jul 2021 04:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWGV84BGkz3s0D; Fri, 23 Jul 2021 04:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F2D61EBB7; Fri, 23 Jul 2021 04:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16N4QOSl086637; Fri, 23 Jul 2021 04:26:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16N4QOAE086636; Fri, 23 Jul 2021 04:26:24 GMT (envelope-from git) Date: Fri, 23 Jul 2021 04:26:24 GMT Message-Id: <202107230426.16N4QOAE086636@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: 4d1597691916 - main - init: execute /etc/rc.final after all user processes have terminated 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: 4d1597691916240b9023ee9f15e249503abf67fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 04:26:24 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4d1597691916240b9023ee9f15e249503abf67fd commit 4d1597691916240b9023ee9f15e249503abf67fd Author: Kyle Evans AuthorDate: 2021-07-20 10:40:30 +0000 Commit: Kyle Evans CommitDate: 2021-07-23 04:26:11 +0000 init: execute /etc/rc.final after all user processes have terminated This can be useful for, e.g., unmounting filesystems that were needed for shutdown. Reviewed by: kib Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #63 Differential Revision: https://reviews.freebsd.org/D31230 --- sbin/init/init.8 | 17 ++++++++++++++--- sbin/init/init.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ sbin/init/pathnames.h | 1 + 3 files changed, 66 insertions(+), 3 deletions(-) diff --git a/sbin/init/init.8 b/sbin/init/init.8 index d852c32ef487..9475b1cce48f 100644 --- a/sbin/init/init.8 +++ b/sbin/init/init.8 @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd August 6, 2019 +.Dd July 22, 2021 .Dt INIT 8 .Os .Sh NAME @@ -279,6 +279,14 @@ Otherwise, .Dq Li reboot argument is used. .Pp +After all user processes have been terminated, +.Nm +will try to run the +.Pa /etc/rc.final +script. +This script can be used to finally prepare and unmount filesystems that may have +been needed during shutdown, for instance. +.Pp The role of .Nm is so critical that if it dies, the system will reboot itself @@ -371,9 +379,10 @@ It is used for running the or .Va init_script if set, as well as for the -.Pa /etc/rc +.Pa /etc/rc , +.Pa /etc/rc.shutdown , and -.Pa /etc/rc.shutdown +.Pa /etc/rc.final scripts. The value of the corresponding .Xr kenv 2 @@ -403,6 +412,8 @@ the terminal initialization information file system startup commands .It Pa /etc/rc.shutdown system shutdown commands +.It Pa /etc/rc.final +system shutdown commands (after process termination) .It Pa /var/log/init.log log of .Xr rc 8 diff --git a/sbin/init/init.c b/sbin/init/init.c index 943db9f26bd3..230c141bd351 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -109,6 +109,7 @@ static void disaster(int); static void revoke_ttys(void); static int runshutdown(void); static char *strk(char *); +static void runfinal(void); /* * We really need a recursive typedef... @@ -876,6 +877,8 @@ single_user(void) if (Reboot) { /* Instead of going single user, let's reboot the machine */ sync(); + /* Run scripts after all processes have been terminated. */ + runfinal(); if (reboot(howto) == -1) { emergency("reboot(%#x) failed, %m", howto); _exit(1); /* panic and reboot */ @@ -2039,3 +2042,51 @@ setprocresources(const char *cname) } } #endif + +/* + * Run /etc/rc.final to execute scripts after all user processes have been + * terminated. + */ +static void +runfinal(void) +{ + struct stat sb; + pid_t other_pid, pid; + sigset_t mask; + + /* Avoid any surprises. */ + alarm(0); + + /* rc.final is optional. */ + if (stat(_PATH_RUNFINAL, &sb) == -1 && errno == ENOENT) + return; + if (access(_PATH_RUNFINAL, X_OK) != 0) { + warning("%s exists, but not executable", _PATH_RUNFINAL); + return; + } + + pid = fork(); + if (pid == 0) { + /* + * Reopen stdin/stdout/stderr so that scripts can write to + * console. + */ + close(0); + open(_PATH_DEVNULL, O_RDONLY); + close(1); + close(2); + open_console(); + dup2(1, 2); + sigemptyset(&mask); + sigprocmask(SIG_SETMASK, &mask, NULL); + signal(SIGCHLD, SIG_DFL); + execl(_PATH_RUNFINAL, _PATH_RUNFINAL, NULL); + perror("execl(" _PATH_RUNFINAL ") failed"); + exit(1); + } + + /* Wait for rc.final script to exit */ + while ((other_pid = waitpid(-1, NULL, 0)) != pid && other_pid > 0) { + continue; + } +} diff --git a/sbin/init/pathnames.h b/sbin/init/pathnames.h index 2ed366e4f7f7..7dc75ba52491 100644 --- a/sbin/init/pathnames.h +++ b/sbin/init/pathnames.h @@ -41,5 +41,6 @@ #define _PATH_SLOGGER "/sbin/session_logger" #define _PATH_RUNCOM "/etc/rc" #define _PATH_RUNDOWN "/etc/rc.shutdown" +#define _PATH_RUNFINAL "/etc/rc.final" #define _PATH_REROOT "/dev/reroot" #define _PATH_REROOT_INIT _PATH_REROOT "/init" From owner-dev-commits-src-main@freebsd.org Fri Jul 23 13:28:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFF9B6725A6; Fri, 23 Jul 2021 13:28: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 4GWVW74rt2z4m7g; Fri, 23 Jul 2021 13:28:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 840D625CB2; Fri, 23 Jul 2021 13:28: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 16NDS3EW008647; Fri, 23 Jul 2021 13:28:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NDS3Rg008646; Fri, 23 Jul 2021 13:28:03 GMT (envelope-from git) Date: Fri, 23 Jul 2021 13:28:03 GMT Message-Id: <202107231328.16NDS3Rg008646@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: a93941b439fc - main - Switch to an ifunc in the kernel for crc32c 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: a93941b439fce7047dffad6bc380cc9454b967cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 13:28:03 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a93941b439fce7047dffad6bc380cc9454b967cd commit a93941b439fce7047dffad6bc380cc9454b967cd Author: Andrew Turner AuthorDate: 2021-07-22 10:24:33 +0000 Commit: Andrew Turner CommitDate: 2021-07-22 20:54:21 +0000 Switch to an ifunc in the kernel for crc32c There is no need to read the same variable to check if the CPU supports crc32c instructions. Reviewed by: arichardson, kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31274 --- sys/libkern/gsb_crc32.c | 56 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/sys/libkern/gsb_crc32.c b/sys/libkern/gsb_crc32.c index 170ceb3aa710..27b9a926888b 100644 --- a/sys/libkern/gsb_crc32.c +++ b/sys/libkern/gsb_crc32.c @@ -55,11 +55,12 @@ __FBSDID("$FreeBSD$"); #if defined(__amd64__) || defined(__i386__) #include #include +#include #endif #if defined(__aarch64__) -#include -#include +#include +#include #endif #endif /* _KERNEL */ @@ -750,29 +751,48 @@ multitable_crc32c(uint32_t crc32c, return (crc32c_sb8_64_bit(crc32c, buffer, length, to_even_word)); } -uint32_t -calculate_crc32c(uint32_t crc32c, - const unsigned char *buffer, - unsigned int length) +static uint32_t +table_crc32c(uint32_t crc32c, const unsigned char *buffer, unsigned int length) { -#ifdef _KERNEL -#if defined(__amd64__) || defined(__i386__) - if ((cpu_feature2 & CPUID2_SSE42) != 0) { - return (sse42_crc32c(crc32c, buffer, length)); - } else -#endif -#if defined(__aarch64__) - if ((elf_hwcap & HWCAP_CRC32) != 0) { - return (armv8_crc32c(crc32c, buffer, length)); - } else -#endif -#endif /* _KERNEL */ if (length < 4) { return (singletable_crc32c(crc32c, buffer, length)); } else { return (multitable_crc32c(crc32c, buffer, length)); } } + +#if defined(_KERNEL) && defined(__aarch64__) +DEFINE_IFUNC(, uint32_t, calculate_crc32c, + (uint32_t crc32c, const unsigned char *buffer, unsigned int length)) +{ + uint64_t reg; + + if (get_kernel_reg(ID_AA64ISAR0_EL1, ®)) { + if (ID_AA64ISAR0_CRC32_VAL(reg) >= ID_AA64ISAR0_CRC32_BASE) + return (armv8_crc32c); + } + + return (table_crc32c); +} +#elif defined(_KERNEL) && (defined(__amd64__) || defined(__i386__)) +DEFINE_IFUNC(, uint32_t, calculate_crc32c, + (uint32_t crc32c, const unsigned char *buffer, unsigned int length)) +{ + if ((cpu_feature2 & CPUID2_SSE42) != 0) + return (sse42_crc32c); + + return (table_crc32c); +} +#else +uint32_t +calculate_crc32c(uint32_t crc32c, + const unsigned char *buffer, + unsigned int length) +{ + return (table_crc32c(crc32c, buffer, length)); +} +#endif /* _KERNEL && __aarch64__ */ + #else uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, unsigned int length) From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:19:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9EB86732AE; Fri, 23 Jul 2021 14:19: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 4GWWfw4xyvz4vkT; Fri, 23 Jul 2021 14:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 914CE262D5; Fri, 23 Jul 2021 14:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NEJqbl074857; Fri, 23 Jul 2021 14:19:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEJq7j074856; Fri, 23 Jul 2021 14:19:52 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:19:52 GMT Message-Id: <202107231419.16NEJq7j074856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: c6f92e64b614 - main - aio_md_test: fix cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6f92e64b6140f9e095b41687ff09ff973c28e14 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:19:52 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=c6f92e64b6140f9e095b41687ff09ff973c28e14 commit c6f92e64b6140f9e095b41687ff09ff973c28e14 Author: Eric van Gyzen AuthorDate: 2021-07-23 13:24:52 +0000 Commit: Eric van Gyzen CommitDate: 2021-07-23 14:19:28 +0000 aio_md_test: fix cleanup ATF cleanup functions cannot use functions such as ATF_REQUIRE and atf_tc_fail. These functions assert that a test case is currently running, which is not true during cleanup, so the process aborts. Change the cleanup function to simply print to stderr and return. MFC after: 1 week Sponsored by: Dell EMC Isilon --- tests/sys/aio/aio_test.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c index b34e7c13f5a4..4b0fb5f7892b 100644 --- a/tests/sys/aio/aio_test.c +++ b/tests/sys/aio/aio_test.c @@ -758,11 +758,15 @@ static void aio_md_cleanup(void) { struct md_ioctl mdio; - int mdctl_fd, error, n, unit; + int mdctl_fd, n, unit; char buf[80]; mdctl_fd = open("/dev/" MDCTL_NAME, O_RDWR, 0); - ATF_REQUIRE(mdctl_fd >= 0); + if (mdctl_fd < 0) { + fprintf(stderr, "opening /dev/%s failed: %s\n", MDCTL_NAME, + strerror(errno)); + return; + } n = readlink(MDUNIT_LINK, buf, sizeof(buf)); if (n > 0) { if (sscanf(buf, "%d", &unit) == 1 && unit >= 0) { @@ -770,11 +774,9 @@ aio_md_cleanup(void) mdio.md_version = MDIOVERSION; mdio.md_unit = unit; if (ioctl(mdctl_fd, MDIOCDETACH, &mdio) == -1) { - error = errno; - close(mdctl_fd); - errno = error; - atf_tc_fail("ioctl MDIOCDETACH failed: %s", - strerror(errno)); + fprintf(stderr, + "ioctl MDIOCDETACH unit %d failed: %s\n", + unit, strerror(errno)); } } } From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:19:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F0B7672C62; Fri, 23 Jul 2021 14:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWWfy6l0Kz4vkY; Fri, 23 Jul 2021 14:19:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA95F26635; Fri, 23 Jul 2021 14:19: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 16NEJsL9074905; Fri, 23 Jul 2021 14:19:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEJsuu074904; Fri, 23 Jul 2021 14:19:54 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:19:54 GMT Message-Id: <202107231419.16NEJsuu074904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 9666cda9764a - main - aio_md_test: label the md MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9666cda9764a1d19cbf967940508dc6d2020cbfb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:19:55 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=9666cda9764a1d19cbf967940508dc6d2020cbfb commit 9666cda9764a1d19cbf967940508dc6d2020cbfb Author: Eric van Gyzen AuthorDate: 2021-07-23 13:57:44 +0000 Commit: Eric van Gyzen CommitDate: 2021-07-23 14:19:29 +0000 aio_md_test: label the md Add a label to md devices created by this test. The next time this test leaks md devices, finding the culprit will be much easier. Thanks to: sobomax, for adding labels in r322969 MFC after: 1 week Sponsored by: Dell EMC Isilon --- tests/sys/aio/aio_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c index 00b0f430529f..6681a13653b4 100644 --- a/tests/sys/aio/aio_test.c +++ b/tests/sys/aio/aio_test.c @@ -734,6 +734,8 @@ aio_md_setup(void) mdio.md_options = MD_AUTOUNIT | MD_COMPRESS; mdio.md_mediasize = GLOBAL_MAX; mdio.md_sectorsize = 512; + strlcpy(buf, __func__, sizeof(buf)); + mdio.md_label = buf; if (ioctl(mdctl_fd, MDIOCATTACH, &mdio) < 0) { error = errno; From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:19:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1833672C5A; Fri, 23 Jul 2021 14:19: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 4GWWfx5v9jz4vq4; Fri, 23 Jul 2021 14:19:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2401262D6; Fri, 23 Jul 2021 14:19: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 16NEJrDP074881; Fri, 23 Jul 2021 14:19:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEJrOP074880; Fri, 23 Jul 2021 14:19:53 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:19:53 GMT Message-Id: <202107231419.16NEJrOP074880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: ea0e1b19f232 - main - aio_md_test: NUL-terminate result of readlink MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea0e1b19f232331bffa75a0a64a6859c40f1cc4d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:19:54 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=ea0e1b19f232331bffa75a0a64a6859c40f1cc4d commit ea0e1b19f232331bffa75a0a64a6859c40f1cc4d Author: Eric van Gyzen AuthorDate: 2021-07-23 13:49:55 +0000 Commit: Eric van Gyzen CommitDate: 2021-07-23 14:19:29 +0000 aio_md_test: NUL-terminate result of readlink readlink does not NUL-terminate the output buffer. This led to spurious failures to destroy the md device because the unit number was garbage. NUL-terminate the output buffer. Reported by: ASLR MFC after: 1 week Sponsored by: Dell EMC Isilon --- tests/sys/aio/aio_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c index 4b0fb5f7892b..00b0f430529f 100644 --- a/tests/sys/aio/aio_test.c +++ b/tests/sys/aio/aio_test.c @@ -767,8 +767,9 @@ aio_md_cleanup(void) strerror(errno)); return; } - n = readlink(MDUNIT_LINK, buf, sizeof(buf)); + n = readlink(MDUNIT_LINK, buf, sizeof(buf) - 1); if (n > 0) { + buf[n] = '\0'; if (sscanf(buf, "%d", &unit) == 1 && unit >= 0) { bzero(&mdio, sizeof(mdio)); mdio.md_version = MDIOVERSION; From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:49:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05A8E673982; Fri, 23 Jul 2021 14:49:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWXKZ6TS9z51Js; Fri, 23 Jul 2021 14:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C675426F2F; Fri, 23 Jul 2021 14:49: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 16NEnsRX015349; Fri, 23 Jul 2021 14:49:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEnsXO015348; Fri, 23 Jul 2021 14:49:54 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:49:54 GMT Message-Id: <202107231449.16NEnsXO015348@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: 5c18bf9d5fd7 - main - ktrace: Zero request structures when populating the pool 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: 5c18bf9d5fd7684024e0a55da1e8537d4cfaf0bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:49:55 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5c18bf9d5fd7684024e0a55da1e8537d4cfaf0bf commit 5c18bf9d5fd7684024e0a55da1e8537d4cfaf0bf Author: Mark Johnston AuthorDate: 2021-07-23 14:29:53 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 14:29:53 +0000 ktrace: Zero request structures when populating the pool Otherwise uninitialized pad bytes may be copied into the ktrace log file. Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/kern_ktrace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 87cea3f269d5..be0ccfd344fa 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -219,7 +219,8 @@ ktrace_init(void *dummy) sx_init(&ktrace_sx, "ktrace_sx"); STAILQ_INIT(&ktr_free); for (i = 0; i < ktr_requestpool; i++) { - req = malloc(sizeof(struct ktr_request), M_KTRACE, M_WAITOK); + req = malloc(sizeof(struct ktr_request), M_KTRACE, M_WAITOK | + M_ZERO); STAILQ_INSERT_HEAD(&ktr_free, req, ktr_list); } } @@ -285,7 +286,7 @@ ktrace_resize_pool(u_int oldsize, u_int newsize) STAILQ_INIT(&ktr_new); while (bound-- > 0) { req = malloc(sizeof(struct ktr_request), M_KTRACE, - M_WAITOK); + M_WAITOK | M_ZERO); STAILQ_INSERT_HEAD(&ktr_new, req, ktr_list); } mtx_lock(&ktrace_mtx); From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:49:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 495C067335E; Fri, 23 Jul 2021 14:49: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 4GWXKc0fD6z51RG; Fri, 23 Jul 2021 14:49:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDC9326CEE; Fri, 23 Jul 2021 14:49:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NEntHo015375; Fri, 23 Jul 2021 14:49:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEntvs015374; Fri, 23 Jul 2021 14:49:55 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:49:55 GMT Message-Id: <202107231449.16NEntvs015374@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: 90959dd1e50e - main - acct: Zero pad bytes in accounting records 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: 90959dd1e50ee820e84bed4bc63fbed140298441 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:49:56 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=90959dd1e50ee820e84bed4bc63fbed140298441 commit 90959dd1e50ee820e84bed4bc63fbed140298441 Author: Mark Johnston AuthorDate: 2021-07-23 14:29:57 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 14:29:57 +0000 acct: Zero pad bytes in accounting records Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/kern_acct.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 4c1efada10da..ad272676083e 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -349,6 +349,8 @@ acct_process(struct thread *td) if (acct_vp == NULL || acct_suspended) return (0); + memset(&acct, 0, sizeof(acct)); + sx_slock(&acct_sx); /* From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:49:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE45C6735CB; Fri, 23 Jul 2021 14:49: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 4GWXKd1xxhz51RJ; Fri, 23 Jul 2021 14:49:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18DCF26DBE; Fri, 23 Jul 2021 14:49: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 16NEnu1q015401; Fri, 23 Jul 2021 14:49:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEnuVB015400; Fri, 23 Jul 2021 14:49:56 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:49:56 GMT Message-Id: <202107231449.16NEnuVB015400@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: 4cd7e82a4c7a - main - cdefs: Add a default definition for __nosanitizememory 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: 4cd7e82a4c7aed19dd722afa809466d5a45765d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:49:57 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4cd7e82a4c7aed19dd722afa809466d5a45765d6 commit 4cd7e82a4c7aed19dd722afa809466d5a45765d6 Author: Mark Johnston AuthorDate: 2021-07-23 14:30:00 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 14:30:00 +0000 cdefs: Add a default definition for __nosanitizememory MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/sys/cdefs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 6c9d219a7885..4db720d08b9f 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -888,6 +888,7 @@ #define __nosanitizethread __attribute__((no_sanitize("thread"))) #else #define __nosanitizeaddress +#define __nosanitizememory #define __nosanitizethread #endif From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:49:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFB11673915; Fri, 23 Jul 2021 14:49: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 4GWXKf3CGNz51MF; Fri, 23 Jul 2021 14:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EE8626C2D; Fri, 23 Jul 2021 14:49: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 16NEnw4Y015432; Fri, 23 Jul 2021 14:49:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEnwfN015431; Fri, 23 Jul 2021 14:49:58 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:49:58 GMT Message-Id: <202107231449.16NEnwfN015431@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: f95e683fa231 - main - Annotate amd64 stack unwinders with __nomemorysanitize 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: f95e683fa231fd1bed5cc10f52db0629a687ac3d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:49:59 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f95e683fa231fd1bed5cc10f52db0629a687ac3d commit f95e683fa231fd1bed5cc10f52db0629a687ac3d Author: Mark Johnston AuthorDate: 2021-07-23 14:30:21 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 14:47:13 +0000 Annotate amd64 stack unwinders with __nomemorysanitize Sponsored by: The FreeBSD Foundation --- sys/amd64/amd64/db_trace.c | 2 +- sys/dev/hwpmc/hwpmc_x86.c | 2 +- sys/x86/x86/stack_machdep.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index 4c569c456e92..d2682afec8b0 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -258,7 +258,7 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, struct thread *td) *fp = (struct amd64_frame *) rbp; } -static int +static int __nosanitizeaddress __nosanitizememory db_backtrace(struct thread *td, struct trapframe *tf, struct amd64_frame *frame, db_addr_t pc, register_t sp, int count) { diff --git a/sys/dev/hwpmc/hwpmc_x86.c b/sys/dev/hwpmc/hwpmc_x86.c index db6ed6fb1145..426f820b8a96 100644 --- a/sys/dev/hwpmc/hwpmc_x86.c +++ b/sys/dev/hwpmc/hwpmc_x86.c @@ -156,7 +156,7 @@ pmc_save_user_callchain(uintptr_t *cc, int nframes, struct trapframe *tf) * code, and if so we terminate our trace. */ -int __nosanitizeaddress +int __nosanitizeaddress __nosanitizememory pmc_save_kernel_callchain(uintptr_t *cc, int nframes, struct trapframe *tf) { int n; diff --git a/sys/x86/x86/stack_machdep.c b/sys/x86/x86/stack_machdep.c index 0e4bf1bf2930..1243137d2ea0 100644 --- a/sys/x86/x86/stack_machdep.c +++ b/sys/x86/x86/stack_machdep.c @@ -70,7 +70,7 @@ static struct mtx intr_lock; MTX_SYSINIT(intr_lock, &intr_lock, "stack intr", MTX_DEF); #endif -static void __nosanitizeaddress +static void __nosanitizeaddress __nosanitizememory stack_capture(struct thread *td, struct stack *st, register_t fp) { x86_frame_t frame; From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:50:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82378673919; Fri, 23 Jul 2021 14:50: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 4GWXKj4cYbz51V7; Fri, 23 Jul 2021 14:50:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81A0426675; Fri, 23 Jul 2021 14:50: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 16NEo14R017072; Fri, 23 Jul 2021 14:50:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEo1wt017052; Fri, 23 Jul 2021 14:50:01 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:50:01 GMT Message-Id: <202107231450.16NEo1wt017052@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: 0dcef81de991 - main - Add required sysctl name length checks to various handlers 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: 0dcef81de9915e8ce1e3985204bebe7026d96b6f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:50:02 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0dcef81de9915e8ce1e3985204bebe7026d96b6f commit 0dcef81de9915e8ce1e3985204bebe7026d96b6f Author: Mark Johnston AuthorDate: 2021-07-23 14:37:11 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 14:47:13 +0000 Add required sysctl name length checks to various handlers Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/kern_descrip.c | 20 ++++++++++++++++++++ sys/kern/kern_proc.c | 16 +++++++++++++++- sys/net/rtsock.c | 5 ++++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 36092c9acd42..c7269e4b33a9 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -4092,8 +4092,13 @@ sysctl_kern_proc_nfds(SYSCTL_HANDLER_ARGS) { NDSLOTTYPE *map; struct filedesc *fdp; + u_int namelen; int count, off, minoff; + namelen = arg2; + if (namelen != 1) + return (EINVAL); + if (*(int *)arg1 != 0) return (EINVAL); @@ -4482,8 +4487,13 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) struct sbuf sb; struct proc *p; ssize_t maxlen; + u_int namelen; int error, error2, *name; + namelen = arg2; + if (namelen != 1) + return (EINVAL); + name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, FILEDESC_SBUF_SIZE, req); @@ -4561,10 +4571,15 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS) struct filedesc *fdp; struct pwddesc *pdp; struct pwd *pwd; + u_int namelen; int error, i, lastfile, *name; struct file *fp; struct proc *p; + namelen = arg2; + if (namelen != 1) + return (EINVAL); + name = (int *)arg1; error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) @@ -4706,8 +4721,13 @@ sysctl_kern_proc_cwd(SYSCTL_HANDLER_ARGS) struct sbuf sb; struct proc *p; ssize_t maxlen; + u_int namelen; int error, error2, *name; + namelen = arg2; + if (namelen != 1) + return (EINVAL); + name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, sizeof(struct kinfo_file), req); diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index ec732e8db060..2017f824f6ad 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2297,7 +2297,7 @@ static int sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) { vm_map_entry_t entry, tmp_entry; - unsigned int last_timestamp; + unsigned int last_timestamp, namelen; char *fullpath, *freepath; struct kinfo_ovmentry *kve; struct vattr va; @@ -2308,6 +2308,10 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) vm_map_t map; struct vmspace *vm; + namelen = arg2; + if (namelen != 1) + return (EINVAL); + name = (int *)arg1; error = pget((pid_t)name[0], PGET_WANTREAD, &p); if (error != 0) @@ -2678,8 +2682,13 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) { struct proc *p; struct sbuf sb; + u_int namelen; int error, error2, *name; + namelen = arg2; + if (namelen != 1) + return (EINVAL); + name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, sizeof(struct kinfo_vmentry), req); sbuf_clear_flags(&sb, SBUF_INCLUDENUL); @@ -2705,6 +2714,11 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) struct stack *st; struct sbuf sb; struct proc *p; + u_int namelen; + + namelen = arg2; + if (namelen != 1) + return (EINVAL); name = (int *)arg1; error = pget((pid_t)name[0], PGET_NOTINEXEC | PGET_WANTREAD, &p); diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 07a2deaa5518..9c91672e0247 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -2567,7 +2567,10 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) u_char af; struct walkarg w; - name ++; + if (namelen < 3) + return (EINVAL); + + name++; namelen--; if (req->newptr) return (EPERM); From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:50:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28F2967366D; Fri, 23 Jul 2021 14:50: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 4GWXKk5L3cz51V8; Fri, 23 Jul 2021 14:50:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FD7A26D21; Fri, 23 Jul 2021 14:50: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 16NEo2nU017376; Fri, 23 Jul 2021 14:50:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEo24b017373; Fri, 23 Jul 2021 14:50:02 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:50:02 GMT Message-Id: <202107231450.16NEo24b017373@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: ea3fbe0707f9 - main - KASAN: Disable checking before triggering a panic 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: ea3fbe0707f9a02a29875966668b6f15284f335a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:50:03 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ea3fbe0707f9a02a29875966668b6f15284f335a commit ea3fbe0707f9a02a29875966668b6f15284f335a Author: Mark Johnston AuthorDate: 2021-07-23 14:41:00 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 14:47:14 +0000 KASAN: Disable checking before triggering a panic KASAN hooks will not generate reports if panicstr != NULL, but then there is a window after the initial panic() call where another report may be raised. This can happen if a false positive occurs; to simplify debugging of such problems, avoid recursing. Sponsored by: The FreeBSD Foundation --- sys/kern/subr_asan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 07f7b44d08d7..825d7d4228c0 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -174,6 +174,7 @@ kasan_code_name(uint8_t code) #define REPORT(f, ...) do { \ if (panic_on_violation) { \ + kasan_enabled = false; \ panic(f, __VA_ARGS__); \ } else { \ struct stack st; \ From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:49:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9A90673916; Fri, 23 Jul 2021 14:49: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 4GWXKg4zPgz51V1; Fri, 23 Jul 2021 14:49:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F98A26CEF; Fri, 23 Jul 2021 14:49: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 16NEnxYQ015456; Fri, 23 Jul 2021 14:49:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEnxbD015455; Fri, 23 Jul 2021 14:49:59 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:49:59 GMT Message-Id: <202107231449.16NEnxbD015455@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: 4e8e26a00471 - main - redzone: Raise a compile error if KASAN is configured 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: 4e8e26a00471f1a5e7a2af322265c45b1529c5b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:50:01 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4e8e26a00471f1a5e7a2af322265c45b1529c5b8 commit 4e8e26a00471f1a5e7a2af322265c45b1529c5b8 Author: Mark Johnston AuthorDate: 2021-07-23 14:30:29 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 14:47:13 +0000 redzone: Raise a compile error if KASAN is configured redzone(9) does some munging of the allocation to insert redzones before and after a valid memory buffer, but KASAN does not know about this and will raise false positives if both are configured. Until this is fixed, do not allow both to be configured. Note that KASAN provides similar checking on its own but currently does not force the creation of redzones for all UMA allocations; this should be addressed as well. Sponsored by: The FreeBSD Foundation --- sys/vm/redzone.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/vm/redzone.c b/sys/vm/redzone.c index affaa5008a22..88e36c41b928 100644 --- a/sys/vm/redzone.c +++ b/sys/vm/redzone.c @@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef KASAN +#error KASAN and DEBUG_REDZONE cannot be configured together +#endif + static SYSCTL_NODE(_vm, OID_AUTO, redzone, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "RedZone data"); static u_long redzone_extra_mem = 0; From owner-dev-commits-src-main@freebsd.org Fri Jul 23 14:50:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C51767366A; Fri, 23 Jul 2021 14:50: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 4GWXKh5h7sz51Rb; Fri, 23 Jul 2021 14:50:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B5C26DBF; Fri, 23 Jul 2021 14:50: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 16NEo0Cm015796; Fri, 23 Jul 2021 14:50:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NEo0kS015784; Fri, 23 Jul 2021 14:50:00 GMT (envelope-from git) Date: Fri, 23 Jul 2021 14:50:00 GMT Message-Id: <202107231450.16NEo0kS015784@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: cae3f9dd01fd - main - select: Define select_flags[] as const 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: cae3f9dd01fd1f8d579546b359305e985f8087d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 14:50:01 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cae3f9dd01fd1f8d579546b359305e985f8087d8 commit cae3f9dd01fd1f8d579546b359305e985f8087d8 Author: Mark Johnston AuthorDate: 2021-07-23 14:30:32 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 14:47:13 +0000 select: Define select_flags[] as const MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/sys_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index c89a643cfcf9..f86d494400e2 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1244,7 +1244,7 @@ done: * The backend always returns POLLHUP/POLLERR if appropriate and we * return this as a set bit in any set. */ -static int select_flags[3] = { +static const int select_flags[3] = { POLLRDNORM | POLLHUP | POLLERR, POLLWRNORM | POLLHUP | POLLERR, POLLRDBAND | POLLERR From owner-dev-commits-src-main@freebsd.org Fri Jul 23 15:06:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF552673C56; Fri, 23 Jul 2021 15:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWXjD5tgXz542x; Fri, 23 Jul 2021 15:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEE8C26AE7; Fri, 23 Jul 2021 15:06: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 16NF6usx044225; Fri, 23 Jul 2021 15:06:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NF6ujN044224; Fri, 23 Jul 2021 15:06:56 GMT (envelope-from git) Date: Fri, 23 Jul 2021 15:06:56 GMT Message-Id: <202107231506.16NF6ujN044224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 7a7930cd4abc - main - LC_CTIME: has been removed from automatic generation long ago MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a7930cd4abce99f406b8ee8a204aa163d4bd1b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 15:06:56 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7a7930cd4abce99f406b8ee8a204aa163d4bd1b0 commit 7a7930cd4abce99f406b8ee8a204aa163d4bd1b0 Author: Baptiste Daroussin AuthorDate: 2021-07-22 15:37:13 +0000 Commit: Baptiste Daroussin CommitDate: 2021-07-23 14:58:19 +0000 LC_CTIME: has been removed from automatic generation long ago due to too many mistakes in the data provided by cldr it was decided to remove timedef from the automatic generation --- share/timedef/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/timedef/Makefile b/share/timedef/Makefile index da2080821ba7..1e05986f1818 100644 --- a/share/timedef/Makefile +++ b/share/timedef/Makefile @@ -1,6 +1,4 @@ # $FreeBSD$ -# Warning: Do not edit. This file is automatically generated from the -# tools in /usr/src/tools/tools/locale. LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_TIME From owner-dev-commits-src-main@freebsd.org Fri Jul 23 15:06:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FF33673E3B; Fri, 23 Jul 2021 15:06: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 4GWXjH3qS6z545B; Fri, 23 Jul 2021 15:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A8C126E63; Fri, 23 Jul 2021 15:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NF6xGC044251; Fri, 23 Jul 2021 15:06:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NF6v2h044248; Fri, 23 Jul 2021 15:06:57 GMT (envelope-from git) Date: Fri, 23 Jul 2021 15:06:57 GMT Message-Id: <202107231506.16NF6v2h044248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 0a36787e4c1f - main - locales: separate unicode from other locales MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a36787e4c1fa0cf77dcf83be0867178476e372b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 15:06:59 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0a36787e4c1fa0cf77dcf83be0867178476e372b commit 0a36787e4c1fa0cf77dcf83be0867178476e372b Author: Baptiste Daroussin AuthorDate: 2021-07-22 17:02:49 +0000 Commit: Baptiste Daroussin CommitDate: 2021-07-23 14:58:20 +0000 locales: separate unicode from other locales Unicode locales are maintained and to evolved in cldr. Generating the other locales from the unicode gets more and more painful over the time. Let's freeze the other locales to cldr 34.0. --- share/Makefile | 8 +- share/colldef/Makefile | 271 +- .../{af_ZA.UTF-8.src => af_ZA.ISO8859-1.src} | 0 .../{be_BY.UTF-8.src => be_BY.ISO8859-5.src} | 0 share/colldef/ca_IT.ISO8859-15.src | 2433 ++ .../{el_GR.UTF-8.src => el_GR.ISO8859-7.src} | 0 .../{es_MX.UTF-8.src => es_MX.ISO8859-1.src} | 0 .../{et_EE.UTF-8.src => et_EE.ISO8859-15.src} | 0 .../{fi_FI.UTF-8.src => fi_FI.ISO8859-15.src} | 0 .../{fr_CA.UTF-8.src => fr_CA.ISO8859-15.src} | 0 .../{hi_IN.UTF-8.src => hi_IN.ISCII-DEV.src} | 0 .../{hy_AM.UTF-8.src => hy_AM.ARMSCII-8.src} | 0 .../{is_IS.UTF-8.src => is_IS.ISO8859-15.src} | 0 share/colldef/{ja_JP.UTF-8.src => ja_JP.SJIS.src} | 0 share/colldef/{ko_KR.UTF-8.src => ko_KR.eucKR.src} | 0 .../{lt_LT.UTF-8.src => lt_LT.ISO8859-13.src} | 0 .../{lv_LV.UTF-8.src => lv_LV.ISO8859-13.src} | 0 .../{pl_PL.UTF-8.src => pl_PL.ISO8859-2.src} | 0 .../{en_US.UTF-8.src => pt_PT.ISO8859-15.src} | 0 .../{ro_RO.UTF-8.src => ro_RO.ISO8859-2.src} | 0 .../colldef/{ru_RU.UTF-8.src => ru_RU.KOI8-R.src} | 0 .../{sl_SI.UTF-8.src => sl_SI.ISO8859-2.src} | 0 .../{sv_SE.UTF-8.src => sv_SE.ISO8859-15.src} | 0 .../{tr_TR.UTF-8.src => tr_TR.ISO8859-9.src} | 0 .../colldef/{uk_UA.UTF-8.src => uk_UA.KOI8-U.src} | 0 share/colldef_unicode/Makefile | 122 + share/colldef_unicode/af_ZA.UTF-8.src | 2430 ++ share/{colldef => colldef_unicode}/am_ET.UTF-8.src | 0 share/{colldef => colldef_unicode}/ar_SA.UTF-8.src | 0 share/colldef_unicode/be_BY.UTF-8.src | 1068 + share/colldef_unicode/ca_AD.UTF-8.src | 2433 ++ share/{colldef => colldef_unicode}/cs_CZ.UTF-8.src | 0 share/{colldef => colldef_unicode}/da_DK.UTF-8.src | 0 share/colldef_unicode/el_GR.UTF-8.src | 831 + share/colldef_unicode/en_US.UTF-8.src | 2430 ++ share/colldef_unicode/es_MX.UTF-8.src | 2434 ++ share/colldef_unicode/et_EE.UTF-8.src | 2446 ++ share/colldef_unicode/fi_FI.UTF-8.src | 2448 ++ share/colldef_unicode/fr_CA.UTF-8.src | 2430 ++ share/{colldef => colldef_unicode}/he_IL.UTF-8.src | 0 share/colldef_unicode/hi_IN.UTF-8.src | 699 + share/{colldef => colldef_unicode}/hu_HU.UTF-8.src | 0 share/colldef_unicode/hy_AM.UTF-8.src | 522 + share/colldef_unicode/is_IS.UTF-8.src | 2454 ++ share/colldef_unicode/ja_JP.UTF-8.src | 22135 +++++++++++++++++++ share/{colldef => colldef_unicode}/kk_KZ.UTF-8.src | 0 share/colldef_unicode/ko_KR.UTF-8.src | 20853 +++++++++++++++++ share/colldef_unicode/lt_LT.UTF-8.src | 2442 ++ share/colldef_unicode/lv_LV.UTF-8.src | 2450 ++ share/{colldef => colldef_unicode}/nn_NO.UTF-8.src | 0 share/colldef_unicode/pl_PL.UTF-8.src | 2450 ++ share/colldef_unicode/ro_RO.UTF-8.src | 2440 ++ share/colldef_unicode/ru_RU.UTF-8.src | 1062 + share/{colldef => colldef_unicode}/se_NO.UTF-8.src | 0 share/{colldef => colldef_unicode}/sk_SK.UTF-8.src | 0 share/colldef_unicode/sl_SI.UTF-8.src | 2442 ++ share/{colldef => colldef_unicode}/sr_RS.UTF-8.src | 0 .../sr_RS.UTF-8@latin.src | 0 share/colldef_unicode/sv_SE.UTF-8.src | 2446 ++ share/colldef_unicode/tr_TR.UTF-8.src | 2442 ++ share/colldef_unicode/uk_UA.UTF-8.src | 1075 + share/{colldef => colldef_unicode}/zh_CN.UTF-8.src | 0 share/{colldef => colldef_unicode}/zh_TW.UTF-8.src | 0 share/ctypedef/Makefile | 4 - share/monetdef/Makefile | 129 +- .../{da_DK.UTF-8.src => da_DK.ISO8859-15.src} | 0 .../{en_AU.UTF-8.src => en_AU.US-ASCII.src} | 0 .../{en_CA.UTF-8.src => en_CA.US-ASCII.src} | 0 .../{zh_HK.UTF-8.src => en_HK.ISO8859-1.src} | 0 .../{en_NZ.UTF-8.src => en_NZ.US-ASCII.src} | 0 .../{en_SG.UTF-8.src => en_SG.ISO8859-1.src} | 0 .../{en_US.UTF-8.src => en_US.US-ASCII.src} | 0 .../{es_AR.UTF-8.src => es_AR.ISO8859-1.src} | 0 .../{es_MX.UTF-8.src => es_MX.ISO8859-1.src} | 0 .../{hr_HR.UTF-8.src => hr_HR.ISO8859-2.src} | 0 .../{is_IS.UTF-8.src => is_IS.ISO8859-15.src} | 0 .../{pt_BR.UTF-8.src => pt_BR.ISO8859-1.src} | 0 .../{ro_RO.UTF-8.src => ro_RO.ISO8859-2.src} | 0 .../{sr_RS.UTF-8@latin.src => sr_RS.ISO8859-2.src} | 0 share/monetdef_unicode/Makefile | 104 + share/monetdef_unicode/Makefile.depend | 11 + .../{monetdef => monetdef_unicode}/am_ET.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/ar_AE.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/ar_EG.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/ar_JO.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/ar_MA.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/ar_QA.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/ar_SA.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/be_BY.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/bg_BG.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/cs_CZ.UTF-8.src | 0 share/monetdef_unicode/da_DK.UTF-8.src | 50 + share/monetdef_unicode/en_AU.UTF-8.src | 50 + share/monetdef_unicode/en_CA.UTF-8.src | 50 + .../{monetdef => monetdef_unicode}/en_GB.UTF-8.src | 0 share/monetdef_unicode/en_NZ.UTF-8.src | 50 + .../{monetdef => monetdef_unicode}/en_PH.UTF-8.src | 0 share/monetdef_unicode/en_SG.UTF-8.src | 50 + share/monetdef_unicode/en_US.UTF-8.src | 50 + .../{monetdef => monetdef_unicode}/en_ZA.UTF-8.src | 0 share/monetdef_unicode/es_AR.UTF-8.src | 50 + .../{monetdef => monetdef_unicode}/es_CR.UTF-8.src | 0 share/monetdef_unicode/es_MX.UTF-8.src | 50 + .../{monetdef => monetdef_unicode}/fr_CA.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/fr_CH.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/fr_FR.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/ga_IE.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/he_IL.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/hi_IN.UTF-8.src | 0 share/monetdef_unicode/hr_HR.UTF-8.src | 50 + .../{monetdef => monetdef_unicode}/hu_HU.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/hy_AM.UTF-8.src | 0 share/monetdef_unicode/is_IS.UTF-8.src | 50 + .../{monetdef => monetdef_unicode}/it_CH.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/it_IT.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/ja_JP.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/kk_KZ.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/ko_KR.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/mn_MN.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/nb_NO.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/nl_BE.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/nl_NL.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/pl_PL.UTF-8.src | 0 share/monetdef_unicode/pt_BR.UTF-8.src | 50 + share/monetdef_unicode/ro_RO.UTF-8.src | 50 + .../{monetdef => monetdef_unicode}/ru_RU.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/se_NO.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/sk_SK.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/sl_SI.UTF-8.src | 0 share/monetdef_unicode/sr_RS.UTF-8@latin.src | 50 + .../{monetdef => monetdef_unicode}/sv_FI.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/sv_SE.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/tr_TR.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/uk_UA.UTF-8.src | 0 .../{monetdef => monetdef_unicode}/zh_CN.UTF-8.src | 0 share/monetdef_unicode/zh_HK.UTF-8.src | 50 + .../{monetdef => monetdef_unicode}/zh_TW.UTF-8.src | 0 share/msgdef/Makefile | 205 +- .../{cs_CZ.UTF-8.src => cs_CZ.ISO8859-2.src} | 0 .../{de_DE.UTF-8.src => de_DE.ISO8859-15.src} | 0 .../msgdef/{en_US.UTF-8.src => en_US.US-ASCII.src} | 0 .../{et_EE.UTF-8.src => et_EE.ISO8859-15.src} | 0 .../{eu_ES.UTF-8.src => eu_ES.ISO8859-15.src} | 0 .../{fr_FR.UTF-8.src => fr_FR.ISO8859-15.src} | 0 .../{hu_HU.UTF-8.src => hu_HU.ISO8859-2.src} | 0 .../{lt_LT.UTF-8.src => lt_LT.ISO8859-13.src} | 0 .../{nb_NO.UTF-8.src => nb_NO.ISO8859-15.src} | 0 .../{nl_NL.UTF-8.src => nl_NL.ISO8859-15.src} | 0 .../{pl_PL.UTF-8.src => pl_PL.ISO8859-2.src} | 0 .../{ro_RO.UTF-8.src => ro_RO.ISO8859-2.src} | 0 .../{sv_SE.UTF-8.src => sv_SE.ISO8859-15.src} | 0 share/msgdef_unicode/Makefile | 104 + share/msgdef_unicode/Makefile.depend | 11 + share/{msgdef => msgdef_unicode}/am_ET.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/ar_SA.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/be_BY.UTF-8.src | 0 share/msgdef_unicode/cs_CZ.UTF-8.src | 17 + share/msgdef_unicode/de_DE.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/el_GR.UTF-8.src | 0 share/msgdef_unicode/en_US.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/es_MX.UTF-8.src | 0 share/msgdef_unicode/et_EE.UTF-8.src | 17 + share/msgdef_unicode/eu_ES.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/fi_FI.UTF-8.src | 0 share/msgdef_unicode/fr_FR.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/ga_IE.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/he_IL.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/hi_IN.UTF-8.src | 0 share/msgdef_unicode/hu_HU.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/hy_AM.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/is_IS.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/it_IT.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/ja_JP.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/kk_KZ.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/ko_KR.UTF-8.src | 0 share/msgdef_unicode/lt_LT.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/lv_LV.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/mn_MN.UTF-8.src | 0 share/msgdef_unicode/nb_NO.UTF-8.src | 17 + share/msgdef_unicode/nl_NL.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/nn_NO.UTF-8.src | 0 share/msgdef_unicode/pl_PL.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/pt_PT.UTF-8.src | 0 share/msgdef_unicode/ro_RO.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/ru_RU.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/se_NO.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/sk_SK.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/sr_RS.UTF-8.src | 0 .../sr_RS.UTF-8@latin.src | 0 share/msgdef_unicode/sv_SE.UTF-8.src | 17 + share/{msgdef => msgdef_unicode}/tr_TR.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/uk_UA.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/zh_CN.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/zh_HK.UTF-8.src | 0 share/{msgdef => msgdef_unicode}/zh_TW.UTF-8.src | 0 share/numericdef/Makefile | 201 +- .../{en_US.UTF-8.src => en_US.US-ASCII.src} | 0 .../{hi_IN.UTF-8.src => hi_IN.ISCII-DEV.src} | 0 .../{tr_TR.UTF-8.src => tr_TR.ISO8859-9.src} | 0 share/numericdef/zh_CN.GBK.src | 14 + share/numericdef_unicode/Makefile | 106 + share/numericdef_unicode/Makefile.depend | 11 + .../ar_SA.UTF-8.src | 0 share/numericdef_unicode/en_US.UTF-8.src | 14 + .../fr_FR.UTF-8.src | 0 share/numericdef_unicode/hi_IN.UTF-8.src | 14 + .../it_CH.UTF-8.src | 0 share/numericdef_unicode/tr_TR.UTF-8.src | 14 + .../uk_UA.UTF-8.src | 0 209 files changed, 88982 insertions(+), 577 deletions(-) diff --git a/share/Makefile b/share/Makefile index c4e12b05f7db..dfa5ff1a65a2 100644 --- a/share/Makefile +++ b/share/Makefile @@ -53,11 +53,11 @@ _i18n= i18n .endif .if ${MK_LOCALES} != "no" -_colldef= colldef +_colldef= colldef colldef_unicode +_monetdef= monetdef monetdef_unicode _ctypedef= ctypedef -_monetdef= monetdef -_msgdef= msgdef -_numericdef= numericdef +_msgdef= msgdef msgdef_unicode +_numericdef= numericdef numericdef_unicode _timedef= timedef .endif diff --git a/share/colldef/Makefile b/share/colldef/Makefile index e7c93d300c91..89454f84a5e4 100644 --- a/share/colldef/Makefile +++ b/share/colldef/Makefile @@ -1,6 +1,4 @@ # $FreeBSD$ -# Warning: Do not edit. This file is automatically generated from the -# tools in /usr/src/tools/tools/locale. LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_COLLATE @@ -16,141 +14,101 @@ CLDR_VERSION= "34.0" -V ${CLDR_VERSION} \ -f ${MAPLOC}/map.${.TARGET:T:R:E:C/@.*//} ${.OBJDIR}/${.IMPSRC:T:R} -LOCALES+= af_ZA.UTF-8 -LOCALES+= am_ET.UTF-8 -LOCALES+= ar_SA.UTF-8 -LOCALES+= be_BY.UTF-8 -LOCALES+= ca_AD.UTF-8 -LOCALES+= cs_CZ.UTF-8 -LOCALES+= da_DK.UTF-8 -LOCALES+= el_GR.UTF-8 -LOCALES+= en_US.UTF-8 -LOCALES+= es_MX.UTF-8 -LOCALES+= et_EE.UTF-8 -LOCALES+= fi_FI.UTF-8 -LOCALES+= fr_CA.UTF-8 -LOCALES+= he_IL.UTF-8 -LOCALES+= hi_IN.UTF-8 -LOCALES+= hu_HU.UTF-8 -LOCALES+= hy_AM.UTF-8 -LOCALES+= is_IS.UTF-8 -LOCALES+= ja_JP.UTF-8 -LOCALES+= kk_KZ.UTF-8 -LOCALES+= ko_KR.UTF-8 -LOCALES+= lt_LT.UTF-8 -LOCALES+= lv_LV.UTF-8 -LOCALES+= nn_NO.UTF-8 -LOCALES+= pl_PL.UTF-8 -LOCALES+= ro_RO.UTF-8 -LOCALES+= ru_RU.UTF-8 -LOCALES+= se_NO.UTF-8 -LOCALES+= sk_SK.UTF-8 -LOCALES+= sl_SI.UTF-8 -LOCALES+= sr_RS.UTF-8 -LOCALES+= sr_RS.UTF-8@latin -LOCALES+= sv_SE.UTF-8 -LOCALES+= tr_TR.UTF-8 -LOCALES+= uk_UA.UTF-8 -LOCALES+= zh_CN.UTF-8 -LOCALES+= zh_TW.UTF-8 - -LOCALES_MAPPED+= af_ZA.UTF-8 af_ZA.ISO8859-15 -LOCALES_MAPPED+= af_ZA.UTF-8 af_ZA.ISO8859-1 -LOCALES_MAPPED+= be_BY.UTF-8 be_BY.ISO8859-5 -LOCALES_MAPPED+= be_BY.UTF-8 be_BY.CP1251 -LOCALES_MAPPED+= be_BY.UTF-8 be_BY.CP1131 -LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.KOI8-R -LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.ISO8859-5 -LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.CP866 -LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.CP1251 -LOCALES_MAPPED+= ru_RU.UTF-8 bg_BG.CP1251 -LOCALES_MAPPED+= ca_AD.UTF-8 ca_IT.ISO8859-15 -LOCALES_MAPPED+= ca_AD.UTF-8 ca_IT.ISO8859-1 -LOCALES_MAPPED+= ca_AD.UTF-8 ca_FR.ISO8859-15 -LOCALES_MAPPED+= ca_AD.UTF-8 ca_FR.ISO8859-1 -LOCALES_MAPPED+= ca_AD.UTF-8 ca_ES.ISO8859-15 -LOCALES_MAPPED+= ca_AD.UTF-8 ca_ES.ISO8859-1 -LOCALES_MAPPED+= ca_AD.UTF-8 ca_AD.ISO8859-15 -LOCALES_MAPPED+= ca_AD.UTF-8 ca_AD.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 pt_PT.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 pt_PT.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 pt_BR.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 nl_NL.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 nl_NL.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 nl_BE.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 nl_BE.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 it_IT.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 it_IT.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 it_CH.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 it_CH.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 fr_FR.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 fr_FR.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 fr_CH.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 fr_CH.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 fr_BE.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 fr_BE.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 eu_ES.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 eu_ES.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 en_ZA.US-ASCII -LOCALES_MAPPED+= en_US.UTF-8 en_ZA.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 en_ZA.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 en_US.US-ASCII -LOCALES_MAPPED+= en_US.UTF-8 en_US.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 en_US.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 en_SG.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 en_NZ.US-ASCII -LOCALES_MAPPED+= en_US.UTF-8 en_NZ.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 en_NZ.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 en_IE.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 en_IE.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 en_HK.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 en_GB.US-ASCII -LOCALES_MAPPED+= en_US.UTF-8 en_GB.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 en_GB.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 en_CA.US-ASCII -LOCALES_MAPPED+= en_US.UTF-8 en_CA.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 en_CA.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 en_AU.US-ASCII -LOCALES_MAPPED+= en_US.UTF-8 en_AU.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 en_AU.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 de_DE.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 de_DE.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 de_CH.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 de_CH.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 de_AT.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 de_AT.ISO8859-1 -LOCALES_MAPPED+= el_GR.UTF-8 el_GR.ISO8859-7 -LOCALES_MAPPED+= es_MX.UTF-8 es_MX.ISO8859-1 -LOCALES_MAPPED+= es_MX.UTF-8 es_ES.ISO8859-15 -LOCALES_MAPPED+= es_MX.UTF-8 es_ES.ISO8859-1 -LOCALES_MAPPED+= es_MX.UTF-8 es_AR.ISO8859-1 -LOCALES_MAPPED+= et_EE.UTF-8 et_EE.ISO8859-15 -LOCALES_MAPPED+= et_EE.UTF-8 et_EE.ISO8859-1 -LOCALES_MAPPED+= fi_FI.UTF-8 fi_FI.ISO8859-15 -LOCALES_MAPPED+= fi_FI.UTF-8 fi_FI.ISO8859-1 -LOCALES_MAPPED+= fr_CA.UTF-8 fr_CA.ISO8859-15 -LOCALES_MAPPED+= fr_CA.UTF-8 fr_CA.ISO8859-1 -LOCALES_MAPPED+= hi_IN.UTF-8 hi_IN.ISCII-DEV -LOCALES_MAPPED+= sr_RS.UTF-8@latin hr_HR.UTF-8 -LOCALES_MAPPED+= hy_AM.UTF-8 hy_AM.ARMSCII-8 -LOCALES_MAPPED+= is_IS.UTF-8 is_IS.ISO8859-15 -LOCALES_MAPPED+= is_IS.UTF-8 is_IS.ISO8859-1 -LOCALES_MAPPED+= ja_JP.UTF-8 ja_JP.SJIS -LOCALES_MAPPED+= ko_KR.UTF-8 ko_KR.eucKR -LOCALES_MAPPED+= lt_LT.UTF-8 lt_LT.ISO8859-13 -LOCALES_MAPPED+= lv_LV.UTF-8 lv_LV.ISO8859-13 -LOCALES_MAPPED+= pl_PL.UTF-8 pl_PL.ISO8859-2 -LOCALES_MAPPED+= ro_RO.UTF-8 ro_RO.ISO8859-2 -LOCALES_MAPPED+= sl_SI.UTF-8 sl_SI.ISO8859-2 -LOCALES_MAPPED+= sv_SE.UTF-8 sv_SE.ISO8859-15 -LOCALES_MAPPED+= sv_SE.UTF-8 sv_SE.ISO8859-1 -LOCALES_MAPPED+= sv_SE.UTF-8 sv_FI.ISO8859-15 -LOCALES_MAPPED+= sv_SE.UTF-8 sv_FI.ISO8859-1 -LOCALES_MAPPED+= tr_TR.UTF-8 tr_TR.ISO8859-9 -LOCALES_MAPPED+= uk_UA.UTF-8 uk_UA.KOI8-U -LOCALES_MAPPED+= uk_UA.UTF-8 uk_UA.ISO8859-5 -LOCALES_MAPPED+= uk_UA.UTF-8 uk_UA.CP1251 +LOCALES_MAPPED+= af_ZA.ISO8859-1 af_ZA.ISO8859-15 +LOCALES_MAPPED+= be_BY.ISO8859-5 be_BY.CP1251 +LOCALES_MAPPED+= be_BY.ISO8859-5 be_BY.CP1131 +LOCALES_MAPPED+= ru_RU.KOI8-R ru_RU.ISO8859-5 +LOCALES_MAPPED+= ru_RU.KOI8-R RU.CP866 +LOCALES_MAPPED+= ru_RU.KOI8-R ru_RU.CP1251 +LOCALES_MAPPED+= ru_RU.KOI8-R bg_BG.CP1251 +LOCALES_MAPPED+= ca_IT.ISO8859-15 ca_IT.ISO8859-1 +LOCALES_MAPPED+= ca_IT.ISO8859-15 ca_FR.ISO8859-15 +LOCALES_MAPPED+= ca_IT.ISO8859-15 ca_FR.ISO8859-1 +LOCALES_MAPPED+= ca_IT.ISO8859-15 ca_ES.ISO8859-15 +LOCALES_MAPPED+= ca_IT.ISO8859-15 ca_ES.ISO8859-1 +LOCALES_MAPPED+= ca_IT.ISO8859-15 ca_AD.ISO8859-15 +LOCALES_MAPPED+= ca_IT.ISO8859-15 ca_AD.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 pt_PT.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 pt_BR.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 nl_NL.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 nl_NL.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 nl_BE.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 nl_BE.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 it_IT.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 it_IT.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 it_CH.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 it_CH.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 fr_FR.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 fr_FR.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 fr_CH.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 fr_CH.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 fr_BE.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 fr_BE.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 eu_ES.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 eu_ES.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_ZA.US-ASCII +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_ZA.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_ZA.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_US.US-ASCII +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_US.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_US.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_SG.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_NZ.US-ASCII +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_NZ.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_NZ.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_IE.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_IE.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_HK.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_GB.US-ASCII +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_GB.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_GB.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_CA.US-ASCII +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_CA.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_CA.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_AU.US-ASCII +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_AU.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 en_AU.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 de_DE.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 de_DE.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 de_CH.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 de_CH.ISO8859-1 +LOCALES_MAPPED+= pt_PT.ISO8859-15 de_AT.ISO8859-15 +LOCALES_MAPPED+= pt_PT.ISO8859-15 de_AT.ISO8859-1 +LOCALES_MAPPED+= es_MX.ISO8859-1 es_ES.ISO8859-15 +LOCALES_MAPPED+= es_MX.ISO8859-1 es_ES.ISO8859-1 +LOCALES_MAPPED+= es_MX.ISO8859-1 es_AR.ISO8859-1 +LOCALES_MAPPED+= et_EE.ISO8859-15 et_EE.ISO8859-1 +LOCALES_MAPPED+= fi_FI.ISO8859-15 fi_FI.ISO8859-1 +LOCALES_MAPPED+= fr_CA.ISO8859-15 fr_CA.ISO8859-1 +LOCALES_MAPPED+= is_IS.ISO8859-15 is_IS.ISO8859-1 +LOCALES_MAPPED+= sv_SE.ISO8859-15 sv_SE.ISO8859-1 +LOCALES_MAPPED+= sv_SE.ISO8859-15 sv_FI.ISO8859-15 +LOCALES_MAPPED+= sv_SE.ISO8859-15 sv_FI.ISO8859-1 +LOCALES_MAPPED+= uk_UA.KOI8-U uk_UA.ISO8859-5 +LOCALES_MAPPED+= uk_UA.KOI8-U uk_UA.CP1251 +LOCALES+= ko_KR.eucKR +LOCALES+= lt_LT.ISO8859-13 +LOCALES+= lv_LV.ISO8859-13 +LOCALES+= pl_PL.ISO8859-2 +LOCALES+= ro_RO.ISO8859-2 +LOCALES+= sl_SI.ISO8859-2 +LOCALES+= sv_SE.ISO8859-15 +LOCALES+= tr_TR.ISO8859-9 +LOCALES+= uk_UA.KOI8-U +LOCALES+= ja_JP.SJIS +LOCALES+= is_IS.ISO8859-15 +LOCALES+= hy_AM.ARMSCII-8 +LOCALES+= hi_IN.ISCII-DEV +LOCALES+= fr_CA.ISO8859-15 +LOCALES+= fi_FI.ISO8859-15 +LOCALES+= et_EE.ISO8859-15 +LOCALES+= es_MX.ISO8859-1 +LOCALES+= af_ZA.ISO8859-1 +LOCALSE+= be_BY.ISO8859-5 +LOCALES+= pt_PT.ISO8859-15 +LOCALES+= el_GR.ISO8859-7 +LOCALES+= ru_RU.KOI8-R LOCALES+= cs_CZ.ISO8859-2 LOCALES+= da_DK.ISO8859-1 LOCALES+= da_DK.ISO8859-15 @@ -170,47 +128,6 @@ LOCALES+= ja_JP.eucJP LOCALES+= nn_NO.ISO8859-15 LOCALES+= nn_NO.ISO8859-1 - -SAME+= ar_SA.UTF-8 ar_QA.UTF-8 -SAME+= ar_SA.UTF-8 ar_MA.UTF-8 -SAME+= ar_SA.UTF-8 ar_JO.UTF-8 -SAME+= ar_SA.UTF-8 ar_EG.UTF-8 -SAME+= ar_SA.UTF-8 ar_AE.UTF-8 -SAME+= ru_RU.UTF-8 mn_MN.UTF-8 -SAME+= ru_RU.UTF-8 bg_BG.UTF-8 -SAME+= ca_AD.UTF-8 ca_IT.UTF-8 -SAME+= ca_AD.UTF-8 ca_FR.UTF-8 -SAME+= ca_AD.UTF-8 ca_ES.UTF-8 -SAME+= en_US.UTF-8 pt_PT.UTF-8 -SAME+= en_US.UTF-8 pt_BR.UTF-8 -SAME+= en_US.UTF-8 nl_NL.UTF-8 -SAME+= en_US.UTF-8 nl_BE.UTF-8 -SAME+= en_US.UTF-8 it_IT.UTF-8 -SAME+= en_US.UTF-8 it_CH.UTF-8 -SAME+= en_US.UTF-8 ga_IE.UTF-8 -SAME+= en_US.UTF-8 fr_FR.UTF-8 -SAME+= en_US.UTF-8 fr_CH.UTF-8 -SAME+= en_US.UTF-8 fr_BE.UTF-8 -SAME+= en_US.UTF-8 eu_ES.UTF-8 -SAME+= en_US.UTF-8 en_ZA.UTF-8 -SAME+= en_US.UTF-8 en_SG.UTF-8 -SAME+= en_US.UTF-8 en_PH.UTF-8 -SAME+= en_US.UTF-8 en_NZ.UTF-8 -SAME+= en_US.UTF-8 en_IE.UTF-8 -SAME+= en_US.UTF-8 en_HK.UTF-8 -SAME+= en_US.UTF-8 en_GB.UTF-8 -SAME+= en_US.UTF-8 en_CA.UTF-8 -SAME+= en_US.UTF-8 en_AU.UTF-8 -SAME+= en_US.UTF-8 de_DE.UTF-8 -SAME+= en_US.UTF-8 de_CH.UTF-8 -SAME+= en_US.UTF-8 de_AT.UTF-8 -SAME+= es_MX.UTF-8 es_ES.UTF-8 -SAME+= es_MX.UTF-8 es_CR.UTF-8 -SAME+= es_MX.UTF-8 es_AR.UTF-8 -SAME+= nn_NO.UTF-8 nb_NO.UTF-8 -SAME+= se_NO.UTF-8 se_FI.UTF-8 -SAME+= sv_SE.UTF-8 sv_FI.UTF-8 -SAME+= zh_TW.UTF-8 zh_HK.UTF-8 SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.LC_COLLATE/} diff --git a/share/colldef/af_ZA.UTF-8.src b/share/colldef/af_ZA.ISO8859-1.src similarity index 100% rename from share/colldef/af_ZA.UTF-8.src rename to share/colldef/af_ZA.ISO8859-1.src diff --git a/share/colldef/be_BY.UTF-8.src b/share/colldef/be_BY.ISO8859-5.src similarity index 100% rename from share/colldef/be_BY.UTF-8.src rename to share/colldef/be_BY.ISO8859-5.src diff --git a/share/colldef/ca_IT.ISO8859-15.src b/share/colldef/ca_IT.ISO8859-15.src new file mode 100644 index 000000000000..1b5dbf8869c5 --- /dev/null +++ b/share/colldef/ca_IT.ISO8859-15.src @@ -0,0 +1,2433 @@ +# Warning: Do not edit. This file is automatically extracted from the +# tools in /usr/src/tools/tools/locale. The data is obtained from the +# CLDR project, obtained from http://cldr.unicode.org/ +# ----------------------------------------------------------------------------- +comment_char * +escape_char / +LC_COLLATE +************* + + + +* Define collation weights as symbols + +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol *** 89966 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Jul 23 15:07:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E20B9673E3C; Fri, 23 Jul 2021 15:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWXjK5tDwz547d; Fri, 23 Jul 2021 15:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA53B2729E; Fri, 23 Jul 2021 15:07: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 16NF71XZ044303; Fri, 23 Jul 2021 15:07:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NF71Vj044302; Fri, 23 Jul 2021 15:07:01 GMT (envelope-from git) Date: Fri, 23 Jul 2021 15:07:01 GMT Message-Id: <202107231507.16NF71Vj044302@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: fb25fdcaa34f - main - locales: only generate unicode locales MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb25fdcaa34f35a4c984b2da12f251fce3d75b0a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 15:07:02 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=fb25fdcaa34f35a4c984b2da12f251fce3d75b0a commit fb25fdcaa34f35a4c984b2da12f251fce3d75b0a Author: Baptiste Daroussin AuthorDate: 2021-07-23 14:10:24 +0000 Commit: Baptiste Daroussin CommitDate: 2021-07-23 14:58:20 +0000 locales: only generate unicode locales --- tools/tools/locale/Makefile | 82 ++++++------------------------------ tools/tools/locale/etc/charmaps.xml | 47 --------------------- tools/tools/locale/tools/cldr2def.pl | 35 --------------- tools/tools/locale/tools/finalize | 34 +-------------- 4 files changed, 14 insertions(+), 184 deletions(-) diff --git a/tools/tools/locale/Makefile b/tools/tools/locale/Makefile index 92f890b2f4d3..0efca83a971e 100644 --- a/tools/tools/locale/Makefile +++ b/tools/tools/locale/Makefile @@ -32,33 +32,9 @@ tools-test: KNOWN= monetdef numericdef msgdef colldef ctypedef # timedef TYPES?= ${KNOWN} -COLLATION_SPECIAL?= \ - cs_CZ ISO8859-2 \ - da_DK ISO8859-1 \ - da_DK ISO8859-15 \ - hr_HR ISO8859-2 \ - hu_HU ISO8859-2 \ - nb_NO ISO8859-1 \ - nb_NO ISO8859-15 \ - sk_SK ISO8859-2 \ - sr_Latn_RS ISO8859-2 \ - sr_Cyrl_RS ISO8859-5 \ - zh_Hans_CN GB2312 \ - zh_Hans_CN eucCN \ - zh_Hant_TW Big5 \ - zh_Hans_CN GB18030 \ - zh_Hans_CN GBK \ - ja_JP eucJP \ - nn_NO ISO8859-15 \ - nn_NO ISO8859-1 - -.for area enc in ${COLLATION_SPECIAL} -COLLATIONS_SPECIAL_ENV+= ${area}.${enc} -.endfor SETENV= env -i \ PATH="${PATH}" \ TMPDIR="${TMPDIR}" \ - COLLATIONS_SPECIAL="${COLLATIONS_SPECIAL_ENV}" \ UNIDIR="${UNIDIR}" \ BASEDIR="${BASEDIR}" \ TOOLSDIR="${TOOLSDIR}" \ @@ -89,16 +65,22 @@ diff-${t}: .endfor install: -.for t in ${TYPES} +.for t in ${TYPES:Nctypedef} . if ${KNOWN:M${t}} install: install-${t} install-${t}: - cd ${LOCALESRCDIR}/${t} && \ + cd ${LOCALESRCDIR}/${t}_unicode && \ rm -f Makefile *.src && \ cd ${.OBJDIR} && \ - install -m 644 ${t}/* ${LOCALESRCDIR}/${t} + install -m 644 ${t}/* ${LOCALESRCDIR}/${t}_unicode . endif .endfor +install: install-ctypedef +install-ctypedef: + cd ${LOCALESRCDIR}/ctypedef && \ + rm -f C.UTF-8.src && \ + cd ${.OBJDIR} && \ + install -m 644 ctypedef/C.UTF-8.src ${LOCALESRCDIR}/ctypedef post-install: .for t in ${TYPES} @@ -121,15 +103,6 @@ build-${t}: ${t} ${SETENV} OUTBASEDIR="${.OBJDIR}/${t}" ${TOOLSDIR}/finalize ${t} .endfor -static-colldef: colldef -build-colldef: static-colldef - -static-colldef: -.for area enc in ${COLLATION_SPECIAL} - awk -f ${TOOLSDIR}/extract-colldef.awk \ - posix/${area}.${enc}.src > colldef.draft/${area}.${enc}.src -.endfor - BASE_LOCALES_OF_INTEREST?= \ af_ZA am_ET ar_AE ar_EG ar_JO ar_MA ar_QA ar_SA \ be_BY bg_BG ca_AD ca_ES ca_FR ca_IT \ @@ -147,35 +120,14 @@ BASE_LOCALES_OF_INTEREST?= \ th_TH lo_LA bo_IN my_MM pa_Guru_IN ka_GE chr_US \ km_KH shi_Tfng_MA ii_CN vai_Vaii_LR vi_VN -ENCODINGS= Big5 \ - CP1251 \ - CP866 \ - CP949 \ - eucCN \ - eucJP \ - eucKR \ - GB18030 \ - GB2312 \ - GBK \ - ISO8859-1 \ - ISO8859-13 \ - ISO8859-15 \ - ISO8859-2 \ - ISO8859-5 \ - ISO8859-7 \ - ISO8859-9 \ - KOI8-R \ - KOI8-U \ - SJIS \ - US-ASCII \ - UTF-8 \ +ENCODINGS= UTF-8 \ UTF-32 # CLDR files CLDRFILES_CORE= https://unicode.org/Public/cldr/35/core.zip CLDRFILES_KEY= https://unicode.org/Public/cldr/35/keyboards.zip CLDRFILES_TOOLS=https://unicode.org/Public/cldr/35/tools.zip -CLDRFILES_UCD= http://www.unicode.org/Public/zipped/latest/UCD.zip +CLDRFILES_UCD= http://www.unicode.org/Public/zipped/13.0.0/UCD.zip # fetch and extract targets ${UNIDIR}: @@ -206,8 +158,8 @@ build-tools: JAVA_CLDR= java -DCLDR_DIR=${UNIDIR:Q} -jar ${UNIDIR}/tools/java/cldr.jar -posix: posixcm post-posixcm posixsrc posixcol -.ORDER: posixcm post-posixcm posixsrc posixcol +posix: posixcm post-posixcm posixsrc +.ORDER: posixcm post-posixcm posixsrc ${UNIDIR}/posix: ln -s -f ../posix ${.TARGET} clean-posix: @@ -232,14 +184,6 @@ posix/${area}.UTF-8.src: ${JAVA_CLDR} org.unicode.cldr.posix.GeneratePOSIX \ -d posix -m ${area} -c UTF-8 .endfor -.for area encoding in ${COLLATION_SPECIAL} -posixcol: build-tools posix/${area}.${encoding}.src -.ORDER: build-tools posix/${area}.${encoding}.src -posix/${area}.${encoding}.src: - mkdir -p posix && \ - ${JAVA_CLDR} org.unicode.cldr.posix.GeneratePOSIX \ - -d posix -m ${area} -c ${encoding} -.endfor # generate widths.txt using the data from libut8proc GETWIDTHS=${TOOLSDIR}/getwidths diff --git a/tools/tools/locale/etc/charmaps.xml b/tools/tools/locale/etc/charmaps.xml index 52e80f2dee05..9d42b1e5247c 100644 --- a/tools/tools/locale/etc/charmaps.xml +++ b/tools/tools/locale/etc/charmaps.xml @@ -28,169 +28,122 @@ --> diff --git a/tools/tools/locale/tools/cldr2def.pl b/tools/tools/locale/tools/cldr2def.pl index fd475db714a0..70e0bdad525b 100755 --- a/tools/tools/locale/tools/cldr2def.pl +++ b/tools/tools/locale/tools/cldr2def.pl @@ -65,7 +65,6 @@ my %values = (); my %hashtable = (); my %languages = (); my %translations = (); -my %encodings = (); my %alternativemonths = (); get_languages(); @@ -74,7 +73,6 @@ $utfmap{'UTF-8'} = {}; $utfmap{'UTF-32'} = {}; get_utfmap("$UNIDIR/posix/$DEFENCODING.cm", $utfmap{'UTF-8'}); get_utfmap("$UNIDIR/posix/UTF-32.cm", $utfmap{'UTF-32'}); -get_encodings("$ETCDIR/charmaps"); my %keys = (); tie(%keys, "Tie::IxHash"); @@ -384,44 +382,11 @@ sub resolve_enc_addition { return $ret; } -sub get_encodings { - my $dir = shift; - foreach my $e (sort(keys(%encodings))) { - if (!open(FIN, "$dir/$e.TXT")) { - print "Cannot open charmap for $e\n"; - next; - - } - $encodings{$e} = 1; - my @lines = ; - close(FIN); - chomp(@lines); - foreach my $l (@lines) { - $l =~ s/\r//; - next if ($l eq ""); - - my @a = split(" ", $l); - next if ($#a < 1); - next if ($a[0] =~ /^\#/ or $a[1] =~ /^\#/); - next if ($a[0] eq '' or $a[1] eq ''); - - $a[0] = resolve_enc_addition($a[0]); # local - $a[1] = resolve_enc_addition($a[1]); # UTF-32 - my $u32 = sprintf("%08X", hex($a[1])); -# print STDERR "$a[1] => $u32\n"; - - # Use UTF-32 as the indices. - $convertors{$e}{$u32} = uc($a[0]); - } - } -} - sub get_languages { my %data = get_xmldata($ETCDIR); %languages = %{$data{L}}; %translations = %{$data{T}}; %alternativemonths = %{$data{AM}}; - %encodings = %{$data{E}}; } sub transform_ctypes { diff --git a/tools/tools/locale/tools/finalize b/tools/tools/locale/tools/finalize index 88dfcad0cb24..207b97ff3cb5 100755 --- a/tools/tools/locale/tools/finalize +++ b/tools/tools/locale/tools/finalize @@ -82,7 +82,6 @@ for i in *_*_*.*.src; do nname=`echo $oldname | awk '{ split($0, a, "_"); print a[1]"_"a[3]"@"a[2];} '` mv -f ${oldname}.src ${nname}.src sed -i '' -e "s/${oldname}/${nname}/g" Makefile - COLLATIONS_SPECIAL=$(echo ${COLLATIONS_SPECIAL} | sed -e "s/${oldname}/${nname}/g") done # For variable without @modifier ambiguity do not keep the @modifier @@ -95,7 +94,6 @@ for i in *@*.src; do if [ $(ls ${shortname}@* | wc -l) -eq 1 ] ; then mv -f $i ${shortname}.src sed -i '' -e "s/${oldname}/${shortname}/g" Makefile - COLLATIONS_SPECIAL=$(echo ${COLLATIONS_SPECIAL} | sed -e "s/${oldname}/${shortname}/g") fi done @@ -106,7 +104,6 @@ for i in *@Latn.src; do fi mv -f ${i} ${i%@*}@latin.src sed -i '' -e "s/${i%.*}/${i%@*}@latin/g" Makefile - COLLATIONS_SPECIAL=$(echo ${COLLATIONS_SPECIAL} | sed -e "s/${i%.*}/${i%@*}@latin/g") done for i in *@Cyrl.src; do @@ -115,7 +112,6 @@ for i in *@Cyrl.src; do fi mv -f ${i} ${i%@*}@cyrillic.src sed -i '' -e "s/${i%.*}/${i%@*}@cyrillic/g" Makefile - COLLATIONS_SPECIAL=$(echo ${COLLATIONS_SPECIAL} | sed -e "s/${i%.*}/${i%@*}@cyrillic/g") done # On locales with multiple modifiers rename the "default" version without the @modifier @@ -150,30 +146,6 @@ then /usr/bin/sed -E -e 's/[ ]+/ /g' \ ${UNIDIR}/posix/UTF-8.cm \ > ${ETCDIR}/final-maps/map.UTF-8 - /usr/bin/sed -E -e 's/[ ]+/ /g' \ - ${UNIDIR}/posix/eucCN.cm \ - > ${ETCDIR}/final-maps/map.eucCN - /usr/bin/sed -E -e 's/[ ]+/ /g' \ - ${UNIDIR}/posix/eucCN.cm \ - > ${ETCDIR}/final-maps/map.GB2312 - - # GB18030 and Big5 are pre-generated from CLDR data - CHARMAPS="ARMSCII-8 CP1131 CP1251 \ - CP866 GBK ISCII-DEV ISO8859-1 \ - ISO8859-13 ISO8859-15 ISO8859-2 ISO8859-4 \ - ISO8859-5 ISO8859-7 ISO8859-9 KOI8-R KOI8-U \ - PT154 SJIS US-ASCII eucJP eucKR" - - for map in ${CHARMAPS} - do - encoding=${map} - env ETCDIR="${ETCDIR}" \ - /usr/local/bin/perl ${TOOLSDIR}/convert_map.pl \ - ${ETCDIR}/charmaps/${map}.TXT ${encoding} \ - | /usr/bin/sed -E -e 's/ +/ /g' \ - > ${ETCDIR}/final-maps/map.${map} - echo map ${map} converted. - done elif [ $1 = "colldef" ] then @@ -190,13 +162,9 @@ then sed -i '' "/^SAME.*$line$/d" ${old}/Makefile done echo "" >> ${TEMP4} - for enc in ${COLLATIONS_SPECIAL}; do - sed -i '' "/^.*${enc}$/d" ${TEMP4} - echo "LOCALES+= ${enc}" >> ${TEMP4} - done keep=$(cat ${TEMP} | awk '{ print $2 }') - for original in ${keep} ${COLLATIONS_SPECIAL} + for original in ${keep} do cp ${old}/${original}.src ${new}/ done From owner-dev-commits-src-main@freebsd.org Fri Jul 23 15:07:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F11C5674103; Fri, 23 Jul 2021 15:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWXjJ5Trgz545J; Fri, 23 Jul 2021 15:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FA4126D7F; Fri, 23 Jul 2021 15:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NF70VW044277; Fri, 23 Jul 2021 15:07:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NF7073044276; Fri, 23 Jul 2021 15:07:00 GMT (envelope-from git) Date: Fri, 23 Jul 2021 15:07:00 GMT Message-Id: <202107231507.16NF7073044276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: ecff3c30b7e4 - main - locales: now that C.UTF-8 is the default locale, always install it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecff3c30b7e4ed8883c007b019f90a8128d16441 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 15:07:01 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=ecff3c30b7e4ed8883c007b019f90a8128d16441 commit ecff3c30b7e4ed8883c007b019f90a8128d16441 Author: Baptiste Daroussin AuthorDate: 2021-07-23 12:15:04 +0000 Commit: Baptiste Daroussin CommitDate: 2021-07-23 14:58:20 +0000 locales: now that C.UTF-8 is the default locale, always install it MFC after: 3 weeks --- share/Makefile | 3 +-- share/ctypedef/Makefile | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/share/Makefile b/share/Makefile index dfa5ff1a65a2..5d81f3229760 100644 --- a/share/Makefile +++ b/share/Makefile @@ -6,7 +6,7 @@ # Do not include `info' in the SUBDIR list, it is handled separately. SUBDIR= ${_colldef} \ - ${_ctypedef} \ + ctypedef \ ${_dict} \ ${_doc} \ ${_dtrace} \ @@ -55,7 +55,6 @@ _i18n= i18n .if ${MK_LOCALES} != "no" _colldef= colldef colldef_unicode _monetdef= monetdef monetdef_unicode -_ctypedef= ctypedef _msgdef= msgdef msgdef_unicode _numericdef= numericdef numericdef_unicode _timedef= timedef diff --git a/share/ctypedef/Makefile b/share/ctypedef/Makefile index 89d7e674a39e..4272b4de4f50 100644 --- a/share/ctypedef/Makefile +++ b/share/ctypedef/Makefile @@ -6,6 +6,7 @@ FILESNAME= LC_CTYPE MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps .include +.include .src.LC_CTYPE: localedef ${LOCALEDEF_ENDIAN} -D -U -c -w ${MAPLOC}/widths.txt \ @@ -13,6 +14,7 @@ MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps -i ${.IMPSRC} ${.OBJDIR}/${.IMPSRC:T:R} || true LOCALES+= C.UTF-8 +.if ${MK_LOCALES} != no LOCALES+= be_BY.CP1131 LOCALES+= ca_IT.ISO8859-1 LOCALES+= ca_IT.ISO8859-15 @@ -206,6 +208,7 @@ SAME+= en_US.US-ASCII en_CA.US-ASCII SAME+= en_US.US-ASCII en_AU.US-ASCII SAME+= lv_LV.ISO8859-13 lt_LT.ISO8859-13 SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) +.endif FILES= ${LOCALES:S/$/.LC_CTYPE/} CLEANFILES= ${FILES} From owner-dev-commits-src-main@freebsd.org Fri Jul 23 15:07:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FFEB67410A; Fri, 23 Jul 2021 15:07: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 4GWXjM0BXfz53vy; Fri, 23 Jul 2021 15:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D58C227300; Fri, 23 Jul 2021 15:07: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 16NF72qS044332; Fri, 23 Jul 2021 15:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NF72eM044331; Fri, 23 Jul 2021 15:07:02 GMT (envelope-from git) Date: Fri, 23 Jul 2021 15:07:02 GMT Message-Id: <202107231507.16NF72eM044331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 74e9e0e0b0d4 - main - locales: prepare CLDR update to v39.0 and Unicode to 13.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74e9e0e0b0d41816f3cfaa635e507f603a1ac57e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 15:07:03 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=74e9e0e0b0d41816f3cfaa635e507f603a1ac57e commit 74e9e0e0b0d41816f3cfaa635e507f603a1ac57e Author: Baptiste Daroussin AuthorDate: 2021-07-23 14:24:51 +0000 Commit: Baptiste Daroussin CommitDate: 2021-07-23 14:58:20 +0000 locales: prepare CLDR update to v39.0 and Unicode to 13.0.0 Note that rebuilding the cldr tool is not necessary anymore, also note that the sources are not anymore provided along with the other distfiles --- tools/tools/locale/Makefile | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/tools/tools/locale/Makefile b/tools/tools/locale/Makefile index 0efca83a971e..16bd9a259dda 100644 --- a/tools/tools/locale/Makefile +++ b/tools/tools/locale/Makefile @@ -21,7 +21,6 @@ PATCHDIR= ${BASEDIR}/patch UNIDIR= ${.OBJDIR:tA}/unicode PKGS= openjdk8 \ - apache-ant \ p5-XML-Parser \ p5-Tie-IxHash \ p5-Text-Iconv @@ -124,9 +123,10 @@ ENCODINGS= UTF-8 \ UTF-32 # CLDR files -CLDRFILES_CORE= https://unicode.org/Public/cldr/35/core.zip -CLDRFILES_KEY= https://unicode.org/Public/cldr/35/keyboards.zip -CLDRFILES_TOOLS=https://unicode.org/Public/cldr/35/tools.zip +CLDRVERSION= 39.0 +CLDRFILES_CORE= https://unicode.org/Public/cldr/${CLDRVERSION:R}/core.zip +CLDRFILES_KEY= https://unicode.org/Public/cldr/${CLDRVERSION:R}/cldr-keyboards-${CLDRVERSION}.zip +CLDRFILES_TOOLS=https://unicode.org/Public/cldr/${CLDRVERSION:R}/cldr-tools-${CLDRVERSION}.jar CLDRFILES_UCD= http://www.unicode.org/Public/zipped/13.0.0/UCD.zip # fetch and extract targets @@ -140,27 +140,17 @@ extract-${CLDRFILES_${N}:T}:: ${CLDRFILES_${N}:T} ${UNIDIR} cd ${UNIDIR} && unzip -o ../${CLDRFILES_${N}:T} extract: extract-${CLDRFILES_${N}:T} .endfor - grep 'name="version"' ${UNIDIR}/tools/build.xml | \ - sed 's/.* value="//;s/".*//' > ${UNIDIR}/cldr-version + echo ${CLDRVERSION} > ${UNIDIR}/cldr-version patch:: .if exists(${PATCHDIR}) cd ${UNIDIR} && cat ${PATCHDIR}/patch-* | patch .endif -.if !exists(${UNIDIR}/tools/java/cldr.jar) -.ORDER: extract patch -build-tools: extract patch tools-test ${UNIDIR} - cd ${UNIDIR}/tools/java && ${SETENV} ant all jar -.else -build-tools: - @echo cldr.jar is ready. -.endif - -JAVA_CLDR= java -DCLDR_DIR=${UNIDIR:Q} -jar ${UNIDIR}/tools/java/cldr.jar +JAVA_CLDR= java -DCLDR_DIR=${UNIDIR:Q} -jar ${.OBJDIR:tA}//${CLDRFILES_TOOLS:T} posix: posixcm post-posixcm posixsrc .ORDER: posixcm post-posixcm posixsrc -${UNIDIR}/posix: +${UNIDIR}/posix: ${UNIDIR} ln -s -f ../posix ${.TARGET} clean-posix: rm -rf posix ${UNIDIR}/posix @@ -169,16 +159,16 @@ ${UNIDIR}/posix/xx_Comm_C.UTF-8.src: ${UNIDIR}/posix --unidir=${UNIDIR} post-posixcm: ${UNIDIR}/posix/xx_Comm_C.UTF-8.src .for enc in ${ENCODINGS} -posixcm: build-tools posix/${enc}.cm -.ORDER: build-tools posix/${enc}.cm +posixcm: posix/${enc}.cm +.ORDER: posix/${enc}.cm posix/${enc}.cm: mkdir -p posix && \ ${JAVA_CLDR} org.unicode.cldr.posix.GenerateCharmap \ -d posix -c ${enc} .endfor .for area in ${BASE_LOCALES_OF_INTEREST} -posixsrc: build-tools posix/${area}.UTF-8.src -.ORDER: build-tools posix/${area}.UTF-8.src +posixsrc: posix/${area}.UTF-8.src +.ORDER: posix/${area}.UTF-8.src posix/${area}.UTF-8.src: mkdir -p posix && \ ${JAVA_CLDR} org.unicode.cldr.posix.GeneratePOSIX \ From owner-dev-commits-src-main@freebsd.org Fri Jul 23 15:07:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C32116740D9; Fri, 23 Jul 2021 15:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWXjR4f1Rz545W; Fri, 23 Jul 2021 15:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B63F2705D; Fri, 23 Jul 2021 15:07: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 16NF77M5044384; Fri, 23 Jul 2021 15:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NF77om044383; Fri, 23 Jul 2021 15:07:07 GMT (envelope-from git) Date: Fri, 23 Jul 2021 15:07:07 GMT Message-Id: <202107231507.16NF77om044383@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: bd90d8bbb1af - main - locale: Add Farsi/Persian locales MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd90d8bbb1af17f0eab55163c98945c64984f36b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 15:07:07 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=bd90d8bbb1af17f0eab55163c98945c64984f36b commit bd90d8bbb1af17f0eab55163c98945c64984f36b Author: Faraz Vahedi AuthorDate: 2021-07-23 14:52:45 +0000 Commit: Baptiste Daroussin CommitDate: 2021-07-23 14:58:20 +0000 locale: Add Farsi/Persian locales MFC after: 3 weeks Reviewed by: farrokhi Differential Revision: https://reviews.freebsd.org/D24359 --- share/colldef_unicode/Makefile | 2 + share/colldef_unicode/fa_AF.UTF-8.src | 1901 ++++++++++++++++++++ share/colldef_unicode/fa_IR.UTF-8.src | 1895 +++++++++++++++++++ share/ctypedef/Makefile | 2 + share/monetdef_unicode/Makefile | 2 + share/monetdef_unicode/fa_AF.UTF-8.src | 50 + share/monetdef_unicode/fa_IR.UTF-8.src | 50 + share/msgdef_unicode/Makefile | 2 + share/msgdef_unicode/fa_IR.UTF-8.src | 17 + share/numericdef_unicode/Makefile | 12 +- .../{ar_SA.UTF-8.src => fa_IR.UTF-8.src} | 0 share/timedef/Makefile | 2 + share/timedef/fa_AF.UTF-8.src | 83 + share/timedef/fa_IR.UTF-8.src | 83 + tools/tools/locale/Makefile | 2 +- tools/tools/locale/etc/charmaps.xml | 2 + 16 files changed, 4099 insertions(+), 6 deletions(-) diff --git a/share/colldef_unicode/Makefile b/share/colldef_unicode/Makefile index 00d64f479a52..e84d952a1316 100644 --- a/share/colldef_unicode/Makefile +++ b/share/colldef_unicode/Makefile @@ -27,6 +27,8 @@ LOCALES+= el_GR.UTF-8 LOCALES+= en_US.UTF-8 LOCALES+= es_MX.UTF-8 LOCALES+= et_EE.UTF-8 +LOCALES+= fa_AF.UTF-8 +LOCALES+= fa_IR.UTF-8 LOCALES+= fi_FI.UTF-8 LOCALES+= fr_CA.UTF-8 LOCALES+= he_IL.UTF-8 diff --git a/share/colldef_unicode/fa_AF.UTF-8.src b/share/colldef_unicode/fa_AF.UTF-8.src new file mode 100644 index 000000000000..bf0e001bd7d5 --- /dev/null +++ b/share/colldef_unicode/fa_AF.UTF-8.src @@ -0,0 +1,1901 @@ +# Warning: Do not edit. This file is automatically extracted from the +# tools in /usr/src/tools/tools/locale. The data is obtained from the +# CLDR project, obtained from http://cldr.unicode.org/ +# ----------------------------------------------------------------------------- +comment_char * +escape_char / +LC_COLLATE +************* + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + + +* Define collation weights as symbols + +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol + +order_start forward;forward;forward;forward + + +* collation weights in order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +* assignment of characters to weights + + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;IGNORE;IGNORE; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + "";;""; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + "";;""; + "";;""; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + "";;""; + "";;""; + ;;; + ;;; + ;;; + ;;; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; + "";"";""; *** 3301 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Jul 23 15:07:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F635673BF9; Fri, 23 Jul 2021 15:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWXjQ2blMz53y3; Fri, 23 Jul 2021 15:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AA4427216; Fri, 23 Jul 2021 15:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NF76eN044360; Fri, 23 Jul 2021 15:07:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NF73iR044355; Fri, 23 Jul 2021 15:07:03 GMT (envelope-from git) Date: Fri, 23 Jul 2021 15:07:03 GMT Message-Id: <202107231507.16NF73iR044355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 3a04284df092 - main - locales: upgrade CLDR to 39.0 and Unicode to 13.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a04284df09203b837948a492ccce797e1403e94 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 15:07:06 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3a04284df09203b837948a492ccce797e1403e94 commit 3a04284df09203b837948a492ccce797e1403e94 Author: Baptiste Daroussin AuthorDate: 2021-07-23 14:32:19 +0000 Commit: Baptiste Daroussin CommitDate: 2021-07-23 14:58:20 +0000 locales: upgrade CLDR to 39.0 and Unicode to 13.0.0 MFC after: 3 weeks Relnotes: yes --- share/colldef_unicode/Makefile | 6 +- share/colldef_unicode/af_ZA.UTF-8.src | 311 +- share/colldef_unicode/am_ET.UTF-8.src | 186 +- share/colldef_unicode/ar_SA.UTF-8.src | 338 +- share/colldef_unicode/be_BY.UTF-8.src | 80 +- share/colldef_unicode/ca_AD.UTF-8.src | 311 +- share/colldef_unicode/cs_CZ.UTF-8.src | 311 +- share/colldef_unicode/da_DK.UTF-8.src | 311 +- share/colldef_unicode/el_GR.UTF-8.src | 80 +- share/colldef_unicode/en_US.UTF-8.src | 311 +- share/colldef_unicode/es_MX.UTF-8.src | 311 +- share/colldef_unicode/et_EE.UTF-8.src | 411 +- share/colldef_unicode/fi_FI.UTF-8.src | 311 +- share/colldef_unicode/fr_CA.UTF-8.src | 311 +- share/colldef_unicode/he_IL.UTF-8.src | 254 +- share/colldef_unicode/hi_IN.UTF-8.src | 138 +- share/colldef_unicode/hu_HU.UTF-8.src | 311 +- share/colldef_unicode/hy_AM.UTF-8.src | 103 +- share/colldef_unicode/is_IS.UTF-8.src | 339 +- share/colldef_unicode/ja_JP.UTF-8.src | 361 +- share/colldef_unicode/kk_KZ.UTF-8.src | 80 +- share/colldef_unicode/ko_KR.UTF-8.src | 78 +- share/colldef_unicode/lt_LT.UTF-8.src | 311 +- share/colldef_unicode/lv_LV.UTF-8.src | 331 +- share/colldef_unicode/nn_NO.UTF-8.src | 311 +- share/colldef_unicode/pl_PL.UTF-8.src | 311 +- share/colldef_unicode/ro_RO.UTF-8.src | 311 +- share/colldef_unicode/ru_RU.UTF-8.src | 80 +- share/colldef_unicode/se_NO.UTF-8.src | 343 +- share/colldef_unicode/sk_SK.UTF-8.src | 311 +- share/colldef_unicode/sl_SI.UTF-8.src | 311 +- share/colldef_unicode/sr_RS.UTF-8.src | 80 +- share/colldef_unicode/sr_RS.UTF-8@latin.src | 311 +- share/colldef_unicode/sv_SE.UTF-8.src | 311 +- share/colldef_unicode/tr_TR.UTF-8.src | 349 +- share/colldef_unicode/uk_UA.UTF-8.src | 80 +- share/colldef_unicode/zh_CN.UTF-8.src | 85004 +++++++++---------- share/colldef_unicode/zh_TW.UTF-8.src | 4892 +- share/ctypedef/C.UTF-8.src | 1542 +- share/monetdef_unicode/Makefile | 6 +- .../{nl_BE.UTF-8.src => de_AT.UTF-8.src} | 0 share/monetdef_unicode/fr_CA.UTF-8.src | 2 +- share/monetdef_unicode/hr_HR.UTF-8.src | 2 +- share/monetdef_unicode/zh_CN.UTF-8.src | 2 +- share/msgdef_unicode/Makefile | 4 +- share/msgdef_unicode/zh_HK.UTF-8.src | 17 - tools/tools/locale/etc/final-maps/map.UTF-8 | 5931 ++ 47 files changed, 56155 insertions(+), 50251 deletions(-) diff --git a/share/colldef_unicode/Makefile b/share/colldef_unicode/Makefile index 4a56ee9baf96..00d64f479a52 100644 --- a/share/colldef_unicode/Makefile +++ b/share/colldef_unicode/Makefile @@ -7,7 +7,7 @@ FILESNAME= LC_COLLATE .SUFFIXES: .src .LC_COLLATE MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps -CLDR_VERSION= "34.0" +CLDR_VERSION= "39.0" .include @@ -54,7 +54,9 @@ LOCALES+= uk_UA.UTF-8 LOCALES+= zh_CN.UTF-8 LOCALES+= zh_TW.UTF-8 -LOCALES_MAPPED= sr_RS.UTF-8@latin hr_HR.UTF-8 +LOCALES_MAPPED+= sr_RS.UTF-8@latin hr_HR.UTF-8 + + SAME+= ar_SA.UTF-8 ar_QA.UTF-8 SAME+= ar_SA.UTF-8 ar_MA.UTF-8 diff --git a/share/colldef_unicode/af_ZA.UTF-8.src b/share/colldef_unicode/af_ZA.UTF-8.src index 6f6c41c2db99..44c7d4e784e6 100644 --- a/share/colldef_unicode/af_ZA.UTF-8.src +++ b/share/colldef_unicode/af_ZA.UTF-8.src @@ -60,7 +60,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -71,10 +71,10 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -89,23 +89,23 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -129,6 +129,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -161,6 +162,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -214,6 +216,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -225,6 +228,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -363,6 +367,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -378,6 +383,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -412,6 +418,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -425,6 +432,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -553,7 +561,7 @@ order_start forward;forward;forward;forward - + @@ -564,10 +572,10 @@ order_start forward;forward;forward;forward - - - - + + + + @@ -582,23 +590,23 @@ order_start forward;forward;forward;forward - + - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -622,6 +630,7 @@ order_start forward;forward;forward;forward + @@ -654,6 +663,7 @@ order_start forward;forward;forward;forward + @@ -707,6 +717,7 @@ order_start forward;forward;forward;forward + @@ -718,6 +729,7 @@ order_start forward;forward;forward;forward + @@ -856,6 +868,7 @@ order_start forward;forward;forward;forward + @@ -871,6 +884,7 @@ order_start forward;forward;forward;forward + @@ -905,6 +919,7 @@ order_start forward;forward;forward;forward + @@ -918,6 +933,7 @@ order_start forward;forward;forward;forward + @@ -1031,10 +1047,10 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1049,23 +1065,23 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; - ;;; - ;;; + ;;; + ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1170,22 +1186,24 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1238,6 +1256,7 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; + ;;; ;;; ;;; ;;; @@ -1281,22 +1300,25 @@ order_start forward;forward;forward;forward "";"";""; "";"";""; "";"";""; + "";"";""; "";"";""; "";"";""; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1492,10 +1514,12 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1560,10 +1584,12 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1643,8 +1669,8 @@ order_start forward;forward;forward;forward ;"";""; ;"";""; ;"";""; - ;"";""; - ;"";""; + ;"";""; + ;"";""; "";"";""; "";"";""; "";"";""; @@ -1991,10 +2017,11 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -2032,23 +2059,26 @@ order_start forward;forward;forward;forward "";"";""; "";"";""; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -2077,7 +2107,8 @@ order_start forward;forward;forward;forward "";"";""; "";"";""; "";"";""; - "";"";""; + "";"";""; + "";"";""; "";"";""; "";"";""; ;;; @@ -2184,22 +2215,24 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -2255,9 +2288,12 @@ order_start forward;forward;forward;forward ;"";""; ;"";""; ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -2340,10 +2376,11 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; + ;;; ;;; ;;; ;;; - ;;; + ;;; ;;; ;;; ;;; diff --git a/share/colldef_unicode/am_ET.UTF-8.src b/share/colldef_unicode/am_ET.UTF-8.src index 00e78835e3bd..a6d5fcdc9e51 100644 --- a/share/colldef_unicode/am_ET.UTF-8.src +++ b/share/colldef_unicode/am_ET.UTF-8.src @@ -13,13 +13,13 @@ LC_COLLATE collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -33,16 +33,16 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -62,35 +62,35 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol -collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -351,13 +351,13 @@ order_start forward;forward;forward;forward - - - + - + + + @@ -371,16 +371,16 @@ order_start forward;forward;forward;forward - - - - + + - - - + + + + + @@ -400,35 +400,35 @@ order_start forward;forward;forward;forward - + - - - - - - + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + @@ -712,9 +712,9 @@ order_start forward;forward;forward;forward IGNORE;IGNORE;IGNORE; IGNORE;IGNORE;IGNORE; IGNORE;IGNORE;IGNORE; - IGNORE;"";""; - IGNORE;"";""; - IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; ;;; ;;; ;;; @@ -724,16 +724,16 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -751,8 +751,8 @@ order_start forward;forward;forward;forward ;;; ;;; ;;; - ;;; - ;;; + ;;; + ;;; ;;; ;;; "";;""; @@ -765,24 +765,24 @@ order_start forward;forward;forward;forward "";;""; "";;""; "";;""; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; diff --git a/share/colldef_unicode/ar_SA.UTF-8.src b/share/colldef_unicode/ar_SA.UTF-8.src index a903edd4df59..c38a0cd2468a 100644 --- a/share/colldef_unicode/ar_SA.UTF-8.src +++ b/share/colldef_unicode/ar_SA.UTF-8.src @@ -62,43 +62,42 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol collating-symbol -collating-symbol +collating-symbol collating-symbol -collating-symbol +collating-symbol collating-symbol -collating-symbol +collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol *** 139927 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Fri Jul 23 16:07:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67216674D32; Fri, 23 Jul 2021 16:07: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 4GWZ3R25l4z3F3n; Fri, 23 Jul 2021 16:07:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EE9227B59; Fri, 23 Jul 2021 16:07: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 16NG7l60024006; Fri, 23 Jul 2021 16:07:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NG7lg7024005; Fri, 23 Jul 2021 16:07:47 GMT (envelope-from git) Date: Fri, 23 Jul 2021 16:07:47 GMT Message-Id: <202107231607.16NG7lg7024005@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: 048cd371f3d7 - main - vfs: Initialize "lastfail" in vfs_mountroot_wait() 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: 048cd371f3d793fa354f1d3a1d484bc2725a3fc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 16:07:47 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=048cd371f3d793fa354f1d3a1d484bc2725a3fc1 commit 048cd371f3d793fa354f1d3a1d484bc2725a3fc1 Author: Mark Johnston AuthorDate: 2021-07-23 16:04:02 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 16:04:02 +0000 vfs: Initialize "lastfail" in vfs_mountroot_wait() This variable is only used to rate-limit "Root mount waiting for: ..." messages using ppsratecheck(). Reported by: KMSAN MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/vfs_mountroot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index 48753b8c6a96..e2a687511e11 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -983,6 +983,7 @@ vfs_mountroot_wait(void) TSENTER(); curfail = 0; + lastfail.tv_sec = 0; while (1) { g_waitidle(); mtx_lock(&root_holds_mtx); From owner-dev-commits-src-main@freebsd.org Fri Jul 23 17:35:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33D46675EAF; Fri, 23 Jul 2021 17:35: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 4GWc0x12Csz3jkY; Fri, 23 Jul 2021 17:35:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07D1628C5F; Fri, 23 Jul 2021 17:35: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 16NHZieh043493; Fri, 23 Jul 2021 17:35:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NHZi4n043492; Fri, 23 Jul 2021 17:35:44 GMT (envelope-from git) Date: Fri, 23 Jul 2021 17:35:44 GMT Message-Id: <202107231735.16NHZi4n043492@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: d9cc6ea270ea - main - pf: hide struct pf_kstatus behind ifdef _KERNEL 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: d9cc6ea270ea52e860e3cc730876ee4324081586 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 17:35:45 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d9cc6ea270ea52e860e3cc730876ee4324081586 commit d9cc6ea270ea52e860e3cc730876ee4324081586 Author: Mateusz Guzik AuthorDate: 2021-07-23 17:34:43 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-23 17:34:43 +0000 pf: hide struct pf_kstatus behind ifdef _KERNEL Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 1dfc769b197d..66027debaa6b 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1149,6 +1149,7 @@ enum pf_syncookies_mode { PF_SYNCOOKIES_MODE_MAX = PF_SYNCOOKIES_ALWAYS }; +#ifdef _KERNEL struct pf_kstatus { counter_u64_t counters[PFRES_MAX]; /* reason for passing/dropping */ counter_u64_t lcounters[LCNT_MAX]; /* limit counters */ @@ -1166,6 +1167,7 @@ struct pf_kstatus { enum pf_syncookies_mode syncookies_mode; bool syncookies_active; }; +#endif struct pf_divert { union { From owner-dev-commits-src-main@freebsd.org Fri Jul 23 17:35:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CD52675EB1; Fri, 23 Jul 2021 17:35: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 4GWc0y1S60z3jh4; Fri, 23 Jul 2021 17:35:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B5C928C60; Fri, 23 Jul 2021 17:35: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 16NHZkMX043517; Fri, 23 Jul 2021 17:35:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NHZkQW043516; Fri, 23 Jul 2021 17:35:46 GMT (envelope-from git) Date: Fri, 23 Jul 2021 17:35:46 GMT Message-Id: <202107231735.16NHZkQW043516@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: 49a7d4723543 - main - pf: consistently malloc rules with M_ZERO 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: 49a7d47235434a300cc57b205e493988fdebf79c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 17:35:46 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=49a7d47235434a300cc57b205e493988fdebf79c commit 49a7d47235434a300cc57b205e493988fdebf79c Author: Mateusz Guzik AuthorDate: 2021-07-23 15:01:29 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-23 17:35:32 +0000 pf: consistently malloc rules with M_ZERO Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 27e1a145f3ec..432585610aa1 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2321,7 +2321,7 @@ DIOCADDRULENV_error: struct pfioc_rule *pr = (struct pfioc_rule *)addr; struct pf_krule *rule; - rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK); + rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK | M_ZERO); error = pf_rule_to_krule(&pr->rule, rule); if (error != 0) { free(rule, M_PFRULE); @@ -2574,7 +2574,7 @@ DIOCGETRULENV_error: } if (pcr->action != PF_CHANGE_REMOVE) { - newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); + newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK | M_ZERO); error = pf_rule_to_krule(&pcr->rule, newrule); if (error != 0) { free(newrule, M_PFRULE); From owner-dev-commits-src-main@freebsd.org Fri Jul 23 19:09:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFD6A6772CC; Fri, 23 Jul 2021 19:09: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 4GWf4l4MGwz4cmw; Fri, 23 Jul 2021 19:09:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C5ED2A5E5; Fri, 23 Jul 2021 19:09: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 16NJ9BjO063407; Fri, 23 Jul 2021 19:09:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NJ9B6e063406; Fri, 23 Jul 2021 19:09:11 GMT (envelope-from git) Date: Fri, 23 Jul 2021 19:09:11 GMT Message-Id: <202107231909.16NJ9B6e063406@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: f4e67f18bdf2 - main - Remove sr_RS.UTF-8@latin from the list of targets 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: f4e67f18bdf292f11fd02fd93e8e67111eadaed9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 19:09:11 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f4e67f18bdf292f11fd02fd93e8e67111eadaed9 commit f4e67f18bdf292f11fd02fd93e8e67111eadaed9 Author: Mark Johnston AuthorDate: 2021-07-23 19:02:56 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 19:05:28 +0000 Remove sr_RS.UTF-8@latin from the list of targets It is installed with other unicode locales, from monetdef_unicode. This is just a band-aid to fix the build, as it's not clear how to regenerate this Makefile. Fixes: 0a36787e4c1f --- share/monetdef/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/monetdef/Makefile b/share/monetdef/Makefile index 1ffa6961b4bd..e5d861da468d 100644 --- a/share/monetdef/Makefile +++ b/share/monetdef/Makefile @@ -40,7 +40,7 @@ LOCALES+= ru_RU.CP866 LOCALES+= ru_RU.ISO8859-5 LOCALES+= ru_RU.KOI8-R LOCALES+= sl_SI.ISO8859-2 -LOCALES+= sr_RS.UTF-8@latin +#LOCALES+= sr_RS.UTF-8@latin LOCALES+= sv_FI.ISO8859-1 LOCALES+= sv_FI.ISO8859-15 LOCALES+= sv_SE.ISO8859-15 From owner-dev-commits-src-main@freebsd.org Fri Jul 23 19:41:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51363677C5B; Fri, 23 Jul 2021 19:41: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 4GWfns1Vrrz4kvd; Fri, 23 Jul 2021 19:41:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B3FE2AD09; Fri, 23 Jul 2021 19:41:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NJfLim011810; Fri, 23 Jul 2021 19:41:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NJfLrx011809; Fri, 23 Jul 2021 19:41:21 GMT (envelope-from git) Date: Fri, 23 Jul 2021 19:41:21 GMT Message-Id: <202107231941.16NJfLrx011809@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: 93d8b4da7b7a - main - kasan.9: Fix formatting in the synopsis 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: 93d8b4da7b7aaa5bc23f6e7ba206fbf61b242462 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 19:41:21 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=93d8b4da7b7aaa5bc23f6e7ba206fbf61b242462 commit 93d8b4da7b7aaa5bc23f6e7ba206fbf61b242462 Author: Mark Johnston AuthorDate: 2021-07-23 19:40:50 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 19:40:50 +0000 kasan.9: Fix formatting in the synopsis Sponsored by: The FreeBSD Foundation --- share/man/man9/kasan.9 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/share/man/man9/kasan.9 b/share/man/man9/kasan.9 index d675a78f1e29..68bcc9fdbf3a 100644 --- a/share/man/man9/kasan.9 +++ b/share/man/man9/kasan.9 @@ -39,9 +39,7 @@ The kernel configuration can be used to compile a KASAN-enabled kernel using .Pa GENERIC as a base configuration. -Alternately, to compile -.Nm -into the kernel, place the following line in your +Alternately, to compile KASAN into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "options KASAN" From owner-dev-commits-src-main@freebsd.org Fri Jul 23 19:41:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B988E677F3D; Fri, 23 Jul 2021 19:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWfnt3B7dz4kyq; Fri, 23 Jul 2021 19:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DC8B2AD0A; Fri, 23 Jul 2021 19:41: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 16NJfMZf011834; Fri, 23 Jul 2021 19:41:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NJfMLh011833; Fri, 23 Jul 2021 19:41:22 GMT (envelope-from git) Date: Fri, 23 Jul 2021 19:41:22 GMT Message-Id: <202107231941.16NJfMLh011833@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: ebf9886654f4 - main - imgact_elf: Avoid redefining suword() 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: ebf9886654f42718229011524a81e2b36e51f9b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 19:41:22 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ebf9886654f42718229011524a81e2b36e51f9b1 commit ebf9886654f42718229011524a81e2b36e51f9b1 Author: Mark Johnston AuthorDate: 2021-07-23 19:40:54 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 19:40:54 +0000 imgact_elf: Avoid redefining suword() Otherwise this interferes with the definition for sanitizer interceptors. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/kern/imgact_elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 42d922e9f002..ac0427a74818 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1341,7 +1341,7 @@ ret: return (error); } -#define suword __CONCAT(suword, __ELF_WORD_SIZE) +#define elf_suword __CONCAT(suword, __ELF_WORD_SIZE) int __elfN(freebsd_copyout_auxargs)(struct image_params *imgp, uintptr_t base) @@ -1414,7 +1414,7 @@ __elfN(freebsd_fixup)(uintptr_t *stack_base, struct image_params *imgp) base = (Elf_Addr *)*stack_base; base--; - if (suword(base, imgp->args->argc) == -1) + if (elf_suword(base, imgp->args->argc) == -1) return (EFAULT); *stack_base = (uintptr_t)base; return (0); From owner-dev-commits-src-main@freebsd.org Fri Jul 23 23:07:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3164652791; Fri, 23 Jul 2021 23:07: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 4GWlNG4SRyz3qPW; Fri, 23 Jul 2021 23:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D9D12D43F; Fri, 23 Jul 2021 23:07: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 16NN7whu084341; Fri, 23 Jul 2021 23:07:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NN7w9l084340; Fri, 23 Jul 2021 23:07:58 GMT (envelope-from git) Date: Fri, 23 Jul 2021 23:07:58 GMT Message-Id: <202107232307.16NN7w9l084340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 58109a87d42b - main - Use an ANSI C function declaration for journal_check_space. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58109a87d42b490eba76879f9007a4dbdaf7bb80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 23:07:58 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=58109a87d42b490eba76879f9007a4dbdaf7bb80 commit 58109a87d42b490eba76879f9007a4dbdaf7bb80 Author: John Baldwin AuthorDate: 2021-07-23 22:06:26 +0000 Commit: John Baldwin CommitDate: 2021-07-23 22:59:11 +0000 Use an ANSI C function declaration for journal_check_space. GCC6 fails to compile this due to a -Wstrict-prototypes error. Sponsored by: Chelsio Communications --- sys/ufs/ffs/ffs_softdep.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 2f9819ff7023..75120175e4a1 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -3223,8 +3223,7 @@ journal_unsuspend(struct ufsmount *ump) } static void -journal_check_space(ump) - struct ufsmount *ump; +journal_check_space(struct ufsmount *ump) { struct mount *mp; From owner-dev-commits-src-main@freebsd.org Fri Jul 23 23:07:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB407652798; Fri, 23 Jul 2021 23:07: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 4GWlNH4rlhz3qPb; Fri, 23 Jul 2021 23:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D63B2DA7E; Fri, 23 Jul 2021 23:07: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 16NN7xA3084365; Fri, 23 Jul 2021 23:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NN7xGL084364; Fri, 23 Jul 2021 23:07:59 GMT (envelope-from git) Date: Fri, 23 Jul 2021 23:07:59 GMT Message-Id: <202107232307.16NN7xGL084364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8843787aa1bd - main - ena: Remove redundant declaration of ena_log_level. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8843787aa1bdbd10de6ba47a04489179ec2d2d3c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 23:08:00 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8843787aa1bdbd10de6ba47a04489179ec2d2d3c commit 8843787aa1bdbd10de6ba47a04489179ec2d2d3c Author: John Baldwin AuthorDate: 2021-07-23 22:31:32 +0000 Commit: John Baldwin CommitDate: 2021-07-23 23:07:35 +0000 ena: Remove redundant declaration of ena_log_level. GCC6 raises a -Wredundant-decl error due to duplicate declarations in ena_fbsd_log.h and ena_plat.h. Sponsored by: Chelsio Communications --- sys/contrib/ena-com/ena_plat.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/contrib/ena-com/ena_plat.h b/sys/contrib/ena-com/ena_plat.h index b31821248398..274f795950c0 100644 --- a/sys/contrib/ena-com/ena_plat.h +++ b/sys/contrib/ena-com/ena_plat.h @@ -98,8 +98,6 @@ extern struct ena_bus_space ebs; #define DEFAULT_ALLOC_ALIGNMENT 8 #define ENA_CDESC_RING_SIZE_ALIGNMENT (1 << 12) /* 4K */ -extern int ena_log_level; - #define container_of(ptr, type, member) \ ({ \ const __typeof(((type *)0)->member) *__p = (ptr); \ From owner-dev-commits-src-main@freebsd.org Sat Jul 24 00:09:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE895653036; Sat, 24 Jul 2021 00:09: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 4GWmkt6917z4V4K; Sat, 24 Jul 2021 00:09:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB5772E0D4; Sat, 24 Jul 2021 00:09: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 16O09ABS064468; Sat, 24 Jul 2021 00:09:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16O09AfV064467; Sat, 24 Jul 2021 00:09:10 GMT (envelope-from git) Date: Sat, 24 Jul 2021 00:09:10 GMT Message-Id: <202107240009.16O09AfV064467@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: 380710a5c8c1 - main - geom: create an API to allocate events, and use that storage to send them 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: 380710a5c8c1fd638ec961351b75b667e91667c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 00:09:11 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=380710a5c8c1fd638ec961351b75b667e91667c9 commit 380710a5c8c1fd638ec961351b75b667e91667c9 Author: Warner Losh AuthorDate: 2021-07-23 21:16:57 +0000 Commit: Warner Losh CommitDate: 2021-07-24 00:08:45 +0000 geom: create an API to allocate events, and use that storage to send them g_alloc_event will allocate storage for an opaque event. g_post_event_ep can use memory returned by g_alloc_event to send an event from a context that might not be able to allocate the event. Occasionally, we can alloate memory when we create an object, but not while we're destroy it. This allows one to allocate at creation time memory to use when destorying the object. Reviewed by: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30544 --- share/man/man9/g_event.9 | 32 ++++++++++++++++++++++++++++- sys/geom/geom.h | 3 +++ sys/geom/geom_event.c | 52 +++++++++++++++++++++++++++++++++++++----------- 3 files changed, 74 insertions(+), 13 deletions(-) diff --git a/share/man/man9/g_event.9 b/share/man/man9/g_event.9 index 0bdd0ab6688b..32c4703100d8 100644 --- a/share/man/man9/g_event.9 +++ b/share/man/man9/g_event.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd July 23, 2021 .Dt G_EVENT 9 .Os .Sh NAME @@ -40,6 +40,10 @@ .Fn g_waitfor_event "g_event_t *func" "void *arg" "int flag" ... .Ft void .Fn g_cancel_event "void *ref" +.Ft "struct g_event *" +.Fn g_alloc_event "int flag" +.Ft void +.Fn g_post_event_ep "g_event_t *func" "void *arg" "struct g_event *ep" ... .Sh DESCRIPTION The GEOM framework has its own event queue to inform classes about important events. @@ -80,6 +84,13 @@ function. It waits until the event is finished or canceled and then returns. .Pp The +.Fn g_post_event_ep +function posts the event with a pre-allocated +.Va struct g_event . +An event may be pre-allocated with +.Fn g_alloc_event . +.Pp +The .Fn g_cancel_event function cancels all event(s) identified by .Fa ref . @@ -123,6 +134,25 @@ The function cannot be called from an event, since doing so would result in a deadlock. .El +.Pp +.Fn g_alloc_event : +.Bl -item -offset indent +.It +The argument +.Fa flag +has to be +.Dv M_WAITOK +or +.Dv M_NOWAIT . +.It +The returned +.Va struct g_event * +must be freed with +.Fn g_free +if +.Fn g_post_event_ep +is not called. +.El .Sh RETURN VALUES The .Fn g_post_event diff --git a/sys/geom/geom.h b/sys/geom/geom.h index cb294e2c7451..1aba1f46d6d5 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -260,6 +260,7 @@ extern int g_debugflags; /* geom_event.c */ typedef void g_event_t(void *, int flag); +struct g_event; #define EV_CANCEL 1 int g_post_event(g_event_t *func, void *arg, int flag, ...); int g_waitfor_event(g_event_t *func, void *arg, int flag, ...); @@ -269,6 +270,8 @@ int g_media_changed(struct g_provider *pp, int flag); int g_media_gone(struct g_provider *pp, int flag); void g_orphan_provider(struct g_provider *pp, int error); void g_waitidlelock(void); +struct g_event *g_alloc_event(int flag); +void g_post_event_ep(g_event_t *func, void *arg, struct g_event *ep, ...); /* geom_subr.c */ int g_access(struct g_consumer *cp, int nread, int nwrite, int nexcl); diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c index b829d2ef637c..f9a1d445d36a 100644 --- a/sys/geom/geom_event.c +++ b/sys/geom/geom_event.c @@ -341,20 +341,22 @@ g_cancel_event(void *ref) mtx_unlock(&g_eventlock); } -static int -g_post_event_x(g_event_t *func, void *arg, int flag, int wuflag, struct g_event **epp, va_list ap) +struct g_event * +g_alloc_event(int flag) +{ + KASSERT(flag == M_WAITOK || flag == M_NOWAIT, + ("Wrong flag to g_alloc_event")); + + return (g_malloc(sizeof(struct g_event), flag | M_ZERO)); +} + +static void +g_post_event_ep_va(g_event_t *func, void *arg, int wuflag, + struct g_event *ep, va_list ap) { - struct g_event *ep; void *p; u_int n; - g_trace(G_T_TOPOLOGY, "g_post_event_x(%p, %p, %d, %d)", - func, arg, flag, wuflag); - KASSERT(wuflag == 0 || wuflag == EV_WAKEUP, - ("Wrong wuflag in g_post_event_x(0x%x)", wuflag)); - ep = g_malloc(sizeof *ep, flag | M_ZERO); - if (ep == NULL) - return (ENOMEM); ep->flag = wuflag; for (n = 0; n < G_N_EVENTREFS; n++) { p = va_arg(ap, void *); @@ -371,12 +373,38 @@ g_post_event_x(g_event_t *func, void *arg, int flag, int wuflag, struct g_event TAILQ_INSERT_TAIL(&g_events, ep, events); mtx_unlock(&g_eventlock); wakeup(&g_wait_event); - if (epp != NULL) - *epp = ep; curthread->td_pflags |= TDP_GEOM; thread_lock(curthread); curthread->td_flags |= TDF_ASTPENDING; thread_unlock(curthread); +} + +void +g_post_event_ep(g_event_t *func, void *arg, struct g_event *ep, ...) +{ + va_list ap; + + va_start(ap, ep); + g_post_event_ep_va(func, arg, 0, ep, ap); + va_end(ap); +} + + +static int +g_post_event_x(g_event_t *func, void *arg, int flag, int wuflag, struct g_event **epp, va_list ap) +{ + struct g_event *ep; + + g_trace(G_T_TOPOLOGY, "g_post_event_x(%p, %p, %d, %d)", + func, arg, flag, wuflag); + KASSERT(wuflag == 0 || wuflag == EV_WAKEUP, + ("Wrong wuflag in g_post_event_x(0x%x)", wuflag)); + ep = g_alloc_event(flag); + if (ep == NULL) + return (ENOMEM); + if (epp != NULL) + *epp = ep; + g_post_event_ep_va(func, arg, wuflag, ep, ap); return (0); } From owner-dev-commits-src-main@freebsd.org Sat Jul 24 00:09:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19D406528E1; Sat, 24 Jul 2021 00:09: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 4GWmkw06vFz4V4Q; Sat, 24 Jul 2021 00:09:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDCE02E705; Sat, 24 Jul 2021 00:09: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 16O09B7L064492; Sat, 24 Jul 2021 00:09:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16O09BF2064491; Sat, 24 Jul 2021 00:09:11 GMT (envelope-from git) Date: Sat, 24 Jul 2021 00:09:11 GMT Message-Id: <202107240009.16O09BF2064491@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: 47aeda7b7055 - main - geom_disk: use a preallocated geom_event for disk destruction. 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: 47aeda7b70555049eccd7f020365aec031f41c62 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 00:09:12 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=47aeda7b70555049eccd7f020365aec031f41c62 commit 47aeda7b70555049eccd7f020365aec031f41c62 Author: Warner Losh AuthorDate: 2021-07-23 21:21:02 +0000 Commit: Warner Losh CommitDate: 2021-07-24 00:08:52 +0000 geom_disk: use a preallocated geom_event for disk destruction. Preallocate a geom_event (using the new geom_alloc_event) when we create a disk. When we create the disk, we're going to be in a sleepable context, so we can always allocate this extra bit of memory. Then use this preallocated memory to free the disk. CAM can try to free the disk from an unsleepable context if there was I/O outstanding when the disk was destroyted (say because the SIM said it had gone away). The I/O context isn't sleepable. Rather than trying to invent a retry mechanism and making sure all the other geom_disk consumers did it properly, preallocating the event ensure that the geom_disk will be properly torn down, even when there's memory pressure when the disk departs. Reviewd by: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30544 --- sys/geom/geom_disk.c | 5 ++++- sys/geom/geom_disk.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index fb215fb3dab5..83d570f7e445 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -885,6 +885,7 @@ disk_create(struct disk *dp, int version) dp->d_sectorsize, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); dp->d_geom = NULL; + dp->d_event = g_alloc_event(M_WAITOK); dp->d_init_level = DISK_INIT_NONE; @@ -896,12 +897,14 @@ void disk_destroy(struct disk *dp) { + KASSERT(dp->d_event != NULL, + ("Disk destroy for %p with event NULL", dp)); disk_gone(dp); dp->d_destroyed = 1; g_cancel_event(dp); if (dp->d_devstat != NULL) devstat_remove_entry(dp->d_devstat); - g_post_event(g_disk_destroy, dp, M_WAITOK, NULL); + g_post_event_ep(g_disk_destroy, dp, dp->d_event, NULL); } void diff --git a/sys/geom/geom_disk.h b/sys/geom/geom_disk.h index 8e2282a09a3a..7dd6e34c9ae2 100644 --- a/sys/geom/geom_disk.h +++ b/sys/geom/geom_disk.h @@ -125,6 +125,7 @@ struct disk { /* Fields private to geom_disk, to be moved on next version bump */ LIST_HEAD(,disk_alias) d_aliases; + void *d_event; }; #define DISKFLAG_RESERVED 0x0001 /* Was NEEDSGIANT */ From owner-dev-commits-src-main@freebsd.org Sat Jul 24 04:16:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75A5D656B51; Sat, 24 Jul 2021 04:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWtDK1fVFz3pxs; Sat, 24 Jul 2021 04:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20F8A1A40; Sat, 24 Jul 2021 04:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16O4GXPD097233; Sat, 24 Jul 2021 04:16:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16O4GXxW097232; Sat, 24 Jul 2021 04:16:33 GMT (envelope-from git) Date: Sat, 24 Jul 2021 04:16:33 GMT Message-Id: <202107240416.16O4GXxW097232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: b7de53528836 - main - amd64: Eliminate a redundant test from pmap_enter_object() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7de535288362b072cf2801007e4d7e0e903d467 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 04:16:33 -0000 The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=b7de535288362b072cf2801007e4d7e0e903d467 commit b7de535288362b072cf2801007e4d7e0e903d467 Author: Alan Cox AuthorDate: 2021-07-24 03:50:10 +0000 Commit: Alan Cox CommitDate: 2021-07-24 04:15:42 +0000 amd64: Eliminate a redundant test from pmap_enter_object() The call to pmap_allow_2m_x_page() in pmap_enter_object() is redundant. Specifically, even without the call to pmap_allow_2m_x_page() in pmap_enter_object(), pmap_allow_2m_x_page() is eventually called by pmap_enter_pde(), so the outcome will be the same. Essentially, calling pmap_allow_2m_x_page() in pmap_enter_object() amounts to "optimizing" for the unexpected case. Reviewed by: kib MFC after: 1 week --- sys/amd64/amd64/pmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 427fbdf44830..688412594e6c 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -7334,7 +7334,6 @@ pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_offset_t end, va = start + ptoa(diff); if ((va & PDRMASK) == 0 && va + NBPDR <= end && m->psind == 1 && pmap_ps_enabled(pmap) && - pmap_allow_2m_x_page(pmap, (prot & VM_PROT_EXECUTE) != 0) && pmap_enter_2mpage(pmap, va, m, prot, &lock)) m = &m[NBPDR / PAGE_SIZE - 1]; else From owner-dev-commits-src-main@freebsd.org Sat Jul 24 11:58:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 988B665F1C0; Sat, 24 Jul 2021 11:58: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 4GX4TS3vmHz4ccC; Sat, 24 Jul 2021 11:58:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DCBB1014F; Sat, 24 Jul 2021 11:58: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 16OBwaXD010810; Sat, 24 Jul 2021 11:58:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OBwaQI010809; Sat, 24 Jul 2021 11:58:36 GMT (envelope-from git) Date: Sat, 24 Jul 2021 11:58:36 GMT Message-Id: <202107241158.16OBwaQI010809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 72f7ddb587a7 - main - linux: implement rt_sigsuspend(2) on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72f7ddb587a79dbea353e40b182ea93bb1dfea21 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 11:58:36 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=72f7ddb587a79dbea353e40b182ea93bb1dfea21 commit 72f7ddb587a79dbea353e40b182ea93bb1dfea21 Author: Edward Tomasz Napierala AuthorDate: 2021-07-23 20:11:06 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-07-23 20:13:00 +0000 linux: implement rt_sigsuspend(2) on arm64 ... by making it architecture-independent. Reviewed By: dchagin Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D31259 --- sys/amd64/linux/linux_machdep.c | 21 --------------------- sys/amd64/linux32/linux32_machdep.c | 18 ------------------ sys/arm64/linux/linux_machdep.c | 10 ---------- sys/compat/linux/linux_signal.c | 18 ++++++++++++++++++ sys/i386/linux/linux_machdep.c | 18 ------------------ 5 files changed, 18 insertions(+), 67 deletions(-) diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index d7b31ce89509..b67bed524c79 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -174,27 +174,6 @@ linux_iopl(struct thread *td, struct linux_iopl_args *args) return (0); } -int -linux_rt_sigsuspend(struct thread *td, struct linux_rt_sigsuspend_args *uap) -{ - l_sigset_t lmask; - sigset_t sigmask; - int error; - - LINUX_CTR2(rt_sigsuspend, "%p, %ld", - uap->newset, uap->sigsetsize); - - if (uap->sigsetsize != sizeof(l_sigset_t)) - return (EINVAL); - - error = copyin(uap->newset, &lmask, sizeof(l_sigset_t)); - if (error) - return (error); - - linux_to_bsd_sigset(&lmask, &sigmask); - return (kern_sigsuspend(td, sigmask)); -} - int linux_pause(struct thread *td, struct linux_pause_args *args) { diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 880cccbb2328..1cfda5d60e13 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -537,24 +537,6 @@ linux_sigsuspend(struct thread *td, struct linux_sigsuspend_args *args) return (kern_sigsuspend(td, sigmask)); } -int -linux_rt_sigsuspend(struct thread *td, struct linux_rt_sigsuspend_args *uap) -{ - l_sigset_t lmask; - sigset_t sigmask; - int error; - - if (uap->sigsetsize != sizeof(l_sigset_t)) - return (EINVAL); - - error = copyin(uap->newset, &lmask, sizeof(l_sigset_t)); - if (error) - return (error); - - linux_to_bsd_sigset(&lmask, &sigmask); - return (kern_sigsuspend(td, sigmask)); -} - int linux_pause(struct thread *td, struct linux_pause_args *args) { diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index d9b13fa631fc..283562cc1028 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -55,7 +55,6 @@ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); /* DTrace probes */ LIN_SDT_PROBE_DEFINE0(machdep, linux_mmap2, todo); -LIN_SDT_PROBE_DEFINE0(machdep, linux_rt_sigsuspend, todo); LIN_SDT_PROBE_DEFINE0(machdep, linux_sigaltstack, todo); /* @@ -124,15 +123,6 @@ linux_madvise(struct thread *td, struct linux_madvise_args *uap) return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); } -/* LINUXTODO: implement arm64 linux_rt_sigsuspend */ -int -linux_rt_sigsuspend(struct thread *td, struct linux_rt_sigsuspend_args *uap) -{ - - LIN_SDT_PROBE0(machdep, linux_rt_sigsuspend, todo); - return (EDOOFUS); -} - /* LINUXTODO: implement arm64 linux_sigaltstack */ int linux_sigaltstack(struct thread *td, struct linux_sigaltstack_args *uap) diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 43213301239c..260352af5a54 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -791,3 +791,21 @@ linux_rt_tgsigqueueinfo(struct thread *td, struct linux_rt_tgsigqueueinfo_args * return (linux_do_tkill(td, tds, &ksi)); } + +int +linux_rt_sigsuspend(struct thread *td, struct linux_rt_sigsuspend_args *uap) +{ + l_sigset_t lmask; + sigset_t sigmask; + int error; + + if (uap->sigsetsize != sizeof(l_sigset_t)) + return (EINVAL); + + error = copyin(uap->newset, &lmask, sizeof(l_sigset_t)); + if (error != 0) + return (error); + + linux_to_bsd_sigset(&lmask, &sigmask); + return (kern_sigsuspend(td, sigmask)); +} diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 45474991475b..b2628738728f 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -505,24 +505,6 @@ linux_sigsuspend(struct thread *td, struct linux_sigsuspend_args *args) return (kern_sigsuspend(td, sigmask)); } -int -linux_rt_sigsuspend(struct thread *td, struct linux_rt_sigsuspend_args *uap) -{ - l_sigset_t lmask; - sigset_t sigmask; - int error; - - if (uap->sigsetsize != sizeof(l_sigset_t)) - return (EINVAL); - - error = copyin(uap->newset, &lmask, sizeof(l_sigset_t)); - if (error) - return (error); - - linux_to_bsd_sigset(&lmask, &sigmask); - return (kern_sigsuspend(td, sigmask)); -} - int linux_pause(struct thread *td, struct linux_pause_args *args) { From owner-dev-commits-src-main@freebsd.org Sat Jul 24 15:05:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F16A9661C0D; Sat, 24 Jul 2021 15:05: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 4GX8dB6JZtz3PMb; Sat, 24 Jul 2021 15:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF7DD124EC; Sat, 24 Jul 2021 15:05: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 16OF5YsV064693; Sat, 24 Jul 2021 15:05:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OF5Ymo064692; Sat, 24 Jul 2021 15:05:34 GMT (envelope-from git) Date: Sat, 24 Jul 2021 15:05:34 GMT Message-Id: <202107241505.16OF5Ymo064692@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: 6475667f7b72 - main - devctl: don't publish the mount options 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: 6475667f7b72f5eb8fcd045967c251e45e38e2a2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 15:05:35 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6475667f7b72f5eb8fcd045967c251e45e38e2a2 commit 6475667f7b72f5eb8fcd045967c251e45e38e2a2 Author: Warner Losh AuthorDate: 2021-07-24 15:03:53 +0000 Commit: Warner Losh CommitDate: 2021-07-24 15:03:53 +0000 devctl: don't publish the mount options Mount options aren't solely ASCII strings. In addition, experience to date suggests that the mount options are much less useful than was originally supposed and the mount flags suffice to make decisions. Drop the reporting of options for the mount/remount/unmount events. Reviewed by: markj Reported by: KASAN Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31287 --- sys/kern/vfs_mount.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 8b4426209818..354113eb3277 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -2553,27 +2553,6 @@ static struct mntoptnames optnames[] = { MNTOPT_NAMES }; -static void -mount_devctl_event_mntopt(struct sbuf *sb, const char *what, struct vfsoptlist *opts) -{ - struct vfsopt *opt; - - if (opts == NULL || TAILQ_EMPTY(opts)) - return; - sbuf_printf(sb, " %s=\"", what); - TAILQ_FOREACH(opt, opts, link) { - if (opt->name[0] == '\0' || (opt->len > 0 && *(char *)opt->value == '\0')) - continue; - devctl_safe_quote_sb(sb, opt->name); - if (opt->len > 0) { - sbuf_putc(sb, '='); - devctl_safe_quote_sb(sb, opt->value); - } - sbuf_putc(sb, ';'); - } - sbuf_putc(sb, '"'); -} - #define DEVCTL_LEN 1024 static void mount_devctl_event(const char *type, struct mount *mp, bool donew) @@ -2606,11 +2585,15 @@ mount_devctl_event(const char *type, struct mount *mp, bool donew) } } sbuf_putc(&sb, '"'); - mount_devctl_event_mntopt(&sb, "opt", mp->mnt_opt); - if (donew) - mount_devctl_event_mntopt(&sb, "optnew", mp->mnt_optnew); sbuf_finish(&sb); + /* + * Options are not published because the form of the options depends on + * the file system and may include binary data. In addition, they don't + * necessarily provide enough useful information to be actionable when + * devd processes them. + */ + if (sbuf_error(&sb) == 0) devctl_notify("VFS", "FS", type, sbuf_data(&sb)); sbuf_delete(&sb); From owner-dev-commits-src-main@freebsd.org Sat Jul 24 15:09:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2ECA566186E; Sat, 24 Jul 2021 15:09: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 4GX8jM0lGfz3Q06; Sat, 24 Jul 2021 15:09:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01CC3124EF; Sat, 24 Jul 2021 15:09: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 16OF9AwS065031; Sat, 24 Jul 2021 15:09:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OF9AMq065030; Sat, 24 Jul 2021 15:09:10 GMT (envelope-from git) Date: Sat, 24 Jul 2021 15:09:10 GMT Message-Id: <202107241509.16OF9AMq065030@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: a2e3e1187309 - main - awk: Make -F '' and -v FS="" behave the same 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: a2e3e1187309f9404940b61ca49a93bd0536559d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 15:09:11 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a2e3e1187309f9404940b61ca49a93bd0536559d commit a2e3e1187309f9404940b61ca49a93bd0536559d Author: Warner Losh AuthorDate: 2021-07-20 04:47:30 +0000 Commit: Warner Losh CommitDate: 2021-07-24 15:08:16 +0000 awk: Make -F '' and -v FS="" behave the same IEEE Std 1003.1-2008 mandates that -F str be treated the same as -v FS=str. For a null string, this was not the case. Since awk(1) documents that a null string for FS has a specific behavior, make -F '' behave consistently with -v FS="". PR: 241441 Upstream issue: https://github.com/onetrueawk/awk/issues/127 Upstream pull request: https://github.com/onetrueawk/awk/pull/128 MFC After: 2 weeks Sponsored by: Netflix --- contrib/one-true-awk/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/contrib/one-true-awk/main.c b/contrib/one-true-awk/main.c index f3936341ae75..4e68bfb46d27 100644 --- a/contrib/one-true-awk/main.c +++ b/contrib/one-true-awk/main.c @@ -91,9 +91,7 @@ setfs(char *p) /* wart: t=>\t */ if (p[0] == 't' && p[1] == '\0') return "\t"; - else if (p[0] != '\0') - return p; - return NULL; + return p; } static char * @@ -169,8 +167,6 @@ int main(int argc, char *argv[]) break; case 'F': /* set field separator */ fs = setfs(getarg(&argc, &argv, "no field separator")); - if (fs == NULL) - WARNING("field separator FS is empty"); break; case 'v': /* -v a=1 to be done NOW. one -v for each */ vn = getarg(&argc, &argv, "no variable name"); From owner-dev-commits-src-main@freebsd.org Sat Jul 24 15:50:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B98DD66242B; Sat, 24 Jul 2021 15:50: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 4GX9d34tC1z3mlR; Sat, 24 Jul 2021 15:50:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EE9312E5A; Sat, 24 Jul 2021 15:50:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16OFoVQ4025896; Sat, 24 Jul 2021 15:50:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OFoVX7025895; Sat, 24 Jul 2021 15:50:31 GMT (envelope-from git) Date: Sat, 24 Jul 2021 15:50:31 GMT Message-Id: <202107241550.16OFoVX7025895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 12faeba9953a - main - allwinner: rsb: Set the PMIC to RSB mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12faeba9953ac7fa5198b258dcd80f89b3b4b947 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 15:50:31 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=12faeba9953ac7fa5198b258dcd80f89b3b4b947 commit 12faeba9953ac7fa5198b258dcd80f89b3b4b947 Author: Emmanuel Vadot AuthorDate: 2021-07-24 15:44:18 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-24 15:46:25 +0000 allwinner: rsb: Set the PMIC to RSB mode With recent ATF (v2.5) the PMIC is reset to I2C mode. Without a PMIC no regulators can be changed/enabled/disabled This fixes cpufreq on A64 (at least) and anything else that needs regulators handled by the PMIC. MFC after: 3 days Sponsored by: Diablotin Systems --- sys/arm/allwinner/aw_rsb.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/arm/allwinner/aw_rsb.c b/sys/arm/allwinner/aw_rsb.c index 48103af6ac6e..e6714107d7b4 100644 --- a/sys/arm/allwinner/aw_rsb.c +++ b/sys/arm/allwinner/aw_rsb.c @@ -71,6 +71,10 @@ __FBSDID("$FreeBSD$"); #define DLEN_READ (1 << 4) #define RSB_DATA0 0x1c #define RSB_DATA1 0x20 +#define RSB_PMCR 0x28 +#define RSB_PMCR_START (1 << 31) +#define RSB_PMCR_DATA(x) (x << 16) +#define RSB_PMCR_REG(x) (x << 8) #define RSB_CMD 0x2c #define CMD_SRTA 0xe8 #define CMD_RD8 0x8b @@ -93,6 +97,10 @@ __FBSDID("$FreeBSD$"); #define RSB_ADDR_PMIC_SECONDARY 0x745 #define RSB_ADDR_PERIPH_IC 0xe89 +#define PMIC_MODE_REG 0x3e +#define PMIC_MODE_I2C 0x00 +#define PMIC_MODE_RSB 0x7c + #define A31_P2WI 1 #define A23_RSB 2 @@ -436,6 +444,9 @@ rsb_attach(device_t dev) goto fail; } + /* Set the PMIC into RSB mode as ATF might have leave it in I2C mode */ + RSB_WRITE(sc, RSB_PMCR, RSB_PMCR_REG(PMIC_MODE_REG) | RSB_PMCR_DATA(PMIC_MODE_RSB) | RSB_PMCR_START); + sc->iicbus = device_add_child(dev, "iicbus", -1); if (sc->iicbus == NULL) { device_printf(dev, "cannot add iicbus child device\n"); From owner-dev-commits-src-main@freebsd.org Sat Jul 24 15:53:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4236662449; Sat, 24 Jul 2021 15:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GX9h358mwz3msV; Sat, 24 Jul 2021 15:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99E7A13703; Sat, 24 Jul 2021 15:53: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 16OFr7hi030323; Sat, 24 Jul 2021 15:53:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OFr7HY030322; Sat, 24 Jul 2021 15:53:07 GMT (envelope-from git) Date: Sat, 24 Jul 2021 15:53:07 GMT Message-Id: <202107241553.16OFr7HY030322@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: 34516d4ad19b - main - amd64 pti init: fix calculation of the kernel text start 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: 34516d4ad19b83e5dfe6ec8c1db232c422d7ecff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 15:53:07 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=34516d4ad19b83e5dfe6ec8c1db232c422d7ecff commit 34516d4ad19b83e5dfe6ec8c1db232c422d7ecff Author: Konstantin Belousov AuthorDate: 2021-07-10 19:51:16 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-24 15:52:44 +0000 amd64 pti init: fix calculation of the kernel text start Old expression happens to provide the correct answer, but assumes that kernel is loaded at physical address zero, with 2M gap. Do not use kernphys to calculate KVA of kernel text start, just explicitly write out KERNBASE and the hole size. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121 --- sys/amd64/amd64/pmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 688412594e6c..03436a60a10b 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -10762,7 +10762,7 @@ pmap_pti_init(void) va = __pcpu[i].pc_common_tss.tss_ist4 + sizeof(struct nmi_pcpu); pmap_pti_add_kva_locked(va - DBG_STACK_SIZE, va, false); } - pmap_pti_add_kva_locked((vm_offset_t)kernphys + KERNBASE, + pmap_pti_add_kva_locked((vm_offset_t)KERNBASE + NBPDR, (vm_offset_t)etext, true); pti_finalized = true; VM_OBJECT_WUNLOCK(pti_obj); From owner-dev-commits-src-main@freebsd.org Sat Jul 24 15:53:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 076E1661E4A; Sat, 24 Jul 2021 15:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GX9h46XQbz3nFM; Sat, 24 Jul 2021 15:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C010F13704; Sat, 24 Jul 2021 15:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16OFr8mi030347; Sat, 24 Jul 2021 15:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OFr8Zn030346; Sat, 24 Jul 2021 15:53:08 GMT (envelope-from git) Date: Sat, 24 Jul 2021 15:53:08 GMT Message-Id: <202107241553.16OFr8Zn030346@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: c8bae074d9e1 - main - amd64: add pmap_alloc_page_below_4g() 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: c8bae074d9e1d766bcbc2e631ce0c2e9d248881c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 15:53:09 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c8bae074d9e1d766bcbc2e631ce0c2e9d248881c commit c8bae074d9e1d766bcbc2e631ce0c2e9d248881c Author: Konstantin Belousov AuthorDate: 2021-07-13 15:00:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-24 15:52:44 +0000 amd64: add pmap_alloc_page_below_4g() Suggested and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121 --- sys/amd64/amd64/pmap.c | 49 +++++++++++++++++++----------------------------- sys/amd64/include/pmap.h | 1 + 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 03436a60a10b..aea4394ebcc0 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2062,6 +2062,19 @@ pmap_init_pat(void) load_cr4(cr4); } +vm_page_t +pmap_page_alloc_below_4g(bool zeroed) +{ + vm_page_t m; + + m = vm_page_alloc_contig(NULL, 0, (zeroed ? VM_ALLOC_ZERO : 0) | + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ, + 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + if (m != NULL && zeroed && (m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + return (m); +} + extern const char la57_trampoline[], la57_trampoline_gdt_desc[], la57_trampoline_gdt[], la57_trampoline_end[]; @@ -2087,42 +2100,18 @@ pmap_bootstrap_la57(void *arg __unused) r_gdt.rd_limit = NGDT * sizeof(struct user_segment_descriptor) - 1; r_gdt.rd_base = (long)__pcpu[0].pc_gdt; - m_code = vm_page_alloc_contig(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, - 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - if ((m_code->flags & PG_ZERO) == 0) - pmap_zero_page(m_code); + m_code = pmap_page_alloc_below_4g(true); v_code = (char *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_code)); - m_pml5 = vm_page_alloc_contig(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, - 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - if ((m_pml5->flags & PG_ZERO) == 0) - pmap_zero_page(m_pml5); + m_pml5 = pmap_page_alloc_below_4g(true); KPML5phys = VM_PAGE_TO_PHYS(m_pml5); v_pml5 = (pml5_entry_t *)PHYS_TO_DMAP(KPML5phys); - m_pml4 = vm_page_alloc_contig(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, - 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - if ((m_pml4->flags & PG_ZERO) == 0) - pmap_zero_page(m_pml4); + m_pml4 = pmap_page_alloc_below_4g(true); v_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pml4)); - m_pdp = vm_page_alloc_contig(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, - 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - if ((m_pdp->flags & PG_ZERO) == 0) - pmap_zero_page(m_pdp); + m_pdp = pmap_page_alloc_below_4g(true); v_pdp = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pdp)); - m_pd = vm_page_alloc_contig(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, - 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - if ((m_pd->flags & PG_ZERO) == 0) - pmap_zero_page(m_pd); + m_pd = pmap_page_alloc_below_4g(true); v_pd = (pdp_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pd)); - m_pt = vm_page_alloc_contig(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ, - 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - if ((m_pt->flags & PG_ZERO) == 0) - pmap_zero_page(m_pt); + m_pt = pmap_page_alloc_below_4g(true); v_pt = (pt_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m_pt)); /* diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 1704ecf903e9..e9117481a41e 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -509,6 +509,7 @@ int pmap_pkru_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, void pmap_thread_init_invl_gen(struct thread *td); int pmap_vmspace_copy(pmap_t dst_pmap, pmap_t src_pmap); void pmap_page_array_startup(long count); +vm_page_t pmap_page_alloc_below_4g(bool zeroed); #ifdef KASAN void pmap_kasan_enter(vm_offset_t); From owner-dev-commits-src-main@freebsd.org Sat Jul 24 15:53:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D9EF661E4D; Sat, 24 Jul 2021 15:53: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 4GX9h60JLHz3n76; Sat, 24 Jul 2021 15:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D426513532; Sat, 24 Jul 2021 15:53: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 16OFr9QE030371; Sat, 24 Jul 2021 15:53:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OFr95H030370; Sat, 24 Jul 2021 15:53:09 GMT (envelope-from git) Date: Sat, 24 Jul 2021 15:53:09 GMT Message-Id: <202107241553.16OFr95H030370@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: 6a3821369f43 - main - amd64: make efi_boot global 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: 6a3821369f43bb1e8a672cbbfd7732406d9f9a4c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 15:53:10 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6a3821369f43bb1e8a672cbbfd7732406d9f9a4c commit 6a3821369f43bb1e8a672cbbfd7732406d9f9a4c Author: Konstantin Belousov AuthorDate: 2021-07-22 16:22:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-24 15:52:44 +0000 amd64: make efi_boot global Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121 --- sys/amd64/amd64/machdep.c | 3 ++- sys/amd64/include/md_var.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 83fc6b26fa44..1bd2c8c0afe0 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -222,6 +222,8 @@ struct mtx dt_lock; /* lock for GDT and LDT */ void (*vmm_resume_p)(void); +bool efi_boot; + static void cpu_startup(dummy) void *dummy; @@ -1604,7 +1606,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) struct region_descriptor r_gdt; size_t kstack0_sz; int late_console; - bool efi_boot; TSRAW(&thread0, TS_ENTER, __func__, NULL); diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index 3b2454a4b441..b66e314d99b1 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -55,6 +55,8 @@ extern int la57; */ extern char kernphys[]; +extern bool efi_boot; + struct savefpu; struct sysentvec; From owner-dev-commits-src-main@freebsd.org Sat Jul 24 15:53:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC4F466213D; Sat, 24 Jul 2021 15:53: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 4GX9h71LLQz3ncG; Sat, 24 Jul 2021 15:53:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1343D134A3; Sat, 24 Jul 2021 15:53: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 16OFrAO0030395; Sat, 24 Jul 2021 15:53:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OFrAoX030394; Sat, 24 Jul 2021 15:53:10 GMT (envelope-from git) Date: Sat, 24 Jul 2021 15:53:10 GMT Message-Id: <202107241553.16OFrAoX030394@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: 48216088b115 - main - amd64: do not touch low memory in AP startup unless we used legacy boot 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: 48216088b1157a22b95540efea58f70057cd5c06 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 15:53:12 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=48216088b1157a22b95540efea58f70057cd5c06 commit 48216088b1157a22b95540efea58f70057cd5c06 Author: Konstantin Belousov AuthorDate: 2021-07-22 16:27:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-24 15:52:45 +0000 amd64: do not touch low memory in AP startup unless we used legacy boot Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121 --- sys/amd64/amd64/mp_machdep.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 1513393a4387..886ea3734a3f 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -450,13 +450,16 @@ start_all_aps(void) } /* save the current value of the warm-start vector */ - mpbioswarmvec = *((u_int32_t *) WARMBOOT_OFF); + if (!efi_boot) + mpbioswarmvec = *((u_int32_t *) WARMBOOT_OFF); outb(CMOS_REG, BIOS_RESET); mpbiosreason = inb(CMOS_DATA); /* setup a vector to our boot code */ - *((volatile u_short *) WARMBOOT_OFF) = WARMBOOT_TARGET; - *((volatile u_short *) WARMBOOT_SEG) = (boot_address >> 4); + if (!efi_boot) { + *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; + *((volatile u_short *)WARMBOOT_SEG) = (boot_address >> 4); + } outb(CMOS_REG, BIOS_RESET); outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ From owner-dev-commits-src-main@freebsd.org Sat Jul 24 15:59:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08D7266291A; Sat, 24 Jul 2021 15:59: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 4GX9qd6tc2z3pMm; Sat, 24 Jul 2021 15:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D50671360B; Sat, 24 Jul 2021 15:59: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 16OFxfvn031125; Sat, 24 Jul 2021 15:59:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OFxfAb031124; Sat, 24 Jul 2021 15:59:41 GMT (envelope-from git) Date: Sat, 24 Jul 2021 15:59:41 GMT Message-Id: <202107241559.16OFxfAb031124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 735041a6138a - main - arm64: allwinner: Remove sun50i-a64-opp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 735041a6138a33b1958590cb9635ce226f044a6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 15:59:42 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=735041a6138a33b1958590cb9635ce226f044a6b commit 735041a6138a33b1958590cb9635ce226f044a6b Author: Emmanuel Vadot AuthorDate: 2021-07-24 15:53:57 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-24 15:59:35 +0000 arm64: allwinner: Remove sun50i-a64-opp This is unneeded now that the DTS have the opp. MFC after: 1 week Sponsored by: Diablotin Systems --- release/arm64/PINE64-LTS.conf | 2 +- release/arm64/PINE64.conf | 2 +- release/arm64/PINEBOOK.conf | 2 +- sys/dts/arm64/overlays/sun50i-a64-opp.dtso | 77 ------------------------------ sys/modules/dtb/allwinner/Makefile | 3 +- 5 files changed, 4 insertions(+), 82 deletions(-) diff --git a/release/arm64/PINE64-LTS.conf b/release/arm64/PINE64-LTS.conf index 4006f6273307..fa4ab6fd5302 100644 --- a/release/arm64/PINE64-LTS.conf +++ b/release/arm64/PINE64-LTS.conf @@ -13,7 +13,7 @@ IMAGE_SIZE="3072M" KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" PART_SCHEME="GPT" -FDT_OVERLAYS="sun50i-a64-timer,sun50i-a64-opp" +FDT_OVERLAYS="sun50i-a64-timer" export BOARDNAME="PINE64-LTS" arm_install_uboot() { diff --git a/release/arm64/PINE64.conf b/release/arm64/PINE64.conf index 87cb9c584c54..c5aa86fc8160 100644 --- a/release/arm64/PINE64.conf +++ b/release/arm64/PINE64.conf @@ -13,7 +13,7 @@ IMAGE_SIZE="3072M" KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" PART_SCHEME="GPT" -FDT_OVERLAYS="sun50i-a64-timer,sun50i-a64-opp" +FDT_OVERLAYS="sun50i-a64-timer" export BOARDNAME="PINE64" arm_install_uboot() { diff --git a/release/arm64/PINEBOOK.conf b/release/arm64/PINEBOOK.conf index da5d31149c04..17e287bc55ad 100644 --- a/release/arm64/PINEBOOK.conf +++ b/release/arm64/PINEBOOK.conf @@ -13,7 +13,7 @@ IMAGE_SIZE="3072M" KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" PART_SCHEME="GPT" -FDT_OVERLAYS="sun50i-a64-timer,sun50i-a64-opp" +FDT_OVERLAYS="sun50i-a64-timer" export BOARDNAME="PINEBOOK" arm_install_uboot() { diff --git a/sys/dts/arm64/overlays/sun50i-a64-opp.dtso b/sys/dts/arm64/overlays/sun50i-a64-opp.dtso deleted file mode 100644 index 8a26c2c20422..000000000000 --- a/sys/dts/arm64/overlays/sun50i-a64-opp.dtso +++ /dev/null @@ -1,77 +0,0 @@ -/dts-v1/; -/plugin/; - -/ { - compatible = "allwinner,sun50i-a64"; -}; - -&{/} { - cpu0_opp_table: opp_table0 { - compatible = "operating-points-v2"; - opp-shared; - - opp-648000000 { - opp-hz = /bits/ 64 <648000000>; - opp-microvolt = <1040000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - opp-792000000 { - opp-hz = /bits/ 64 <792000000>; - opp-microvolt = <1100000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - opp-816000000 { - opp-hz = /bits/ 64 <816000000>; - opp-microvolt = <1100000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - opp-912000000 { - opp-hz = /bits/ 64 <912000000>; - opp-microvolt = <1120000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - opp-960000000 { - opp-hz = /bits/ 64 <960000000>; - opp-microvolt = <1160000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - opp-1008000000 { - opp-hz = /bits/ 64 <1008000000>; - opp-microvolt = <1200000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - opp-1056000000 { - opp-hz = /bits/ 64 <1056000000>; - opp-microvolt = <1240000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - opp-1104000000 { - opp-hz = /bits/ 64 <1104000000>; - opp-microvolt = <1260000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - opp-1152000000 { - opp-hz = /bits/ 64 <1152000000>; - opp-microvolt = <1300000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - }; -}; - -&{/cpus/cpu@0} { - operating-points-v2 = <&cpu0_opp_table>; - clocks = <&ccu 1>; - cpu-supply = <®_dcdc2>; -}; - -&{/cpus/cpu@1} { - operating-points-v2 = <&cpu0_opp_table>; -}; - -&{/cpus/cpu@2} { - operating-points-v2 = <&cpu0_opp_table>; -}; - -&{/cpus/cpu@3} { - operating-points-v2 = <&cpu0_opp_table>; -}; diff --git a/sys/modules/dtb/allwinner/Makefile b/sys/modules/dtb/allwinner/Makefile index fe3dccc7fd91..5b9d93a7a20e 100644 --- a/sys/modules/dtb/allwinner/Makefile +++ b/sys/modules/dtb/allwinner/Makefile @@ -54,8 +54,7 @@ DTS= \ allwinner/sun50i-h6-pine-h64.dts \ allwinner/sun50i-h6-pine-h64-model-b.dts -DTSO= sun50i-a64-opp.dtso \ - sun50i-a64-pwm.dtso \ +DTSO= sun50i-a64-pwm.dtso \ sun50i-a64-rpwm.dtso \ sun50i-a64-spi0-spigen.dtso \ sun50i-a64-timer.dtso \ From owner-dev-commits-src-main@freebsd.org Sat Jul 24 18:10:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBEC3664D9C; Sat, 24 Jul 2021 18:10: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 4GXDk44DDfz4mlF; Sat, 24 Jul 2021 18:10:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78D5714DBC; Sat, 24 Jul 2021 18:10: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 16OIA4Zc009128; Sat, 24 Jul 2021 18:10:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OIA4bx009124; Sat, 24 Jul 2021 18:10:04 GMT (envelope-from git) Date: Sat, 24 Jul 2021 18:10:04 GMT Message-Id: <202107241810.16OIA4bx009124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 3687797618b6 - main - amd64: Don't repeat unnecessary tests when cmpset fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3687797618b6c978ad733bd206a623e5df47dbe3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 18:10:04 -0000 The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=3687797618b6c978ad733bd206a623e5df47dbe3 commit 3687797618b6c978ad733bd206a623e5df47dbe3 Author: Alan Cox AuthorDate: 2021-07-24 08:50:27 +0000 Commit: Alan Cox CommitDate: 2021-07-24 18:06:47 +0000 amd64: Don't repeat unnecessary tests when cmpset fails When a cmpset for removing the PG_RW bit in pmap_promote_pde() fails, there is no need to repeat the alignment, PG_A, and PG_V tests just to reload the PTE's value. The only bit that we need be concerned with at this point is PG_M. Use fcmpset instead. MFC after: 1 week --- sys/amd64/amd64/pmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index aea4394ebcc0..47315c560831 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -6615,7 +6615,6 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, * within a 2MB page. */ firstpte = (pt_entry_t *)PHYS_TO_DMAP(*pde & PG_FRAME); -setpde: newpde = *firstpte; if ((newpde & ((PG_FRAME & PDRMASK) | PG_A | PG_V)) != (PG_A | PG_V) || !pmap_allow_2m_x_page(pmap, pmap_pde_ept_executable(pmap, @@ -6625,12 +6624,13 @@ setpde: " in pmap %p", va, pmap); return; } +setpde: if ((newpde & (PG_M | PG_RW)) == PG_RW) { /* * When PG_M is already clear, PG_RW can be cleared without * a TLB invalidation. */ - if (!atomic_cmpset_long(firstpte, newpde, newpde & ~PG_RW)) + if (!atomic_fcmpset_long(firstpte, &newpde, newpde & ~PG_RW)) goto setpde; newpde &= ~PG_RW; } @@ -6642,7 +6642,6 @@ setpde: */ pa = (newpde & (PG_PS_FRAME | PG_A | PG_V)) + NBPDR - PAGE_SIZE; for (pte = firstpte + NPTEPG - 1; pte > firstpte; pte--) { -setpte: oldpte = *pte; if ((oldpte & (PG_FRAME | PG_A | PG_V)) != pa) { counter_u64_add(pmap_pde_p_failures, 1); @@ -6650,12 +6649,13 @@ setpte: " in pmap %p", va, pmap); return; } +setpte: if ((oldpte & (PG_M | PG_RW)) == PG_RW) { /* * When PG_M is already clear, PG_RW can be cleared * without a TLB invalidation. */ - if (!atomic_cmpset_long(pte, oldpte, oldpte & ~PG_RW)) + if (!atomic_fcmpset_long(pte, &oldpte, oldpte & ~PG_RW)) goto setpte; oldpte &= ~PG_RW; CTR2(KTR_PMAP, "pmap_promote_pde: protect for va %#lx" From owner-dev-commits-src-main@freebsd.org Sat Jul 24 18:19:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AD2B665117; Sat, 24 Jul 2021 18:19: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 4GXDxH3JV0z4q2r; Sat, 24 Jul 2021 18:19:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5859F154D9; Sat, 24 Jul 2021 18:19: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 16OIJlEQ020014; Sat, 24 Jul 2021 18:19:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OIJlip020013; Sat, 24 Jul 2021 18:19:47 GMT (envelope-from git) Date: Sat, 24 Jul 2021 18:19:47 GMT Message-Id: <202107241819.16OIJlip020013@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: 73358cd2cfcc - main - Fix the pattern for changing PermitRootLogin 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: 73358cd2cfccf9aafde069ffcb8185a0f3420ffd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 18:19:47 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=73358cd2cfccf9aafde069ffcb8185a0f3420ffd commit 73358cd2cfccf9aafde069ffcb8185a0f3420ffd Author: Jose Luis Duran AuthorDate: 2021-07-16 17:11:47 +0000 Commit: Warner Losh CommitDate: 2021-07-24 18:19:19 +0000 Fix the pattern for changing PermitRootLogin The previous pattern had the (harmless) side-effect of duplicating the entry in the config file. No functional change intended. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/510 --- tools/tools/nanobsd/defaults.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 77c0e216ec80..45d9fe44c650 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -728,7 +728,7 @@ cust_comconsole ( ) ( # Allow root login via ssh cust_allow_ssh_root ( ) ( - sed -i "" -e '/PermitRootLogin/s/.*/PermitRootLogin yes/' \ + sed -i "" -E 's/^#?PermitRootLogin.*/PermitRootLogin yes/' \ ${NANO_WORLDDIR}/etc/ssh/sshd_config ) From owner-dev-commits-src-main@freebsd.org Sat Jul 24 20:39:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E02E9667FF8; Sat, 24 Jul 2021 20:39: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 4GXJ2H3CLlz3pYS; Sat, 24 Jul 2021 20:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 347F217212; Sat, 24 Jul 2021 20:39: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 16OKdHXp011436; Sat, 24 Jul 2021 20:39:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OKdHcN011435; Sat, 24 Jul 2021 20:39:17 GMT (envelope-from git) Date: Sat, 24 Jul 2021 20:39:17 GMT Message-Id: <202107242039.16OKdHcN011435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: c746ed724d01 - main - Allow stacked filesystems to be recursively unmounted MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c746ed724d01b439d42aff01cbe88eadacd0ac0d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 20:39:21 -0000 The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=c746ed724d01b439d42aff01cbe88eadacd0ac0d commit c746ed724d01b439d42aff01cbe88eadacd0ac0d Author: Jason A. Harmening AuthorDate: 2021-06-12 19:42:12 +0000 Commit: Jason A. Harmening CommitDate: 2021-07-24 19:52:00 +0000 Allow stacked filesystems to be recursively unmounted In certain emergency cases such as media failure or removal, UFS will initiate a forced unmount in order to prevent dirty buffers from accumulating against the no-longer-usable filesystem. The presence of a stacked filesystem such as nullfs or unionfs above the UFS mount will prevent this forced unmount from succeeding. This change addreses the situation by allowing stacked filesystems to be recursively unmounted on a taskqueue thread when the MNT_RECURSE flag is specified to dounmount(). This call will block until all upper mounts have been removed unless the caller specifies the MNT_DEFERRED flag to indicate the base filesystem should also be unmounted from the taskqueue. To achieve this, the recently-added vfs_pin_from_vp()/vfs_unpin() KPIs have been combined with the existing 'mnt_uppers' list used by nullfs and renamed to vfs_register_upper_from_vp()/vfs_unregister_upper(). The format of the mnt_uppers list has also been changed to accommodate filesystems such as unionfs in which a given mount may be stacked atop more than one lower mount. Additionally, management of lower FS reclaim/unlink notifications has been split into a separate list managed by a separate set of KPIs, as registration of an upper FS no longer implies interest in these notifications. Reviewed by: kib, mckusick Tested by: pho Differential Revision: https://reviews.freebsd.org/D31016 --- sys/fs/nullfs/null.h | 2 + sys/fs/nullfs/null_vfsops.c | 30 ++--- sys/fs/unionfs/union.h | 2 + sys/fs/unionfs/union_vfsops.c | 14 ++- sys/kern/vfs_mount.c | 280 +++++++++++++++++++++++++++++++++++++----- sys/kern/vfs_subr.c | 55 +++++---- sys/sys/mount.h | 51 ++++++-- sys/ufs/ffs/ffs_vfsops.c | 2 +- 8 files changed, 348 insertions(+), 88 deletions(-) diff --git a/sys/fs/nullfs/null.h b/sys/fs/nullfs/null.h index 6fdac4b1006e..a41625536d65 100644 --- a/sys/fs/nullfs/null.h +++ b/sys/fs/nullfs/null.h @@ -45,6 +45,8 @@ struct null_mount { struct mount *nullm_vfs; struct vnode *nullm_lowerrootvp; /* Ref to lower root vnode */ uint64_t nullm_flags; + struct mount_upper_node upper_node; + struct mount_upper_node notify_node; }; #ifdef _KERNEL diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 4914e5fc2dbf..73301c9275d2 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -163,7 +163,8 @@ nullfs_mount(struct mount *mp) * Save pointer to underlying FS and the reference to the * lower root vnode. */ - xmp->nullm_vfs = vfs_pin_from_vp(lowerrootvp); + xmp->nullm_vfs = vfs_register_upper_from_vp(lowerrootvp, mp, + &xmp->upper_node); if (xmp->nullm_vfs == NULL) { vput(lowerrootvp); free(xmp, M_NULLFSMNT); @@ -178,7 +179,7 @@ nullfs_mount(struct mount *mp) */ error = null_nodeget(mp, lowerrootvp, &nullm_rootvp); if (error != 0) { - vfs_unpin(xmp->nullm_vfs); + vfs_unregister_upper(xmp->nullm_vfs, &xmp->upper_node); vrele(lowerrootvp); free(xmp, M_NULLFSMNT); return (error); @@ -195,6 +196,11 @@ nullfs_mount(struct mount *mp) (xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) != 0) xmp->nullm_flags &= ~NULLM_CACHE; + if ((xmp->nullm_flags & NULLM_CACHE) != 0) { + vfs_register_for_notification(xmp->nullm_vfs, mp, + &xmp->notify_node); + } + MNT_ILOCK(mp); if ((xmp->nullm_flags & NULLM_CACHE) != 0) { mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & @@ -206,13 +212,6 @@ nullfs_mount(struct mount *mp) (MNTK_USES_BCACHE | MNTK_NO_IOPF | MNTK_UNMAPPED_BUFS); MNT_IUNLOCK(mp); vfs_getnewfsid(mp); - if ((xmp->nullm_flags & NULLM_CACHE) != 0) { - MNT_ILOCK(xmp->nullm_vfs); - TAILQ_INSERT_TAIL(&xmp->nullm_vfs->mnt_uppers, mp, - mnt_upper_link); - MNT_IUNLOCK(xmp->nullm_vfs); - } - vfs_mountedfrom(mp, target); vput(nullm_rootvp); @@ -230,7 +229,6 @@ nullfs_unmount(mp, mntflags) int mntflags; { struct null_mount *mntdata; - struct mount *ump; int error, flags; NULLFSDEBUG("nullfs_unmount: mp = %p\n", (void *)mp); @@ -259,17 +257,11 @@ nullfs_unmount(mp, mntflags) * Finally, throw away the null_mount structure */ mntdata = mp->mnt_data; - ump = mntdata->nullm_vfs; if ((mntdata->nullm_flags & NULLM_CACHE) != 0) { - MNT_ILOCK(ump); - while ((ump->mnt_kern_flag & MNTK_VGONE_UPPER) != 0) { - ump->mnt_kern_flag |= MNTK_VGONE_WAITER; - msleep(&ump->mnt_uppers, &ump->mnt_mtx, 0, "vgnupw", 0); - } - TAILQ_REMOVE(&ump->mnt_uppers, mp, mnt_upper_link); - MNT_IUNLOCK(ump); + vfs_unregister_for_notification(mntdata->nullm_vfs, + &mntdata->notify_node); } - vfs_unpin(ump); + vfs_unregister_upper(mntdata->nullm_vfs, &mntdata->upper_node); vrele(mntdata->nullm_lowerrootvp); mp->mnt_data = NULL; free(mntdata, M_NULLFSMNT); diff --git a/sys/fs/unionfs/union.h b/sys/fs/unionfs/union.h index 64706b2b21a2..96180480dbec 100644 --- a/sys/fs/unionfs/union.h +++ b/sys/fs/unionfs/union.h @@ -57,6 +57,8 @@ struct unionfs_mount { struct vnode *um_lowervp; /* VREFed once */ struct vnode *um_uppervp; /* VREFed once */ struct vnode *um_rootvp; /* ROOT vnode */ + struct mount_upper_node um_lower_link; /* node in lower FS list of uppers */ + struct mount_upper_node um_upper_link; /* node in upper FS list of uppers */ unionfs_copymode um_copymode; unionfs_whitemode um_whitemode; uid_t um_uid; diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index 96a30f0ae8b5..c17650dedc63 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/union_vfsops.c @@ -292,14 +292,16 @@ unionfs_domount(struct mount *mp) return (error); } - lowermp = vfs_pin_from_vp(ump->um_lowervp); - uppermp = vfs_pin_from_vp(ump->um_uppervp); + lowermp = vfs_register_upper_from_vp(ump->um_lowervp, mp, + &ump->um_lower_link); + uppermp = vfs_register_upper_from_vp(ump->um_uppervp, mp, + &ump->um_upper_link); if (lowermp == NULL || uppermp == NULL) { if (lowermp != NULL) - vfs_unpin(lowermp); + vfs_unregister_upper(lowermp, &ump->um_lower_link); if (uppermp != NULL) - vfs_unpin(uppermp); + vfs_unregister_upper(uppermp, &ump->um_upper_link); free(ump, M_UNIONFSMNT); mp->mnt_data = NULL; return (ENOENT); @@ -357,8 +359,8 @@ unionfs_unmount(struct mount *mp, int mntflags) if (error) return (error); - vfs_unpin(ump->um_lowervp->v_mount); - vfs_unpin(ump->um_uppervp->v_mount); + vfs_unregister_upper(ump->um_lowervp->v_mount, &ump->um_lower_link); + vfs_unregister_upper(ump->um_uppervp->v_mount, &ump->um_upper_link); free(ump, M_UNIONFSMNT); mp->mnt_data = NULL; diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 354113eb3277..3c546392b213 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -89,6 +90,11 @@ static bool default_autoro = false; SYSCTL_BOOL(_vfs, OID_AUTO, default_autoro, CTLFLAG_RW, &default_autoro, 0, "Retry failed r/w mount as r/o if no explicit ro/rw option is specified"); +static bool recursive_forced_unmount = false; +SYSCTL_BOOL(_vfs, OID_AUTO, recursive_forced_unmount, CTLFLAG_RW, + &recursive_forced_unmount, 0, "Recursively unmount stacked upper mounts" + " when a file system is forcibly unmounted"); + MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure"); MALLOC_DEFINE(M_STATFS, "statfs", "statfs structure"); static uma_zone_t mount_zone; @@ -103,6 +109,16 @@ MTX_SYSINIT(mountlist, &mountlist_mtx, "mountlist", MTX_DEF); EVENTHANDLER_LIST_DEFINE(vfs_mounted); EVENTHANDLER_LIST_DEFINE(vfs_unmounted); +static void vfs_deferred_unmount(void *arg, int pending); +static struct task deferred_unmount_task = + TASK_INITIALIZER(0, vfs_deferred_unmount, NULL);; +static struct mtx deferred_unmount_lock; +MTX_SYSINIT(deferred_unmount, &deferred_unmount_lock, "deferred_unmount", + MTX_DEF); +static STAILQ_HEAD(, mount) deferred_unmount_list = + STAILQ_HEAD_INITIALIZER(deferred_unmount_list); +TASKQUEUE_DEFINE_THREAD(deferred_unmount); + static void mount_devctl_event(const char *type, struct mount *mp, bool donew); /* @@ -505,8 +521,21 @@ vfs_ref(struct mount *mp) MNT_IUNLOCK(mp); } +/* + * Register ump as an upper mount of the mount associated with + * vnode vp. This registration will be tracked through + * mount_upper_node upper, which should be allocated by the + * caller and stored in per-mount data associated with mp. + * + * If successful, this function will return the mount associated + * with vp, and will ensure that it cannot be unmounted until + * ump has been unregistered as one of its upper mounts. + * + * Upon failure this function will return NULL. + */ struct mount * -vfs_pin_from_vp(struct vnode *vp) +vfs_register_upper_from_vp(struct vnode *vp, struct mount *ump, + struct mount_upper_node *upper) { struct mount *mp; @@ -514,26 +543,81 @@ vfs_pin_from_vp(struct vnode *vp) if (mp == NULL) return (NULL); MNT_ILOCK(mp); - if (mp != vp->v_mount || (mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { + if (mp != vp->v_mount || + ((mp->mnt_kern_flag & (MNTK_UNMOUNT | MNTK_RECURSE)) != 0)) { MNT_IUNLOCK(mp); return (NULL); } + KASSERT(ump != mp, ("upper and lower mounts are identical")); + upper->mp = ump; MNT_REF(mp); - KASSERT(mp->mnt_pinned_count < INT_MAX, - ("mount pinned count overflow")); - ++mp->mnt_pinned_count; + TAILQ_INSERT_TAIL(&mp->mnt_uppers, upper, mnt_upper_link); MNT_IUNLOCK(mp); return (mp); } +/* + * Register upper mount ump to receive vnode unlink/reclaim + * notifications from lower mount mp. This registration will + * be tracked through mount_upper_node upper, which should be + * allocated by the caller and stored in per-mount data + * associated with mp. + * + * ump must already be registered as an upper mount of mp + * through a call to vfs_register_upper_from_vp(). + */ void -vfs_unpin(struct mount *mp) +vfs_register_for_notification(struct mount *mp, struct mount *ump, + struct mount_upper_node *upper) +{ + upper->mp = ump; + MNT_ILOCK(mp); + TAILQ_INSERT_TAIL(&mp->mnt_notify, upper, mnt_upper_link); + MNT_IUNLOCK(mp); +} + +static void +vfs_drain_upper_locked(struct mount *mp) +{ + mtx_assert(MNT_MTX(mp), MA_OWNED); + while (mp->mnt_upper_pending != 0) { + mp->mnt_kern_flag |= MNTK_UPPER_WAITER; + msleep(&mp->mnt_uppers, MNT_MTX(mp), 0, "mntupw", 0); + } +} + +/* + * Undo a previous call to vfs_register_for_notification(). + * The mount represented by upper must be currently registered + * as an upper mount for mp. + */ +void +vfs_unregister_for_notification(struct mount *mp, + struct mount_upper_node *upper) +{ + MNT_ILOCK(mp); + vfs_drain_upper_locked(mp); + TAILQ_REMOVE(&mp->mnt_notify, upper, mnt_upper_link); + MNT_IUNLOCK(mp); +} + +/* + * Undo a previous call to vfs_register_upper_from_vp(). + * This must be done before mp can be unmounted. + */ +void +vfs_unregister_upper(struct mount *mp, struct mount_upper_node *upper) { MNT_ILOCK(mp); - KASSERT(mp->mnt_pinned_count > 0, ("mount pinned count underflow")); KASSERT((mp->mnt_kern_flag & MNTK_UNMOUNT) == 0, - ("mount pinned with pending unmount")); - --mp->mnt_pinned_count; + ("registered upper with pending unmount")); + vfs_drain_upper_locked(mp); + TAILQ_REMOVE(&mp->mnt_uppers, upper, mnt_upper_link); + if ((mp->mnt_kern_flag & MNTK_TASKQUEUE_WAITER) != 0 && + TAILQ_EMPTY(&mp->mnt_uppers)) { + mp->mnt_kern_flag &= ~MNTK_TASKQUEUE_WAITER; + wakeup(&mp->mnt_taskqueue_link); + } MNT_REL(mp); MNT_IUNLOCK(mp); } @@ -600,8 +684,10 @@ vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp, const char *fspath, mac_mount_create(cred, mp); #endif arc4rand(&mp->mnt_hashseed, sizeof mp->mnt_hashseed, 0); + mp->mnt_upper_pending = 0; TAILQ_INIT(&mp->mnt_uppers); - mp->mnt_pinned_count = 0; + TAILQ_INIT(&mp->mnt_notify); + mp->mnt_taskqueue_flags = 0; return (mp); } @@ -640,9 +726,9 @@ vfs_mount_destroy(struct mount *mp) vn_printf(vp, "dangling vnode "); panic("unmount: dangling vnode"); } - KASSERT(mp->mnt_pinned_count == 0, - ("mnt_pinned_count = %d", mp->mnt_pinned_count)); + KASSERT(mp->mnt_upper_pending == 0, ("mnt_upper_pending")); KASSERT(TAILQ_EMPTY(&mp->mnt_uppers), ("mnt_uppers")); + KASSERT(TAILQ_EMPTY(&mp->mnt_notify), ("mnt_notify")); if (mp->mnt_nvnodelistsize != 0) panic("vfs_mount_destroy: nonzero nvnodelistsize"); if (mp->mnt_lazyvnodelistsize != 0) @@ -1799,17 +1885,166 @@ vfs_mount_fetch_counter(struct mount *mp, enum mount_counter which) return (sum); } +static bool +deferred_unmount_enqueue(struct mount *mp, uint64_t flags, bool requeue) +{ + bool enqueued; + + enqueued = false; + mtx_lock(&deferred_unmount_lock); + if ((mp->mnt_taskqueue_flags & MNT_DEFERRED) == 0 || requeue) { + mp->mnt_taskqueue_flags = flags | MNT_DEFERRED; + STAILQ_INSERT_TAIL(&deferred_unmount_list, mp, + mnt_taskqueue_link); + enqueued = true; + } + mtx_unlock(&deferred_unmount_lock); + + if (enqueued) { + taskqueue_enqueue(taskqueue_deferred_unmount, + &deferred_unmount_task); + } + + return (enqueued); +} + +/* + * Taskqueue handler for processing async/recursive unmounts + */ +static void +vfs_deferred_unmount(void *argi __unused, int pending __unused) +{ + STAILQ_HEAD(, mount) local_unmounts; + uint64_t flags; + struct mount *mp, *tmp; + bool unmounted; + + STAILQ_INIT(&local_unmounts); + mtx_lock(&deferred_unmount_lock); + STAILQ_CONCAT(&local_unmounts, &deferred_unmount_list); + mtx_unlock(&deferred_unmount_lock); + + STAILQ_FOREACH_SAFE(mp, &local_unmounts, mnt_taskqueue_link, tmp) { + flags = mp->mnt_taskqueue_flags; + KASSERT((flags & MNT_DEFERRED) != 0, + ("taskqueue unmount without MNT_DEFERRED")); + if (dounmount(mp, flags, curthread) != 0) { + MNT_ILOCK(mp); + unmounted = ((mp->mnt_kern_flag & MNTK_REFEXPIRE) != 0); + MNT_IUNLOCK(mp); + if (!unmounted) + deferred_unmount_enqueue(mp, flags, true); + else + vfs_rel(mp); + } + } +} + /* * Do the actual filesystem unmount. */ int -dounmount(struct mount *mp, int flags, struct thread *td) +dounmount(struct mount *mp, uint64_t flags, struct thread *td) { + struct mount_upper_node *upper; struct vnode *coveredvp, *rootvp; int error; uint64_t async_flag; int mnt_gen_r; + KASSERT((flags & MNT_DEFERRED) == 0 || + (flags & (MNT_RECURSE | MNT_FORCE)) == (MNT_RECURSE | MNT_FORCE), + ("MNT_DEFERRED requires MNT_RECURSE | MNT_FORCE")); + + /* + * If the caller has explicitly requested the unmount to be handled by + * the taskqueue and we're not already in taskqueue context, queue + * up the unmount request and exit. This is done prior to any + * credential checks; MNT_DEFERRED should be used only for kernel- + * initiated unmounts and will therefore be processed with the + * (kernel) credentials of the taskqueue thread. Still, callers + * should be sure this is the behavior they want. + */ + if ((flags & MNT_DEFERRED) != 0 && + taskqueue_member(taskqueue_deferred_unmount, curthread) == 0) { + if (!deferred_unmount_enqueue(mp, flags, false)) + vfs_rel(mp); + return (EINPROGRESS); + } + + /* + * Only privileged root, or (if MNT_USER is set) the user that did the + * original mount is permitted to unmount this filesystem. + * This check should be made prior to queueing up any recursive + * unmounts of upper filesystems. Those unmounts will be executed + * with kernel thread credentials and are expected to succeed, so + * we must at least ensure the originating context has sufficient + * privilege to unmount the base filesystem before proceeding with + * the uppers. + */ + error = vfs_suser(mp, td); + if (error != 0) { + KASSERT((flags & MNT_DEFERRED) == 0, + ("taskqueue unmount with insufficient privilege")); + vfs_rel(mp); + return (error); + } + + if (recursive_forced_unmount && ((flags & MNT_FORCE) != 0)) + flags |= MNT_RECURSE; + + if ((flags & MNT_RECURSE) != 0) { + KASSERT((flags & MNT_FORCE) != 0, + ("MNT_RECURSE requires MNT_FORCE")); + + MNT_ILOCK(mp); + /* + * Set MNTK_RECURSE to prevent new upper mounts from being + * added, and note that an operation on the uppers list is in + * progress. This will ensure that unregistration from the + * uppers list, and therefore any pending unmount of the upper + * FS, can't complete until after we finish walking the list. + */ + mp->mnt_kern_flag |= MNTK_RECURSE; + mp->mnt_upper_pending++; + TAILQ_FOREACH(upper, &mp->mnt_uppers, mnt_upper_link) { + MNT_IUNLOCK(mp); + vfs_ref(upper->mp); + if (!deferred_unmount_enqueue(upper->mp, flags, false)) + vfs_rel(upper->mp); + MNT_ILOCK(mp); + } + mp->mnt_upper_pending--; + if ((mp->mnt_kern_flag & MNTK_UPPER_WAITER) != 0 && + mp->mnt_upper_pending == 0) { + mp->mnt_kern_flag &= ~MNTK_UPPER_WAITER; + wakeup(&mp->mnt_uppers); + } + /* + * If we're not on the taskqueue, wait until the uppers list + * is drained before proceeding with unmount. Otherwise, if + * we are on the taskqueue and there are still pending uppers, + * just re-enqueue on the end of the taskqueue. + */ + if ((flags & MNT_DEFERRED) == 0) { + while (!TAILQ_EMPTY(&mp->mnt_uppers)) { + mp->mnt_kern_flag |= MNTK_TASKQUEUE_WAITER; + msleep(&mp->mnt_taskqueue_link, MNT_MTX(mp), 0, + "umntqw", 0); + } + } else if (!TAILQ_EMPTY(&mp->mnt_uppers)) { + MNT_IUNLOCK(mp); + deferred_unmount_enqueue(mp, flags, true); + return (0); + } + MNT_IUNLOCK(mp); + KASSERT(TAILQ_EMPTY(&mp->mnt_uppers), ("mnt_uppers not empty")); + } + + /* Allow the taskqueue to safely re-enqueue on failure */ + if ((flags & MNT_DEFERRED) != 0) + vfs_ref(mp); + if ((coveredvp = mp->mnt_vnodecovered) != NULL) { mnt_gen_r = mp->mnt_gen; VI_LOCK(coveredvp); @@ -1828,27 +2063,13 @@ dounmount(struct mount *mp, int flags, struct thread *td) } } - /* - * Only privileged root, or (if MNT_USER is set) the user that did the - * original mount is permitted to unmount this filesystem. - */ - error = vfs_suser(mp, td); - if (error != 0) { - if (coveredvp != NULL) { - VOP_UNLOCK(coveredvp); - vdrop(coveredvp); - } - vfs_rel(mp); - return (error); - } - vfs_op_enter(mp); vn_start_write(NULL, &mp, V_WAIT | V_MNTREF); MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0 || (mp->mnt_flag & MNT_UPDATE) != 0 || - mp->mnt_pinned_count != 0) { + !TAILQ_EMPTY(&mp->mnt_uppers)) { dounmount_cleanup(mp, coveredvp, 0); return (EBUSY); } @@ -1952,6 +2173,7 @@ dounmount(struct mount *mp, int flags, struct thread *td) } return (error); } + mtx_lock(&mountlist_mtx); TAILQ_REMOVE(&mountlist, mp, mnt_list); mtx_unlock(&mountlist_mtx); @@ -1977,6 +2199,8 @@ dounmount(struct mount *mp, int flags, struct thread *td) } if (mp == rootdevmp) rootdevmp = NULL; + if ((flags & MNT_DEFERRED) != 0) + vfs_rel(mp); vfs_mount_destroy(mp); return (0); } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a2f25bf78495..8add6951645f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -831,9 +831,9 @@ vfs_busy(struct mount *mp, int flags) * valid. */ while (mp->mnt_kern_flag & MNTK_UNMOUNT) { - KASSERT(mp->mnt_pinned_count == 0, - ("%s: non-zero pinned count %d with pending unmount", - __func__, mp->mnt_pinned_count)); + KASSERT(TAILQ_EMPTY(&mp->mnt_uppers), + ("%s: non-empty upper mount list with pending unmount", + __func__)); if (flags & MBF_NOWAIT || mp->mnt_kern_flag & MNTK_REFEXPIRE) { MNT_REL(mp); MNT_IUNLOCK(mp); @@ -3897,6 +3897,11 @@ notify_lowervp_vfs_dummy(struct mount *mp __unused, { } +struct notify_mount { + struct mount mp; + struct mount_upper_node upper; +}; + /* * Notify upper mounts about reclaimed or unlinked vnode. */ @@ -3907,45 +3912,52 @@ vfs_notify_upper(struct vnode *vp, int event) .vfs_reclaim_lowervp = notify_lowervp_vfs_dummy, .vfs_unlink_lowervp = notify_lowervp_vfs_dummy, }; - struct mount *mp, *ump, *mmp; + struct mount *mp; + struct mount_upper_node *ump; + struct notify_mount *mmp; mp = vp->v_mount; if (mp == NULL) return; - if (TAILQ_EMPTY(&mp->mnt_uppers)) + if (TAILQ_EMPTY(&mp->mnt_notify)) return; - mmp = malloc(sizeof(struct mount), M_TEMP, M_WAITOK | M_ZERO); - mmp->mnt_op = &vgonel_vfsops; - mmp->mnt_kern_flag |= MNTK_MARKER; + mmp = malloc(sizeof(*mmp), M_TEMP, M_WAITOK | M_ZERO); + mmp->mp.mnt_op = &vgonel_vfsops; + mmp->mp.mnt_kern_flag |= MNTK_MARKER; + mmp->upper.mp = &mmp->mp; MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_VGONE_UPPER; - for (ump = TAILQ_FIRST(&mp->mnt_uppers); ump != NULL;) { - if ((ump->mnt_kern_flag & MNTK_MARKER) != 0) { + mp->mnt_upper_pending++; + KASSERT(mp->mnt_upper_pending > 0, + ("%s: mnt_upper_pending %d", __func__, mp->mnt_upper_pending)); + for (ump = TAILQ_FIRST(&mp->mnt_notify); ump != NULL;) { + if ((ump->mp->mnt_kern_flag & MNTK_MARKER) != 0) { ump = TAILQ_NEXT(ump, mnt_upper_link); continue; } - TAILQ_INSERT_AFTER(&mp->mnt_uppers, ump, mmp, mnt_upper_link); + TAILQ_INSERT_AFTER(&mp->mnt_notify, ump, &mmp->upper, + mnt_upper_link); MNT_IUNLOCK(mp); switch (event) { case VFS_NOTIFY_UPPER_RECLAIM: - VFS_RECLAIM_LOWERVP(ump, vp); + VFS_RECLAIM_LOWERVP(ump->mp, vp); break; case VFS_NOTIFY_UPPER_UNLINK: - VFS_UNLINK_LOWERVP(ump, vp); + VFS_UNLINK_LOWERVP(ump->mp, vp); break; default: KASSERT(0, ("invalid event %d", event)); break; } MNT_ILOCK(mp); - ump = TAILQ_NEXT(mmp, mnt_upper_link); - TAILQ_REMOVE(&mp->mnt_uppers, mmp, mnt_upper_link); + ump = TAILQ_NEXT(&mmp->upper, mnt_upper_link); + TAILQ_REMOVE(&mp->mnt_notify, &mmp->upper, mnt_upper_link); } free(mmp, M_TEMP); - mp->mnt_kern_flag &= ~MNTK_VGONE_UPPER; - if ((mp->mnt_kern_flag & MNTK_VGONE_WAITER) != 0) { - mp->mnt_kern_flag &= ~MNTK_VGONE_WAITER; + mp->mnt_upper_pending--; + if ((mp->mnt_kern_flag & MNTK_UPPER_WAITER) != 0 && + mp->mnt_upper_pending == 0) { + mp->mnt_kern_flag &= ~MNTK_UPPER_WAITER; wakeup(&mp->mnt_uppers); } MNT_IUNLOCK(mp); @@ -4376,12 +4388,13 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_EXTENDED_SHARED); MNT_KERN_FLAG(MNTK_SHARED_WRITES); MNT_KERN_FLAG(MNTK_NO_IOPF); - MNT_KERN_FLAG(MNTK_VGONE_UPPER); - MNT_KERN_FLAG(MNTK_VGONE_WAITER); + MNT_KERN_FLAG(MNTK_RECURSE); + MNT_KERN_FLAG(MNTK_UPPER_WAITER); MNT_KERN_FLAG(MNTK_LOOKUP_EXCL_DOTDOT); MNT_KERN_FLAG(MNTK_MARKER); MNT_KERN_FLAG(MNTK_USES_BCACHE); MNT_KERN_FLAG(MNTK_FPLOOKUP); + MNT_KERN_FLAG(MNTK_TASKQUEUE_WAITER); MNT_KERN_FLAG(MNTK_NOASYNC); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 693293b12370..2082ff089d69 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -190,6 +190,19 @@ struct mount_pcpu { _Static_assert(sizeof(struct mount_pcpu) == 16, "the struct is allocated from pcpu 16 zone"); +/* + * Structure for tracking a stacked filesystem mounted above another + * filesystem. This is expected to be stored in the upper FS' per-mount data. + * + * Lock reference: + * i - lower mount interlock + * c - constant from node initialization + */ +struct mount_upper_node { + struct mount *mp; /* (c) mount object for upper FS */ + TAILQ_ENTRY(mount_upper_node) mnt_upper_link; /* (i) position in uppers list */ +}; + /* * Structure per mounted filesystem. Each mounted filesystem has an * array of operations and an instance record. The filesystems are @@ -199,8 +212,8 @@ _Static_assert(sizeof(struct mount_pcpu) == 16, * l - mnt_listmtx * m - mountlist_mtx * i - interlock - * i* - interlock of uppers' list head * v - vnode freelist mutex + * d - deferred unmount list mutex * * Unmarked fields are considered stable as long as a ref is held. * @@ -242,10 +255,12 @@ struct mount { struct mtx mnt_listmtx; struct vnodelst mnt_lazyvnodelist; /* (l) list of lazy vnodes */ int mnt_lazyvnodelistsize; /* (l) # of lazy vnodes */ - int mnt_pinned_count; /* (i) unmount prevented */ + int mnt_upper_pending; /* (i) # of pending ops on mnt_uppers */ struct lock mnt_explock; /* vfs_export walkers lock */ - TAILQ_ENTRY(mount) mnt_upper_link; /* (i*) we in the all uppers */ - TAILQ_HEAD(, mount) mnt_uppers; /* (i) upper mounts over us */ + TAILQ_HEAD(, mount_upper_node) mnt_uppers; /* (i) upper mounts over us */ + TAILQ_HEAD(, mount_upper_node) mnt_notify; /* (i) upper mounts for notification */ + STAILQ_ENTRY(mount) mnt_taskqueue_link; /* (d) our place in deferred unmount list */ + uint64_t mnt_taskqueue_flags; /* (d) unmount flags passed from taskqueue */ }; #endif /* _WANT_MOUNT || _KERNEL */ @@ -438,9 +453,13 @@ struct mntoptnames { #define MNT_BYFSID 0x0000000008000000ULL /* specify filesystem by ID. */ #define MNT_NOCOVER 0x0000001000000000ULL /* Do not cover a mount point */ #define MNT_EMPTYDIR 0x0000002000000000ULL /* Only mount on empty dir */ -#define MNT_CMDFLAGS (MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD | \ +#define MNT_RECURSE 0x0000100000000000ULL /* recursively unmount uppers */ +#define MNT_DEFERRED 0x0000200000000000ULL /* unmount in async context */ +#define MNT_CMDFLAGS (MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD | \ MNT_FORCE | MNT_SNAPSHOT | MNT_NONBUSY | \ - MNT_BYFSID | MNT_NOCOVER | MNT_EMPTYDIR) + MNT_BYFSID | MNT_NOCOVER | MNT_EMPTYDIR | \ + MNT_RECURSE | MNT_DEFERRED) + /* * Internal filesystem control flags stored in mnt_kern_flag. * @@ -466,8 +485,8 @@ struct mntoptnames { #define MNTK_NO_IOPF 0x00000100 /* Disallow page faults during reads and writes. Filesystem shall properly handle i/o state on EFAULT. */ -#define MNTK_VGONE_UPPER 0x00000200 -#define MNTK_VGONE_WAITER 0x00000400 +#define MNTK_RECURSE 0x00000200 /* pending recursive unmount */ +#define MNTK_UPPER_WAITER 0x00000400 /* waiting to drain MNTK_UPPER_PENDING */ #define MNTK_LOOKUP_EXCL_DOTDOT 0x00000800 #define MNTK_MARKER 0x00001000 #define MNTK_UNMAPPED_BUFS 0x00002000 @@ -477,8 +496,9 @@ struct mntoptnames { #define MNTK_UNIONFS 0x00020000 /* A hack for F_ISUNIONSTACK */ #define MNTK_FPLOOKUP 0x00040000 /* fast path lookup is supported */ #define MNTK_SUSPEND_ALL 0x00080000 /* Suspended by all-fs suspension */ -#define MNTK_NOASYNC 0x00800000 /* disable async */ -#define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ +#define MNTK_TASKQUEUE_WAITER 0x00100000 /* Waiting on unmount taskqueue */ +#define MNTK_NOASYNC 0x00800000 /* disable async */ +#define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ #define MNTK_SUSPEND2 0x04000000 /* block secondary writes */ @@ -952,7 +972,7 @@ vfs_statfs_t __vfs_statfs; * exported vnode operations */ -int dounmount(struct mount *, int, struct thread *); +int dounmount(struct mount *, uint64_t, struct thread *); int kernel_mount(struct mntarg *ma, uint64_t flags); int kernel_vmount(int flags, ...); @@ -1012,8 +1032,13 @@ struct mount *vfs_mount_alloc(struct vnode *, struct vfsconf *, const char *, int vfs_suser(struct mount *, struct thread *); void vfs_unbusy(struct mount *); void vfs_unmountall(void); -struct mount *vfs_pin_from_vp(struct vnode *); -void vfs_unpin(struct mount *); +struct mount *vfs_register_upper_from_vp(struct vnode *, + struct mount *ump, struct mount_upper_node *); +void vfs_register_for_notification(struct mount *, struct mount *, + struct mount_upper_node *); +void vfs_unregister_for_notification(struct mount *, + struct mount_upper_node *); +void vfs_unregister_upper(struct mount *, struct mount_upper_node *); extern TAILQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ extern struct mtx_padalign mountlist_mtx; extern struct nfs_public nfs_pub; diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 6b7407eb88f9..689c85d7bb1f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -297,7 +297,7 @@ ffs_fsfail_unmount(void *v, int pending) */ mp = vfs_getvfs(&etp->fsid); if (mp != NULL) - dounmount(mp, MNT_FORCE, curthread); + dounmount(mp, MNT_FORCE | MNT_RECURSE, curthread); free(etp, M_UFSMNT); } From owner-dev-commits-src-main@freebsd.org Sat Jul 24 20:39:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32AF7667EF6; Sat, 24 Jul 2021 20:39: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 4GXJ2K4Jlbz3pfB; Sat, 24 Jul 2021 20:39:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27E1117213; Sat, 24 Jul 2021 20:39: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 16OKdKmh011488; Sat, 24 Jul 2021 20:39:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OKdKap011487; Sat, 24 Jul 2021 20:39:20 GMT (envelope-from git) Date: Sat, 24 Jul 2021 20:39:20 GMT Message-Id: <202107242039.16OKdKap011487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: 211ec9b7d6ec - main - FFS: remove ffs_fsfail_task MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 211ec9b7d6ec2d52e2fec2ce10e82c12ec0e4ddd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 20:39:23 -0000 The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=211ec9b7d6ec2d52e2fec2ce10e82c12ec0e4ddd commit 211ec9b7d6ec2d52e2fec2ce10e82c12ec0e4ddd Author: Jason A. Harmening AuthorDate: 2021-07-18 05:35:42 +0000 Commit: Jason A. Harmening CommitDate: 2021-07-24 19:52:41 +0000 FFS: remove ffs_fsfail_task Now that dounmount() supports a dedicated taskqueue, we can simply call it with MNT_DEFERRED directly from the failing context. This also avoids blocking taskqueue_thread with a potentially-expensive unmount operation. Reviewed by: kib, mckusick Tested by: pho Differential Revision: https://reviews.freebsd.org/D31016 --- sys/ufs/ffs/ffs_vfsops.c | 47 +++++++---------------------------------------- sys/ufs/ufs/ufsmount.h | 5 ----- 2 files changed, 7 insertions(+), 45 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 689c85d7bb1f..2ff71cc3e4d1 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -281,28 +281,8 @@ ffs_check_blkno(struct mount *mp, ino_t inum, ufs2_daddr_t daddr, int blksize) } /* - * Initiate a forcible unmount. + * On first ENXIO error, initiate an asynchronous forcible unmount. * Used to unmount filesystems whose underlying media has gone away. - */ -static void -ffs_fsfail_unmount(void *v, int pending) -{ - struct fsfail_task *etp; - struct mount *mp; - - etp = v; - - /* - * Find our mount and get a ref on it, then try to unmount. - */ - mp = vfs_getvfs(&etp->fsid); - if (mp != NULL) - dounmount(mp, MNT_FORCE | MNT_RECURSE, curthread); - free(etp, M_UFSMNT); -} - -/* - * On first ENXIO error, start a task that forcibly unmounts the filesystem. * * Return true if a cleanup is in progress. */ @@ -320,25 +300,18 @@ ffs_fsfail_cleanup(struct ufsmount *ump, int error) int ffs_fsfail_cleanup_locked(struct ufsmount *ump, int error) { - struct fsfail_task *etp; - struct task *tp; - mtx_assert(UFS_MTX(ump), MA_OWNED); if (error == ENXIO && (ump->um_flags & UM_FSFAIL_CLEANUP) == 0) { ump->um_flags |= UM_FSFAIL_CLEANUP; /* * Queue an async forced unmount. */ - etp = ump->um_fsfail_task; - ump->um_fsfail_task = NULL; - if (etp != NULL) { - tp = &etp->task; - TASK_INIT(tp, 0, ffs_fsfail_unmount, etp); - taskqueue_enqueue(taskqueue_thread, tp); - printf("UFS: forcibly unmounting %s from %s\n", - ump->um_mountp->mnt_stat.f_mntfromname, - ump->um_mountp->mnt_stat.f_mntonname); - } + vfs_ref(ump->um_mountp); + dounmount(ump->um_mountp, + MNT_FORCE | MNT_RECURSE | MNT_DEFERRED, curthread); + printf("UFS: forcibly unmounting %s from %s\n", + ump->um_mountp->mnt_stat.f_mntfromname, + ump->um_mountp->mnt_stat.f_mntonname); } return ((ump->um_flags & UM_FSFAIL_CLEANUP) != 0); } @@ -1046,7 +1019,6 @@ ffs_mountfs(odevvp, mp, td) struct g_consumer *cp; struct mount *nmp; struct vnode *devvp; - struct fsfail_task *etp; int candelete, canspeedup; off_t loc; @@ -1334,9 +1306,6 @@ ffs_mountfs(odevvp, mp, td) (void) ufs_extattr_autostart(mp, td); #endif /* !UFS_EXTATTR_AUTOSTART */ #endif /* !UFS_EXTATTR */ - etp = malloc(sizeof *ump->um_fsfail_task, M_UFSMNT, M_WAITOK | M_ZERO); - etp->fsid = mp->mnt_stat.f_fsid; - ump->um_fsfail_task = etp; return (0); out: if (fs != NULL) { @@ -1583,8 +1552,6 @@ ffs_unmount(mp, mntflags) free(fs->fs_csp, M_UFSMNT); free(fs->fs_si, M_UFSMNT); free(fs, M_UFSMNT); - if (ump->um_fsfail_task != NULL) - free(ump->um_fsfail_task, M_UFSMNT); free(ump, M_UFSMNT); mp->mnt_data = NULL; MNT_ILOCK(mp); diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h index 6071faec795c..f2951d74d44c 100644 --- a/sys/ufs/ufs/ufsmount.h +++ b/sys/ufs/ufs/ufsmount.h @@ -67,10 +67,6 @@ struct inodedep; TAILQ_HEAD(inodedeplst, inodedep); LIST_HEAD(bmsafemaphd, bmsafemap); LIST_HEAD(trimlist_hashhead, ffs_blkfree_trim_params); -struct fsfail_task { - struct task task; - fsid_t fsid; -}; #include #include @@ -123,7 +119,6 @@ struct ufsmount { struct taskqueue *um_trim_tq; /* (c) trim request queue */ struct trimlist_hashhead *um_trimhash; /* (i) trimlist hash table */ u_long um_trimlisthashsize; /* (i) trim hash table size-1 */ - struct fsfail_task *um_fsfail_task; /* (i) task for fsfail cleanup*/ /* (c) - below function ptrs */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); From owner-dev-commits-src-main@freebsd.org Sat Jul 24 20:39:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C203668218; Sat, 24 Jul 2021 20:39: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 4GXJ2H3Ccjz3pYV; Sat, 24 Jul 2021 20:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02BC8170A3; Sat, 24 Jul 2021 20:39: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 16OKdIax011462; Sat, 24 Jul 2021 20:39:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OKdIdr011461; Sat, 24 Jul 2021 20:39:18 GMT (envelope-from git) Date: Sat, 24 Jul 2021 20:39:18 GMT Message-Id: <202107242039.16OKdIdr011461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: 2bc16e8aaf75 - main - VFS: remove MNTK_MARKER MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bc16e8aaf7577e702ce1dbcb343f11c53e8dce0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 20:39:20 -0000 The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=2bc16e8aaf7577e702ce1dbcb343f11c53e8dce0 commit 2bc16e8aaf7577e702ce1dbcb343f11c53e8dce0 Author: Jason A. Harmening AuthorDate: 2021-07-18 04:26:48 +0000 Commit: Jason A. Harmening CommitDate: 2021-07-24 19:52:32 +0000 VFS: remove MNTK_MARKER We no longer allow upper filesystems to be unregistered from the base mount while vfs_notify_upper() or any other upper operation is pending. New upper mounts can still be registered during this period, but they will be added at the end of the upper mount tailq. We therefore no longer need to allocate marker nodes during vfs_notify_upper() to keep our place in the iteration. Reviewed by: kib, mckusick Tested by: pho Differential Revision: https://reviews.freebsd.org/D31016 --- sys/kern/vfs_subr.c | 34 ++-------------------------------- sys/sys/mount.h | 1 - 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 8add6951645f..23f6ec9cf3fd 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3891,52 +3891,26 @@ vgone(struct vnode *vp) VI_UNLOCK(vp); } -static void -notify_lowervp_vfs_dummy(struct mount *mp __unused, - struct vnode *lowervp __unused) -{ -} - -struct notify_mount { - struct mount mp; - struct mount_upper_node upper; -}; - /* * Notify upper mounts about reclaimed or unlinked vnode. */ void vfs_notify_upper(struct vnode *vp, int event) { - static struct vfsops vgonel_vfsops = { - .vfs_reclaim_lowervp = notify_lowervp_vfs_dummy, - .vfs_unlink_lowervp = notify_lowervp_vfs_dummy, - }; struct mount *mp; struct mount_upper_node *ump; - struct notify_mount *mmp; - mp = vp->v_mount; + mp = atomic_load_ptr(&vp->v_mount); if (mp == NULL) return; if (TAILQ_EMPTY(&mp->mnt_notify)) return; - mmp = malloc(sizeof(*mmp), M_TEMP, M_WAITOK | M_ZERO); - mmp->mp.mnt_op = &vgonel_vfsops; - mmp->mp.mnt_kern_flag |= MNTK_MARKER; - mmp->upper.mp = &mmp->mp; MNT_ILOCK(mp); mp->mnt_upper_pending++; KASSERT(mp->mnt_upper_pending > 0, ("%s: mnt_upper_pending %d", __func__, mp->mnt_upper_pending)); - for (ump = TAILQ_FIRST(&mp->mnt_notify); ump != NULL;) { - if ((ump->mp->mnt_kern_flag & MNTK_MARKER) != 0) { - ump = TAILQ_NEXT(ump, mnt_upper_link); - continue; - } - TAILQ_INSERT_AFTER(&mp->mnt_notify, ump, &mmp->upper, - mnt_upper_link); + TAILQ_FOREACH(ump, &mp->mnt_notify, mnt_upper_link) { MNT_IUNLOCK(mp); switch (event) { case VFS_NOTIFY_UPPER_RECLAIM: @@ -3950,10 +3924,7 @@ vfs_notify_upper(struct vnode *vp, int event) break; } MNT_ILOCK(mp); - ump = TAILQ_NEXT(&mmp->upper, mnt_upper_link); - TAILQ_REMOVE(&mp->mnt_notify, &mmp->upper, mnt_upper_link); } - free(mmp, M_TEMP); mp->mnt_upper_pending--; if ((mp->mnt_kern_flag & MNTK_UPPER_WAITER) != 0 && mp->mnt_upper_pending == 0) { @@ -4391,7 +4362,6 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_RECURSE); MNT_KERN_FLAG(MNTK_UPPER_WAITER); MNT_KERN_FLAG(MNTK_LOOKUP_EXCL_DOTDOT); - MNT_KERN_FLAG(MNTK_MARKER); MNT_KERN_FLAG(MNTK_USES_BCACHE); MNT_KERN_FLAG(MNTK_FPLOOKUP); MNT_KERN_FLAG(MNTK_TASKQUEUE_WAITER); diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 2082ff089d69..016c7e9c188d 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -488,7 +488,6 @@ struct mntoptnames { #define MNTK_RECURSE 0x00000200 /* pending recursive unmount */ #define MNTK_UPPER_WAITER 0x00000400 /* waiting to drain MNTK_UPPER_PENDING */ #define MNTK_LOOKUP_EXCL_DOTDOT 0x00000800 -#define MNTK_MARKER 0x00001000 #define MNTK_UNMAPPED_BUFS 0x00002000 #define MNTK_USES_BCACHE 0x00004000 /* FS uses the buffer cache. */ #define MNTK_TEXT_REFS 0x00008000 /* Keep use ref for text */ From owner-dev-commits-src-main@freebsd.org Sat Jul 24 20:39:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82577667EF9; Sat, 24 Jul 2021 20:39: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 4GXJ2K5S52z3pRT; Sat, 24 Jul 2021 20:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 506C717283; Sat, 24 Jul 2021 20:39: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 16OKdLAW011512; Sat, 24 Jul 2021 20:39:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OKdLMu011511; Sat, 24 Jul 2021 20:39:21 GMT (envelope-from git) Date: Sat, 24 Jul 2021 20:39:21 GMT Message-Id: <202107242039.16OKdLMu011511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jason A. Harmening" Subject: git: c44685732899 - main - Add stress2 test to exercise FFS forcible unmount with stacked nullfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c44685732899aa76e8c77107d711f98717ddc5c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 20:39:23 -0000 The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=c44685732899aa76e8c77107d711f98717ddc5c8 commit c44685732899aa76e8c77107d711f98717ddc5c8 Author: Jason A. Harmening AuthorDate: 2021-07-19 15:33:02 +0000 Commit: Jason A. Harmening CommitDate: 2021-07-24 19:52:56 +0000 Add stress2 test to exercise FFS forcible unmount with stacked nullfs Reviewed by: kib, mckusick Tested by: pho Differential Revision: https://reviews.freebsd.org/D31016 --- tools/test/stress2/misc/gnop11.sh | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/tools/test/stress2/misc/gnop11.sh b/tools/test/stress2/misc/gnop11.sh new file mode 100755 index 000000000000..8a23eb072144 --- /dev/null +++ b/tools/test/stress2/misc/gnop11.sh @@ -0,0 +1,85 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Kirk McKusick +# +# 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. +# + +# 'panic: Lock (lockmgr) ufs not locked @ kern/kern_lock.c:1271' seen: +# https://people.freebsd.org/~pho/stress/log/gnop8.txt + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +fsck=/sbin/fsck_ffs +exp=/sbin/fsck_ffs.exp # Experimental version +[ -f $exp ] && { echo "Using $exp"; fsck=$exp; } +mdconfig -a -t swap -s 5g -u $mdstart || exit 1 +md=md$mdstart +newfs -j /dev/$md || exit 1 +start=`date +%s` + +nullfs_mounts=15 +: ${nullfs_dstdir:=$mntpoint} + +while [ $((`date +%s` - start)) -lt 120 ]; do + gnop create /dev/$md || exit 1 + mount /dev/$md.nop /mnt || exit 1 + + for i in `jot $nullfs_mounts`; do + [ ! -d ${nullfs_dstdir}$i ] && mkdir ${nullfs_dstdir}$i + [ ! -d ${nullfs_dstdir}$(($i + $nullfs_mounts)) ] && + mkdir ${nullfs_dstdir}$(($i + $nullfs_mounts)) + mount | grep -q " ${nullfs_dstdir}$i " && + umount ${nullfs_dstdir}$i + mount | grep -q " ${nullfs_dstdir}$(($i + $nullfs_mounts)) " && + umount ${nullfs_dstdir}$(($i + $nullfs_mounts)) + mount_nullfs /mnt ${nullfs_dstdir}$i > \ + /dev/null 2>&1 + mount_nullfs ${nullfs_dstdir}$i ${nullfs_dstdir}$(($i + $nullfs_mounts)) > \ + /dev/null 2>&1 + done + # start your favorite I/O test here + cp -rp /[a-l]* /[n-z]* /mnt & + + # after some number of seconds + sleep 1 + gnop destroy -f /dev/$md.nop + kill $! + + # wait until forcible unmount, may be up to about 30 seconds, + # but typically very quick if I/O is in progress + while (a=`mount | egrep /mnt`) do sleep 1; done + + # first fsck will attempt journal recovery + $fsck -d -y /dev/$md + + # second fsck will do traditional fsck to check for any errors + # from journal recovery + $fsck -d -y /dev/$md + wait +done +mdconfig -d -u ${md#md} +exit 0 From owner-dev-commits-src-main@freebsd.org Sat Jul 24 21:01:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81EED669321; Sat, 24 Jul 2021 21:01: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 4GXJX933MHz3tVc; Sat, 24 Jul 2021 21:01:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50647176E3; Sat, 24 Jul 2021 21:01:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16OL1jxI047382; Sat, 24 Jul 2021 21:01:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OL1jTe047381; Sat, 24 Jul 2021 21:01:45 GMT (envelope-from git) Date: Sat, 24 Jul 2021 21:01:45 GMT Message-Id: <202107242101.16OL1jTe047381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 40cb9b435782 - main - arm64: allwinner: dtbo: Add dtb overlays to disable mmc node MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40cb9b435782de2bc44ff23582d8660072510efc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 21:01:45 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=40cb9b435782de2bc44ff23582d8660072510efc commit 40cb9b435782de2bc44ff23582d8660072510efc Author: Emmanuel Vadot AuthorDate: 2021-07-24 20:05:55 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-24 20:53:33 +0000 arm64: allwinner: dtbo: Add dtb overlays to disable mmc node This is useful for development. Sponsored by: Diablotin Systems --- sys/dts/arm64/overlays/sun50i-a64-mmc0-disable.dtso | 10 ++++++++++ sys/dts/arm64/overlays/sun50i-a64-mmc1-disable.dtso | 10 ++++++++++ sys/dts/arm64/overlays/sun50i-a64-mmc2-disable.dtso | 10 ++++++++++ sys/modules/dtb/allwinner/Makefile | 5 ++++- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/sys/dts/arm64/overlays/sun50i-a64-mmc0-disable.dtso b/sys/dts/arm64/overlays/sun50i-a64-mmc0-disable.dtso new file mode 100644 index 000000000000..1df9a75c7bc2 --- /dev/null +++ b/sys/dts/arm64/overlays/sun50i-a64-mmc0-disable.dtso @@ -0,0 +1,10 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-a64"; +}; + +&mmc0 { + status = "disabled"; +}; diff --git a/sys/dts/arm64/overlays/sun50i-a64-mmc1-disable.dtso b/sys/dts/arm64/overlays/sun50i-a64-mmc1-disable.dtso new file mode 100644 index 000000000000..a0d2f8ef795b --- /dev/null +++ b/sys/dts/arm64/overlays/sun50i-a64-mmc1-disable.dtso @@ -0,0 +1,10 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-a64"; +}; + +&mmc1 { + status = "disabled"; +}; diff --git a/sys/dts/arm64/overlays/sun50i-a64-mmc2-disable.dtso b/sys/dts/arm64/overlays/sun50i-a64-mmc2-disable.dtso new file mode 100644 index 000000000000..a3ac9e0678d4 --- /dev/null +++ b/sys/dts/arm64/overlays/sun50i-a64-mmc2-disable.dtso @@ -0,0 +1,10 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-a64"; +}; + +&mmc2 { + status = "disabled"; +}; diff --git a/sys/modules/dtb/allwinner/Makefile b/sys/modules/dtb/allwinner/Makefile index 5b9d93a7a20e..0b15b883c398 100644 --- a/sys/modules/dtb/allwinner/Makefile +++ b/sys/modules/dtb/allwinner/Makefile @@ -54,7 +54,10 @@ DTS= \ allwinner/sun50i-h6-pine-h64.dts \ allwinner/sun50i-h6-pine-h64-model-b.dts -DTSO= sun50i-a64-pwm.dtso \ +DTSO= sun50i-a64-mmc0-disable.dtso \ + sun50i-a64-mmc1-disable.dtso \ + sun50i-a64-mmc2-disable.dtso \ + sun50i-a64-pwm.dtso \ sun50i-a64-rpwm.dtso \ sun50i-a64-spi0-spigen.dtso \ sun50i-a64-timer.dtso \ From owner-dev-commits-src-main@freebsd.org Sun Jul 25 00:19:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6113566C72C; Sun, 25 Jul 2021 00:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXNvs2DPcz4tHF; Sun, 25 Jul 2021 00:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30BD81A048; Sun, 25 Jul 2021 00:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P0J5r6002736; Sun, 25 Jul 2021 00:19:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P0J5JH002735; Sun, 25 Jul 2021 00:19:05 GMT (envelope-from git) Date: Sun, 25 Jul 2021 00:19:05 GMT Message-Id: <202107250019.16P0J5JH002735@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: 0626b0a89c2d - main - Add myself to the calendar 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: 0626b0a89c2de9c5bfa5b22ed6b021e735a46bbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 00:19:05 -0000 The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=0626b0a89c2de9c5bfa5b22ed6b021e735a46bbe commit 0626b0a89c2de9c5bfa5b22ed6b021e735a46bbe Author: Robert Wing AuthorDate: 2021-07-24 23:57:41 +0000 Commit: Robert Wing CommitDate: 2021-07-25 00:12:17 +0000 Add myself to the calendar --- usr.bin/calendar/calendars/calendar.freebsd | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index fa24de988bd8..88bde011d3c7 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -394,6 +394,7 @@ 10/05 Chris Costello born in Houston, Texas, United States, 1985 10/09 Stefan Walter born in Werne, Nordrhein-Westfalen, Germany, 1978 10/11 Rick Macklem born in Ontario, Canada, 1955 +10/11 Rob Wing born in Fairbanks, Alaska, 1985 10/12 Pawel Jakub Dawidek born in Radzyn Podlaski, Poland, 1980 10/15 Maxim Konovalov born in Khabarovsk, USSR, 1973 10/15 Eugene Grosbein born in Novokuznetsk, Russian Republic, USSR, 1976 From owner-dev-commits-src-main@freebsd.org Sun Jul 25 07:01:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16483653FC3; Sun, 25 Jul 2021 07: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 4GXYrH70L1z3GnD; Sun, 25 Jul 2021 07:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D90391F5A7; Sun, 25 Jul 2021 07: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 16P71ZWg047712; Sun, 25 Jul 2021 07: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 16P71ZjY047711; Sun, 25 Jul 2021 07:01:35 GMT (envelope-from git) Date: Sun, 25 Jul 2021 07:01:35 GMT Message-Id: <202107250701.16P71ZjY047711@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: 0d60235ecd6c - main - stress2: Add another "mdconfig -d -o force" test scenario 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: 0d60235ecd6c711b997345c28e15f0335811e19f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 07:01:36 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=0d60235ecd6c711b997345c28e15f0335811e19f commit 0d60235ecd6c711b997345c28e15f0335811e19f Author: Peter Holm AuthorDate: 2021-07-25 07:00:53 +0000 Commit: Peter Holm CommitDate: 2021-07-25 07:00:53 +0000 stress2: Add another "mdconfig -d -o force" test scenario --- tools/test/stress2/misc/force8.sh | 81 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/tools/test/stress2/misc/force8.sh b/tools/test/stress2/misc/force8.sh new file mode 100755 index 000000000000..77a8e6fd97bf --- /dev/null +++ b/tools/test/stress2/misc/force8.sh @@ -0,0 +1,81 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# "mdconfig -o force" test scenario with nullfs. +# Variation of force4.sh + +# Seen with WiP kernel code: +# panic: refcount 0xfffffe015105bdfc wraparound +# https://people.freebsd.org/~pho/stress/log/log0154.txt + +. ../default.cfg + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 1g -u $mdstart +flags=$newfs_flags +[ `jot -r 1 0 1` -eq 1 ] && flags="-j" +echo "newfs $flags md$mdstart" +newfs $flags md$mdstart > /dev/null 2>&1 +mount /dev/md$mdstart $mntpoint +chmod 777 $mntpoint + +mp2=${mntpoint}2 +mkdir -p $mp2 +mount -t nullfs $mntpoint $mp2 || exit 1 + +export LOAD=80 +export MAXSWAPPCT=80 +export RUNDIR=$mp2/stressX +export runRUNTIME=3m +export TESTPROGS=' +testcases/rename/rename +testcases/swap/swap +testcases/dirnprename/dirnprename +testcases/dirrename/dirrename +' + +su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > /dev/null 2>&1 & + +sleep `jot -r 1 20 60` +while mdconfig -l | grep -q md$mdstart; do + mdconfig -d -u $mdstart -o force || sleep 1 +done +sleep 1 +../tools/killall.sh +wait +umount $mp2 +n=0 +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 + [ $((n += 1)) -gt 300 ] && { echo FAIL; exit 1; } +done +exit 0 From owner-dev-commits-src-main@freebsd.org Sun Jul 25 08:24:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 658DC656354; Sun, 25 Jul 2021 08:24: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 4GXbhT2LNjz3nKd; Sun, 25 Jul 2021 08:24:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38F3520727; Sun, 25 Jul 2021 08:24: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 16P8Ov0l056592; Sun, 25 Jul 2021 08:24:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8OvD9056591; Sun, 25 Jul 2021 08:24:57 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:24:57 GMT Message-Id: <202107250824.16P8OvD9056591@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: 6f1fb6561236 - main - pf: drop redundant 'else' in pf_normalize_* 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: 6f1fb6561236fa933835a9a67bd442053fb509e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:24:57 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6f1fb6561236fa933835a9a67bd442053fb509e9 commit 6f1fb6561236fa933835a9a67bd442053fb509e9 Author: Mateusz Guzik AuthorDate: 2021-07-24 05:17:27 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 08:22:16 +0000 pf: drop redundant 'else' in pf_normalize_* Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_norm.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 561181eb1b56..3df4e06f15b6 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1065,10 +1065,9 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kkif *kif, u_short *reason if (r == NULL || r->action == PF_NOSCRUB) return (PF_PASS); - else { - counter_u64_add(r->packets[dir == PF_OUT], 1); - counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len); - } + + counter_u64_add(r->packets[dir == PF_OUT], 1); + counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len); /* Check for illegal packets */ if (hlen < (int)sizeof(struct ip)) { @@ -1207,10 +1206,9 @@ pf_normalize_ip6(struct mbuf **m0, int dir, struct pfi_kkif *kif, if (r == NULL || r->action == PF_NOSCRUB) return (PF_PASS); - else { - counter_u64_add(r->packets[dir == PF_OUT], 1); - counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len); - } + + counter_u64_add(r->packets[dir == PF_OUT], 1); + counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len); /* Check for illegal packets */ if (sizeof(struct ip6_hdr) + IPV6_MAXPACKET < m->m_pkthdr.len) @@ -1369,10 +1367,9 @@ pf_normalize_tcp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, if (rm == NULL || rm->action == PF_NOSCRUB) return (PF_PASS); - else { - counter_u64_add(r->packets[dir == PF_OUT], 1); - counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len); - } + + counter_u64_add(r->packets[dir == PF_OUT], 1); + counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len); if (rm->rule_flag & PFRULE_REASSEMBLE_TCP) pd->flags |= PFDESC_TCP_NORM; From owner-dev-commits-src-main@freebsd.org Sun Jul 25 08:24:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2E7F655FDB; Sun, 25 Jul 2021 08:24: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 4GXbhV3xrhz3nKj; Sun, 25 Jul 2021 08:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54A7A20905; Sun, 25 Jul 2021 08:24: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 16P8Owhc056616; Sun, 25 Jul 2021 08:24:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8OwaE056615; Sun, 25 Jul 2021 08:24:58 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:24:58 GMT Message-Id: <202107250824.16P8OwaE056615@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: defdcdd5648d - main - pf: add hybrid 32- an 64- bit counters 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: defdcdd5648dc1ea789bc54bb45108fcab546a6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:24:59 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=defdcdd5648dc1ea789bc54bb45108fcab546a6b commit defdcdd5648dc1ea789bc54bb45108fcab546a6b Author: Mateusz Guzik AuthorDate: 2021-07-22 20:47:24 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 08:22:16 +0000 pf: add hybrid 32- an 64- bit counters Numerous counters got migrated from straight uint64_t to the counter(9) API. Unfortunately the implementation comes with a significiant performance hit on some platforms and cannot be easily fixed. Work around the problem by implementing a pf-specific variant. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 218 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf.c | 28 ++++++- 2 files changed, 245 insertions(+), 1 deletion(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 66027debaa6b..62aebfaf8981 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -44,9 +44,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -65,6 +67,222 @@ #ifdef _KERNEL +#if defined(__arm__) +#define PF_WANT_32_TO_64_COUNTER +#endif + +/* + * A hybrid of 32-bit and 64-bit counters which can be used on platforms where + * counter(9) is very expensive. + * + * As 32-bit counters are expected to overflow, a periodic job sums them up to + * a saved 64-bit state. Fetching the value still walks all CPUs to get the most + * current snapshot. + */ +#ifdef PF_WANT_32_TO_64_COUNTER +struct pf_counter_u64_pcpu { + u_int32_t current; + u_int32_t snapshot; +}; + +struct pf_counter_u64 { + struct pf_counter_u64_pcpu *pfcu64_pcpu; + u_int64_t pfcu64_value; + seqc_t pfcu64_seqc; +}; + +static inline int +pf_counter_u64_init(struct pf_counter_u64 *pfcu64, int flags) +{ + + pfcu64->pfcu64_value = 0; + pfcu64->pfcu64_seqc = 0; + pfcu64->pfcu64_pcpu = uma_zalloc_pcpu(pcpu_zone_8, flags | M_ZERO); + if (__predict_false(pfcu64->pfcu64_pcpu == NULL)) + return (ENOMEM); + return (0); +} + +static inline void +pf_counter_u64_deinit(struct pf_counter_u64 *pfcu64) +{ + + uma_zfree_pcpu(pcpu_zone_8, pfcu64->pfcu64_pcpu); +} + +static inline void +pf_counter_u64_critical_enter(void) +{ + + critical_enter(); +} + +static inline void +pf_counter_u64_critical_exit(void) +{ + + critical_exit(); +} + +static inline void +pf_counter_u64_add_protected(struct pf_counter_u64 *pfcu64, uint32_t n) +{ + struct pf_counter_u64_pcpu *pcpu; + u_int32_t val; + + MPASS(curthread->td_critnest > 0); + pcpu = zpcpu_get(pfcu64->pfcu64_pcpu); + val = atomic_load_int(&pcpu->current); + atomic_store_int(&pcpu->current, val + n); +} + +static inline void +pf_counter_u64_add(struct pf_counter_u64 *pfcu64, uint32_t n) +{ + + critical_enter(); + pf_counter_u64_add_protected(pfcu64, n); + critical_exit(); +} + +static inline u_int64_t +pf_counter_u64_periodic(struct pf_counter_u64 *pfcu64) +{ + struct pf_counter_u64_pcpu *pcpu; + u_int64_t sum; + u_int32_t val; + int cpu; + + MPASS(curthread->td_critnest > 0); + seqc_write_begin(&pfcu64->pfcu64_seqc); + sum = pfcu64->pfcu64_value; + CPU_FOREACH(cpu) { + pcpu = zpcpu_get_cpu(pfcu64->pfcu64_pcpu, cpu); + val = atomic_load_int(&pcpu->current); + sum += (uint32_t)(val - pcpu->snapshot); + pcpu->snapshot = val; + } + pfcu64->pfcu64_value = sum; + seqc_write_end(&pfcu64->pfcu64_seqc); + return (sum); +} + +static inline u_int64_t +pf_counter_u64_fetch(struct pf_counter_u64 *pfcu64) +{ + struct pf_counter_u64_pcpu *pcpu; + u_int64_t sum; + seqc_t seqc; + int cpu; + + for (;;) { + seqc = seqc_read(&pfcu64->pfcu64_seqc); + sum = 0; + CPU_FOREACH(cpu) { + pcpu = zpcpu_get_cpu(pfcu64->pfcu64_pcpu, cpu); + sum += (uint32_t)(atomic_load_int(&pcpu->current) -pcpu->snapshot); + } + sum += pfcu64->pfcu64_value; + if (seqc_consistent(&pfcu64->pfcu64_seqc, seqc)) + break; + } + return (sum); +} + +static inline void +pf_counter_u64_zero_protected(struct pf_counter_u64 *pfcu64) +{ + struct pf_counter_u64_pcpu *pcpu; + int cpu; + + MPASS(curthread->td_critnest > 0); + seqc_write_begin(&pfcu64->pfcu64_seqc); + CPU_FOREACH(cpu) { + pcpu = zpcpu_get_cpu(pfcu64->pfcu64_pcpu, cpu); + pcpu->snapshot = atomic_load_int(&pcpu->current); + } + pfcu64->pfcu64_value = 0; + seqc_write_end(&pfcu64->pfcu64_seqc); +} + +static inline void +pf_counter_u64_zero(struct pf_counter_u64 *pfcu64) +{ + + critical_enter(); + pf_counter_u64_zero_protected(pfcu64); + critical_exit(); +} +#else +struct pf_counter_u64 { + counter_u64_t counter; +}; + +static inline int +pf_counter_u64_init(struct pf_counter_u64 *pfcu64, int flags) +{ + + pfcu64->counter = counter_u64_alloc(flags); + if (__predict_false(pfcu64->counter == NULL)) + return (ENOMEM); + return (0); +} + +static inline void +pf_counter_u64_deinit(struct pf_counter_u64 *pfcu64) +{ + + counter_u64_free(pfcu64->counter); +} + +static inline void +pf_counter_u64_critical_enter(void) +{ + +} + +static inline void +pf_counter_u64_critical_exit(void) +{ + +} + +static inline void +pf_counter_u64_add_protected(struct pf_counter_u64 *pfcu64, uint32_t n) +{ + + counter_u64_add(pfcu64->counter, n); +} + +static inline void +pf_counter_u64_add(struct pf_counter_u64 *pfcu64, uint32_t n) +{ + + pf_counter_u64_add_protected(pfcu64, n); +} + +static inline u_int64_t +pf_counter_u64_fetch(struct pf_counter_u64 *pfcu64) +{ + + return (counter_u64_fetch(pfcu64->counter)); +} + +static inline void +pf_counter_u64_zero_protected(struct pf_counter_u64 *pfcu64) +{ + + counter_u64_zero(pfcu64->counter); +} + +static inline void +pf_counter_u64_zero(struct pf_counter_u64 *pfcu64) +{ + + pf_counter_u64_zero_protected(pfcu64); +} +#endif + SYSCTL_DECL(_net_pf); MALLOC_DECLARE(M_PFHASH); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 4729e7a5c19f..7cef71c78140 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -154,6 +154,11 @@ VNET_DECLARE(int, pf_vnet_active); VNET_DEFINE_STATIC(uint32_t, pf_purge_idx); #define V_pf_purge_idx VNET(pf_purge_idx) +#ifdef PF_WANT_32_TO_64_COUNTER +VNET_DEFINE_STATIC(uint32_t, pf_counter_periodic_iter); +#define V_pf_counter_periodic_iter VNET(pf_counter_periodic_iter) +#endif + /* * Queue for pf_intr() sends. */ @@ -1509,6 +1514,25 @@ pf_intr(void *v) CURVNET_RESTORE(); } +#define pf_purge_thread_period (hz / 10) + +#ifdef PF_WANT_32_TO_64_COUNTER +static void +pf_counter_u64_periodic_main(void) +{ + PF_RULES_RLOCK_TRACKER; + + V_pf_counter_periodic_iter++; + + PF_RULES_RLOCK(); + pf_counter_u64_critical_enter(); + pf_counter_u64_critical_exit(); + PF_RULES_RUNLOCK(); +} +#else +#define pf_counter_u64_periodic_main() do { } while (0) +#endif + void pf_purge_thread(void *unused __unused) { @@ -1516,7 +1540,7 @@ pf_purge_thread(void *unused __unused) sx_xlock(&pf_end_lock); while (pf_end_threads == 0) { - sx_sleep(pf_purge_thread, &pf_end_lock, 0, "pftm", hz / 10); + sx_sleep(pf_purge_thread, &pf_end_lock, 0, "pftm", pf_purge_thread_period); VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { @@ -1528,6 +1552,8 @@ pf_purge_thread(void *unused __unused) continue; } + pf_counter_u64_periodic_main(); + /* * Process 1/interval fraction of the state * table every run. From owner-dev-commits-src-main@freebsd.org Sun Jul 25 08:24:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D075265635A; Sun, 25 Jul 2021 08:24: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 4GXbhW4hQHz3nJY; Sun, 25 Jul 2021 08:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 822D62057C; Sun, 25 Jul 2021 08:24: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 16P8OxmJ056646; Sun, 25 Jul 2021 08:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8OxtQ056645; Sun, 25 Jul 2021 08:24:59 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:24:59 GMT Message-Id: <202107250824.16P8OxtQ056645@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: fc4c42ce0b5c - main - pf: switch pf_status.fcounters to pf_counter_u64 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: fc4c42ce0b5ce87901b327e25f55b4e3ab4c6cf5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:25:00 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=fc4c42ce0b5ce87901b327e25f55b4e3ab4c6cf5 commit fc4c42ce0b5ce87901b327e25f55b4e3ab4c6cf5 Author: Mateusz Guzik AuthorDate: 2021-07-24 05:33:52 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 08:22:16 +0000 pf: switch pf_status.fcounters to pf_counter_u64 Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/pf.c | 26 +++++++++++++++++++++----- sys/netpfil/pf/pf_ioctl.c | 8 ++++---- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 62aebfaf8981..8683e4fece58 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1371,7 +1371,7 @@ enum pf_syncookies_mode { struct pf_kstatus { counter_u64_t counters[PFRES_MAX]; /* reason for passing/dropping */ counter_u64_t lcounters[LCNT_MAX]; /* limit counters */ - counter_u64_t fcounters[FCNT_MAX]; /* state operation counters */ + struct pf_counter_u64 fcounters[FCNT_MAX]; /* state operation counters */ counter_u64_t scounters[SCNT_MAX]; /* src_node operation counters */ uint32_t states; uint32_t src_nodes; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 7cef71c78140..e2e4f5895cfa 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1311,7 +1311,7 @@ pf_state_insert(struct pfi_kkif *kif, struct pfi_kkif *orig_kif, /* One for keys, one for ID hash. */ refcount_init(&s->refs, 2); - counter_u64_add(V_pf_status.fcounters[FCNT_STATE_INSERT], 1); + pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_INSERT], 1); if (V_pfsync_insert_state_ptr != NULL) V_pfsync_insert_state_ptr(s); @@ -1328,7 +1328,7 @@ pf_find_state_byid(uint64_t id, uint32_t creatorid) struct pf_idhash *ih; struct pf_kstate *s; - counter_u64_add(V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); + pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); ih = &V_pf_idhash[(be64toh(id) % (pf_hashmask + 1))]; @@ -1355,7 +1355,7 @@ pf_find_state(struct pfi_kkif *kif, struct pf_state_key_cmp *key, u_int dir) struct pf_kstate *s; int idx; - counter_u64_add(V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); + pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); kh = &V_pf_keyhash[pf_hashkey((struct pf_state_key *)key)]; @@ -1399,7 +1399,7 @@ pf_find_state_all(struct pf_state_key_cmp *key, u_int dir, int *more) struct pf_kstate *s, *ret = NULL; int idx, inout = 0; - counter_u64_add(V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); + pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); kh = &V_pf_keyhash[pf_hashkey((struct pf_state_key *)key)]; @@ -1517,6 +1517,21 @@ pf_intr(void *v) #define pf_purge_thread_period (hz / 10) #ifdef PF_WANT_32_TO_64_COUNTER +static void +pf_status_counter_u64_periodic(void) +{ + + PF_RULES_RASSERT(); + + if ((V_pf_counter_periodic_iter % (pf_purge_thread_period * 10 * 60)) != 0) { + return; + } + + for (int i = 0; i < FCNT_MAX; i++) { + pf_counter_u64_periodic(&V_pf_status.fcounters[i]); + } +} + static void pf_counter_u64_periodic_main(void) { @@ -1526,6 +1541,7 @@ pf_counter_u64_periodic_main(void) PF_RULES_RLOCK(); pf_counter_u64_critical_enter(); + pf_status_counter_u64_periodic(); pf_counter_u64_critical_exit(); PF_RULES_RUNLOCK(); } @@ -1781,7 +1797,7 @@ pf_free_state(struct pf_kstate *cur) pf_normalize_tcp_cleanup(cur); uma_zfree(V_pf_state_z, cur); - counter_u64_add(V_pf_status.fcounters[FCNT_STATE_REMOVALS], 1); + pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_REMOVALS], 1); } /* diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 432585610aa1..560dd4f666c0 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -354,7 +354,7 @@ pfattach_vnet(void) for (int i = 0; i < LCNT_MAX; i++) V_pf_status.lcounters[i] = counter_u64_alloc(M_WAITOK); for (int i = 0; i < FCNT_MAX; i++) - V_pf_status.fcounters[i] = counter_u64_alloc(M_WAITOK); + pf_counter_u64_init(&V_pf_status.fcounters[i], M_WAITOK); for (int i = 0; i < SCNT_MAX; i++) V_pf_status.scounters[i] = counter_u64_alloc(M_WAITOK); @@ -2986,7 +2986,7 @@ DIOCGETSTATESV2_full: counter_u64_fetch(V_pf_status.lcounters[i]); for (int i = 0; i < FCNT_MAX; i++) s->fcounters[i] = - counter_u64_fetch(V_pf_status.fcounters[i]); + pf_counter_u64_fetch(&V_pf_status.fcounters[i]); for (int i = 0; i < SCNT_MAX; i++) s->scounters[i] = counter_u64_fetch(V_pf_status.scounters[i]); @@ -3018,7 +3018,7 @@ DIOCGETSTATESV2_full: for (int i = 0; i < PFRES_MAX; i++) counter_u64_zero(V_pf_status.counters[i]); for (int i = 0; i < FCNT_MAX; i++) - counter_u64_zero(V_pf_status.fcounters[i]); + pf_counter_u64_zero(&V_pf_status.fcounters[i]); for (int i = 0; i < SCNT_MAX; i++) counter_u64_zero(V_pf_status.scounters[i]); for (int i = 0; i < LCNT_MAX; i++) @@ -5615,7 +5615,7 @@ pf_unload_vnet(void) for (int i = 0; i < LCNT_MAX; i++) counter_u64_free(V_pf_status.lcounters[i]); for (int i = 0; i < FCNT_MAX; i++) - counter_u64_free(V_pf_status.fcounters[i]); + pf_counter_u64_deinit(&V_pf_status.fcounters[i]); for (int i = 0; i < SCNT_MAX; i++) counter_u64_free(V_pf_status.scounters[i]); } From owner-dev-commits-src-main@freebsd.org Sun Jul 25 08:25:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E373655FE5; Sun, 25 Jul 2021 08:25: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 4GXbhX5lj3z3nNl; Sun, 25 Jul 2021 08:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC81A20358; Sun, 25 Jul 2021 08:25: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 16P8P0dn056677; Sun, 25 Jul 2021 08:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8P0gG056676; Sun, 25 Jul 2021 08:25:00 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:25:00 GMT Message-Id: <202107250825.16P8P0gG056676@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: d40d4b3ed788 - main - pf: switch kif counters to pf_counter_u64 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: d40d4b3ed788b05697541b9ae94b1960ff2cf6f6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:25:01 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=d40d4b3ed788b05697541b9ae94b1960ff2cf6f6 commit d40d4b3ed788b05697541b9ae94b1960ff2cf6f6 Author: Mateusz Guzik AuthorDate: 2021-07-23 10:29:46 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 08:22:17 +0000 pf: switch kif counters to pf_counter_u64 Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 17 +++++++++++-- sys/netpfil/pf/pf.c | 51 +++++++++++++++++++++++++++++++++++--- sys/netpfil/pf/pf_if.c | 62 +++++++++++++++++++++++++++++++++++------------ sys/netpfil/pf/pf_ioctl.c | 17 +++++++++++++ 4 files changed, 126 insertions(+), 21 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 8683e4fece58..7895ea84cf46 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1258,14 +1258,17 @@ struct pfi_kkif { } _pfik_glue; #define pfik_tree _pfik_glue._pfik_tree #define pfik_list _pfik_glue._pfik_list - counter_u64_t pfik_packets[2][2][2]; - counter_u64_t pfik_bytes[2][2][2]; + struct pf_counter_u64 pfik_packets[2][2][2]; + struct pf_counter_u64 pfik_bytes[2][2][2]; u_int32_t pfik_tzero; u_int pfik_flags; struct ifnet *pfik_ifp; struct ifg_group *pfik_group; u_int pfik_rulerefs; TAILQ_HEAD(, pfi_dynaddr) pfik_dynaddrs; +#ifdef PF_WANT_32_TO_64_COUNTER + LIST_ENTRY(pfi_kkif) pfik_allkiflist; +#endif }; #endif @@ -1851,6 +1854,16 @@ VNET_DECLARE(struct pf_altqqueue *, pf_altq_ifs_inactive); VNET_DECLARE(struct pf_krulequeue, pf_unlinked_rules); #define V_pf_unlinked_rules VNET(pf_unlinked_rules) +#ifdef PF_WANT_32_TO_64_COUNTER +LIST_HEAD(allkiflist_head, pfi_kkif); +VNET_DECLARE(struct allkiflist_head, pf_allkiflist); +#define V_pf_allkiflist VNET(pf_allkiflist) +VNET_DECLARE(size_t, pf_allkifcount); +#define V_pf_allkifcount VNET(pf_allkifcount) +VNET_DECLARE(struct pfi_kkif *, pf_kifmarker); +#define V_pf_kifmarker VNET(pf_kifmarker) +#endif + void pf_initialize(void); void pf_mtag_initialize(void); void pf_mtag_cleanup(void); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e2e4f5895cfa..c41566f808b6 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1532,6 +1532,48 @@ pf_status_counter_u64_periodic(void) } } +static void +pf_kif_counter_u64_periodic(void) +{ + struct pfi_kkif *kif; + size_t r, run; + + PF_RULES_RASSERT(); + + if (__predict_false(V_pf_allkifcount == 0)) { + return; + } + + if ((V_pf_counter_periodic_iter % (pf_purge_thread_period * 10 * 300)) != 0) { + return; + } + + run = V_pf_allkifcount / 10; + if (run < 5) + run = 5; + + for (r = 0; r < run; r++) { + kif = LIST_NEXT(V_pf_kifmarker, pfik_allkiflist); + if (kif == NULL) { + LIST_REMOVE(V_pf_kifmarker, pfik_allkiflist); + LIST_INSERT_HEAD(&V_pf_allkiflist, V_pf_kifmarker, pfik_allkiflist); + break; + } + + LIST_REMOVE(V_pf_kifmarker, pfik_allkiflist); + LIST_INSERT_AFTER(kif, V_pf_kifmarker, pfik_allkiflist); + + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 2; j++) { + for (int k = 0; k < 2; k++) { + pf_counter_u64_periodic(&kif->pfik_packets[i][j][k]); + pf_counter_u64_periodic(&kif->pfik_bytes[i][j][k]); + } + } + } + } +} + static void pf_counter_u64_periodic_main(void) { @@ -1542,6 +1584,7 @@ pf_counter_u64_periodic_main(void) PF_RULES_RLOCK(); pf_counter_u64_critical_enter(); pf_status_counter_u64_periodic(); + pf_kif_counter_u64_periodic(); pf_counter_u64_critical_exit(); PF_RULES_RUNLOCK(); } @@ -6402,9 +6445,9 @@ done: (s == NULL)); } - counter_u64_add(kif->pfik_bytes[0][dir == PF_OUT][action != PF_PASS], + pf_counter_u64_add(&kif->pfik_bytes[0][dir == PF_OUT][action != PF_PASS], pd.tot_len); - counter_u64_add(kif->pfik_packets[0][dir == PF_OUT][action != PF_PASS], + pf_counter_u64_add(&kif->pfik_packets[0][dir == PF_OUT][action != PF_PASS], 1); if (action == PF_PASS || r->action == PF_DROP) { @@ -6807,9 +6850,9 @@ done: &pd, (s == NULL)); } - counter_u64_add(kif->pfik_bytes[1][dir == PF_OUT][action != PF_PASS], + pf_counter_u64_add(&kif->pfik_bytes[1][dir == PF_OUT][action != PF_PASS], pd.tot_len); - counter_u64_add(kif->pfik_packets[1][dir == PF_OUT][action != PF_PASS], + pf_counter_u64_add(&kif->pfik_packets[1][dir == PF_OUT][action != PF_PASS], 1); if (action == PF_PASS || r->action == PF_DROP) { diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c index 3c9b53daa28c..dcbbce08ed6c 100644 --- a/sys/netpfil/pf/pf_if.c +++ b/sys/netpfil/pf/pf_if.c @@ -69,6 +69,12 @@ VNET_DEFINE_STATIC(int, pfi_buffer_max); #define V_pfi_buffer_cnt VNET(pfi_buffer_cnt) #define V_pfi_buffer_max VNET(pfi_buffer_max) +#ifdef PF_WANT_32_TO_64_COUNTER +VNET_DEFINE(struct allkiflist_head, pf_allkiflist); +VNET_DEFINE(size_t, pf_allkifcount); +VNET_DEFINE(struct pfi_kkif *, pf_kifmarker); +#endif + eventhandler_tag pfi_attach_cookie; eventhandler_tag pfi_detach_cookie; eventhandler_tag pfi_attach_group_cookie; @@ -222,6 +228,9 @@ struct pfi_kkif* pf_kkif_create(int flags) { struct pfi_kkif *kif; +#ifdef PF_WANT_32_TO_64_COUNTER + bool wowned; +#endif kif = malloc(sizeof(*kif), PFI_MTYPE, flags | M_ZERO); if (! kif) @@ -230,13 +239,12 @@ pf_kkif_create(int flags) for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { - kif->pfik_packets[i][j][k] = - counter_u64_alloc(flags); - kif->pfik_bytes[i][j][k] = - counter_u64_alloc(flags); + if (pf_counter_u64_init(&kif->pfik_packets[i][j][k], flags) != 0) { + pf_kkif_free(kif); + return (NULL); + } - if (! kif->pfik_packets[i][j][k] || - ! kif->pfik_bytes[i][j][k]) { + if (pf_counter_u64_init(&kif->pfik_bytes[i][j][k], flags) != 0) { pf_kkif_free(kif); return (NULL); } @@ -244,20 +252,44 @@ pf_kkif_create(int flags) } } +#ifdef PF_WANT_32_TO_64_COUNTER + wowned = PF_RULES_WOWNED(); + if (!wowned) + PF_RULES_WLOCK(); + LIST_INSERT_HEAD(&V_pf_allkiflist, kif, pfik_allkiflist); + V_pf_allkifcount++; + if (!wowned) + PF_RULES_WUNLOCK(); +#endif + return (kif); } void pf_kkif_free(struct pfi_kkif *kif) { +#ifdef PF_WANT_32_TO_64_COUNTER + bool wowned; +#endif + if (! kif) return; +#ifdef PF_WANT_32_TO_64_COUNTER + wowned = PF_RULES_WOWNED(); + if (!wowned) + PF_RULES_WLOCK(); + LIST_REMOVE(kif, pfik_allkiflist); + V_pf_allkifcount--; + if (!wowned) + PF_RULES_WUNLOCK(); +#endif + for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { - counter_u64_free(kif->pfik_packets[i][j][k]); - counter_u64_free(kif->pfik_bytes[i][j][k]); + pf_counter_u64_deinit(&kif->pfik_packets[i][j][k]); + pf_counter_u64_deinit(&kif->pfik_bytes[i][j][k]); } } } @@ -272,8 +304,8 @@ pf_kkif_zero(struct pfi_kkif *kif) for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { - counter_u64_zero(kif->pfik_packets[i][j][k]); - counter_u64_zero(kif->pfik_bytes[i][j][k]); + pf_counter_u64_zero(&kif->pfik_packets[i][j][k]); + pf_counter_u64_zero(&kif->pfik_bytes[i][j][k]); } } } @@ -805,15 +837,15 @@ pfi_update_status(const char *name, struct pf_status *pfs) for (j = 0; j < 2; j++) for (k = 0; k < 2; k++) { pfs->pcounters[i][j][k] += - counter_u64_fetch(p->pfik_packets[i][j][k]); + pf_counter_u64_fetch(&p->pfik_packets[i][j][k]); pfs->bcounters[i][j] += - counter_u64_fetch(p->pfik_bytes[i][j][k]); + pf_counter_u64_fetch(&p->pfik_bytes[i][j][k]); } } } static void -pf_kkif_to_kif(const struct pfi_kkif *kkif, struct pfi_kif *kif) +pf_kkif_to_kif(struct pfi_kkif *kkif, struct pfi_kif *kif) { bzero(kif, sizeof(*kif)); @@ -822,9 +854,9 @@ pf_kkif_to_kif(const struct pfi_kkif *kkif, struct pfi_kif *kif) for (int j = 0; j < 2; j++) { for (int k = 0; k < 2; k++) { kif->pfik_packets[i][j][k] = - counter_u64_fetch(kkif->pfik_packets[i][j][k]); + pf_counter_u64_fetch(&kkif->pfik_packets[i][j][k]); kif->pfik_bytes[i][j][k] = - counter_u64_fetch(kkif->pfik_bytes[i][j][k]); + pf_counter_u64_fetch(&kkif->pfik_bytes[i][j][k]); } } } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 560dd4f666c0..f9df5d691cc9 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -319,6 +319,13 @@ pfattach_vnet(void) V_pf_default_rule.states_tot = counter_u64_alloc(M_WAITOK); V_pf_default_rule.src_nodes = counter_u64_alloc(M_WAITOK); +#ifdef PF_WANT_32_TO_64_COUNTER + V_pf_kifmarker = malloc(sizeof(*V_pf_kifmarker), PFI_MTYPE, M_WAITOK | M_ZERO); + PF_RULES_WLOCK(); + LIST_INSERT_HEAD(&V_pf_allkiflist, V_pf_kifmarker, pfik_allkiflist); + PF_RULES_WUNLOCK(); +#endif + /* initialize default timeouts */ my_timeout[PFTM_TCP_FIRST_PACKET] = PFTM_TCP_FIRST_PACKET_VAL; my_timeout[PFTM_TCP_OPENING] = PFTM_TCP_OPENING_VAL; @@ -5600,6 +5607,16 @@ pf_unload_vnet(void) #endif uma_zdestroy(V_pf_tag_z); +#ifdef PF_WANT_32_TO_64_COUNTER + PF_RULES_WLOCK(); + LIST_REMOVE(V_pf_kifmarker, pfik_allkiflist); + PF_RULES_WUNLOCK(); + free(V_pf_kifmarker, PFI_MTYPE); + + MPASS(LIST_EMPTY(&V_pf_allkiflist)); + MPASS(V_pf_allkifcount == 0); +#endif + /* Free counters last as we updated them during shutdown. */ counter_u64_free(V_pf_default_rule.evaluations); for (int i = 0; i < 2; i++) { From owner-dev-commits-src-main@freebsd.org Sun Jul 25 08:25:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9835065614C; Sun, 25 Jul 2021 08:25: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 4GXbhY6vdhz3n9f; Sun, 25 Jul 2021 08:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C53CD20906; Sun, 25 Jul 2021 08:25: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 16P8P1Os056701; Sun, 25 Jul 2021 08:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8P1le056700; Sun, 25 Jul 2021 08:25:01 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:25:01 GMT Message-Id: <202107250825.16P8P1le056700@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: 02cf67ccf653 - main - pf: switch rule counters to pf_counter_u64 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: 02cf67ccf6538b14677672640e405f7f94044dc3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:25:02 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=02cf67ccf6538b14677672640e405f7f94044dc3 commit 02cf67ccf6538b14677672640e405f7f94044dc3 Author: Mateusz Guzik AuthorDate: 2021-07-22 14:45:14 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 08:22:17 +0000 pf: switch rule counters to pf_counter_u64 Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 19 ++++++- sys/netpfil/pf/pf.c | 80 +++++++++++++++++++++------ sys/netpfil/pf/pf_ioctl.c | 137 +++++++++++++++++++++++++++++++--------------- sys/netpfil/pf/pf_lb.c | 2 +- sys/netpfil/pf/pf_norm.c | 18 +++--- sys/netpfil/pf/pf_nv.c | 8 +-- sys/netpfil/pf/pf_nv.h | 2 +- 7 files changed, 185 insertions(+), 81 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 7895ea84cf46..e13b3b61c1a3 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -586,9 +586,9 @@ struct pf_krule { TAILQ_ENTRY(pf_krule) entries; struct pf_kpool rpool; - counter_u64_t evaluations; - counter_u64_t packets[2]; - counter_u64_t bytes[2]; + struct pf_counter_u64 evaluations; + struct pf_counter_u64 packets[2]; + struct pf_counter_u64 bytes[2]; struct pfi_kkif *kif; struct pf_kanchor *anchor; @@ -662,6 +662,11 @@ struct pf_krule { struct pf_addr addr; u_int16_t port; } divert; + +#ifdef PF_WANT_32_TO_64_COUNTER + LIST_ENTRY(pf_krule) allrulelist; + bool allrulelinked; +#endif }; struct pf_ksrc_node { @@ -1862,6 +1867,14 @@ VNET_DECLARE(size_t, pf_allkifcount); #define V_pf_allkifcount VNET(pf_allkifcount) VNET_DECLARE(struct pfi_kkif *, pf_kifmarker); #define V_pf_kifmarker VNET(pf_kifmarker) + +LIST_HEAD(allrulelist_head, pf_krule); +VNET_DECLARE(struct allrulelist_head, pf_allrulelist); +#define V_pf_allrulelist VNET(pf_allrulelist) +VNET_DECLARE(size_t, pf_allrulecount); +#define V_pf_allrulecount VNET(pf_allrulecount) +VNET_DECLARE(struct pf_krule *, pf_rulemarker); +#define V_pf_rulemarker VNET(pf_rulemarker) #endif void pf_initialize(void); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index c41566f808b6..7eb2b5e669ca 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -157,6 +157,10 @@ VNET_DEFINE_STATIC(uint32_t, pf_purge_idx); #ifdef PF_WANT_32_TO_64_COUNTER VNET_DEFINE_STATIC(uint32_t, pf_counter_periodic_iter); #define V_pf_counter_periodic_iter VNET(pf_counter_periodic_iter) + +VNET_DEFINE(struct allrulelist_head, pf_allrulelist); +VNET_DEFINE(size_t, pf_allrulecount); +VNET_DEFINE(struct pf_krule *, pf_rulemarker); #endif /* @@ -1574,6 +1578,45 @@ pf_kif_counter_u64_periodic(void) } } +static void +pf_rule_counter_u64_periodic(void) +{ + struct pf_krule *rule; + size_t r, run; + + PF_RULES_RASSERT(); + + if (__predict_false(V_pf_allrulecount == 0)) { + return; + } + + if ((V_pf_counter_periodic_iter % (pf_purge_thread_period * 10 * 300)) != 0) { + return; + } + + run = V_pf_allrulecount / 10; + if (run < 5) + run = 5; + + for (r = 0; r < run; r++) { + rule = LIST_NEXT(V_pf_rulemarker, allrulelist); + if (rule == NULL) { + LIST_REMOVE(V_pf_rulemarker, allrulelist); + LIST_INSERT_HEAD(&V_pf_allrulelist, V_pf_rulemarker, allrulelist); + break; + } + + LIST_REMOVE(V_pf_rulemarker, allrulelist); + LIST_INSERT_AFTER(rule, V_pf_rulemarker, allrulelist); + + pf_counter_u64_periodic(&rule->evaluations); + for (int i = 0; i < 2; i++) { + pf_counter_u64_periodic(&rule->packets[i]); + pf_counter_u64_periodic(&rule->bytes[i]); + } + } +} + static void pf_counter_u64_periodic_main(void) { @@ -1585,6 +1628,7 @@ pf_counter_u64_periodic_main(void) pf_counter_u64_critical_enter(); pf_status_counter_u64_periodic(); pf_kif_counter_u64_periodic(); + pf_rule_counter_u64_periodic(); pf_counter_u64_critical_exit(); PF_RULES_RUNLOCK(); } @@ -3663,7 +3707,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, } while (r != NULL) { - counter_u64_add(r->evaluations, 1); + pf_counter_u64_add(&r->evaluations, 1); if (pfi_kkif_match(r->kif, kif) == r->ifnot) r = r->skip[PF_SKIP_IFP].ptr; else if (r->direction && r->direction != direction) @@ -3732,8 +3776,8 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, rtableid = r->rtableid; if (r->anchor == NULL) { if (r->action == PF_MATCH) { - counter_u64_add(r->packets[direction == PF_OUT], 1); - counter_u64_add(r->bytes[direction == PF_OUT], pd->tot_len); + pf_counter_u64_add(&r->packets[direction == PF_OUT], 1); + pf_counter_u64_add(&r->bytes[direction == PF_OUT], pd->tot_len); pf_rule_to_actions(r, &pd->act); if (r->log) PFLOG_PACKET(kif, m, af, @@ -4105,7 +4149,7 @@ pf_test_fragment(struct pf_krule **rm, int direction, struct pfi_kkif *kif, r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_FILTER].active.ptr); while (r != NULL) { - counter_u64_add(r->evaluations, 1); + pf_counter_u64_add(&r->evaluations, 1); if (pfi_kkif_match(r->kif, kif) == r->ifnot) r = r->skip[PF_SKIP_IFP].ptr; else if (r->direction && r->direction != direction) @@ -4146,8 +4190,8 @@ pf_test_fragment(struct pf_krule **rm, int direction, struct pfi_kkif *kif, else { if (r->anchor == NULL) { if (r->action == PF_MATCH) { - counter_u64_add(r->packets[direction == PF_OUT], 1); - counter_u64_add(r->bytes[direction == PF_OUT], pd->tot_len); + pf_counter_u64_add(&r->packets[direction == PF_OUT], 1); + pf_counter_u64_add(&r->bytes[direction == PF_OUT], pd->tot_len); pf_rule_to_actions(r, &pd->act); if (r->log) PFLOG_PACKET(kif, m, af, @@ -6452,17 +6496,17 @@ done: if (action == PF_PASS || r->action == PF_DROP) { dirndx = (dir == PF_OUT); - counter_u64_add(r->packets[dirndx], 1); - counter_u64_add(r->bytes[dirndx], pd.tot_len); + pf_counter_u64_add(&r->packets[dirndx], 1); + pf_counter_u64_add(&r->bytes[dirndx], pd.tot_len); if (a != NULL) { - counter_u64_add(a->packets[dirndx], 1); - counter_u64_add(a->bytes[dirndx], pd.tot_len); + pf_counter_u64_add(&a->packets[dirndx], 1); + pf_counter_u64_add(&a->bytes[dirndx], pd.tot_len); } if (s != NULL) { if (s->nat_rule.ptr != NULL) { - counter_u64_add(s->nat_rule.ptr->packets[dirndx], + pf_counter_u64_add(&s->nat_rule.ptr->packets[dirndx], 1); - counter_u64_add(s->nat_rule.ptr->bytes[dirndx], + pf_counter_u64_add(&s->nat_rule.ptr->bytes[dirndx], pd.tot_len); } if (s->src_node != NULL) { @@ -6857,17 +6901,17 @@ done: if (action == PF_PASS || r->action == PF_DROP) { dirndx = (dir == PF_OUT); - counter_u64_add(r->packets[dirndx], 1); - counter_u64_add(r->bytes[dirndx], pd.tot_len); + pf_counter_u64_add(&r->packets[dirndx], 1); + pf_counter_u64_add(&r->bytes[dirndx], pd.tot_len); if (a != NULL) { - counter_u64_add(a->packets[dirndx], 1); - counter_u64_add(a->bytes[dirndx], pd.tot_len); + pf_counter_u64_add(&a->packets[dirndx], 1); + pf_counter_u64_add(&a->bytes[dirndx], pd.tot_len); } if (s != NULL) { if (s->nat_rule.ptr != NULL) { - counter_u64_add(s->nat_rule.ptr->packets[dirndx], + pf_counter_u64_add(&s->nat_rule.ptr->packets[dirndx], 1); - counter_u64_add(s->nat_rule.ptr->bytes[dirndx], + pf_counter_u64_add(&s->nat_rule.ptr->bytes[dirndx], pd.tot_len); } if (s->src_node != NULL) { diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index f9df5d691cc9..8fe1798ff7c3 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -310,10 +310,10 @@ pfattach_vnet(void) V_pf_default_rule.nr = -1; V_pf_default_rule.rtableid = -1; - V_pf_default_rule.evaluations = counter_u64_alloc(M_WAITOK); + pf_counter_u64_init(&V_pf_default_rule.evaluations, M_WAITOK); for (int i = 0; i < 2; i++) { - V_pf_default_rule.packets[i] = counter_u64_alloc(M_WAITOK); - V_pf_default_rule.bytes[i] = counter_u64_alloc(M_WAITOK); + pf_counter_u64_init(&V_pf_default_rule.packets[i], M_WAITOK); + pf_counter_u64_init(&V_pf_default_rule.bytes[i], M_WAITOK); } V_pf_default_rule.states_cur = counter_u64_alloc(M_WAITOK); V_pf_default_rule.states_tot = counter_u64_alloc(M_WAITOK); @@ -321,8 +321,12 @@ pfattach_vnet(void) #ifdef PF_WANT_32_TO_64_COUNTER V_pf_kifmarker = malloc(sizeof(*V_pf_kifmarker), PFI_MTYPE, M_WAITOK | M_ZERO); + V_pf_rulemarker = malloc(sizeof(*V_pf_rulemarker), M_PFRULE, M_WAITOK | M_ZERO); PF_RULES_WLOCK(); LIST_INSERT_HEAD(&V_pf_allkiflist, V_pf_kifmarker, pfik_allkiflist); + LIST_INSERT_HEAD(&V_pf_allrulelist, &V_pf_default_rule, allrulelist); + V_pf_allrulecount++; + LIST_INSERT_HEAD(&V_pf_allrulelist, V_pf_rulemarker, allrulelist); PF_RULES_WUNLOCK(); #endif @@ -1116,16 +1120,16 @@ pf_commit_rules(u_int32_t ticket, int rs_num, char *anchor) while ((tail != NULL) && ! pf_krule_compare(tail, rule)) tail = TAILQ_NEXT(tail, entries); if (tail != NULL) { - counter_u64_add(rule->evaluations, - counter_u64_fetch(tail->evaluations)); - counter_u64_add(rule->packets[0], - counter_u64_fetch(tail->packets[0])); - counter_u64_add(rule->packets[1], - counter_u64_fetch(tail->packets[1])); - counter_u64_add(rule->bytes[0], - counter_u64_fetch(tail->bytes[0])); - counter_u64_add(rule->bytes[1], - counter_u64_fetch(tail->bytes[1])); + pf_counter_u64_add(&rule->evaluations, + pf_counter_u64_fetch(&tail->evaluations)); + pf_counter_u64_add(&rule->packets[0], + pf_counter_u64_fetch(&tail->packets[0])); + pf_counter_u64_add(&rule->packets[1], + pf_counter_u64_fetch(&tail->packets[1])); + pf_counter_u64_add(&rule->bytes[0], + pf_counter_u64_fetch(&tail->bytes[0])); + pf_counter_u64_add(&rule->bytes[1], + pf_counter_u64_fetch(&tail->bytes[1])); } } } @@ -1505,13 +1509,29 @@ pf_altq_get_nth_active(u_int32_t n) void pf_krule_free(struct pf_krule *rule) { +#ifdef PF_WANT_32_TO_64_COUNTER + bool wowned; +#endif + if (rule == NULL) return; - counter_u64_free(rule->evaluations); +#ifdef PF_WANT_32_TO_64_COUNTER + if (rule->allrulelinked) { + wowned = PF_RULES_WOWNED(); + if (!wowned) + PF_RULES_WLOCK(); + LIST_REMOVE(rule, allrulelist); + V_pf_allrulecount--; + if (!wowned) + PF_RULES_WUNLOCK(); + } +#endif + + pf_counter_u64_deinit(&rule->evaluations); for (int i = 0; i < 2; i++) { - counter_u64_free(rule->packets[i]); - counter_u64_free(rule->bytes[i]); + pf_counter_u64_deinit(&rule->packets[i]); + pf_counter_u64_deinit(&rule->bytes[i]); } counter_u64_free(rule->states_cur); counter_u64_free(rule->states_tot); @@ -1573,7 +1593,7 @@ pf_pool_to_kpool(const struct pf_pool *pool, struct pf_kpool *kpool) } static void -pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) +pf_krule_to_rule(struct pf_krule *krule, struct pf_rule *rule) { bzero(rule, sizeof(*rule)); @@ -1600,10 +1620,10 @@ pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) pf_kpool_to_pool(&krule->rpool, &rule->rpool); - rule->evaluations = counter_u64_fetch(krule->evaluations); + rule->evaluations = pf_counter_u64_fetch(&krule->evaluations); for (int i = 0; i < 2; i++) { - rule->packets[i] = counter_u64_fetch(krule->packets[i]); - rule->bytes[i] = counter_u64_fetch(krule->bytes[i]); + rule->packets[i] = pf_counter_u64_fetch(&krule->packets[i]); + rule->bytes[i] = pf_counter_u64_fetch(&krule->bytes[i]); } /* kif, anchor, overload_tbl are not copied over. */ @@ -1819,10 +1839,10 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, if (rule->ifname[0]) kif = pf_kkif_create(M_WAITOK); - rule->evaluations = counter_u64_alloc(M_WAITOK); + pf_counter_u64_init(&rule->evaluations, M_WAITOK); for (int i = 0; i < 2; i++) { - rule->packets[i] = counter_u64_alloc(M_WAITOK); - rule->bytes[i] = counter_u64_alloc(M_WAITOK); + pf_counter_u64_init(&rule->packets[i], M_WAITOK); + pf_counter_u64_init(&rule->bytes[i], M_WAITOK); } rule->states_cur = counter_u64_alloc(M_WAITOK); rule->states_tot = counter_u64_alloc(M_WAITOK); @@ -1832,6 +1852,12 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, TAILQ_INIT(&rule->rpool.list); PF_RULES_WLOCK(); +#ifdef PF_WANT_32_TO_64_COUNTER + LIST_INSERT_HEAD(&V_pf_allrulelist, rule, allrulelist); + MPASS(!rule->allrulelinked); + rule->allrulelinked = true; + V_pf_allrulecount++; +#endif ruleset = pf_find_kruleset(anchor); if (ruleset == NULL) ERROUT(EINVAL); @@ -1935,10 +1961,10 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, } rule->rpool.cur = TAILQ_FIRST(&rule->rpool.list); - counter_u64_zero(rule->evaluations); + pf_counter_u64_zero(&rule->evaluations); for (int i = 0; i < 2; i++) { - counter_u64_zero(rule->packets[i]); - counter_u64_zero(rule->bytes[i]); + pf_counter_u64_zero(&rule->packets[i]); + pf_counter_u64_zero(&rule->bytes[i]); } TAILQ_INSERT_TAIL(ruleset->rules[rs_num].inactive.ptr, rule, entries); @@ -2419,10 +2445,10 @@ DIOCADDRULENV_error: pf_addr_copyout(&pr->rule.dst.addr); if (pr->action == PF_GET_CLR_CNTR) { - counter_u64_zero(rule->evaluations); + pf_counter_u64_zero(&rule->evaluations); for (int i = 0; i < 2; i++) { - counter_u64_zero(rule->packets[i]); - counter_u64_zero(rule->bytes[i]); + pf_counter_u64_zero(&rule->packets[i]); + pf_counter_u64_zero(&rule->bytes[i]); } counter_u64_zero(rule->states_tot); } @@ -2541,10 +2567,10 @@ DIOCADDRULENV_error: } if (clear_counter) { - counter_u64_zero(rule->evaluations); + pf_counter_u64_zero(&rule->evaluations); for (int i = 0; i < 2; i++) { - counter_u64_zero(rule->packets[i]); - counter_u64_zero(rule->bytes[i]); + pf_counter_u64_zero(&rule->packets[i]); + pf_counter_u64_zero(&rule->bytes[i]); } counter_u64_zero(rule->states_tot); } @@ -2590,12 +2616,10 @@ DIOCGETRULENV_error: if (newrule->ifname[0]) kif = pf_kkif_create(M_WAITOK); - newrule->evaluations = counter_u64_alloc(M_WAITOK); + pf_counter_u64_init(&newrule->evaluations, M_WAITOK); for (int i = 0; i < 2; i++) { - newrule->packets[i] = - counter_u64_alloc(M_WAITOK); - newrule->bytes[i] = - counter_u64_alloc(M_WAITOK); + pf_counter_u64_init(&newrule->packets[i], M_WAITOK); + pf_counter_u64_init(&newrule->bytes[i], M_WAITOK); } newrule->states_cur = counter_u64_alloc(M_WAITOK); newrule->states_tot = counter_u64_alloc(M_WAITOK); @@ -2607,6 +2631,14 @@ DIOCGETRULENV_error: #define ERROUT(x) { error = (x); goto DIOCCHANGERULE_error; } PF_RULES_WLOCK(); +#ifdef PF_WANT_32_TO_64_COUNTER + if (newrule != NULL) { + LIST_INSERT_HEAD(&V_pf_allrulelist, newrule, allrulelist); + newrule->allrulelinked = true; + V_pf_allrulecount++; + } +#endif + if (!(pcr->action == PF_CHANGE_REMOVE || pcr->action == PF_CHANGE_GET_TICKET) && pcr->pool_ticket != V_ticket_pabuf) @@ -3165,10 +3197,10 @@ DIOCGETSTATESV2_full: PF_RULES_WLOCK(); TAILQ_FOREACH(rule, ruleset->rules[PF_RULESET_FILTER].active.ptr, entries) { - counter_u64_zero(rule->evaluations); + pf_counter_u64_zero(&rule->evaluations); for (int i = 0; i < 2; i++) { - counter_u64_zero(rule->packets[i]); - counter_u64_zero(rule->bytes[i]); + pf_counter_u64_zero(&rule->packets[i]); + pf_counter_u64_zero(&rule->bytes[i]); } } PF_RULES_WUNLOCK(); @@ -5610,18 +5642,33 @@ pf_unload_vnet(void) #ifdef PF_WANT_32_TO_64_COUNTER PF_RULES_WLOCK(); LIST_REMOVE(V_pf_kifmarker, pfik_allkiflist); - PF_RULES_WUNLOCK(); - free(V_pf_kifmarker, PFI_MTYPE); MPASS(LIST_EMPTY(&V_pf_allkiflist)); MPASS(V_pf_allkifcount == 0); + + LIST_REMOVE(&V_pf_default_rule, allrulelist); + V_pf_allrulecount--; + LIST_REMOVE(V_pf_rulemarker, allrulelist); + + /* + * There are known pf rule leaks when running the test suite. + */ +#ifdef notyet + MPASS(LIST_EMPTY(&V_pf_allrulelist)); + MPASS(V_pf_allrulecount == 0); +#endif + + PF_RULES_WUNLOCK(); + + free(V_pf_kifmarker, PFI_MTYPE); + free(V_pf_rulemarker, M_PFRULE); #endif /* Free counters last as we updated them during shutdown. */ - counter_u64_free(V_pf_default_rule.evaluations); + pf_counter_u64_deinit(&V_pf_default_rule.evaluations); for (int i = 0; i < 2; i++) { - counter_u64_free(V_pf_default_rule.packets[i]); - counter_u64_free(V_pf_default_rule.bytes[i]); + pf_counter_u64_deinit(&V_pf_default_rule.packets[i]); + pf_counter_u64_deinit(&V_pf_default_rule.bytes[i]); } counter_u64_free(V_pf_default_rule.states_cur); counter_u64_free(V_pf_default_rule.states_tot); diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 000ee69d9ae9..3da27c7df26d 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -149,7 +149,7 @@ pf_match_translation(struct pf_pdesc *pd, struct mbuf *m, int off, dst = &r->dst; } - counter_u64_add(r->evaluations, 1); + pf_counter_u64_add(&r->evaluations, 1); if (pfi_kkif_match(r->kif, kif) == r->ifnot) r = r->skip[PF_SKIP_IFP].ptr; else if (r->direction && r->direction != direction) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 3df4e06f15b6..388e2bca77b6 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1039,7 +1039,7 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kkif *kif, u_short *reason r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_SCRUB].active.ptr); while (r != NULL) { - counter_u64_add(r->evaluations, 1); + pf_counter_u64_add(&r->evaluations, 1); if (pfi_kkif_match(r->kif, kif) == r->ifnot) r = r->skip[PF_SKIP_IFP].ptr; else if (r->direction && r->direction != dir) @@ -1066,8 +1066,8 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kkif *kif, u_short *reason if (r == NULL || r->action == PF_NOSCRUB) return (PF_PASS); - counter_u64_add(r->packets[dir == PF_OUT], 1); - counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_add(&r->packets[dir == PF_OUT], 1); + pf_counter_u64_add(&r->bytes[dir == PF_OUT], pd->tot_len); /* Check for illegal packets */ if (hlen < (int)sizeof(struct ip)) { @@ -1181,7 +1181,7 @@ pf_normalize_ip6(struct mbuf **m0, int dir, struct pfi_kkif *kif, r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_SCRUB].active.ptr); while (r != NULL) { - counter_u64_add(r->evaluations, 1); + pf_counter_u64_add(&r->evaluations, 1); if (pfi_kkif_match(r->kif, kif) == r->ifnot) r = r->skip[PF_SKIP_IFP].ptr; else if (r->direction && r->direction != dir) @@ -1207,8 +1207,8 @@ pf_normalize_ip6(struct mbuf **m0, int dir, struct pfi_kkif *kif, if (r == NULL || r->action == PF_NOSCRUB) return (PF_PASS); - counter_u64_add(r->packets[dir == PF_OUT], 1); - counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_add(&r->packets[dir == PF_OUT], 1); + pf_counter_u64_add(&r->bytes[dir == PF_OUT], pd->tot_len); /* Check for illegal packets */ if (sizeof(struct ip6_hdr) + IPV6_MAXPACKET < m->m_pkthdr.len) @@ -1334,7 +1334,7 @@ pf_normalize_tcp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_SCRUB].active.ptr); while (r != NULL) { - counter_u64_add(r->evaluations, 1); + pf_counter_u64_add(&r->evaluations, 1); if (pfi_kkif_match(r->kif, kif) == r->ifnot) r = r->skip[PF_SKIP_IFP].ptr; else if (r->direction && r->direction != dir) @@ -1368,8 +1368,8 @@ pf_normalize_tcp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, if (rm == NULL || rm->action == PF_NOSCRUB) return (PF_PASS); - counter_u64_add(r->packets[dir == PF_OUT], 1); - counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_add(&r->packets[dir == PF_OUT], 1); + pf_counter_u64_add(&r->bytes[dir == PF_OUT], pd->tot_len); if (rm->rule_flag & PFRULE_REASSEMBLE_TCP) pd->flags |= PFDESC_TCP_NORM; diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index c0a17cd876ae..d1eca90e0ee5 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -655,7 +655,7 @@ error: } nvlist_t * -pf_krule_to_nvrule(const struct pf_krule *rule) +pf_krule_to_nvrule(struct pf_krule *rule) { nvlist_t *nvl, *tmp; @@ -698,12 +698,12 @@ pf_krule_to_nvrule(const struct pf_krule *rule) nvlist_destroy(tmp); nvlist_add_number(nvl, "evaluations", - counter_u64_fetch(rule->evaluations)); + pf_counter_u64_fetch(&rule->evaluations)); for (int i = 0; i < 2; i++) { nvlist_append_number_array(nvl, "packets", - counter_u64_fetch(rule->packets[i])); + pf_counter_u64_fetch(&rule->packets[i])); nvlist_append_number_array(nvl, "bytes", - counter_u64_fetch(rule->bytes[i])); + pf_counter_u64_fetch(&rule->bytes[i])); } nvlist_add_number(nvl, "os_fingerprint", rule->os_fingerprint); diff --git a/sys/netpfil/pf/pf_nv.h b/sys/netpfil/pf/pf_nv.h index f3610407dae1..8a46aae326a6 100644 --- a/sys/netpfil/pf/pf_nv.h +++ b/sys/netpfil/pf/pf_nv.h @@ -77,7 +77,7 @@ int pf_nvstring(const nvlist_t *, const char *, char *, size_t); int pf_check_rule_addr(const struct pf_rule_addr *); -nvlist_t *pf_krule_to_nvrule(const struct pf_krule *); +nvlist_t *pf_krule_to_nvrule(struct pf_krule *); int pf_nvrule_to_krule(const nvlist_t *, struct pf_krule *); int pf_nvstate_kill_to_kstate_kill(const nvlist_t *, struct pf_kstate_kill *); From owner-dev-commits-src-main@freebsd.org Sun Jul 25 08:25:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 697DD65604A; Sun, 25 Jul 2021 08:25: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 4GXbhb0vmfz3nJj; Sun, 25 Jul 2021 08:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5F9B20728; Sun, 25 Jul 2021 08:25: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 16P8P2Q2056725; Sun, 25 Jul 2021 08:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8P2c4056724; Sun, 25 Jul 2021 08:25:02 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:25:02 GMT Message-Id: <202107250825.16P8P2c4056724@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: 87c010e6e364 - main - pf: batch critical section for several counters 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: 87c010e6e364e96e2c1546b3c2bbcbef1dcd422f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:25:03 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=87c010e6e364e96e2c1546b3c2bbcbef1dcd422f commit 87c010e6e364e96e2c1546b3c2bbcbef1dcd422f Author: Mateusz Guzik AuthorDate: 2021-07-24 07:47:40 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 08:22:17 +0000 pf: batch critical section for several counters Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 48 +++++++++++++++++++++++++++-------------------- sys/netpfil/pf/pf_ioctl.c | 12 +++++++----- sys/netpfil/pf/pf_norm.c | 18 ++++++++++++------ 3 files changed, 47 insertions(+), 31 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 7eb2b5e669ca..ec2a5b1efc5f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3776,8 +3776,10 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, rtableid = r->rtableid; if (r->anchor == NULL) { if (r->action == PF_MATCH) { - pf_counter_u64_add(&r->packets[direction == PF_OUT], 1); - pf_counter_u64_add(&r->bytes[direction == PF_OUT], pd->tot_len); + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&r->packets[direction == PF_OUT], 1); + pf_counter_u64_add_protected(&r->bytes[direction == PF_OUT], pd->tot_len); + pf_counter_u64_critical_exit(); pf_rule_to_actions(r, &pd->act); if (r->log) PFLOG_PACKET(kif, m, af, @@ -4190,8 +4192,10 @@ pf_test_fragment(struct pf_krule **rm, int direction, struct pfi_kkif *kif, else { if (r->anchor == NULL) { if (r->action == PF_MATCH) { - pf_counter_u64_add(&r->packets[direction == PF_OUT], 1); - pf_counter_u64_add(&r->bytes[direction == PF_OUT], pd->tot_len); + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&r->packets[direction == PF_OUT], 1); + pf_counter_u64_add_protected(&r->bytes[direction == PF_OUT], pd->tot_len); + pf_counter_u64_critical_exit(); pf_rule_to_actions(r, &pd->act); if (r->log) PFLOG_PACKET(kif, m, af, @@ -6489,24 +6493,25 @@ done: (s == NULL)); } - pf_counter_u64_add(&kif->pfik_bytes[0][dir == PF_OUT][action != PF_PASS], + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&kif->pfik_bytes[0][dir == PF_OUT][action != PF_PASS], pd.tot_len); - pf_counter_u64_add(&kif->pfik_packets[0][dir == PF_OUT][action != PF_PASS], + pf_counter_u64_add_protected(&kif->pfik_packets[0][dir == PF_OUT][action != PF_PASS], 1); if (action == PF_PASS || r->action == PF_DROP) { dirndx = (dir == PF_OUT); - pf_counter_u64_add(&r->packets[dirndx], 1); - pf_counter_u64_add(&r->bytes[dirndx], pd.tot_len); + pf_counter_u64_add_protected(&r->packets[dirndx], 1); + pf_counter_u64_add_protected(&r->bytes[dirndx], pd.tot_len); if (a != NULL) { - pf_counter_u64_add(&a->packets[dirndx], 1); - pf_counter_u64_add(&a->bytes[dirndx], pd.tot_len); + pf_counter_u64_add_protected(&a->packets[dirndx], 1); + pf_counter_u64_add_protected(&a->bytes[dirndx], pd.tot_len); } if (s != NULL) { if (s->nat_rule.ptr != NULL) { - pf_counter_u64_add(&s->nat_rule.ptr->packets[dirndx], + pf_counter_u64_add_protected(&s->nat_rule.ptr->packets[dirndx], 1); - pf_counter_u64_add(&s->nat_rule.ptr->bytes[dirndx], + pf_counter_u64_add_protected(&s->nat_rule.ptr->bytes[dirndx], pd.tot_len); } if (s->src_node != NULL) { @@ -6544,6 +6549,7 @@ done: pd.af, pd.tot_len, dir == PF_OUT, r->action == PF_PASS, tr->dst.neg); } + pf_counter_u64_critical_exit(); switch (action) { case PF_SYNPROXY_DROP: @@ -6894,24 +6900,25 @@ done: &pd, (s == NULL)); } - pf_counter_u64_add(&kif->pfik_bytes[1][dir == PF_OUT][action != PF_PASS], + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&kif->pfik_bytes[1][dir == PF_OUT][action != PF_PASS], pd.tot_len); - pf_counter_u64_add(&kif->pfik_packets[1][dir == PF_OUT][action != PF_PASS], + pf_counter_u64_add_protected(&kif->pfik_packets[1][dir == PF_OUT][action != PF_PASS], 1); if (action == PF_PASS || r->action == PF_DROP) { dirndx = (dir == PF_OUT); - pf_counter_u64_add(&r->packets[dirndx], 1); - pf_counter_u64_add(&r->bytes[dirndx], pd.tot_len); + pf_counter_u64_add_protected(&r->packets[dirndx], 1); + pf_counter_u64_add_protected(&r->bytes[dirndx], pd.tot_len); if (a != NULL) { - pf_counter_u64_add(&a->packets[dirndx], 1); - pf_counter_u64_add(&a->bytes[dirndx], pd.tot_len); + pf_counter_u64_add_protected(&a->packets[dirndx], 1); + pf_counter_u64_add_protected(&a->bytes[dirndx], pd.tot_len); } if (s != NULL) { if (s->nat_rule.ptr != NULL) { - pf_counter_u64_add(&s->nat_rule.ptr->packets[dirndx], + pf_counter_u64_add_protected(&s->nat_rule.ptr->packets[dirndx], 1); - pf_counter_u64_add(&s->nat_rule.ptr->bytes[dirndx], + pf_counter_u64_add_protected(&s->nat_rule.ptr->bytes[dirndx], pd.tot_len); } if (s->src_node != NULL) { @@ -6947,6 +6954,7 @@ done: pd.af, pd.tot_len, dir == PF_OUT, r->action == PF_PASS, tr->dst.neg); } + pf_counter_u64_critical_exit(); switch (action) { case PF_SYNPROXY_DROP: diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 8fe1798ff7c3..6f45a1d1ac53 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1120,16 +1120,18 @@ pf_commit_rules(u_int32_t ticket, int rs_num, char *anchor) while ((tail != NULL) && ! pf_krule_compare(tail, rule)) tail = TAILQ_NEXT(tail, entries); if (tail != NULL) { - pf_counter_u64_add(&rule->evaluations, + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&rule->evaluations, pf_counter_u64_fetch(&tail->evaluations)); - pf_counter_u64_add(&rule->packets[0], + pf_counter_u64_add_protected(&rule->packets[0], pf_counter_u64_fetch(&tail->packets[0])); - pf_counter_u64_add(&rule->packets[1], + pf_counter_u64_add_protected(&rule->packets[1], pf_counter_u64_fetch(&tail->packets[1])); - pf_counter_u64_add(&rule->bytes[0], + pf_counter_u64_add_protected(&rule->bytes[0], pf_counter_u64_fetch(&tail->bytes[0])); - pf_counter_u64_add(&rule->bytes[1], + pf_counter_u64_add_protected(&rule->bytes[1], pf_counter_u64_fetch(&tail->bytes[1])); + pf_counter_u64_critical_exit(); } } } diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 388e2bca77b6..e9674d21ec5a 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1066,8 +1066,10 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kkif *kif, u_short *reason if (r == NULL || r->action == PF_NOSCRUB) return (PF_PASS); - pf_counter_u64_add(&r->packets[dir == PF_OUT], 1); - pf_counter_u64_add(&r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&r->packets[dir == PF_OUT], 1); + pf_counter_u64_add_protected(&r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_critical_exit(); /* Check for illegal packets */ if (hlen < (int)sizeof(struct ip)) { @@ -1207,8 +1209,10 @@ pf_normalize_ip6(struct mbuf **m0, int dir, struct pfi_kkif *kif, if (r == NULL || r->action == PF_NOSCRUB) return (PF_PASS); - pf_counter_u64_add(&r->packets[dir == PF_OUT], 1); - pf_counter_u64_add(&r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&r->packets[dir == PF_OUT], 1); + pf_counter_u64_add_protected(&r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_critical_exit(); /* Check for illegal packets */ if (sizeof(struct ip6_hdr) + IPV6_MAXPACKET < m->m_pkthdr.len) @@ -1368,8 +1372,10 @@ pf_normalize_tcp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, if (rm == NULL || rm->action == PF_NOSCRUB) return (PF_PASS); - pf_counter_u64_add(&r->packets[dir == PF_OUT], 1); - pf_counter_u64_add(&r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&r->packets[dir == PF_OUT], 1); + pf_counter_u64_add_protected(&r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_critical_exit(); if (rm->rule_flag & PFRULE_REASSEMBLE_TCP) pd->flags |= PFDESC_TCP_NORM; From owner-dev-commits-src-main@freebsd.org Sun Jul 25 08:31:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 110F3656560; Sun, 25 Jul 2021 08:31: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 4GXbr66x2Vz3pNh; Sun, 25 Jul 2021 08:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B89204D3; Sun, 25 Jul 2021 08:31: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 16P8VYwN065483; Sun, 25 Jul 2021 08:31:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8VYFo065482; Sun, 25 Jul 2021 08:31:34 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:31:34 GMT Message-Id: <202107250831.16P8VYFo065482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Grehan Subject: git: bbe80bff7c35 - main - arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grehan X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbe80bff7c3549128bd19862eea7899b3def1d7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:31:35 -0000 The branch main has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=bbe80bff7c3549128bd19862eea7899b3def1d7f commit bbe80bff7c3549128bd19862eea7899b3def1d7f Author: Peter Grehan AuthorDate: 2021-07-25 09:34:14 +0000 Commit: Peter Grehan CommitDate: 2021-07-25 09:39:32 +0000 arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries. This fixes build/run of golang under COMPAT32 emulation. PR: 256897 Reviewed by: andrew, mmel, manu, jhb, cognet, Robert Clausecker Tested by: brd, andrew, Robert Clausecker MFC after: 3 weeks Relnotes: yes Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31175 --- sys/arm64/arm64/elf32_machdep.c | 5 + sys/arm64/arm64/identcpu.c | 302 ++++++++++++++++++++++++++++++++++++++++ sys/arm64/include/armreg.h | 131 +++++++++++++++++ sys/arm64/include/elf.h | 29 ++++ sys/arm64/include/md_var.h | 4 + 5 files changed, 471 insertions(+) diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c index 7cedbffc4d43..ec1afd2d7b3e 100644 --- a/sys/arm64/arm64/elf32_machdep.c +++ b/sys/arm64/arm64/elf32_machdep.c @@ -77,6 +77,9 @@ static boolean_t elf32_arm_abi_supported(struct image_params *, int32_t *, extern void freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); +u_long __read_frequently elf32_hwcap; +u_long __read_frequently elf32_hwcap2; + static struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, @@ -112,6 +115,8 @@ static struct sysentvec elf32_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_hwcap = &elf32_hwcap, + .sv_hwcap2 = &elf32_hwcap2, .sv_onexec_old = exec_onexec_old, .sv_onexit = exit_onexit, }; diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 2afad3ea8a81..233b036f4499 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -50,6 +50,10 @@ __FBSDID("$FreeBSD$"); static void print_cpu_features(u_int cpu); static u_long parse_cpu_features_hwcap(void); static u_long parse_cpu_features_hwcap2(void); +#ifdef COMPAT_FREEBSD32 +static u_long parse_cpu_features_hwcap32(void); +static u_long parse_cpu_features_hwcap32_2(void); +#endif char machine[] = "arm64"; @@ -135,6 +139,11 @@ struct cpu_desc { uint64_t id_aa64pfr0; uint64_t id_aa64pfr1; uint64_t ctr; +#ifdef COMPAT_FREEBSD32 + uint64_t id_isar5; + uint64_t mvfr0; + uint64_t mvfr1; +#endif }; static struct cpu_desc cpu_desc[MAXCPU]; @@ -152,6 +161,11 @@ static u_int cpu_print_regs; #define PRINT_ID_AA64_MMFR2 0x00004000 #define PRINT_ID_AA64_PFR0 0x00010000 #define PRINT_ID_AA64_PFR1 0x00020000 +#ifdef COMPAT_FREEBSD32 +#define PRINT_ID_ISAR5 0x01000000 +#define PRINT_MVFR0 0x02000000 +#define PRINT_MVFR1 0x04000000 +#endif #define PRINT_CTR_EL0 0x10000000 struct cpu_parts { @@ -987,6 +1001,167 @@ static struct mrs_field id_aa64pfr1_fields[] = { MRS_FIELD_END, }; +#ifdef COMPAT_FREEBSD32 +/* ID_ISAR5_EL1 */ +static struct mrs_field_value id_isar5_vcma[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, VCMA, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_rdm[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, RDM, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_crc32[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, CRC32, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_sha2[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SHA2, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_sha1[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SHA1, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_aes[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, AES, NONE, BASE), + MRS_FIELD_VALUE(ID_ISAR5_AES_VMULL, "AES+VMULL"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_isar5_sevl[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SEVL, NOP, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field id_isar5_fields[] = { + MRS_FIELD(ID_ISAR5, VCMA, false, MRS_LOWER, id_isar5_vcma), + MRS_FIELD(ID_ISAR5, RDM, false, MRS_LOWER, id_isar5_rdm), + MRS_FIELD(ID_ISAR5, CRC32, false, MRS_LOWER, id_isar5_crc32), + MRS_FIELD(ID_ISAR5, SHA2, false, MRS_LOWER, id_isar5_sha2), + MRS_FIELD(ID_ISAR5, SHA1, false, MRS_LOWER, id_isar5_sha1), + MRS_FIELD(ID_ISAR5, AES, false, MRS_LOWER, id_isar5_aes), + MRS_FIELD(ID_ISAR5, SEVL, false, MRS_LOWER, id_isar5_sevl), + MRS_FIELD_END, +}; + +/* MVFR0 */ +static struct mrs_field_value mvfr0_fpround[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR0, FPRound, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fpsqrt[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR0, FPSqrt, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fpdivide[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR0, FPDivide, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fptrap[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR0, FPTrap, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fpdp[] = { + MRS_FIELD_VALUE(MVFR0_FPDP_NONE, ""), + MRS_FIELD_VALUE(MVFR0_FPDP_VFP_v2, "DP VFPv2"), + MRS_FIELD_VALUE(MVFR0_FPDP_VFP_v3_v4, "DP VFPv3+v4"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_fpsp[] = { + MRS_FIELD_VALUE(MVFR0_FPSP_NONE, ""), + MRS_FIELD_VALUE(MVFR0_FPSP_VFP_v2, "SP VFPv2"), + MRS_FIELD_VALUE(MVFR0_FPSP_VFP_v3_v4, "SP VFPv3+v4"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr0_simdreg[] = { + MRS_FIELD_VALUE(MVFR0_SIMDReg_NONE, ""), + MRS_FIELD_VALUE(MVFR0_SIMDReg_FP, "FP 16x64"), + MRS_FIELD_VALUE(MVFR0_SIMDReg_AdvSIMD, "AdvSIMD"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field mvfr0_fields[] = { + MRS_FIELD(MVFR0, FPRound, false, MRS_LOWER, mvfr0_fpround), + MRS_FIELD(MVFR0, FPSqrt, false, MRS_LOWER, mvfr0_fpsqrt), + MRS_FIELD(MVFR0, FPDivide, false, MRS_LOWER, mvfr0_fpdivide), + MRS_FIELD(MVFR0, FPTrap, false, MRS_LOWER, mvfr0_fptrap), + MRS_FIELD(MVFR0, FPDP, false, MRS_LOWER, mvfr0_fpdp), + MRS_FIELD(MVFR0, FPSP, false, MRS_LOWER, mvfr0_fpsp), + MRS_FIELD(MVFR0, SIMDReg, false, MRS_LOWER, mvfr0_simdreg), + MRS_FIELD_END, +}; + +/* MVFR1 */ +static struct mrs_field_value mvfr1_simdfmac[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, SIMDFMAC, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_fphp[] = { + MRS_FIELD_VALUE(MVFR1_FPHP_NONE, ""), + MRS_FIELD_VALUE(MVFR1_FPHP_CONV_SP, "FPHP SP Conv"), + MRS_FIELD_VALUE(MVFR1_FPHP_CONV_DP, "FPHP DP Conv"), + MRS_FIELD_VALUE(MVFR1_FPHP_ARITH, "FPHP Arith"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_simdhp[] = { + MRS_FIELD_VALUE(MVFR1_SIMDHP_NONE, ""), + MRS_FIELD_VALUE(MVFR1_SIMDHP_CONV_SP, "SIMDHP SP Conv"), + MRS_FIELD_VALUE(MVFR1_SIMDHP_ARITH, "SIMDHP Arith"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_simdsp[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, SIMDSP, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_simdint[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, SIMDInt, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_simdls[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, SIMDLS, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_fpdnan[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, FPDNaN, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value mvfr1_fpftz[] = { + MRS_FIELD_VALUE_NONE_IMPL(MVFR1, FPFtZ, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field mvfr1_fields[] = { + MRS_FIELD(MVFR1, SIMDFMAC, false, MRS_LOWER, mvfr1_simdfmac), + MRS_FIELD(MVFR1, FPHP, false, MRS_LOWER, mvfr1_fphp), + MRS_FIELD(MVFR1, SIMDHP, false, MRS_LOWER, mvfr1_simdhp), + MRS_FIELD(MVFR1, SIMDSP, false, MRS_LOWER, mvfr1_simdsp), + MRS_FIELD(MVFR1, SIMDInt, false, MRS_LOWER, mvfr1_simdint), + MRS_FIELD(MVFR1, SIMDLS, false, MRS_LOWER, mvfr1_simdls), + MRS_FIELD(MVFR1, FPDNaN, false, MRS_LOWER, mvfr1_fpdnan), + MRS_FIELD(MVFR1, FPFtZ, false, MRS_LOWER, mvfr1_fpftz), + MRS_FIELD_END, +}; +#endif /* COMPAT_FREEBSD32 */ + struct mrs_user_reg { u_int reg; u_int CRm; @@ -1038,6 +1213,32 @@ static struct mrs_user_reg user_regs[] = { .offset = __offsetof(struct cpu_desc, id_aa64mmfr0), .fields = id_aa64mmfr0_fields, }, +#ifdef COMPAT_FREEBSD32 + { + /* id_isar5_el1 */ + .reg = ID_ISAR5_EL1, + .CRm = 2, + .Op2 = 5, + .offset = __offsetof(struct cpu_desc, id_isar5), + .fields = id_isar5_fields, + }, + { + /* mvfr0 */ + .reg = MVFR0_EL1, + .CRm = 3, + .Op2 = 0, + .offset = __offsetof(struct cpu_desc, mvfr0), + .fields = mvfr0_fields, + }, + { + /* mvfr1 */ + .reg = MVFR1_EL1, + .CRm = 3, + .Op2 = 1, + .offset = __offsetof(struct cpu_desc, mvfr1), + .fields = mvfr1_fields, + }, +#endif /* COMPAT_FREEBSD32 */ }; #define CPU_DESC_FIELD(desc, idx) \ @@ -1288,6 +1489,12 @@ identify_cpu_sysinit(void *dummy __unused) elf_hwcap = parse_cpu_features_hwcap(); elf_hwcap2 = parse_cpu_features_hwcap2(); +#ifdef COMPAT_FREEBSD32 + /* 32-bit ARM versions of AT_HWCAP/HWCAP2 */ + elf32_hwcap = parse_cpu_features_hwcap32(); + elf32_hwcap2 = parse_cpu_features_hwcap32_2(); +#endif + if (dic && idc) { arm64_icache_sync_range = &arm64_dic_idc_icache_sync_range; if (bootverbose) @@ -1499,6 +1706,66 @@ parse_cpu_features_hwcap2(void) return (hwcap2); } +#ifdef COMPAT_FREEBSD32 +static u_long +parse_cpu_features_hwcap32(void) +{ + u_long hwcap = HWCAP32_DEFAULT; + + if (MVFR0_FPDP_VAL(user_cpu_desc.mvfr0) >= + MVFR0_FPDP_VFP_v2) { + hwcap |= HWCAP32_VFP; + + if (MVFR0_FPDP_VAL(user_cpu_desc.mvfr0) == + MVFR0_FPDP_VFP_v3_v4) { + hwcap |= HWCAP32_VFPv3; + + if (MVFR1_SIMDFMAC_VAL(user_cpu_desc.mvfr1) == + MVFR1_SIMDFMAC_IMPL) + hwcap |= HWCAP32_VFPv4; + } + } + + if ((MVFR1_SIMDLS_VAL(user_cpu_desc.mvfr1) == + MVFR1_SIMDLS_IMPL) && + (MVFR1_SIMDInt_VAL(user_cpu_desc.mvfr1) == + MVFR1_SIMDInt_IMPL) && + (MVFR1_SIMDSP_VAL(user_cpu_desc.mvfr1) == + MVFR1_SIMDSP_IMPL)) + hwcap |= HWCAP32_NEON; + + return (hwcap); +} + +static u_long +parse_cpu_features_hwcap32_2(void) +{ + u_long hwcap2 = 0; + + if (ID_ISAR5_AES_VAL(user_cpu_desc.id_isar5) >= + ID_ISAR5_AES_BASE) + hwcap2 |= HWCAP32_2_AES; + + if (ID_ISAR5_AES_VAL(user_cpu_desc.id_isar5) == + ID_ISAR5_AES_VMULL) + hwcap2 |= HWCAP32_2_PMULL; + + if (ID_ISAR5_SHA1_VAL(user_cpu_desc.id_isar5) == + ID_ISAR5_SHA1_IMPL) + hwcap2 |= HWCAP32_2_SHA1; + + if (ID_ISAR5_SHA2_VAL(user_cpu_desc.id_isar5) == + ID_ISAR5_SHA2_IMPL) + hwcap2 |= HWCAP32_2_SHA2; + + if (ID_ISAR5_CRC32_VAL(user_cpu_desc.id_isar5) == + ID_ISAR5_CRC32_IMPL) + hwcap2 |= HWCAP32_2_CRC32; + + return (hwcap2); +} +#endif /* COMPAT_FREEBSD32 */ + static void print_ctr_fields(struct sbuf *sb, uint64_t reg, void *arg) { @@ -1712,6 +1979,23 @@ print_cpu_features(u_int cpu) print_id_register(sb, "Auxiliary Features 1", cpu_desc[cpu].id_aa64afr1, id_aa64afr1_fields); +#ifdef COMPAT_FREEBSD32 + /* AArch32 Instruction Set Attribute Register 5 */ + if (cpu == 0 || (cpu_print_regs & PRINT_ID_ISAR5) != 0) + print_id_register(sb, "AArch32 Instruction Set Attributes 5", + cpu_desc[cpu].id_isar5, id_isar5_fields); + + /* AArch32 Media and VFP Feature Register 0 */ + if (cpu == 0 || (cpu_print_regs & PRINT_MVFR0) != 0) + print_id_register(sb, "AArch32 Media and VFP Features 0", + cpu_desc[cpu].mvfr0, mvfr0_fields); + + /* AArch32 Media and VFP Feature Register 1 */ + if (cpu == 0 || (cpu_print_regs & PRINT_MVFR1) != 0) + print_id_register(sb, "AArch32 Media and VFP Features 1", + cpu_desc[cpu].mvfr1, mvfr1_fields); +#endif + sbuf_delete(sb); sb = NULL; #undef SEP_STR @@ -1811,6 +2095,15 @@ identify_cpu(u_int cpu) cpu_desc[cpu].id_aa64mmfr2 = READ_SPECIALREG(id_aa64mmfr2_el1); cpu_desc[cpu].id_aa64pfr0 = READ_SPECIALREG(id_aa64pfr0_el1); cpu_desc[cpu].id_aa64pfr1 = READ_SPECIALREG(id_aa64pfr1_el1); +#ifdef COMPAT_FREEBSD32 + /* Only read aarch32 SRs if EL0-32 is available */ + if (ID_AA64PFR0_EL0_VAL(cpu_desc[cpu].id_aa64pfr0) == + ID_AA64PFR0_EL0_64_32) { + cpu_desc[cpu].id_isar5 = READ_SPECIALREG(id_isar5_el1); + cpu_desc[cpu].mvfr0 = READ_SPECIALREG(mvfr0_el1); + cpu_desc[cpu].mvfr1 = READ_SPECIALREG(mvfr1_el1); + } +#endif } static void @@ -1875,4 +2168,13 @@ check_cpu_regs(u_int cpu) identify_cache(cpu_desc[cpu].ctr); cpu_print_regs |= PRINT_CTR_EL0; } + +#ifdef COMPAT_FREEBSD32 + if (cpu_desc[cpu].id_isar5 != cpu_desc[0].id_isar5) + cpu_print_regs |= PRINT_ID_ISAR5; + if (cpu_desc[cpu].mvfr0 != cpu_desc[0].mvfr0) + cpu_print_regs |= PRINT_MVFR0; + if (cpu_desc[cpu].mvfr1 != cpu_desc[0].mvfr1) + cpu_print_regs |= PRINT_MVFR1; +#endif } diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 1361177b8f42..819a1f807c69 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -771,6 +771,45 @@ #define ID_AA64PFR1_RAS_frac_V1 (UL(0x0) << ID_AA64PFR1_RAS_frac_SHIFT) #define ID_AA64PFR1_RAS_frac_V2 (UL(0x1) << ID_AA64PFR1_RAS_frac_SHIFT) +/* ID_ISAR5_EL1 */ +#define ID_ISAR5_EL1 MRS_REG(3, 0, 0, 2, 5) +#define ID_ISAR5_SEVL_SHIFT 0 +#define ID_ISAR5_SEVL_MASK (UL(0xf) << ID_ISAR5_SEVL_SHIFT) +#define ID_ISAR5_SEVL_VAL(x) ((x) & ID_ISAR5_SEVL_MASK) +#define ID_ISAR5_SEVL_NOP (UL(0x0) << ID_ISAR5_SEVL_SHIFT) +#define ID_ISAR5_SEVL_IMPL (UL(0x1) << ID_ISAR5_SEVL_SHIFT) +#define ID_ISAR5_AES_SHIFT 4 +#define ID_ISAR5_AES_MASK (UL(0xf) << ID_ISAR5_AES_SHIFT) +#define ID_ISAR5_AES_VAL(x) ((x) & ID_ISAR5_AES_MASK) +#define ID_ISAR5_AES_NONE (UL(0x0) << ID_ISAR5_AES_SHIFT) +#define ID_ISAR5_AES_BASE (UL(0x1) << ID_ISAR5_AES_SHIFT) +#define ID_ISAR5_AES_VMULL (UL(0x2) << ID_ISAR5_AES_SHIFT) +#define ID_ISAR5_SHA1_SHIFT 8 +#define ID_ISAR5_SHA1_MASK (UL(0xf) << ID_ISAR5_SHA1_SHIFT) +#define ID_ISAR5_SHA1_VAL(x) ((x) & ID_ISAR5_SHA1_MASK) +#define ID_ISAR5_SHA1_NONE (UL(0x0) << ID_ISAR5_SHA1_SHIFT) +#define ID_ISAR5_SHA1_IMPL (UL(0x1) << ID_ISAR5_SHA1_SHIFT) +#define ID_ISAR5_SHA2_SHIFT 12 +#define ID_ISAR5_SHA2_MASK (UL(0xf) << ID_ISAR5_SHA2_SHIFT) +#define ID_ISAR5_SHA2_VAL(x) ((x) & ID_ISAR5_SHA2_MASK) +#define ID_ISAR5_SHA2_NONE (UL(0x0) << ID_ISAR5_SHA2_SHIFT) +#define ID_ISAR5_SHA2_IMPL (UL(0x1) << ID_ISAR5_SHA2_SHIFT) +#define ID_ISAR5_CRC32_SHIFT 16 +#define ID_ISAR5_CRC32_MASK (UL(0xf) << ID_ISAR5_CRC32_SHIFT) +#define ID_ISAR5_CRC32_VAL(x) ((x) & ID_ISAR5_CRC32_MASK) +#define ID_ISAR5_CRC32_NONE (UL(0x0) << ID_ISAR5_CRC32_SHIFT) +#define ID_ISAR5_CRC32_IMPL (UL(0x1) << ID_ISAR5_CRC32_SHIFT) +#define ID_ISAR5_RDM_SHIFT 24 +#define ID_ISAR5_RDM_MASK (UL(0xf) << ID_ISAR5_RDM_SHIFT) +#define ID_ISAR5_RDM_VAL(x) ((x) & ID_ISAR5_RDM_MASK) +#define ID_ISAR5_RDM_NONE (UL(0x0) << ID_ISAR5_RDM_SHIFT) +#define ID_ISAR5_RDM_IMPL (UL(0x1) << ID_ISAR5_RDM_SHIFT) +#define ID_ISAR5_VCMA_SHIFT 28 +#define ID_ISAR5_VCMA_MASK (UL(0xf) << ID_ISAR5_VCMA_SHIFT) +#define ID_ISAR5_VCMA_VAL(x) ((x) & ID_ISAR5_VCMA_MASK) +#define ID_ISAR5_VCMA_NONE (UL(0x0) << ID_ISAR5_VCMA_SHIFT) +#define ID_ISAR5_VCMA_IMPL (UL(0x1) << ID_ISAR5_VCMA_SHIFT) + /* MAIR_EL1 - Memory Attribute Indirection Register */ #define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8)) #define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8)) @@ -780,6 +819,98 @@ #define MAIR_NORMAL_WT 0xbb #define MAIR_NORMAL_WB 0xff +/* MVFR0_EL1 */ +#define MVFR0_EL1 MRS_REG(3, 0, 0, 3, 0) +#define MVFR0_SIMDReg_SHIFT 0 +#define MVFR0_SIMDReg_MASK (UL(0xf) << MVFR0_SIMDReg_SHIFT) +#define MVFR0_SIMDReg_VAL(x) ((x) & MVFR0_SIMDReg_MASK) +#define MVFR0_SIMDReg_NONE (UL(0x0) << MVFR0_SIMDReg_SHIFT) +#define MVFR0_SIMDReg_FP (UL(0x1) << MVFR0_SIMDReg_SHIFT) +#define MVFR0_SIMDReg_AdvSIMD (UL(0x2) << MVFR0_SIMDReg_SHIFT) +#define MVFR0_FPSP_SHIFT 4 +#define MVFR0_FPSP_MASK (UL(0xf) << MVFR0_FPSP_SHIFT) +#define MVFR0_FPSP_VAL(x) ((x) & MVFR0_FPSP_MASK) +#define MVFR0_FPSP_NONE (UL(0x0) << MVFR0_FPSP_SHIFT) +#define MVFR0_FPSP_VFP_v2 (UL(0x1) << MVFR0_FPSP_SHIFT) +#define MVFR0_FPSP_VFP_v3_v4 (UL(0x2) << MVFR0_FPSP_SHIFT) +#define MVFR0_FPDP_SHIFT 8 +#define MVFR0_FPDP_MASK (UL(0xf) << MVFR0_FPDP_SHIFT) +#define MVFR0_FPDP_VAL(x) ((x) & MVFR0_FPDP_MASK) +#define MVFR0_FPDP_NONE (UL(0x0) << MVFR0_FPDP_SHIFT) +#define MVFR0_FPDP_VFP_v2 (UL(0x1) << MVFR0_FPDP_SHIFT) +#define MVFR0_FPDP_VFP_v3_v4 (UL(0x2) << MVFR0_FPDP_SHIFT) +#define MVFR0_FPTrap_SHIFT 12 +#define MVFR0_FPTrap_MASK (UL(0xf) << MVFR0_FPTrap_SHIFT) +#define MVFR0_FPTrap_VAL(x) ((x) & MVFR0_FPTrap_MASK) +#define MVFR0_FPTrap_NONE (UL(0x0) << MVFR0_FPTrap_SHIFT) +#define MVFR0_FPTrap_IMPL (UL(0x1) << MVFR0_FPTrap_SHIFT) +#define MVFR0_FPDivide_SHIFT 16 +#define MVFR0_FPDivide_MASK (UL(0xf) << MVFR0_FPDivide_SHIFT) +#define MVFR0_FPDivide_VAL(x) ((x) & MVFR0_FPDivide_MASK) +#define MVFR0_FPDivide_NONE (UL(0x0) << MVFR0_FPDivide_SHIFT) +#define MVFR0_FPDivide_IMPL (UL(0x1) << MVFR0_FPDivide_SHIFT) +#define MVFR0_FPSqrt_SHIFT 20 +#define MVFR0_FPSqrt_MASK (UL(0xf) << MVFR0_FPSqrt_SHIFT) +#define MVFR0_FPSqrt_VAL(x) ((x) & MVFR0_FPSqrt_MASK) +#define MVFR0_FPSqrt_NONE (UL(0x0) << MVFR0_FPSqrt_SHIFT) +#define MVFR0_FPSqrt_IMPL (UL(0x1) << MVFR0_FPSqrt_SHIFT) +#define MVFR0_FPShVec_SHIFT 24 +#define MVFR0_FPShVec_MASK (UL(0xf) << MVFR0_FPShVec_SHIFT) +#define MVFR0_FPShVec_VAL(x) ((x) & MVFR0_FPShVec_MASK) +#define MVFR0_FPShVec_NONE (UL(0x0) << MVFR0_FPShVec_SHIFT) +#define MVFR0_FPShVec_IMPL (UL(0x1) << MVFR0_FPShVec_SHIFT) +#define MVFR0_FPRound_SHIFT 28 +#define MVFR0_FPRound_MASK (UL(0xf) << MVFR0_FPRound_SHIFT) +#define MVFR0_FPRound_VAL(x) ((x) & MVFR0_FPRound_MASK) +#define MVFR0_FPRound_NONE (UL(0x0) << MVFR0_FPRound_SHIFT) +#define MVFR0_FPRound_IMPL (UL(0x1) << MVFR0_FPRound_SHIFT) + +/* MVFR1_EL1 */ +#define MVFR1_EL1 MRS_REG(3, 0, 0, 3, 1) +#define MVFR1_FPFtZ_SHIFT 0 +#define MVFR1_FPFtZ_MASK (UL(0xf) << MVFR1_FPFtZ_SHIFT) +#define MVFR1_FPFtZ_VAL(x) ((x) & MVFR1_FPFtZ_MASK) +#define MVFR1_FPFtZ_NONE (UL(0x0) << MVFR1_FPFtZ_SHIFT) +#define MVFR1_FPFtZ_IMPL (UL(0x1) << MVFR1_FPFtZ_SHIFT) +#define MVFR1_FPDNaN_SHIFT 4 +#define MVFR1_FPDNaN_MASK (UL(0xf) << MVFR1_FPDNaN_SHIFT) +#define MVFR1_FPDNaN_VAL(x) ((x) & MVFR1_FPDNaN_MASK) +#define MVFR1_FPDNaN_NONE (UL(0x0) << MVFR1_FPDNaN_SHIFT) +#define MVFR1_FPDNaN_IMPL (UL(0x1) << MVFR1_FPDNaN_SHIFT) +#define MVFR1_SIMDLS_SHIFT 8 +#define MVFR1_SIMDLS_MASK (UL(0xf) << MVFR1_SIMDLS_SHIFT) +#define MVFR1_SIMDLS_VAL(x) ((x) & MVFR1_SIMDLS_MASK) +#define MVFR1_SIMDLS_NONE (UL(0x0) << MVFR1_SIMDLS_SHIFT) +#define MVFR1_SIMDLS_IMPL (UL(0x1) << MVFR1_SIMDLS_SHIFT) +#define MVFR1_SIMDInt_SHIFT 12 +#define MVFR1_SIMDInt_MASK (UL(0xf) << MVFR1_SIMDInt_SHIFT) +#define MVFR1_SIMDInt_VAL(x) ((x) & MVFR1_SIMDInt_MASK) +#define MVFR1_SIMDInt_NONE (UL(0x0) << MVFR1_SIMDInt_SHIFT) +#define MVFR1_SIMDInt_IMPL (UL(0x1) << MVFR1_SIMDInt_SHIFT) +#define MVFR1_SIMDSP_SHIFT 16 +#define MVFR1_SIMDSP_MASK (UL(0xf) << MVFR1_SIMDSP_SHIFT) +#define MVFR1_SIMDSP_VAL(x) ((x) & MVFR1_SIMDSP_MASK) +#define MVFR1_SIMDSP_NONE (UL(0x0) << MVFR1_SIMDSP_SHIFT) +#define MVFR1_SIMDSP_IMPL (UL(0x1) << MVFR1_SIMDSP_SHIFT) +#define MVFR1_SIMDHP_SHIFT 20 +#define MVFR1_SIMDHP_MASK (UL(0xf) << MVFR1_SIMDHP_SHIFT) +#define MVFR1_SIMDHP_VAL(x) ((x) & MVFR1_SIMDHP_MASK) +#define MVFR1_SIMDHP_NONE (UL(0x0) << MVFR1_SIMDHP_SHIFT) +#define MVFR1_SIMDHP_CONV_SP (UL(0x1) << MVFR1_SIMDHP_SHIFT) +#define MVFR1_SIMDHP_ARITH (UL(0x2) << MVFR1_SIMDHP_SHIFT) +#define MVFR1_FPHP_SHIFT 24 +#define MVFR1_FPHP_MASK (UL(0xf) << MVFR1_FPHP_SHIFT) +#define MVFR1_FPHP_VAL(x) ((x) & MVFR1_FPHP_MASK) +#define MVFR1_FPHP_NONE (UL(0x0) << MVFR1_FPHP_SHIFT) +#define MVFR1_FPHP_CONV_SP (UL(0x1) << MVFR1_FPHP_SHIFT) +#define MVFR1_FPHP_CONV_DP (UL(0x2) << MVFR1_FPHP_SHIFT) +#define MVFR1_FPHP_ARITH (UL(0x3) << MVFR1_FPHP_SHIFT) +#define MVFR1_SIMDFMAC_SHIFT 28 +#define MVFR1_SIMDFMAC_MASK (UL(0xf) << MVFR1_SIMDFMAC_SHIFT) +#define MVFR1_SIMDFMAC_VAL(x) ((x) & MVFR1_SIMDFMAC_MASK) +#define MVFR1_SIMDFMAC_NONE (UL(0x0) << MVFR1_SIMDFMAC_SHIFT) +#define MVFR1_SIMDFMAC_IMPL (UL(0x1) << MVFR1_SIMDFMAC_SHIFT) + /* PAR_EL1 - Physical Address Register */ #define PAR_F_SHIFT 0 #define PAR_F (0x1 << PAR_F_SHIFT) diff --git a/sys/arm64/include/elf.h b/sys/arm64/include/elf.h index bed84e6c755a..3f7c3964d428 100644 --- a/sys/arm64/include/elf.h +++ b/sys/arm64/include/elf.h @@ -150,4 +150,33 @@ __ElfType(Auxinfo); #define HWCAP2_RNG 0x00010000 #define HWCAP2_BTI 0x00020000 +#ifdef COMPAT_FREEBSD32 +/* ARM HWCAP */ +#define HWCAP32_HALF 0x00000002 /* Always set. */ +#define HWCAP32_THUMB 0x00000004 /* Always set. */ +#define HWCAP32_FAST_MULT 0x00000010 /* Always set. */ +#define HWCAP32_VFP 0x00000040 +#define HWCAP32_EDSP 0x00000080 /* Always set. */ +#define HWCAP32_NEON 0x00001000 +#define HWCAP32_VFPv3 0x00002000 +#define HWCAP32_TLS 0x00008000 /* Always set. */ +#define HWCAP32_VFPv4 0x00010000 +#define HWCAP32_IDIVA 0x00020000 /* Always set. */ +#define HWCAP32_IDIVT 0x00040000 /* Always set. */ +#define HWCAP32_VFPD32 0x00080000 /* Always set. */ +#define HWCAP32_LPAE 0x00100000 /* Always set. */ + +#define HWCAP32_DEFAULT \ + (HWCAP32_HALF | HWCAP32_THUMB | HWCAP32_FAST_MULT | HWCAP32_EDSP |\ + HWCAP32_TLS | HWCAP32_IDIVA | HWCAP32_IDIVT | HWCAP32_VFPD32 | \ + HWCAP32_LPAE) + +/* ARM HWCAP2 */ +#define HWCAP32_2_AES 0x00000001 +#define HWCAP32_2_PMULL 0x00000002 +#define HWCAP32_2_SHA1 0x00000004 +#define HWCAP32_2_SHA2 0x00000008 +#define HWCAP32_2_CRC32 0x00000010 +#endif + #endif /* !_MACHINE_ELF_H_ */ diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h index 0132ab0dd8fd..1f5e6f693d60 100644 --- a/sys/arm64/include/md_var.h +++ b/sys/arm64/include/md_var.h @@ -38,6 +38,10 @@ extern char sigcode[]; extern int szsigcode; extern u_long elf_hwcap; extern u_long elf_hwcap2; +#ifdef COMPAT_FREEBSD32 +extern u_long elf32_hwcap; +extern u_long elf32_hwcap2; +#endif struct dumperinfo; From owner-dev-commits-src-main@freebsd.org Sun Jul 25 10:51:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77326658378; Sun, 25 Jul 2021 10:51: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 4GXfy02mcGz4pvm; Sun, 25 Jul 2021 10:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 465ED22709; Sun, 25 Jul 2021 10:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16PApqJR054740; Sun, 25 Jul 2021 10:51:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16PApqT5054739; Sun, 25 Jul 2021 10:51:52 GMT (envelope-from git) Date: Sun, 25 Jul 2021 10:51:52 GMT Message-Id: <202107251051.16PApqT5054739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Popov Subject: git: feac06569a38 - main - lib/csu: Get rid of unused fptr typedef on amd64. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: feac06569a381dd7fec92c7d490fc34ef0bbdda5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 10:51:52 -0000 The branch main has been updated by arrowd (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=feac06569a381dd7fec92c7d490fc34ef0bbdda5 commit feac06569a381dd7fec92c7d490fc34ef0bbdda5 Author: Gleb Popov AuthorDate: 2021-07-22 15:28:21 +0000 Commit: Gleb Popov CommitDate: 2021-07-25 10:51:09 +0000 lib/csu: Get rid of unused fptr typedef on amd64. Make i386 and riscv parts not use it. Approved by: kib Differential Revision: https://reviews.freebsd.org/D31281 --- lib/csu/amd64/crt1_c.c | 2 -- lib/csu/i386/crt1_c.c | 6 ++---- lib/csu/riscv/crt1_c.c | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/csu/amd64/crt1_c.c b/lib/csu/amd64/crt1_c.c index 9dbd34492023..f1c99de9ffe0 100644 --- a/lib/csu/amd64/crt1_c.c +++ b/lib/csu/amd64/crt1_c.c @@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "ignore_init.c" -typedef void (*fptr)(void); - #ifdef GCRT extern void _mcleanup(void); extern void monstartup(void *, void *); diff --git a/lib/csu/i386/crt1_c.c b/lib/csu/i386/crt1_c.c index 0d82cda6fa1f..b39134824f7e 100644 --- a/lib/csu/i386/crt1_c.c +++ b/lib/csu/i386/crt1_c.c @@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "ignore_init.c" -typedef void (*fptr)(void); - extern void _start(char *, ...); #ifdef GCRT @@ -45,11 +43,11 @@ extern int eprol; extern int etext; #endif -void _start1(fptr, int, char *[]) __dead2; +void _start1(void (*)(void), int, char *[]) __dead2; /* The entry function, C part. */ void -_start1(fptr cleanup, int argc, char *argv[]) +_start1(void (*cleanup)(void), int argc, char *argv[]) { char **env; diff --git a/lib/csu/riscv/crt1_c.c b/lib/csu/riscv/crt1_c.c index 9291d6d200df..11519e46c7f3 100644 --- a/lib/csu/riscv/crt1_c.c +++ b/lib/csu/riscv/crt1_c.c @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "ignore_init.c" -typedef void (*fptr)(void); - #ifdef GCRT extern void _mcleanup(void); extern void monstartup(void *, void *); From owner-dev-commits-src-main@freebsd.org Sun Jul 25 20:20:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 786F365F396; Sun, 25 Jul 2021 20:20: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 4GXvYh2czFz3F0q; Sun, 25 Jul 2021 20:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B46B1AE9; Sun, 25 Jul 2021 20:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16PKK8TT005412; Sun, 25 Jul 2021 20:20:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16PKK8Z7005410; Sun, 25 Jul 2021 20:20:08 GMT (envelope-from git) Date: Sun, 25 Jul 2021 20:20:08 GMT Message-Id: <202107252020.16PKK8Z7005410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jilles Tjoelker Subject: git: 0c47338023d4 - main - libc/tests: Correctly compare si_status from wait6() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jilles X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c47338023d44ff130cf69465bd1b2e75ff0bb39 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 20:20:08 -0000 The branch main has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=0c47338023d44ff130cf69465bd1b2e75ff0bb39 commit 0c47338023d44ff130cf69465bd1b2e75ff0bb39 Author: Jilles Tjoelker AuthorDate: 2021-07-25 20:19:18 +0000 Commit: Jilles Tjoelker CommitDate: 2021-07-25 20:19:18 +0000 libc/tests: Correctly compare si_status from wait6() Fix erroneous = that was meant to be ==. Revision 1.10 from NetBSD t_wait.c Obtained from: NetBSD --- contrib/netbsd-tests/lib/libc/sys/t_wait.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_wait.c b/contrib/netbsd-tests/lib/libc/sys/t_wait.c index ce060da8937e..79e25b4bbaa4 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_wait.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_wait.c @@ -88,7 +88,7 @@ ATF_TC_BODY(wait6_exited, tc) default: ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); ATF_REQUIRE(WIFEXITED(st) && WEXITSTATUS(st) == 0x5a); - ATF_REQUIRE(si.si_status = 0x5a5a5a5a); + ATF_REQUIRE(si.si_status == 0x5a5a5a5a); ATF_REQUIRE(si.si_pid == pid); ATF_REQUIRE(si.si_uid == getuid()); ATF_REQUIRE(si.si_code == CLD_EXITED);